against shadows that we know might be matched.
private BcelShadow clinitShadow = null;
-
-
/**
* This holds the initialization and pre-initialization shadows for this class
* that were actually matched by mungers (if no match, then we don't even create the
private boolean canMatchBodyShadows = false;
private boolean canMatchInitialization = false;
private void fastMatchShadowMungers(List shadowMungers) {
- perKindShadowMungers = new List[Shadow.MAX_SHADOW_KIND+1];
- for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
- Shadow.Kind kind = Shadow.SHADOW_KINDS[i];
+ // beware the annoying property that SHADOW_KINDS[i].getKey == (i+1) !
+
+ perKindShadowMungers = new List[Shadow.MAX_SHADOW_KIND + 1];
+ for (int i = 0; i < perKindShadowMungers.length; i++) {
ArrayList mungers = new ArrayList(0);
- perKindShadowMungers[kind.getKey()] = mungers;
- fastMatchShadowMungers(shadowMungers, mungers, kind);
- if (mungers.isEmpty()) {
- perKindShadowMungers[kind.getKey()] = null;
- } else {
- if (kind == Shadow.Initialization) {
- canMatchInitialization = true;
- } else if (!kind.isEnclosingKind()) {
- canMatchBodyShadows = true;
- }
+ perKindShadowMungers[i] = new ArrayList(0);
+ }
+ for (Iterator iter = shadowMungers.iterator(); iter.hasNext();) {
+ ShadowMunger munger = (ShadowMunger) iter.next();
+ Set couldMatchKinds = munger.getPointcut().couldMatchKinds();
+ for (Iterator kindIterator = couldMatchKinds.iterator();
+ kindIterator.hasNext();) {
+ Shadow.Kind aKind = (Shadow.Kind) kindIterator.next();
+ perKindShadowMungers[aKind.getKey()].add(munger);
}
}
+
+ if (!perKindShadowMungers[Shadow.Initialization.getKey()].isEmpty())
+ canMatchInitialization = true;
+
+ for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
+ Shadow.Kind kind = Shadow.SHADOW_KINDS[i];
+ if (!kind.isEnclosingKind() && !perKindShadowMungers[i+1].isEmpty()) {
+ canMatchBodyShadows = true;
+ }
+ if (perKindShadowMungers[i+1].isEmpty()) {
+ perKindShadowMungers[i+1] = null;
+ }
+ }
}
private boolean canMatch(Shadow.Kind kind) {
match(mg, h, enclosingShadow, shadowAccumulator);
}
}
- if (match(enclosingShadow, shadowAccumulator)) {
- enclosingShadow.init();
+ if (canMatch(enclosingShadow.getKind())) {
+ if (match(enclosingShadow, shadowAccumulator)) {
+ enclosingShadow.init();
+ }
}
mg.matchedShadows = shadowAccumulator;
return !shadowAccumulator.isEmpty();
match(mg, h, beforeSuperOrThisCall ? null : enclosingShadow, shadowAccumulator);
}
}
- match(enclosingShadow, shadowAccumulator);
+ if (canMatch(Shadow.ConstructorExecution))
+ match(enclosingShadow, shadowAccumulator);
}
// XXX we don't do pre-inits of interfaces
List shadowAccumulator)
{
Instruction i = ih.getInstruction();
- if (i instanceof FieldInstruction) {
+ if ((i instanceof FieldInstruction) &&
+ (canMatch(Shadow.FieldGet) || canMatch(Shadow.FieldSet))
+ ) {
FieldInstruction fi = (FieldInstruction) i;
if (fi instanceof PUTFIELD || fi instanceof PUTSTATIC) {
// it's final, so it's the set of a final constant, so it's
// not a join point according to 1.0.6 and 1.1.
} else {
- matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator);
+ if (canMatch(Shadow.FieldSet))
+ matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator);
}
} else {
- matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator);
+ if (canMatch(Shadow.FieldSet))
+ matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator);
}
} else {
- matchGetInstruction(mg, ih, enclosingShadow, shadowAccumulator);
+ if (canMatch(Shadow.FieldGet))
+ matchGetInstruction(mg, ih, enclosingShadow, shadowAccumulator);
}
} else if (i instanceof InvokeInstruction) {
InvokeInstruction ii = (InvokeInstruction) i;
if (ii.getMethodName(clazz.getConstantPoolGen()).equals("<init>")) {
- match(
- BcelShadow.makeConstructorCall(world, mg, ih, enclosingShadow),
- shadowAccumulator);
+ if (canMatch(Shadow.ConstructorCall))
+ match(
+ BcelShadow.makeConstructorCall(world, mg, ih, enclosingShadow),
+ shadowAccumulator);
} else if (ii instanceof INVOKESPECIAL) {
String onTypeName = ii.getClassName(cpg);
if (onTypeName.equals(mg.getEnclosingClass().getName())) {
// performance optimization... we only actually care about ASTORE instructions,
// since that's what every javac type thing ever uses to start a handler, but for
// now we'll do this for everybody.
+ if (!canMatch(Shadow.ExceptionHandler)) return;
if (Range.isRangeHandle(ih)) return;
InstructionTargeter[] targeters = ih.getTargeters();
if (targeters != null) {
kind = Shadow.FieldGet;
}
- match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow,
- kind, declaredSig),
- shadowAccumulator);
+ if (canMatch(Shadow.FieldGet) || canMatch(Shadow.FieldSet))
+ match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow,
+ kind, declaredSig),
+ shadowAccumulator);
} else {
AjAttribute.EffectiveSignatureAttribute effectiveSig =
declaredSig.getEffectiveSignature();
if (effectiveSig == null) return;
//System.err.println("call to inter-type member: " + effectiveSig);
if (effectiveSig.isWeaveBody()) return;
- match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow,
- effectiveSig.getShadowKind(), effectiveSig.getEffectiveSignature()),
- shadowAccumulator);
+ if (canMatch(effectiveSig.getShadowKind()))
+ match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow,
+ effectiveSig.getShadowKind(), effectiveSig.getEffectiveSignature()),
+ shadowAccumulator);
}
} else {
- match(
- BcelShadow.makeMethodCall(world, mg, ih, enclosingShadow),
- shadowAccumulator);
+ if (canMatch(Shadow.MethodCall))
+ match(
+ BcelShadow.makeMethodCall(world, mg, ih, enclosingShadow),
+ shadowAccumulator);
}
}
* only used by {@link BcelClassWeaver}
*/
List /*ShadowMungers*/ matchedShadows;
+ List /*Test*/ matchedShadowTests;
// Used for interface introduction
// this is the type of the interface the method is technically on
| catch java.lang.UnsupportedOperationException -> E0
| | NEW DynamicHelloWorld (line 12)
| | DUP
- | | constructor-call(void DynamicHelloWorld.<init>())
- | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
- | | constructor-call(void DynamicHelloWorld.<init>())
+ | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
| | LDC "hello"
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
- | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
+ | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | GOTO L0
| catch java.lang.UnsupportedOperationException -> E0
| E0: ASTORE_1 (line 13)
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
| NEW java.lang.StringBuffer
| DUP
| LDC "expected and caught: "
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ALOAD_1 // java.lang.UnsupportedOperationException t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| L0: NEW java.lang.RuntimeException (line 17)
| DUP
| LDC "should have caught exception"
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
| ATHROW
method-execution(void DynamicHelloWorld.main(java.lang.String[]))
end public static void main(String[])
| catch java.lang.UnsupportedOperationException -> E0
| | NEW DynamicHelloWorld (line 12)
| | DUP
- | | constructor-call(void DynamicHelloWorld.<init>())
- | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
- | | constructor-call(void DynamicHelloWorld.<init>())
+ | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
| | LDC "hello"
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
- | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
+ | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | GOTO L0
| catch java.lang.UnsupportedOperationException -> E0
| E0: ASTORE_1 (line 13)
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
| NEW java.lang.StringBuffer
| DUP
| LDC "expected and caught: "
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ALOAD_1 // java.lang.UnsupportedOperationException t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| L0: NEW java.lang.RuntimeException (line 17)
| DUP
| LDC "should have caught exception"
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
| ATHROW
method-execution(void DynamicHelloWorld.main(java.lang.String[]))
end public static void main(String[])
| catch java.lang.UnsupportedOperationException -> E0
| | NEW DynamicHelloWorld (line 12)
| | DUP
- | | constructor-call(void DynamicHelloWorld.<init>())
- | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
- | | constructor-call(void DynamicHelloWorld.<init>())
+ | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
| | LDC "hello"
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
- | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
+ | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | GOTO L0
| catch java.lang.UnsupportedOperationException -> E0
| E0: ASTORE_1 (line 13)
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
| NEW java.lang.StringBuffer
| DUP
| LDC "expected and caught: "
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ALOAD_1 // java.lang.UnsupportedOperationException t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| L0: NEW java.lang.RuntimeException (line 17)
| DUP
| LDC "should have caught exception"
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
| ATHROW
method-execution(void DynamicHelloWorld.main(java.lang.String[]))
end public static void main(String[])
| | catch java.lang.Exception -> E0
| | | ALOAD_1 // java.io.PrintStream out (line 11)
| | | LDC "bye"
- | | | method-call(void java.io.PrintStream.println(java.lang.String))
- | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| | | GOTO L1
| | catch java.lang.Exception -> E0
| | E0: ASTORE_2 (line 12)
| | ALOAD_1 // java.io.PrintStream out (line 13)
| | ALOAD_2 // java.lang.Exception e
- | | method-call(void java.io.PrintStream.println(java.lang.Object))
- | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
- | | method-call(void java.io.PrintStream.println(java.lang.Object))
+ | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
| finally -> E1
| GOTO L1
| E1: ASTORE 4 (line 14)
| L2: ASTORE_3
| ALOAD_1 // java.io.PrintStream out (line 15)
| LDC "finally"
- | method-call(void java.io.PrintStream.println(java.lang.String))
- | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | method-call(void java.io.PrintStream.println(java.lang.String))
+ | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RET 3 (line 10)
| L3: RETURN (line 17)
method-execution(void FancyHelloWorld.main(java.lang.String[]))
| ISTORE_0
| ILOAD_0 // int x (line 21)
| LDC "name"
- | method-call(int java.lang.String.hashCode())
- | | INVOKEVIRTUAL java.lang.String.hashCode ()I
- | method-call(int java.lang.String.hashCode())
+ | INVOKEVIRTUAL java.lang.String.hashCode ()I
| IADD
| ISTORE_0 // int x
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | method-call(java.lang.String java.lang.StringBuffer.toString())
- | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
- | method-call(java.lang.String java.lang.StringBuffer.toString())
+ | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
+ | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
| ARETURN
method-execution(java.lang.String FancyHelloWorld.getName())
end public static String getName()
+
end public abstract class FancyHelloWorld
| | L0: NOP
| field-get(java.io.PrintStream java.lang.System.out)
| LDC "hello world" (line 9)
- | method-call(void java.io.PrintStream.println(java.lang.String))
- | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | method-call(void java.io.PrintStream.println(java.lang.String))
+ | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RETURN (line 11)
method-execution(void HelloWorld.main(java.lang.String[]))
end public static void main(String[])
+
end public class HelloWorld
public static void main(String[]):
method-execution(void FancyHelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
| ASTORE_1
| finally -> E1
| | catch java.lang.Exception -> E0
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
| ARETURN
method-execution(java.lang.String FancyHelloWorld.getName())
end public static String getName()
+
end public abstract class FancyHelloWorld
| | catch java.lang.Exception -> E0
| | | ALOAD_1 // java.io.PrintStream out (line 11)
| | | LDC "bye"
- | | | method-call(void java.io.PrintStream.println(java.lang.String))
- | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| | | GOTO L0
| | catch java.lang.Exception -> E0
| | E0: ASTORE_2 (line 12)
| | ALOAD_1 // java.io.PrintStream out (line 13)
| | ALOAD_2 // java.lang.Exception e
- | | method-call(void java.io.PrintStream.println(java.lang.Object))
- | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
- | | method-call(void java.io.PrintStream.println(java.lang.Object))
+ | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
| finally -> E1
| GOTO L0
| E1: ASTORE 4 (line 14)
| L1: ASTORE_3
| ALOAD_1 // java.io.PrintStream out (line 15)
| LDC "finally"
- | method-call(void java.io.PrintStream.println(java.lang.String))
- | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | method-call(void java.io.PrintStream.println(java.lang.String))
+ | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RET 3 (line 10)
| L2: RETURN (line 17)
method-execution(void FancyHelloWorld.main(java.lang.String[]))
| ISTORE_0
| ILOAD_0 // int x (line 21)
| LDC "name"
- | method-call(int java.lang.String.hashCode())
- | | INVOKEVIRTUAL java.lang.String.hashCode ()I
- | method-call(int java.lang.String.hashCode())
+ | INVOKEVIRTUAL java.lang.String.hashCode ()I
| IADD
| ISTORE_0 // int x
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | method-call(java.lang.String java.lang.StringBuffer.toString())
- | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
- | method-call(java.lang.String java.lang.StringBuffer.toString())
+ | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
+ | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
| ARETURN
method-execution(java.lang.String FancyHelloWorld.getName())
end public static String getName()
+
end public abstract class FancyHelloWorld
| | NOP
| field-get(java.io.PrintStream java.lang.System.out)
| LDC "hello world" (line 9)
- | method-call(void java.io.PrintStream.println(java.lang.String))
- | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | method-call(void java.io.PrintStream.println(java.lang.String))
+ | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RETURN (line 11)
method-execution(void HelloWorld.main(java.lang.String[]))
end public static void main(String[])
+
end public class HelloWorld
| | catch java.lang.Exception -> E0
| | | ALOAD_1 // java.io.PrintStream out (line 11)
| | | LDC "bye"
- | | | method-call(void java.io.PrintStream.println(java.lang.String))
- | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| | | GOTO L1
| | catch java.lang.Exception -> E0
| | E0: ASTORE_2 (line 12)
| | ALOAD_1 // java.io.PrintStream out (line 13)
| | ALOAD_2 // java.lang.Exception e
- | | method-call(void java.io.PrintStream.println(java.lang.Object))
- | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
- | | method-call(void java.io.PrintStream.println(java.lang.Object))
+ | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
| finally -> E1
| GOTO L1
| E1: ASTORE 4 (line 14)
| L2: ASTORE_3
| ALOAD_1 // java.io.PrintStream out (line 15)
| LDC "finally"
- | method-call(void java.io.PrintStream.println(java.lang.String))
- | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | method-call(void java.io.PrintStream.println(java.lang.String))
+ | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RET 3 (line 10)
| L3: RETURN (line 17)
method-execution(void FancyHelloWorld.main(java.lang.String[]))
| ISTORE_0
| ILOAD_0 // int x (line 21)
| LDC "name"
- | method-call(int java.lang.String.hashCode())
- | | INVOKEVIRTUAL java.lang.String.hashCode ()I
- | method-call(int java.lang.String.hashCode())
+ | INVOKEVIRTUAL java.lang.String.hashCode ()I
| IADD
| ISTORE_0 // int x
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | method-call(java.lang.String java.lang.StringBuffer.toString())
- | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
- | method-call(java.lang.String java.lang.StringBuffer.toString())
+ | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
+ | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
| ARETURN
method-execution(java.lang.String FancyHelloWorld.getName())
end public static String getName()
| | L0: NOP
| field-get(java.io.PrintStream java.lang.System.out)
| LDC "hello world" (line 9)
- | method-call(void java.io.PrintStream.println(java.lang.String))
- | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | method-call(void java.io.PrintStream.println(java.lang.String))
+ | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RETURN (line 11)
method-execution(void HelloWorld.main(java.lang.String[]))
end public static void main(String[])
+
end public class HelloWorld
ALOAD_0
ASTORE 8
method-execution(void FancyHelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
| ASTORE_1
| finally -> E1
| | catch java.lang.Exception -> E0
| ARETURN
method-execution(java.lang.String FancyHelloWorld.getName())
end public static String getName()
+
end public abstract class FancyHelloWorld
ALOAD_0
ASTORE_2
method-execution(void HelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| LDC "hello world" (line 9)
| ASTORE_1
| method-call(void java.io.PrintStream.println(java.lang.String))
| RETURN
method-execution(void HelloWorld.main(java.lang.String[]))
end public static void main(String[])
+
end public class HelloWorld
ASTORE_3
method-execution(void HelloWorld.main(java.lang.String[]))
| catch java.lang.Throwable -> E1
- | | field-get(java.io.PrintStream java.lang.System.out)
- | | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
- | | field-get(java.io.PrintStream java.lang.System.out)
+ | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| | LDC "hello world" (line 9)
| | ASTORE_1
| | method-call(void java.io.PrintStream.println(java.lang.String))
| ATHROW
method-execution(void HelloWorld.main(java.lang.String[]))
end public static void main(String[])
+
end public class HelloWorld
| catch java.lang.Throwable -> E1
| | ALOAD_3
| | INVOKESTATIC Aspect.ajc_before_method_execution (Ljava/lang/Object;)V
- | | field-get(java.io.PrintStream java.lang.System.out)
- | | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
- | | field-get(java.io.PrintStream java.lang.System.out)
+ | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| | LDC "hello world" (line 9)
| | ASTORE_1
| | method-call(void java.io.PrintStream.println(java.lang.String))
| RETURN
method-execution(void HelloWorld.main(java.lang.String[]))
end public static void main(String[])
+
end public class HelloWorld
public static void main(String[]):
method-execution(void FancyHelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
| ASTORE_1
| finally -> E1
| | catch java.lang.Exception -> E0
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
public static void main(String[]):
method-execution(void HelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| LDC "hello world" (line 9)
| ASTORE_1
| ASTORE_2
| catch java.lang.UnsupportedOperationException -> E0
| | NEW DynamicHelloWorld (line 12)
| | DUP
- | | constructor-call(void DynamicHelloWorld.<init>())
- | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
- | | constructor-call(void DynamicHelloWorld.<init>())
+ | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
| | LDC "hello"
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
- | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
+ | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | GOTO L0
| catch java.lang.UnsupportedOperationException -> E0
| E0: ASTORE_1 (line 13)
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
| NEW java.lang.StringBuffer
| DUP
| LDC "expected and caught: "
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ALOAD_1 // java.lang.UnsupportedOperationException t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| L0: NEW java.lang.RuntimeException (line 17)
| DUP
| LDC "should have caught exception"
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
| ATHROW
method-execution(void DynamicHelloWorld.main(java.lang.String[]))
end public static void main(String[])
public static void main(String[]):
method-execution(void FancyHelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
| ASTORE_1
| finally -> E1
| | catch java.lang.Exception -> E0
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
public static void main(String[]):
method-execution(void HelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| LDC "hello world" (line 9)
| ASTORE_1
| ASTORE_2
| | | catch java.lang.Exception -> E0
| | | | ALOAD_1 // java.io.PrintStream out (line 11)
| | | | LDC "bye"
- | | | | method-call(void java.io.PrintStream.println(java.lang.String))
- | | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | | | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| | | | GOTO L1
| | | catch java.lang.Exception -> E0
| | | E0: ASTORE_2 (line 12)
| | | ALOAD_1 // java.io.PrintStream out (line 13)
| | | ALOAD_2 // java.lang.Exception e
- | | | method-call(void java.io.PrintStream.println(java.lang.Object))
- | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
- | | | method-call(void java.io.PrintStream.println(java.lang.Object))
+ | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
| | finally -> E1
| | GOTO L1
| | E1: ASTORE 4 (line 14)
| | L2: ASTORE_3
| | ALOAD_1 // java.io.PrintStream out (line 15)
| | LDC "finally"
- | | method-call(void java.io.PrintStream.println(java.lang.String))
- | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| | RET 3 (line 10)
| | L3: GOTO L4 (line 17)
| catch java.lang.Throwable -> E2
| ISTORE_0
| ILOAD_0 // int x (line 21)
| LDC "name"
- | method-call(int java.lang.String.hashCode())
- | | INVOKEVIRTUAL java.lang.String.hashCode ()I
- | method-call(int java.lang.String.hashCode())
+ | INVOKEVIRTUAL java.lang.String.hashCode ()I
| IADD
| ISTORE_0 // int x
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | method-call(java.lang.String java.lang.StringBuffer.toString())
- | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
- | method-call(java.lang.String java.lang.StringBuffer.toString())
+ | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
+ | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
| ARETURN
method-execution(java.lang.String FancyHelloWorld.getName())
end public static String getName()
| | | L0: GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| | field-get(java.io.PrintStream java.lang.System.out)
| | LDC "hello world" (line 9)
- | | method-call(void java.io.PrintStream.println(java.lang.String))
- | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| | GOTO L1 (line 11)
| catch java.lang.Throwable -> E0
| E0: ASTORE_2
| catch java.lang.UnsupportedOperationException -> E0
| | L0: NEW DynamicHelloWorld (line 12)
| | DUP
- | | constructor-call(void DynamicHelloWorld.<init>())
- | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
- | | constructor-call(void DynamicHelloWorld.<init>())
+ | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
| | LDC "hello"
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
- | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
+ | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | GOTO L1
| catch java.lang.UnsupportedOperationException -> E0
| E0: ASTORE_1 (line 13)
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
| NEW java.lang.StringBuffer
| DUP
| LDC "expected and caught: "
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ALOAD_1 // java.lang.UnsupportedOperationException t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| L1: NEW java.lang.RuntimeException (line 17)
| DUP
| LDC "should have caught exception"
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
| ATHROW
method-execution(void DynamicHelloWorld.main(java.lang.String[]))
end public static void main(String[])
static void <clinit>():
staticinitialization(void FieldyHelloWorld.<clinit>())
| LDC "Hello" (line 3)
- | field-set(java.lang.String FieldyHelloWorld.str)
- | | PUTSTATIC FieldyHelloWorld.str Ljava/lang/String;
- | field-set(java.lang.String FieldyHelloWorld.str)
+ | PUTSTATIC FieldyHelloWorld.str Ljava/lang/String;
| RETURN (line 1)
staticinitialization(void FieldyHelloWorld.<clinit>())
end static void <clinit>()
| | INVOKESTATIC Aspect.ajc_before_method_call ()V
| | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
| method-call(java.lang.String java.lang.StringBuffer.toString())
- | field-set(java.lang.String FieldyHelloWorld.str)
- | | PUTSTATIC FieldyHelloWorld.str Ljava/lang/String;
- | field-set(java.lang.String FieldyHelloWorld.str)
+ | PUTSTATIC FieldyHelloWorld.str Ljava/lang/String;
| field-get(java.io.PrintStream java.lang.System.out)
| | INVOKESTATIC Aspect.ajc_before_field_get ()V
| | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
--- /dev/null
+public abstract class FancyHelloWorld extends java.lang.Object:
+ public void <init>():
+ ALOAD_0 // FancyHelloWorld this (line 7)
+ INVOKESPECIAL java.lang.Object.<init> ()V
+ constructor-execution(void FancyHelloWorld.<init>())
+ | RETURN
+ constructor-execution(void FancyHelloWorld.<init>())
+ end public void <init>()
+
+ public static void main(String[]):
+ method-execution(void FancyHelloWorld.main(java.lang.String[]))
+ | field-get(java.io.PrintStream java.lang.System.out)
+ | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
+ | field-get(java.io.PrintStream java.lang.System.out)
+ | ASTORE_1
+ | finally -> E1
+ | | catch java.lang.Exception -> E0
+ | | | ALOAD_1 // java.io.PrintStream out (line 11)
+ | | | LDC "bye"
+ | | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
+ | | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | | GOTO L0
+ | | catch java.lang.Exception -> E0
+ | | E0: ASTORE_2 (line 12)
+ | | ALOAD_1 // java.io.PrintStream out (line 13)
+ | | ALOAD_2 // java.lang.Exception e
+ | | method-call(void java.io.PrintStream.println(java.lang.Object))
+ | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
+ | | method-call(void java.io.PrintStream.println(java.lang.Object))
+ | finally -> E1
+ | GOTO L0
+ | E1: ASTORE 4 (line 14)
+ | JSR L1
+ | ALOAD 4
+ | ATHROW
+ | L0: JSR L1
+ | GOTO L2
+ | L1: ASTORE_3
+ | ALOAD_1 // java.io.PrintStream out (line 15)
+ | LDC "finally"
+ | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
+ | method-call(void java.io.PrintStream.println(java.lang.String))
+ | RET 3 (line 10)
+ | L2: RETURN (line 17)
+ method-execution(void FancyHelloWorld.main(java.lang.String[]))
+ end public static void main(String[])
+
+ public static String getName():
+ method-execution(java.lang.String FancyHelloWorld.getName())
+ | ICONST_0 (line 20)
+ | ISTORE_0
+ | ILOAD_0 // int x (line 21)
+ | LDC "name"
+ | method-call(int java.lang.String.hashCode())
+ | | INVOKEVIRTUAL java.lang.String.hashCode ()I
+ | method-call(int java.lang.String.hashCode())
+ | IADD
+ | ISTORE_0 // int x
+ | NEW java.lang.StringBuffer (line 22)
+ | DUP
+ | LDC "name"
+ | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
+ | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | ILOAD_0 // int x
+ | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
+ | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
+ | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
+ | method-call(java.lang.String java.lang.StringBuffer.toString())
+ | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
+ | method-call(java.lang.String java.lang.StringBuffer.toString())
+ | ARETURN
+ method-execution(java.lang.String FancyHelloWorld.getName())
+ end public static String getName()
+
+end public abstract class FancyHelloWorld
--- /dev/null
+public class HelloWorld extends java.lang.Object:
+ public void <init>():
+ ALOAD_0 // HelloWorld this (line 5)
+ INVOKESPECIAL java.lang.Object.<init> ()V
+ constructor-execution(void HelloWorld.<init>())
+ | RETURN
+ constructor-execution(void HelloWorld.<init>())
+ end public void <init>()
+
+ public static void main(String[]):
+ method-execution(void HelloWorld.main(java.lang.String[]))
+ | field-get(java.io.PrintStream java.lang.System.out)
+ | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
+ | field-get(java.io.PrintStream java.lang.System.out)
+ | LDC "hello world" (line 9)
+ | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
+ | method-call(void java.io.PrintStream.println(java.lang.String))
+ | RETURN (line 11)
+ method-execution(void HelloWorld.main(java.lang.String[]))
+ end public static void main(String[])
+
+end public class HelloWorld
public static void main(String[]):
method-execution(void FancyHelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
| ASTORE_1
| finally -> E1
| | catch java.lang.Exception -> E0
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
| ARETURN
method-execution(java.lang.String FancyHelloWorld.getName())
end public static String getName()
+
end public abstract class FancyHelloWorld
public static void main(String[]):
method-execution(void HelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| LDC "hello world" (line 9)
| method-call(void java.io.PrintStream.println(java.lang.String))
| | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RETURN (line 11)
method-execution(void HelloWorld.main(java.lang.String[]))
end public static void main(String[])
+
end public class HelloWorld
| catch java.lang.UnsupportedOperationException -> E0
| | NEW DynamicHelloWorld (line 12)
| | DUP
- | | constructor-call(void DynamicHelloWorld.<init>())
- | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
- | | constructor-call(void DynamicHelloWorld.<init>())
+ | | INVOKESPECIAL DynamicHelloWorld.<init> ()V
| | LDC "hello"
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
- | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
- | | field-get(java.util.List java.util.Collections.EMPTY_LIST)
+ | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String;
| | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| | GOTO L0
| catch java.lang.UnsupportedOperationException -> E0
| E0: ASTORE_1 (line 13)
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14)
| NEW java.lang.StringBuffer
| DUP
| LDC "expected and caught: "
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ALOAD_1 // java.lang.UnsupportedOperationException t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| L0: NEW java.lang.RuntimeException (line 17)
| DUP
| LDC "should have caught exception"
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V
| ATHROW
method-execution(void DynamicHelloWorld.main(java.lang.String[]))
end public static void main(String[])
| | catch java.lang.Exception -> E0
| | | ALOAD_1 // java.io.PrintStream out (line 11)
| | | LDC "bye"
- | | | method-call(void java.io.PrintStream.println(java.lang.String))
- | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | | | method-call(void java.io.PrintStream.println(java.lang.String))
+ | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| | | GOTO L0
| | catch java.lang.Exception -> E0
| | E0: ASTORE_2 (line 12)
| | ALOAD_1 // java.io.PrintStream out (line 13)
| | ALOAD_2 // java.lang.Exception e
- | | method-call(void java.io.PrintStream.println(java.lang.Object))
- | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
- | | method-call(void java.io.PrintStream.println(java.lang.Object))
+ | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V
| finally -> E1
| GOTO L0
| E1: ASTORE 4 (line 14)
| L1: ASTORE_3
| ALOAD_1 // java.io.PrintStream out (line 15)
| LDC "finally"
- | method-call(void java.io.PrintStream.println(java.lang.String))
- | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | method-call(void java.io.PrintStream.println(java.lang.String))
+ | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RET 3 (line 10)
| L2: RETURN (line 17)
method-execution(void FancyHelloWorld.main(java.lang.String[]))
| ISTORE_0
| ILOAD_0 // int x (line 21)
| LDC "name"
- | method-call(int java.lang.String.hashCode())
- | | INVOKEVIRTUAL java.lang.String.hashCode ()I
- | method-call(int java.lang.String.hashCode())
+ | INVOKEVIRTUAL java.lang.String.hashCode ()I
| IADD
| ISTORE_0 // int x
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
- | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
- | method-call(java.lang.String java.lang.StringBuffer.toString())
- | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
- | method-call(java.lang.String java.lang.StringBuffer.toString())
+ | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
+ | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String;
| ARETURN
method-execution(java.lang.String FancyHelloWorld.getName())
end public static String getName()
| | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| field-get(java.io.PrintStream java.lang.System.out)
| LDC "hello world" (line 9)
- | method-call(void java.io.PrintStream.println(java.lang.String))
- | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
- | method-call(void java.io.PrintStream.println(java.lang.String))
+ | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
| RETURN (line 11)
method-execution(void HelloWorld.main(java.lang.String[]))
end public static void main(String[])
public static void main(String[]):
method-execution(void FancyHelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9)
| ASTORE_1
| finally -> E1
| | catch java.lang.Exception -> E0
| NEW java.lang.StringBuffer (line 22)
| DUP
| LDC "name"
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
- | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
- | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
+ | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V
| ILOAD_0 // int x
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer;
public static void main(String[]):
method-execution(void HelloWorld.main(java.lang.String[]))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8)
| LDC "hello world" (line 9)
| ASTORE_1
| ASTORE_2
static void foo(Object, Object):
method-execution(void MultiArgHelloWorld.foo(java.lang.Object, java.lang.Object))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
| NEW java.lang.StringBuffer
| DUP
- | constructor-call(void java.lang.StringBuffer.<init>())
- | | INVOKESPECIAL java.lang.StringBuffer.<init> ()V
- | constructor-call(void java.lang.StringBuffer.<init>())
+ | INVOKESPECIAL java.lang.StringBuffer.<init> ()V
| ALOAD_0 // java.lang.Object s
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String))
- | ALOAD_1 // java.lang.Object arg1
+ | ALOAD_1 // java.lang.Object t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
static void foo(Object, Object):
method-execution(void MultiArgHelloWorld.foo(java.lang.Object, java.lang.Object))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
| NEW java.lang.StringBuffer
| DUP
- | constructor-call(void java.lang.StringBuffer.<init>())
- | | INVOKESPECIAL java.lang.StringBuffer.<init> ()V
- | constructor-call(void java.lang.StringBuffer.<init>())
+ | INVOKESPECIAL java.lang.StringBuffer.<init> ()V
| ALOAD_0 // java.lang.Object s
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String))
- | ALOAD_1 // java.lang.Object arg1
+ | ALOAD_1 // java.lang.Object t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
static void foo(Object, Object):
method-execution(void MultiArgHelloWorld.foo(java.lang.Object, java.lang.Object))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
| NEW java.lang.StringBuffer
| DUP
- | constructor-call(void java.lang.StringBuffer.<init>())
- | | INVOKESPECIAL java.lang.StringBuffer.<init> ()V
- | constructor-call(void java.lang.StringBuffer.<init>())
+ | INVOKESPECIAL java.lang.StringBuffer.<init> ()V
| ALOAD_0 // java.lang.Object s
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String))
- | ALOAD_1 // java.lang.Object arg1
+ | ALOAD_1 // java.lang.Object t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
static void foo(Object, Object):
method-execution(void MultiArgHelloWorld.foo(java.lang.Object, java.lang.Object))
- | field-get(java.io.PrintStream java.lang.System.out)
- | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
- | field-get(java.io.PrintStream java.lang.System.out)
+ | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
| NEW java.lang.StringBuffer
| DUP
- | constructor-call(void java.lang.StringBuffer.<init>())
- | | INVOKESPECIAL java.lang.StringBuffer.<init> ()V
- | constructor-call(void java.lang.StringBuffer.<init>())
+ | INVOKESPECIAL java.lang.StringBuffer.<init> ()V
| ALOAD_0 // java.lang.Object s
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String))
- | ALOAD_1 // java.lang.Object arg1
+ | ALOAD_1 // java.lang.Object t
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
| | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
| method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object))
return false;
}
};
- weaveTest(new String[] {"FancyHelloWorld"}, "Id", p);
+ weaveTest(new String[] {"FancyHelloWorld"}, "Id2", p);
checkShadowSet(l, new String[] {
"method-call(void java.io.PrintStream.println(java.lang.Object))",
});
}
+
public void testId() throws IOException {
final List l = new ArrayList();
BcelAdvice p = new BcelAdvice(null, makePointcutAll(), null, 0, -1, -1, null, null) {
l.add(shadow);
}
};
- weaveTest(new String[] {"HelloWorld"}, "Id", p);
+ weaveTest(new String[] {"HelloWorld"}, "Id2", p);
checkShadowSet(l, new String[] {
"method-execution(void HelloWorld.main(java.lang.String[]))",
TestUtil.runMain(makeClassPath(outDirPath), name);
}
} catch (Error e) {
+ System.err.println("Comparing to " + outName + ".txt");
gen.print(System.err);
throw e;
} catch (RuntimeException e) {