History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2524
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Charles Oliver Nutter
Reporter: Tyler Jennings
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JRuby

File.exists? "file:/" crashes jruby (I believe the actual cause is the file: prefix)

Created: 15/May/08 10:08 AM   Updated: 04/Jul/08 09:07 AM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 1.1.1
Fix Version/s: JRuby 1.1.2

Time Tracking:
Not Specified

File Attachments: 1. File patch_2524.diff (4 kb)

Environment: Mac OSX Tiger, Jruby 1.1.1


 Description  « Hide
URI prefixes on file paths cause some methods in File to throw exceptions. Try File.exists? "file:/" from jirb for a sample.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Thomas E Enebo - 15/May/08 10:14 AM
Methods I found:
FileTest.exists?
File.lstat,stat
File.atime,ctime,mtime

require/load have lots of file: logic, but I have no checked to see if it does the same unguarded indexOf check.


Steen Lehmann - 16/May/08 04:37 PM
Attaching patch for RubyFile.java, RubyFileTest.java and test_file.rb, which fixes and tests the issue.

Charles Oliver Nutter - 17/May/08 01:29 AM
Hey, thanks for the fix, Steen. Committed in 6726.