Details

    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      Referencing a Java class with a mixed-case package name, e.g. Java::mixed.Case.Example, fails. Although a mixed-case package violates the Java naming standard, it is legal. The use case is integration with existing Java code that cannot be modified.

      Test case:

      1. Make a jar file with the trivial Java class:

      package mixed.Case;

      public class Example
      {
      }

      2. require the jar file

      3. Java::mixed.Case.Example #=> NameError

        Activity

        Show
        Hiro Asari added a comment - See the comment here: https://github.com/jruby/jruby/blob/e6c371fb89e3f848645eb140769d58d427a0fe49/src/org/jruby/javasupport/Java.java#L929-941 ...which was introduced by Charlie in https://github.com/jruby/jruby/commit/3f257adced4b556da52c19f02d98d74188d8d1a1
        Show
        Hiro Asari added a comment - Fixed in https://github.com/jruby/jruby/commit/bb9cd0753436fabe726ada1036ad1476e70383a3
        Hide
        Hiro Asari added a comment -
        $ jruby -rjava -e 'require "temp/jruby-6076/example.jar"; p Java::mixed.Case.Example'
        NameError: cannot load Java class mixed.Case
          get_proxy_or_package_under_package at org/jruby/javasupport/JavaUtilities.java:54
                              method_missing at /Users/asari/Development/src/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51
                                      (root) at -e:1
        $ jruby -J-Djruby.ji.upcase.package.name.allowed=true -rjava -e 'require "temp/jruby-6076/example.jar"; p Java::mixed.Case.Example'
        Java::MixedCase::Example
        
        Show
        Hiro Asari added a comment - $ jruby -rjava -e 'require "temp/jruby-6076/example.jar"; p Java::mixed.Case.Example' NameError: cannot load Java class mixed.Case get_proxy_or_package_under_package at org/jruby/javasupport/JavaUtilities.java:54 method_missing at /Users/asari/Development/src/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51 (root) at -e:1 $ jruby -J-Djruby.ji.upcase.package.name.allowed=true -rjava -e 'require "temp/jruby-6076/example.jar"; p Java::mixed.Case.Example' Java::MixedCase::Example

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Fred Loney
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: