Files added to a module via Kernel.autoload are not automatically loaded if the 
class they contain is extended
--------------------------------------------------------------------------------------------------------------

                 Key: JRUBY-1345
                 URL: http://jira.codehaus.org/browse/JRUBY-1345
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Interpreter
    Affects Versions: JRuby 1.0.1
            Reporter: Daniel Einspanjer
         Attachments: overriding_plugins.zip

Discovered while trying to run a Rails project under JRuby.  The project makes 
use of ActiveScaffold and a second plugin that extends ActiveScaffold.
AS uses autoload for all the files in its library.
The second plugin extends one of the classes in AS in the following way:

module Foo::Bar
  class Baz
    def a_method_new
    end
    alias_method_chain :a_method, :new
  end
end

This works in MRI but in JRuby, the Foo::Bar::Baz class is not autoloaded and 
the alias causes the application to crash with an "undefined method" NameError

Attached is a test case that demonstrates the problem.  Expand the zip into the 
vendor/plugins directory of a new rails project and attempt to start the 
project via jruby script/server

-- 
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

Reply via email to