Fixes JRUBY-6658 #176

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+5 −2
Diff settings

Always

Just for now

@@ -3530,8 +3530,11 @@ protected IRubyObject constantTableRemove(String name) {
* Define an autoload. ConstantMap holds UNDEF for the name as an autoload marker.
*/
protected void defineAutoload(String name, IAutoloadMethod loadMethod) {
- storeConstant(name, RubyObject.UNDEF);
- getAutoloadMapForWrite().put(name, new Autoload(loadMethod));
+ Autoload existingAutoload = getAutoloadMap().get(name);
+ if (existingAutoload == null || existingAutoload.getValue() == null) {
+ storeConstant(name, RubyObject.UNDEF);
+ getAutoloadMapForWrite().put(name, new Autoload(loadMethod));
+ }
}
/**