Dir.glob with some 'file:/'-style URLs throws native Java exception
-------------------------------------------------------------------
Key: JRUBY-4598
URL: http://jira.codehaus.org/browse/JRUBY-4598
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules, Java Integration
Affects Versions: JRuby 1.4
Environment: Latest jruby dev.
Reporter: Vladimir Sizikov
We even have a java integration spec for that, but since RSpec 1.2.9 was hiding
the exception, we never knew JRuby works incorrectly in this case. :)
{noformat}
jruby -e 'p Dir.glob("file:/opt/work/jruby.git/lib/jruby.jar")'
String.java:405:in `checkBounds': java.lang.StringIndexOutOfBoundsException:
String index out of range: -1
from String.java:450:in `<init>'
from Dir.java:801:in `newStringFromUTF8'
from Dir.java:579:in `glob_helper'
from Dir.java:449:in `push_globs'
from Dir.java:423:in `push_braces'
from Dir.java:302:in `push_glob'
from RubyDir.java:185:in `glob'
from org/jruby/RubyDir$s_method_0_1$RUBYFRAMEDINVOKER$glob.gen:-1:in
`call'
from DynamicMethod.java:190:in `call'
from DynamicMethod.java:186:in `call'
from CachingCallSite.java:309:in `cacheAndCall'
from CachingCallSite.java:148:in `call'
from -e:1:in `__file__'
from -e:-1:in `load'
from Ruby.java:651:in `runScript'
from Ruby.java:569:in `runNormally'
from Ruby.java:415:in `runFromMain'
from Main.java:275:in `run'
from Main.java:117:in `run'
from Main.java:97:in `main'
{noformat}
But, the following works fine:
{code}
jruby -e 'p Dir.glob("file:/opt/work/jruby.git/lib/jruby.jar!/*")'
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email