Skip to content
Browse files

Cuts out unnecessary constant resetting.

  • Loading branch information...
1 parent 9a672d0 commit 7c866628b6f6366dbedaa4be42ca666735f411fe @yokolet yokolet committed Jul 24, 2012
Showing with 3 additions and 12 deletions.
  1. +1 −0 src/org/jruby/Ruby.java
  2. +2 −12 src/org/jruby/RubyModule.java
View
1 src/org/jruby/Ruby.java
@@ -1281,6 +1281,7 @@ private void initRoot() {
}
private void initCore() {
+ // this is a hack to avoid NoClassDefFoundError.
org.jruby.runtime.backtrace.FrameType frameType = org.jruby.runtime.backtrace.FrameType.METHOD;
if (profile.allowClass("Data")) {
defineClass("Data", objectClass, ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
View
14 src/org/jruby/RubyModule.java
@@ -3011,7 +3011,7 @@ public IRubyObject getConstantNoConstMissing(String name, boolean inherit, boole
if (constant == null && !isClass() && includeObject) {
constant = iterateConstantNoConstMissing(name, getRuntime().getObject(), inherit);
}
-
+
if (constant == null) constant = tryGetConstantIfPossible(getRuntime(), name);
return constant;
@@ -3479,17 +3479,7 @@ private IRubyObject tryGetConstantIfPossible(Ruby runtime, String name) {
if (method != null) {
try {
Object obj = method.invoke(runtime);
- if (obj instanceof IRubyObject) {
- if (getSuperClass() != null) {
- getSuperClass().storeConstant(name, (IRubyObject)obj);
- getSuperClass().invalidateConstantCache();
- }
- else {
- storeConstant(name, (IRubyObject)obj);
- invalidateConstantCache();
- }
- return (IRubyObject)obj;
- }
+ if (obj instanceof IRubyObject) return (IRubyObject)obj;
} catch (IllegalAccessException ex) {
return null;
} catch (IllegalArgumentException ex) {

0 comments on commit 7c86662

Please sign in to comment.
Something went wrong with that request. Please try again.