FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[WIP] Removes JodaTime by bakatz · Pull Request #157 · jasync-sql/jasync-sql · GitHub

[WIP] Removes JodaTime - #157

Closed
bakatz wants to merge 10 commits into
jasync-sql:masterfrom
bakatz:master
Closed

[WIP] Removes JodaTime#157
bakatz wants to merge 10 commits into
jasync-sql:masterfrom
bakatz:master

Conversation

bakatz commented Sep 30, 2019
edited
Loading

Copy link
Copy Markdown

I don't want a dependency on JodaTime for my projects, so I decided to start fixing #131

TODO:
[x] Common library
[x] MySQL
[x] Fix TimestampEncoder
[ ] Fix MySQL tests
[] Postgres
[] Fix Postgres tests

Looking for comments on this before I finish the whole thing (ideally from someone who has in depth knowledge of java.time) - I'm not 100% sure I've converted the calls successfully in some cases. Mostly followed this as a guide: https://blog.joda.org/2014/11/converting-from-joda-time-to-javatime.html

Implementation notes:
TimestampEncoder is definitely broken, probably need to use ZonedDateTime instead of LocalDateTime etc. Will take a look at it later and resolve. Even though TimestampEncoder assumes no time zone, it formats times using a 'Z' suffix to represent the UTC timezone. As such, I had to make it use ZonedDateTime otherwise a formatting exception would occur at runtime.

Cheers

oshai commented Sep 30, 2019

Copy link
Copy Markdown
Contributor

Thanks for the effort! I guess you saw conversation in #131
In any case a suggestion for competability or migration for users will be also beneficial.

bakatz commented Sep 30, 2019

Copy link
Copy Markdown
Author

@oshai No worries! Yep, I saw the discussion. In the event that I get this working I'll bump the version to 2.0.0 since this would be a breaking change. Will add some notes to the README as well in that case RE: how to migrate from 1.x to 2.x.

@@ -1,18 +1,10 @@
package com.github.jasync.sql.db.column

import sun.net.util.IPAddressUtil.textToNumericFormatV4

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This was not compiling for me using JDK 11 (AdoptOpenJDK, windows), and generally using sun.* packages is discouraged - decided to replace with standard java library calls. Let me know if there's a reason this textToNumeric() call was made in the first place - seems like .getByName() works OK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think I checked it and this method not exists in java 8

bakatz Sep 30, 2019
edited
Loading

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yep, the textToNumeric methods aren't public/don't exist or something. That's why I decided to remove them.

bakatz commented Oct 8, 2019

Copy link
Copy Markdown
Author

hey @oshai I made some progress and fixed all of the common tests. However, I'm running into a strange exception with the MySQL tests. It seems one test is failing due to:

com.github.jasync.sql.db.mysql.PreparedStatementsSpec > read a timestamp with microseconds FAILED
    java.util.concurrent.ExecutionException at PreparedStatementsSpec.kt:277
        Caused by: java.lang.UnsupportedOperationException

Does this sound familiar to you? I haven't been able to figure out what's causing it.

Thanks

oshai commented Oct 8, 2019

Copy link
Copy Markdown
Contributor

Try to run the test seperatly and provide full stacktrace. Right now it doesn't looks familiar.

oshai commented Dec 22, 2019

Copy link
Copy Markdown
Contributor

@bakatz - whats the status of this PR? are you still planning on working on it?

bakatz commented Dec 22, 2019

Copy link
Copy Markdown
Author

@oshai not exactly - haven't had time to work on this due to work commitments - feel free to take the PR over if you have time

oshai commented Dec 22, 2019

Copy link
Copy Markdown
Contributor

@bakatz I don't have the time to do that as well, just thinking how we can continue that effort.

Copy link
Copy Markdown

Stale pull request message

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL