Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      this snippet:

      require 'java'
      
      class JFrameDescendant < javax.swing.JFrame
      
        def initialize
           @panel = 3
        end
      end
      JFrameDescendant.new
      

      Results in this message:

      repro.rb:1 warning: instance vars on non-persistent Java type
      JFrameDescendant (http://wiki.jruby.org/Persistence)
      

      Which may not be accurate, since the descendant is pure ruby, so should be happy with instance vars, shouldn't it?

      see http://www.ruby-forum.com/topic/4341042

        Activity

        Hide
        Roger Pack added a comment -

        Hmm I'm not sure it doesn't seem immediately obvious if it's adding an instance variable to a java class or not in there...

        Show
        Roger Pack added a comment - Hmm I'm not sure it doesn't seem immediately obvious if it's adding an instance variable to a java class or not in there...
        Hide
        Theo Hultberg added a comment -

        Here's a minimal command to reproduce the error:

        ruby -e 'require "ant"; ant { echo :message => "hello" }'
        
        Show
        Theo Hultberg added a comment - Here's a minimal command to reproduce the error: ruby -e 'require "ant" ; ant { echo :message => "hello" }'
        Hide
        Theo Hultberg added a comment -

        The instance variable is created when the ant variable is accessed, because ant is an attr_accessor method (see https://github.com/jruby/jruby/blob/master/lib/ruby/shared/ant/element.rb#L9)

        Can I reopen this bug somehow, or should I open a new one?

        Show
        Theo Hultberg added a comment - The instance variable is created when the ant variable is accessed, because ant is an attr_accessor method (see https://github.com/jruby/jruby/blob/master/lib/ruby/shared/ant/element.rb#L9 ) Can I reopen this bug somehow, or should I open a new one?
        Hide
        Roger Pack added a comment -

        I'd open a new one.

        Show
        Roger Pack added a comment - I'd open a new one.
        Hide
        Theo Hultberg added a comment -

        I opened JRUBY-6918

        Show
        Theo Hultberg added a comment - I opened JRUBY-6918

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Roger Pack
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: