Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.7
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: Standard Library
    • Environment:
      jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (OpenJDK 64-Bit Server VM 1.6.0_24) [linux-amd64-java]
    • Number of attachments :
      0

      Description

      `Socket#bind` does not accept `nil` for the local port to bind to. Both MRI 1.8.7 and Rubinius seem to convert a `nil` port value to `0`.

      Reproduction:

      require 'socket'
      socket = UDPSocket.new
      socket.bind('localhost',nil)
      

      Expected Results:

      # => 0
      

      Actual Results:

      TypeError: no implicit conversion from nil to integer
      	from org/jruby/ext/socket/RubyUDPSocket.java:131:in `bind'
      	from (irb):3:in `evaluate'
      	from org/jruby/RubyKernel.java:1083:in `eval'
      	from /home/hal/.rvm/rubies/jruby-1.6.7/lib/ruby/1.8/irb.rb:158:in `eval_input'
      	from /home/hal/.rvm/rubies/jruby-1.6.7/lib/ruby/1.8/irb.rb:271:in `signal_status'
      	from /home/hal/.rvm/rubies/jruby-1.6.7/lib/ruby/1.8/irb.rb:155:in `eval_input'
      	from org/jruby/RubyKernel.java:1410:in `loop'
      	from org/jruby/RubyKernel.java:1183:in `catch'
      	from /home/hal/.rvm/rubies/jruby-1.6.7/lib/ruby/1.8/irb.rb:154:in `eval_input'
      	from /home/hal/.rvm/rubies/jruby-1.6.7/lib/ruby/1.8/irb.rb:71:in `start'
      	from org/jruby/RubyKernel.java:1183:in `catch'
      	from /home/hal/.rvm/rubies/jruby-1.6.7/lib/ruby/1.8/irb.rb:70:in `start'
      	from /home/hal/.rvm/rubies/jruby-1.6.7/bin/irb:17:in `(root)'
      

        Activity

        Hiro Asari made changes -
        Field Original Value New Value
        Assignee Thomas E Enebo [ enebo ] Hiro Asari [ asari ]
        Hiro Asari made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s JRuby 1.7 [ 17049 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Postmodern
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: