Can't require jars with leading underscores #1006

Closed
phs opened this Issue Sep 11, 2013 · 2 comments

Projects

None yet

2 participants

@phs
Contributor
phs commented Sep 11, 2013

It looks like requiring jars whose name begins with a _ causes a stack trace. This doesn't affect similarly named rb files:

$ ls _alphabetically_early.rb _alphabetically_early.jar
_alphabetically_early.jar _alphabetically_early.rb
$ irb
>> JRUBY_VERSION
=> "1.7.4"
>> JRUBY_REVISION
=> "2390d3b"
>> require './_alphabetically_early.rb'
=> true
>> require './_alphabetically_early.jar'
LoadError: Exception loading extension `..`: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    from org/jruby/RubyKernel.java:1054:in `require'
    from /usr/local/var/rbenv/versions/jruby-1.7.4/lib/ruby/shared/rubygems/custom_require.rb:36:in `require'
    from (irb):4:in `evaluate'
    from org/jruby/RubyKernel.java:1093:in `eval'
    from org/jruby/RubyKernel.java:1489:in `loop'
    from org/jruby/RubyKernel.java:1254:in `catch'
    from org/jruby/RubyKernel.java:1254:in `catch'
    from /usr/local/var/rbenv/versions/jruby-1.7.4/bin/irb:13:in `(root)'
>>
$ java -version
java version "1.7.0_12-ea"
Java(TM) SE Runtime Environment (build 1.7.0_12-ea-b08)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b28, mixed mode)
$ uname -a
Darwin holmes.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
@BanzaiMan
Member

JAR with two consecutive underscores would fail to load, too.

@BanzaiMan BanzaiMan closed this in f84e7db Sep 11, 2013
@BanzaiMan BanzaiMan was assigned Sep 11, 2013
@BanzaiMan BanzaiMan added a commit that referenced this issue Sep 11, 2013
@BanzaiMan BanzaiMan Add test case for #1006 b0a9065
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment