rubenochiavone / rastreio-java

A Java library for tracking Correios' shipments.
https://rubenochiavone.github.io/rastreio-java
Apache License 2.0
5 stars 1 forks source link

Deprecated java.util.Date #2

Closed dhiogoboza closed 4 years ago

dhiogoboza commented 4 years ago

Is it possible to you replace deprecated java.util.Date by another solution?

rubenochiavone commented 4 years ago

I am not sure that java.util.Date class is deprecated. A few methods are though.

I wrote a test case that checks rastreio.TrackObject#getPostedAt() for example. Please take a look:

https://github.com/rubenochiavone/rastreio-java/blob/32166b1679cc1154ea2a2d08db4fc24d8697a2c6/src/test/java/rastreio/RastreioTest.java#L116-L118

Before 32166b1679cc1154ea2a2d08db4fc24d8697a2c6, parsing was not properly setting seconds and milliseconds of Dates objects. Do you have any use case that java.util.Date does not work or is using a deprecated API?

dhiogoboza commented 4 years ago

Yes, some methods are deprecated. I believe that using another solution will be better, but ok. I just use Calendar as you metioned.

dhiogoboza commented 4 years ago

The fix in seconds and nanosecons resolve my issue, thanks.