Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.7
    • Fix Version/s: JRuby 1.7.0.RC1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I want org.joda.time.format.DateTimeFormatter.withDefaultYear(), the joda docs claim it appeared in version 2.0, so I download version 2.1 -

      % irb -rjava    
      >> require "vendor/jar/joda-time-2.1/joda-time-2.1.jar"
      => true
      >> org.joda.time.format.DateTimeFormat.forPattern("MMM dd HH:mm:ss").methods.grep(/with[A-Z]/)
      => [:withZone, :withChronology, :withLocale, :withOffsetParsed, :withPivotYear]
      

      No 'withDefaultYear' method.

      Relevant javadoc for the method I'm looking for:
      http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormatter.html#withDefaultYear%28int%29

        Activity

        Hide
        Douglas Campos added a comment -

        during our bundling process we rewrite asm package to avoid conflicts, I think we should do the same for joda too, Jordan isn't the first complaint about it.

        Show
        Douglas Campos added a comment - during our bundling process we rewrite asm package to avoid conflicts, I think we should do the same for joda too, Jordan isn't the first complaint about it.
        Hide
        Hiro Asari added a comment -

        What conflict is there in this case?

        Show
        Hiro Asari added a comment - What conflict is there in this case?
        Hide
        kristian meier added a comment -

        have look at https://gist.github.com/01236caf13cc4ab0bf17 which shows you the dependency tree of jruby.

        so you find quite some libraries which can gives you the same trouble as joda-time. do you really want to rewrite bouncy-castle ?

        joda-time might be even more problematic since it is part of the jruby API which we use for the java version of DO drivers (https://github.com/datamapper/do/)

        asm is only used internally and there is not harm in rewriting them.

        once http://jira.codehaus.org/browse/JRUBY-5848 is fixed you get control back. when you use this artifact via ivy, buildr, maven, etc, then you can always overwrite the joda deps by the version which works for you, dito for ALL the other jar dependencies.

        once that JRUBY-5848 is fixed, I will look into jbundler to allow to "overwrite" those jruby deps as well via the "Jarfile"

        besides that juby would need a way to "overwrite" those jar when using the command-line tools since the jruby.jar is appended to bootclassloader, so to overwrite any embedded jar you would need to prepend to the bootclassloader.

        Show
        kristian meier added a comment - have look at https://gist.github.com/01236caf13cc4ab0bf17 which shows you the dependency tree of jruby. so you find quite some libraries which can gives you the same trouble as joda-time. do you really want to rewrite bouncy-castle ? joda-time might be even more problematic since it is part of the jruby API which we use for the java version of DO drivers ( https://github.com/datamapper/do/ ) asm is only used internally and there is not harm in rewriting them. once http://jira.codehaus.org/browse/JRUBY-5848 is fixed you get control back. when you use this artifact via ivy, buildr, maven, etc, then you can always overwrite the joda deps by the version which works for you, dito for ALL the other jar dependencies. once that JRUBY-5848 is fixed, I will look into jbundler to allow to "overwrite" those jruby deps as well via the "Jarfile" besides that juby would need a way to "overwrite" those jar when using the command-line tools since the jruby.jar is appended to bootclassloader, so to overwrite any embedded jar you would need to prepend to the bootclassloader.
        Hide
        Charles Oliver Nutter added a comment -

        Rewriting Joda has been considered and rejected before, since several public APIs return Joda object types. Stephen Colebourne actually jumped into the discussion and strongly recommended we not rewrite it.

        In general, only libraries that are truly internal and that would prevent JRuby from running unless we use a very specific version (like ASM) should be rewritten.

        The maven dependency-related issue kristian mentions has been resolved on master, which tells me this issue may be resolved as well (since he claims you should be able to override joda-time now).

        For non-maven overriding, kristian is also right: JRuby loads on the boot classpath, so you'd need joda to go into the boot classpath as well ahead of JRuby.

        For other scenarios that use a standard JRuby jar and normal classloading, putting joda earlier in classpath should work fine.

        Marking resolved.

        Show
        Charles Oliver Nutter added a comment - Rewriting Joda has been considered and rejected before, since several public APIs return Joda object types. Stephen Colebourne actually jumped into the discussion and strongly recommended we not rewrite it. In general, only libraries that are truly internal and that would prevent JRuby from running unless we use a very specific version (like ASM) should be rewritten. The maven dependency-related issue kristian mentions has been resolved on master, which tells me this issue may be resolved as well (since he claims you should be able to override joda-time now). For non-maven overriding, kristian is also right: JRuby loads on the boot classpath, so you'd need joda to go into the boot classpath as well ahead of JRuby. For other scenarios that use a standard JRuby jar and normal classloading, putting joda earlier in classpath should work fine. Marking resolved.
        Hide
        kristian meier added a comment -

        once jruby-1.7.0.RC1 is released and on maven central I will add a wiki page with some instructions how to use some other version of joda-time via maven and maven-like frameworks.

        Show
        kristian meier added a comment - once jruby-1.7.0.RC1 is released and on maven central I will add a wiki page with some instructions how to use some other version of joda-time via maven and maven-like frameworks.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Jordan Sissel
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: