jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-3180

Class in default package can't be reopened under Java namespace

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1.5
  • Fix Version/s: JRuby 1.2
  • Component/s: Embedding
  • Labels:
    None

Description

Java class:

public class Foo {

public String foo () { return "foo"; }
}

>> require 'java'
=> false
>> Java::Foo.new.foo
=> "foo"
>> class Java::Foo
>> def bar
>> "bar"
>> end
>> end
=> nil
>> Java::Foo.new.bar
=> "bar"
>> Java::Foo.new.foo
NoMethodError: undefined method `foo' for #<Java::Foo:0x3bb17a>
from (irb):10
from /Users/mark/opt/jruby-1.1.5/lib/ruby/1.8/irb.rb:150:in `eval_input'
from /Users/mark/opt/jruby-1.1.5/lib/ruby/1.8/irb.rb:259:in `signal_status'
from /Users/mark/opt/jruby-1.1.5/lib/ruby/1.8/irb.rb:147:in `eval_input'
from /Users/mark/opt/jruby-1.1.5/lib/ruby/1.8/irb.rb:146:in `eval_input'
from /Users/mark/opt/jruby-1.1.5/lib/ruby/1.8/irb.rb:70:in `start'
from /Users/mark/opt/jruby-1.1.5/lib/ruby/1.8/irb.rb:69:in `catch'
from /Users/mark/opt/jruby-1.1.5/lib/ruby/1.8/irb.rb:69:in `start'
from /Users/mark/opt/jruby/bin/jirb:19

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 12/Feb/09 7:10 PM

Fixed in r9128 by having the Java module define as constants any classes from the default package you access directly.

Show
Charles Oliver Nutter added a comment - 12/Feb/09 7:10 PM Fixed in r9128 by having the Java module define as constants any classes from the default package you access directly.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Mark Menard
Vote (0)
Watch (0)

Dates

  • Created:
    24/Nov/08 10:39 AM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    12/Feb/09 7:10 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.