From 907dc1b73d052f9a0f95498b6ed5a92e0517cf65 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 27 Feb 2007 13:30:51 +0000 Subject: [PATCH] optimization: if forcing a public type public, dont consider it a change! --- weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java | 3 +-- weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index 0a392cc26..016bf8a68 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -520,8 +520,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { return true; //throw new BCException("no match for " + member + " in " + gen); } else if (member.getKind() == Member.STATIC_INITIALIZATION) { - gen.forcePublic(); - return true; + return gen.forcePublic(); } else { throw new RuntimeException("unimplemented"); } diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java index 6f6743f47..8f414f848 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java @@ -1321,8 +1321,10 @@ public final class LazyClassGen { } - public void forcePublic() { + public boolean forcePublic() { + if (myGen.isPublic()) return false; myGen.setAccessFlags(Utility.makePublic(myGen.getAccessFlags())); + return true; } -- 2.39.5