From 5a11d89a94c19851b85e014041664b360aa6b1b0 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 22 Feb 2006 15:21:16 +0000 Subject: [PATCH] optimization: less string manipulation --- weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java index 527e7369b..b40fa9b93 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java @@ -1679,15 +1679,16 @@ class BcelClassWeaver implements IClassWeaver { private boolean match(LazyMethodGen mg) { BcelShadow enclosingShadow; - List shadowAccumulator = new ArrayList(); + + boolean startsAngly = mg.getName().charAt(0)=='<'; // we want to match ajsynthetic constructors... - if (mg.getName().equals("")) { + if (startsAngly && mg.getName().equals("")) { return matchInit(mg, shadowAccumulator); } else if (!shouldWeaveBody(mg)) { //.isAjSynthetic()) { return false; } else { - if (mg.getName().equals("")) { + if (startsAngly && mg.getName().equals("")) { clinitShadow = enclosingShadow = BcelShadow.makeStaticInitialization(world, mg); //System.err.println(enclosingShadow); } else if (mg.isAdviceMethod()) { @@ -1720,7 +1721,7 @@ class BcelClassWeaver implements IClassWeaver { } } // FIXME asc change from string match if we can, rather brittle. this check actually prevents field-exec jps - if (canMatch(enclosingShadow.getKind()) && !mg.getName().startsWith("ajc$interFieldInit")) { + if (canMatch(enclosingShadow.getKind()) && !(mg.getName().charAt(0)=='a' && mg.getName().startsWith("ajc$interFieldInit"))) { if (match(enclosingShadow, shadowAccumulator)) { enclosingShadow.init(); } -- 2.39.5