Protected methods not being propagated properly (affects active_scaffold)
-------------------------------------------------------------------------
Key: JRUBY-990
URL: http://jira.codehaus.org/browse/JRUBY-990
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.x
Environment: java 1.5
Reporter: Matt Williams
Attachments: protected_broken.zip
I discovered this with active_scaffold, but I've been able to recreate it with
smaller code.
Basically the gist is that the JRuby interpreter is not finding inherited
protected methods when defined as follows:
class BrokenParent
def self.inherited(subclass)
puts "I'm inside inherited with my subclass: #{subclass}"
class << subclass
def crud_type
@crud_type
end
protected
def crud_type=(val)
@crud_type = val.to_sym
end
end
end
def crud_type
self.class.crud_type
end
end
If I have a child which attempts to invoke the crud_type= method, it fails,
unless I remove the protected in the parent
class BrokenChild < BrokenParent
self.crud_type=:list
end
This is the issue which Morten Christensen commented on in JRUBY-751. For now,
active_scaffold seems to work if the protected is removed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email