Skip to content

remove joda-time dependency #131

Closed
Closed

Description

@xuwei-k

I think we should use java.time.* classes instead of joda-time

Activity

  1. oshai commented on Jun 30, 2019

    @oshai
    Contributor

    I think it is a good idea. On the other hand, I am afraid backwards-incompatibility will prevent users from upgrading and might be risky for them. So if we can come up with a smooth migration path it can be helpful. Another alternative is to support both jdk/joda somehow without having to maintain two branches.

  2. xp-vit commented on Jul 1, 2019

    @xp-vit

    sad but true: joda-time need to be dropped. And I think it makes sense to do it as soon as possible, because it is going to be breaking change and number of affected users should be as small as possible. Options on how to implement this change are:

    1. Radical(preferable):
    • major release (or at least version 1.1) and just remove all joda-time references
    1. Soft:
    • deprecate all public API which currently returns joda-time and add new methods which will use java.time.*
    • announce that deprecated API will be dropped in future major release
    • drop deprecated api together with joda-time dependency in next major release
  3. oshai commented on Jul 3, 2019

    @oshai
    Contributor

    The second alternative is really not feasible for that lib. joda time can be returned from rows in result set so it is hard to replace it there and can be given as a parameter to a prepared statement.
    Another idea is to have some kind of "feature flag" that based on that we will decide which one to use.
    Then users can pick which one they want, and in case they do not want joda they will have to exclude it from the dependency in gradle/maven.

  4. xp-vit commented on Jul 3, 2019

    @xp-vit

    no... excluding dependency is dirty and complicated. Only 1% of users will do it I believe... Only those who care about classpath size. I would try to go with more radical way then, since library is really young and there are not a lot users yet.

  5. oshai commented on Jul 3, 2019

    @oshai
    Contributor

    The library is almost 1 year old and it is a fork of mauricio lib that existed since 2012. We want to allow easy migration from the original lib if possible. I guess the original one has many users.
    So from my perspective, it is better to allow an easy and safe migration path if possible.

    The question is what will be the benefit of such a move? From my perspective, it can be avoiding classpath collisions and moving to the standard api. Other than that, I don't see great benefits from that change. Are there?

    So although I think it is a good idea (as I mentioned above) I am pretty reluctant to go with the radical approach at the moment.

    I am still open to other ideas about how to do the migration.

  6. mirromutth commented on Jul 31, 2019

    @mirromutth
    Contributor

    How about change dependency from a requirement to an optional one? Like compileOnly('...joda-time...'), that means if user dependent on joda, than enable joda, otherwise disable for default.

    Than, user can just upgrade jasync-sql version and add a dependency of joda rather than change their code.

  7. oshai commented on Jul 31, 2019

    @oshai
    Contributor

    Thats ok, but the code should be changed as well to work in both scenarios without throwing class not found exception.

  8. ratcashdev commented on Aug 22, 2019

    @ratcashdev
    Contributor

    how about introducing version 2.x that won't be using joda.time?

  9. oshai commented on Aug 22, 2019

    @oshai
    Contributor

    As I mentioned above:

    The question is what will be the benefit of such a move? From my perspective, it can be avoiding classpath collisions and moving to the standard api. Other than that, I don't see great benefits from that change. Are there?

    I think that moving to it while not maintaining compatibility in such a way (you will not get compilation errors, but failures on runtime) is not ideal, even for version 2.0. In addition, I don't have the capacity for such a change at the moment. So if anyone wants to pick it up we can discuss concrete plans.

  10. xp-vit commented on Aug 22, 2019

    @xp-vit

    I believe that this thread is exactly about plan discussion and understanding if this is necessary and doable at all. After decision made, someone will pick it and implement it. So my ideal proposal:

    • version 2.0 with breaking change just removing joda time and providing instructions on how to upgrade.
  11. oshai commented on Nov 17, 2019

    @oshai
    Contributor

    Here is an example of another library that used gradle modules to decide on the implementation: https://github.com/JetBrains/Exposed/wiki/LibDocumentation#exposed-0181-and-higher

  12. github-actions commented on May 14, 2020

    @github-actions

    Stale issue message

  13. ilya40umov commented on Sep 5, 2020

    @ilya40umov

    ➕ to moving out of JodaTime. For now I have to keep these extension functions around, but even with them the code gets bloated with back-and-forth conversions between java.time.* and Joda classes.
    IMO, I would also never close an issue like this. The fact that the main maintainer does not have capacity does not mean that the library is already perfect and has no issues that need to be addressed.

  14. oshai commented on Sep 6, 2020

    @oshai
    Contributor

    I prefer to keep open issues for bugs, or features actively developed. We used to have a TODO list, and there are also known issues in the wiki, so we can also keep it there. This issue still waits for someone to pick it up, the main progress that was done until now is #157.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions