JRuby

require './NonExistantRequiredFile' causes StringIndexOutOfBoundException instead of LoadError

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.0.3, JRuby 1.1RC1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP, with jDK 1.6.0 with both JRUby 1.0.1 and trunk version
  • Testcase included:
    yes
  • Number of attachments :
    1

Description

I added this line to test/testLoad.rb

test_exception(LoadError) { require './NonExistantRequriedFile'}

fails with:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(Unknown Source)
at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:285)
at org.jruby.runtime.load.LoadService.require(LoadService.java:344)
at org.jruby.RubyKernel.require(RubyKernel.java:671)
at org.jruby.RubyKernelInvoker$require_method_1_0.call(Unknown Source)
at org.jruby.runtime.CallAdapter$DefaultCallAdapter.call(CallAdapter.java:154)
at org.jruby.runtime.CallAdapter$DefaultCallAdapter.call(CallAdapter.java:107)
at test_load._file_(test_load.rb:1)
at test_load.load(test_load.rb)
at org.jruby.Ruby.runScript(Ruby.java:562)
at org.jruby.Ruby.runNormally(Ruby.java:484)
at org.jruby.Ruby.runFromMain(Ruby.java:409)
at org.jruby.Main.runInterpreter(Main.java:223)
at org.jruby.Main.runInterpreter(Main.java:179)
at org.jruby.Main.run(Main.java:121)
at org.jruby.Main.main(Main.java:96)

Activity

Hide
Thomas E Enebo added a comment -

This test is now in both versions and we work. This has been fixed in the past and not resolved. Stick a fork in it.

Show
Thomas E Enebo added a comment - This test is now in both versions and we work. This has been fixed in the past and not resolved. Stick a fork in it.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: