Closed italiviocorrea closed 3 years ago
Are you interested in providing a pull request that contains the fix and a way to reproduce the issue?
Hey! I can make the correction yes, it's up to you. Even because I made a fork and I'm using it with the fix, so far this solution is ok. I'm not practice pull request, but I'm a fast learner and I have a lot of experience in java programming, suddenly I can help fix other bugs. And I'm already using the lib in one project, which I'm currently working on, and I plan to use it in other projects.
Bug Report
I'm using the latest driver 0.8.6.
I have a field in an MSSQLServer table that is of the DateTimeOffSet type, and I realized that when the timezone is negative it ignores the signal and treats it as a positive timezone. Analyzing the code of the OffsetDateTimeCodec Class, in line 87 we have a call to the uShort method of the Decode class, which converts the buffer to an unsigned integer.
This removes the TimeZone signal when it is negative. The correct thing would be to do this:
As the Short method does not exist in the Decode class, it would be necessary to add it to this class, as in the example below:
With this simple change, the negative and positive timezones will be decoded correctly.