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

Key: JRUBY-1228
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Matt Fletcher
Votes: 0
Watchers: 1
Operations

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

TCPSocket.open will not accept a string for the port parameter

Created: 20/Jul/07 08:52 AM   Updated: 22/Dec/07 06:28 AM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 1.0.0
Fix Version/s: JRuby 1.0.1, JRuby 1.1b1

Time Tracking:
Not Specified

File Attachments: 1. File ftpsocket.diff (1 kb)

Environment: Mac OS X, Linux


 Description  « Hide
Ruby's TCPSocket.open method will happily accept a string as the port parameter:

socket = TCPSocket.open("waldorf", "7500")
socket.close

This code generates an exception in JRuby:
socket = TCPSocket.open("waldorf", "7500")
TypeError: can't convert String into Integer
from (irb):4:in `open'
from (irb):4:in `binding'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:150:in `eval_input'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:70:in `signal_status'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:189:in `eval_input'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:70:in `each_top_level_statement'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:190:in `loop'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:190:in `catch'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:190:in `eval_input'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:70:in `start'
from :-1:in `catch'
from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:71:in `start'
from :-1



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Nicolas Modrzyk - 23/Jul/07 12:34 AM
attaching ftpsocket.diff to allow to parse a string for the port number.
This is fixing the noticed behavior.

Thomas E Enebo - 23/Aug/07 10:33 AM
Applied on 1.0 branch as well.