Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in loading Java classes with upper case package names #2742

Closed
donv opened this Issue Mar 22, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@donv
Copy link
Member

commented Mar 22, 2015

Hi all!

It looks like we have a regression in loading Java classes with upper case package names. Works fine in JRuby 1.7.19, but fails with JRuby 1.7 head:

$ cat org/TestApp/TestClass.java
package org.TestApp;

public class TestClass {
    public static void hello() {
        System.out.println("Hello!");
    }
}

$ javac org/TestApp/TestClass.java

$ rvm use jruby
Using /Users/uwe/.rvm/gems/jruby-1.7.19

$ ruby -J-Djruby.ji.upper.case.package.name.allowed=true -S irb
jruby-1.7.19 :001 > Java::org.TestApp.TestClass.hello
Hello!
 => nil 
jruby-1.7.19 :002 > exit

$ rvm use jruby-17-head
Using /Users/uwe/.rvm/gems/jruby-17-head

$ ruby -J-Djruby.ji.upper.case.package.name.allowed=true -S irb
jruby-17-head :001 > Java::org.TestApp.TestClass.hello
NameError: missing class name (`org.TestApp')
    from org/jruby/javasupport/JavaUtilities.java:54:in `get_proxy_or_package_under_package'
    from file:/Users/uwe/.rvm/rubies/jruby-17-head/lib/jruby.jar!/jruby/java/java_package_module_template.rb:14:in `method_missing'
    from (irb):1:in `evaluate'
    from org/jruby/RubyKernel.java:1107:in `eval'
    from org/jruby/RubyKernel.java:1507:in `loop'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from /Users/uwe/.rvm/rubies/jruby-17-head/bin/jirb:13:in `(root)'
jruby-17-head :002 > RUBY_DESCRIPTION
 => "jruby 1.7.20-SNAPSHOT (1.9.3p551) 2015-03-22 e66cbd5 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_31-b13 +jit [darwin-x86_64]" 

@donv donv added this to the JRuby 1.7.20 milestone Mar 22, 2015

@donv

This comment has been minimized.

Copy link
Member Author

commented Mar 24, 2015

Can anyone confirm this issue, or is it just me?

@kares

This comment has been minimized.

Copy link
Member

commented Mar 24, 2015

@donv will look into it ... just bare with me for a while :)

@kares kares self-assigned this Mar 24, 2015

@donv

This comment has been minimized.

Copy link
Member Author

commented Mar 24, 2015

Thanks @kares !

kares added a commit to kares/jruby that referenced this issue Mar 24, 2015

avoid regression in loading Java classes with upper case package names (
fixes jruby#2742)

... caused by the internal cleanup (the regression is not part of any 1.7.x release)

one can only test this with *-Xji.upper.case.package.name.allowed=true* but since there's another failure the feature introduces, this will need to be revisited

@kares kares closed this in f4ff889 Mar 26, 2015

@donv

This comment has been minimized.

Copy link
Member Author

commented Mar 27, 2015

Hi @kares !

Thanks for the fix. The initial test case is now working with JRuby commandline, but I still have a failing test case in Ruboto, the one that initiated my report.

The test case is simple and fails consistently in my local work space, but succeeds in travis-ci. I will investigate a bit more and come back to you.

@kares

This comment has been minimized.

Copy link
Member

commented Mar 28, 2015

OK, thanks for the feedback @donv ... please be sure to let me know if there's any regression ...

for me running test:jruby19 with ji.upper.case.package.name.allowed=true still shows one failure but that one pretty sure failed previously.I hoped for your case to be covered with the added test ;(

@donv

This comment has been minimized.

Copy link
Member Author

commented Mar 28, 2015

Hi @kares !

It now looks like everything is OK. I am not sure what changed, but my tests are green.

Consider this fixed. I'll report if there is a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.