Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6
-
Fix Version/s: JRuby 1.6.1
-
Component/s: Core Classes/Modules, Intro
-
Labels:None
-
Environment:jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (OpenJDK Client VM 1.6.0_20) [linux-i386-java]
-
Testcase included:yes
-
Number of attachments :
Description
In MRI the Dir#pos= method accepts a negative value. It's effectively a no-op if a read has not occurred yet, or returns nil if at least one read has already occurred, which I assume moves the pointer to the end of the stream. The behavior is curious, and I suspect it's driven by the rules of the underlying seekdir() function, though I haven't thoroughly scoured the source, and the man page for seekdir() made no mention of negative values.
JRuby fails with an Java::JavaLang::ArrayIndexOutOfBoundsException.
I've attached the test suite I'm using for berger_spec.