From: Alexander Kriegisch Date: Sat, 25 Feb 2023 22:11:05 +0000 (+0100) Subject: Sync HandleProviderDelimiter with JDT Core & AJDT X-Git-Tag: V1_9_20~39 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9e0d2bc02474a9549093d57fa4a0d321c2739198;p=aspectj.git Sync HandleProviderDelimiter with JDT Core & AJDT New constants: JEM_MODULAR_CLASSFILE - '\'' (single quote) ANNOTATION - '}' LAMBDA_EXPRESSION - ')' LAMBDA_METHOD - '&' STRING - '"' MODULE - '`' DELIMITER_ESCAPE - '=' Updated AspectJ constants due to JDT Core using constants previously used by AspectJ: ADVICE - '&' to '§' ASPECT_TYPE - '\'' to '>' ITD_METHOD - ')' to '°' DECLARE - '`' to '´' POINTCUT - '"' to '©' Signed-off-by: Alexander Kriegisch --- diff --git a/asm/src/main/java/org/aspectj/asm/internal/HandleProviderDelimiter.java b/asm/src/main/java/org/aspectj/asm/internal/HandleProviderDelimiter.java index 2732d109f..f8f601bb4 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/HandleProviderDelimiter.java +++ b/asm/src/main/java/org/aspectj/asm/internal/HandleProviderDelimiter.java @@ -17,35 +17,52 @@ import org.aspectj.asm.IProgramElement; */ public class HandleProviderDelimiter { - // taken from JavaElement + // TODO: + // Keep constants in sync between + // - org.eclipse.jdt.internal.core.JavaElement (JDT Core), + // - org.eclipse.ajdt.core.javaelements.AspectElement (AJDT Core), + // - org.aspectj.asm.internal.HandleProviderDelimiter (AspectJ). + // The reason is that JDT Core introduces new delimiters for new Java language constructs once in a while. + // This led to clashes with existing AJDT symbols in the past already, which consequently had to be changed + // to use other characters. Therefore, manual synchronisation with JDT Core is necessary. + + // Taken from org.eclipse.jdt.internal.core.JavaElement (JDT Core) + public static final HandleProviderDelimiter ESCAPE = new HandleProviderDelimiter('\\'); public static final HandleProviderDelimiter JAVAPROJECT = new HandleProviderDelimiter('='); + public static final HandleProviderDelimiter PACKAGEFRAGMENTROOT = new HandleProviderDelimiter('/'); public static final HandleProviderDelimiter PACKAGEFRAGMENT = new HandleProviderDelimiter('<'); public static final HandleProviderDelimiter FIELD = new HandleProviderDelimiter('^'); public static final HandleProviderDelimiter METHOD = new HandleProviderDelimiter('~'); public static final HandleProviderDelimiter INITIALIZER = new HandleProviderDelimiter('|'); public static final HandleProviderDelimiter COMPILATIONUNIT = new HandleProviderDelimiter('{'); public static final HandleProviderDelimiter CLASSFILE = new HandleProviderDelimiter('('); + public static final HandleProviderDelimiter JEM_MODULAR_CLASSFILE = new HandleProviderDelimiter('\''); public static final HandleProviderDelimiter TYPE = new HandleProviderDelimiter('['); + public static final HandleProviderDelimiter PACKAGEDECLARATION = new HandleProviderDelimiter('%'); public static final HandleProviderDelimiter IMPORTDECLARATION = new HandleProviderDelimiter('#'); public static final HandleProviderDelimiter COUNT = new HandleProviderDelimiter('!'); - public static final HandleProviderDelimiter ESCAPE = new HandleProviderDelimiter('\\'); - public static final HandleProviderDelimiter PACKAGEDECLARATION = new HandleProviderDelimiter('%'); - public static final HandleProviderDelimiter PACKAGEFRAGMENTROOT = new HandleProviderDelimiter('/'); // these below are not currently used because no iprogramelement.kind // equivalent public static final HandleProviderDelimiter LOCALVARIABLE = new HandleProviderDelimiter('@'); public static final HandleProviderDelimiter TYPE_PARAMETER = new HandleProviderDelimiter(']'); + public static final HandleProviderDelimiter ANNOTATION = new HandleProviderDelimiter('}'); + public static final HandleProviderDelimiter LAMBDA_EXPRESSION = new HandleProviderDelimiter(')'); + public static final HandleProviderDelimiter LAMBDA_METHOD = new HandleProviderDelimiter('&'); + public static final HandleProviderDelimiter STRING = new HandleProviderDelimiter('"'); + public static final HandleProviderDelimiter MODULE = new HandleProviderDelimiter('`'); + public static final HandleProviderDelimiter DELIMITER_ESCAPE = new HandleProviderDelimiter('='); - // AspectJ specific ones + // Taken from org.aspectj.asm.internal.HandleProviderDelimiter (AspectJ) public static final HandleProviderDelimiter ASPECT_CU = new HandleProviderDelimiter('*'); - public static final HandleProviderDelimiter ADVICE = new HandleProviderDelimiter('&'); - public static final HandleProviderDelimiter ASPECT_TYPE = new HandleProviderDelimiter('\''); + public static final HandleProviderDelimiter ADVICE = new HandleProviderDelimiter('§'); + public static final HandleProviderDelimiter ASPECT_TYPE = new HandleProviderDelimiter('>'); public static final HandleProviderDelimiter CODEELEMENT = new HandleProviderDelimiter('?'); public static final HandleProviderDelimiter ITD_FIELD = new HandleProviderDelimiter(','); - public static final HandleProviderDelimiter ITD = new HandleProviderDelimiter(')'); - public static final HandleProviderDelimiter DECLARE = new HandleProviderDelimiter('`'); - public static final HandleProviderDelimiter POINTCUT = new HandleProviderDelimiter('"'); + public static final HandleProviderDelimiter ITD_METHOD = new HandleProviderDelimiter('°'); + public static final HandleProviderDelimiter DECLARE = new HandleProviderDelimiter('´'); + public static final HandleProviderDelimiter POINTCUT = new HandleProviderDelimiter('©'); + // Special delimiter for phantom handles public static final HandleProviderDelimiter PHANTOM = new HandleProviderDelimiter(';'); private static char empty = ' '; @@ -99,7 +116,7 @@ public class HandleProviderDelimiter { return ITD_FIELD.getDelimiter(); } else if (kind.equals(IProgramElement.Kind.INTER_TYPE_METHOD) || kind.equals(IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR) || kind.equals(IProgramElement.Kind.INTER_TYPE_PARENT)) { - return ITD.getDelimiter(); + return ITD_METHOD.getDelimiter(); } else if (kind.equals(IProgramElement.Kind.CONSTRUCTOR) || kind.equals(IProgramElement.Kind.METHOD)) { return METHOD.getDelimiter(); } else if (kind.equals(IProgramElement.Kind.FIELD) || kind.equals(IProgramElement.Kind.ENUM_VALUE)) { diff --git a/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java b/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java index 8ae6feeff..19ecb85ec 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java +++ b/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java @@ -20,11 +20,13 @@ import org.aspectj.bridge.ISourceLocation; /** * Creates JDT-like handles, for example - * - * method with string argument: <tjp{Demo.java[Demo~main~\[QString; method with generic argument: - * <pkg{MyClass.java[MyClass~myMethod~QList\<QString;>; an aspect: <pkg*A1.aj}A1 advice with Integer arg: - * <pkg*A8.aj}A8&afterReturning&QInteger; method call: <pkg*A10.aj[C~m1?method-call(void pkg.C.m2()) - * + * */ public class JDTLikeHandleProvider implements IElementHandleProvider { diff --git a/tests/model/expected/pr115607.txt b/tests/model/expected/pr115607.txt index 609e26ed0..983bf6f0f 100644 --- a/tests/model/expected/pr115607.txt +++ b/tests/model/expected/pr115607.txt @@ -1,16 +1,16 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - [package] + [java source file] + [package] pr115607.java [java source file] TEST_SANDBOX\pr115607.java:1: - [import reference] + [import reference] I [annotation] TEST_SANDBOX\pr115607.java:1: Simple [class] TEST_SANDBOX\pr115607.java:3: pr115607 [aspect] TEST_SANDBOX\pr115607.java:5: declare @type: Simple : @I [declare @type] TEST_SANDBOX\pr115607.java:6: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) <{pr115607.java[Simple (annotated by) <{pr115607.java'pr115607`declare \@type -(targets=1) <{pr115607.java'pr115607`declare \@type (annotates) <{pr115607.java[Simple +(targets=1) <{pr115607.java[Simple (annotated by) <{pr115607.java>pr115607´declare \@type +(targets=1) <{pr115607.java>pr115607´declare \@type (annotates) <{pr115607.java[Simple === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== import reference=1 diff --git a/tests/model/expected/pr120356.txt b/tests/model/expected/pr120356.txt index 983fa724d..d3687725b 100644 --- a/tests/model/expected/pr120356.txt +++ b/tests/model/expected/pr120356.txt @@ -1,8 +1,8 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - [package] + [java source file] + [package] A.java [java source file] TEST_SANDBOX\A.java:1: - [import reference] + [import reference] org.aspectj.lang.annotation.DeclareError [import reference] TEST_SANDBOX\A.java:4: org.aspectj.lang.annotation.DeclareWarning [import reference] TEST_SANDBOX\A.java:3: org.aspectj.lang.annotation.Aspect [import reference] TEST_SANDBOX\A.java:2: @@ -10,7 +10,7 @@ warning [field] TEST_SANDBOX\A.java:10: error [field] TEST_SANDBOX\A.java:13: C.java [java source file] TEST_SANDBOX\C.java:1: - [import reference] + [import reference] C [class] TEST_SANDBOX\C.java:3: warningMethod() [method] TEST_SANDBOX\C.java:5: badMethod() [method] TEST_SANDBOX\C.java:8: diff --git a/tests/model/expected/pr131932.txt b/tests/model/expected/pr131932.txt index acbfd737f..17bccb9f1 100644 --- a/tests/model/expected/pr131932.txt +++ b/tests/model/expected/pr131932.txt @@ -1,8 +1,8 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - [package] + [java source file] + [package] pr131932.aj [java source file] TEST_SANDBOX\pr131932.aj:1: - [import reference] + [import reference] java.util.List [import reference] TEST_SANDBOX\pr131932.aj:1: Slide74 [aspect] TEST_SANDBOX\pr131932.aj:3: Bar [class] TEST_SANDBOX\pr131932.aj:13: @@ -13,12 +13,12 @@ Foo [class] TEST_SANDBOX\pr131932.aj:19: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) <*pr131932.aj'Slide74,Bar.children (declared on) <*pr131932.aj'Slide74[Bar -(targets=2) <*pr131932.aj'Slide74[Bar (aspect declarations) <*pr131932.aj'Slide74)Bar.getFirst -(targets=2) <*pr131932.aj'Slide74[Bar (aspect declarations) <*pr131932.aj'Slide74,Bar.children -(targets=1) <*pr131932.aj'Slide74)Foo.Foo_new)QList\; (declared on) <*pr131932.aj[Foo -(targets=1) <*pr131932.aj'Slide74)Bar.getFirst (declared on) <*pr131932.aj'Slide74[Bar -(targets=1) <*pr131932.aj[Foo (aspect declarations) <*pr131932.aj'Slide74)Foo.Foo_new)QList\; +(targets=1) <*pr131932.aj>Slide74,Bar.children (declared on) <*pr131932.aj>Slide74[Bar +(targets=2) <*pr131932.aj>Slide74[Bar (aspect declarations) <*pr131932.aj>Slide74°Bar.getFirst +(targets=2) <*pr131932.aj>Slide74[Bar (aspect declarations) <*pr131932.aj>Slide74,Bar.children +(targets=1) <*pr131932.aj>Slide74°Foo.Foo_new°QList\; (declared on) <*pr131932.aj[Foo +(targets=1) <*pr131932.aj>Slide74°Bar.getFirst (declared on) <*pr131932.aj>Slide74[Bar +(targets=1) <*pr131932.aj[Foo (aspect declarations) <*pr131932.aj>Slide74°Foo.Foo_new°QList\; === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== import reference=2 diff --git a/tests/model/expected/pr132130.txt b/tests/model/expected/pr132130.txt index b82043dd1..e3776f8bb 100644 --- a/tests/model/expected/pr132130.txt +++ b/tests/model/expected/pr132130.txt @@ -1,8 +1,8 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - [package] + [java source file] + [package] pr132130.aj [java source file] TEST_SANDBOX\pr132130.aj:1: - [import reference] + [import reference] basic [aspect] TEST_SANDBOX\pr132130.aj:1: declare @method: * debit(..) : @Secured(role = "supervisor") [declare @method] TEST_SANDBOX\pr132130.aj:3: declare @constructor: BankAccount+.new(..) : @Secured(role = "supervisor") [declare @constructor] TEST_SANDBOX\pr132130.aj:4: @@ -12,10 +12,10 @@ Secured [annotation] TEST_SANDBOX\pr132130.aj:15: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) <*pr132130.aj'basic`declare \@method (annotates) <*pr132130.aj[BankAccount~debit~J~J -(targets=1) <*pr132130.aj[BankAccount~debit~J~J (annotated by) <*pr132130.aj'basic`declare \@method -(targets=1) <*pr132130.aj'basic`declare \@constructor (annotates) <*pr132130.aj[BankAccount~BankAccount~QString;~I -(targets=1) <*pr132130.aj[BankAccount~BankAccount~QString;~I (annotated by) <*pr132130.aj'basic`declare \@constructor +(targets=1) <*pr132130.aj>basic´declare \@method (annotates) <*pr132130.aj[BankAccount~debit~J~J +(targets=1) <*pr132130.aj[BankAccount~debit~J~J (annotated by) <*pr132130.aj>basic´declare \@method +(targets=1) <*pr132130.aj>basic´declare \@constructor (annotates) <*pr132130.aj[BankAccount~BankAccount~QString;~I +(targets=1) <*pr132130.aj[BankAccount~BankAccount~QString;~I (annotated by) <*pr132130.aj>basic´declare \@constructor === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=1 diff --git a/tests/model/expected/pr141730_1.txt b/tests/model/expected/pr141730_1.txt index 85f7d8b36..1ac2eba7e 100644 --- a/tests/model/expected/pr141730_1.txt +++ b/tests/model/expected/pr141730_1.txt @@ -1,8 +1,8 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - [package] + [java source file] + [package] pr141730.aj [java source file] TEST_SANDBOX\pr141730.aj:1: - [import reference] + [import reference] A [aspect] TEST_SANDBOX\pr141730.aj:1: p() [pointcut] TEST_SANDBOX\pr141730.aj:3: before(): p.. [advice] TEST_SANDBOX\pr141730.aj:5: @@ -19,28 +19,28 @@ MyClass [class] TEST_SANDBOX\pr141730.aj:33: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) <*pr141730.aj[C~intArray~\[I (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C~myClassMethod~QMyClass; (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C~method (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C~intMethod~I (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C~C (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C~multiMethod~\[\[QString; (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C~twoArgsMethod~I~QString; (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[MyClass (advised by) <*pr141730.aj'A&before -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj'A -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[MyClass -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~C -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~method -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~intMethod~I -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~stringMethod~QString; -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~myClassMethod~QMyClass; -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~twoArgsMethod~I~QString; -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~main~\[QString; -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~multiMethod~\[\[QString; -(targets=11) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~intArray~\[I -(targets=1) <*pr141730.aj'A (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C~main~\[QString; (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C~stringMethod~QString; (advised by) <*pr141730.aj'A&before +(targets=1) <*pr141730.aj[C~intArray~\[I (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C~myClassMethod~QMyClass; (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C~method (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C~intMethod~I (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C~C (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C~multiMethod~\[\[QString; (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C~twoArgsMethod~I~QString; (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[MyClass (advised by) <*pr141730.aj>A§before +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj>A +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[MyClass +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~C +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~method +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~intMethod~I +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~stringMethod~QString; +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~myClassMethod~QMyClass; +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~twoArgsMethod~I~QString; +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~main~\[QString; +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~multiMethod~\[\[QString; +(targets=11) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~intArray~\[I +(targets=1) <*pr141730.aj>A (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C~main~\[QString; (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C~stringMethod~QString; (advised by) <*pr141730.aj>A§before === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=8 diff --git a/tests/model/expected/pr141730_2.txt b/tests/model/expected/pr141730_2.txt index e7ac84cae..054fb835c 100644 --- a/tests/model/expected/pr141730_2.txt +++ b/tests/model/expected/pr141730_2.txt @@ -1,8 +1,8 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - [package] + [java source file] + [package] pr141730.aj [java source file] TEST_SANDBOX\pr141730.aj:1: - [import reference] + [import reference] java.util.List [import reference] TEST_SANDBOX\pr141730.aj:1: A [aspect] TEST_SANDBOX\pr141730.aj:3: p() [pointcut] TEST_SANDBOX\pr141730.aj:5: @@ -14,18 +14,18 @@ MyGenericClass [class] TEST_SANDBOX\pr141730.aj:22: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) <*pr141730.aj[C~genericMethod2~QMyGenericClass\; (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[MyClass (advised by) <*pr141730.aj'A&before -(targets=6) <*pr141730.aj'A&before (advises) <*pr141730.aj'A -(targets=6) <*pr141730.aj'A&before (advises) <*pr141730.aj[MyGenericClass -(targets=6) <*pr141730.aj'A&before (advises) <*pr141730.aj[C -(targets=6) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~genericMethod~QList\; -(targets=6) <*pr141730.aj'A&before (advises) <*pr141730.aj[C~genericMethod2~QMyGenericClass\; -(targets=6) <*pr141730.aj'A&before (advises) <*pr141730.aj[MyClass -(targets=1) <*pr141730.aj[C~genericMethod~QList\; (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[MyGenericClass (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj'A (advised by) <*pr141730.aj'A&before -(targets=1) <*pr141730.aj[C (advised by) <*pr141730.aj'A&before +(targets=1) <*pr141730.aj[C~genericMethod2~QMyGenericClass\; (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[MyClass (advised by) <*pr141730.aj>A§before +(targets=6) <*pr141730.aj>A§before (advises) <*pr141730.aj>A +(targets=6) <*pr141730.aj>A§before (advises) <*pr141730.aj[MyGenericClass +(targets=6) <*pr141730.aj>A§before (advises) <*pr141730.aj[C +(targets=6) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~genericMethod~QList\; +(targets=6) <*pr141730.aj>A§before (advises) <*pr141730.aj[C~genericMethod2~QMyGenericClass\; +(targets=6) <*pr141730.aj>A§before (advises) <*pr141730.aj[MyClass +(targets=1) <*pr141730.aj[C~genericMethod~QList\; (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[MyGenericClass (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj>A (advised by) <*pr141730.aj>A§before +(targets=1) <*pr141730.aj[C (advised by) <*pr141730.aj>A§before === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=2 diff --git a/tests/model/expected/pr141730_3.txt b/tests/model/expected/pr141730_3.txt index 9351dd1ba..45bd942ce 100644 --- a/tests/model/expected/pr141730_3.txt +++ b/tests/model/expected/pr141730_3.txt @@ -1,9 +1,9 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - foo [package] + [java source file] + foo [package] MyFoo.java [java source file] TEST_SANDBOX\MyFoo.java:1: foo [package declaration] TEST_SANDBOX\MyFoo.java:1: - [import reference] + [import reference] MyFoo [class] TEST_SANDBOX\MyFoo.java:3: callMain() [method] TEST_SANDBOX\MyFoo.java:5: method-call(void foo.MyFoo.main()) [code] TEST_SANDBOX\MyFoo.java:6: diff --git a/tests/model/expected/pr141730_4.txt b/tests/model/expected/pr141730_4.txt index 575115e3d..c0ee12f48 100644 --- a/tests/model/expected/pr141730_4.txt +++ b/tests/model/expected/pr141730_4.txt @@ -1,9 +1,9 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - bar [package] + [java source file] + bar [package] MyBar.aj [java source file] TEST_SANDBOX\MyBar.aj:1: bar [package declaration] TEST_SANDBOX\MyBar.aj:1: - [import reference] + [import reference] foo.* [import reference] TEST_SANDBOX\MyBar.aj:3: MyBar [aspect] TEST_SANDBOX\MyBar.aj:5: before(): [advice] TEST_SANDBOX\MyBar.aj:7: @@ -15,18 +15,18 @@ declare @field: int *Foo.* : @MyAnnotation [declare @field] TEST_SANDBOX\MyBar.aj:16: MyAnnotation.java [java source file] TEST_SANDBOX\MyAnnotation.java:1: bar [package declaration] TEST_SANDBOX\MyAnnotation.java:1: - [import reference] + [import reference] MyAnnotation [annotation] TEST_SANDBOX\MyAnnotation.java:3: NewClass.java [java source file] TEST_SANDBOX\NewClass.java:1: bar [package declaration] TEST_SANDBOX\NewClass.java:1: - [import reference] + [import reference] NewClass [class] TEST_SANDBOX\NewClass.java:3: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) MyBar´declare \@type (annotates) {MyFoo.java +(targets=1) {MyFoo.java (annotated by) MyBar´declare \@type +(targets=1) MyBar´declare parents (declared on) /;MyBar´declare parents === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== import reference=4 diff --git a/tests/model/expected/pr143924.txt b/tests/model/expected/pr143924.txt index c6834c71a..0437e134f 100644 --- a/tests/model/expected/pr143924.txt +++ b/tests/model/expected/pr143924.txt @@ -1,8 +1,8 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - [package] + [java source file] + [package] pr143924.aj [java source file] TEST_SANDBOX\pr143924.aj:1: - [import reference] + [import reference] DeclareAnnotation [aspect] TEST_SANDBOX\pr143924.aj:1: declare @method: * debit(..) : @Secured(role = "supervisor") [declare @method] TEST_SANDBOX\pr143924.aj:2: BankAccount [class] TEST_SANDBOX\pr143924.aj:5: @@ -10,8 +10,8 @@ Secured [annotation] TEST_SANDBOX\pr143924.aj:11: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) <*pr143924.aj[BankAccount~debit~QString;~J (annotated by) <*pr143924.aj'DeclareAnnotation`declare \@method -(targets=1) <*pr143924.aj'DeclareAnnotation`declare \@method (annotates) <*pr143924.aj[BankAccount~debit~QString;~J +(targets=1) <*pr143924.aj[BankAccount~debit~QString;~J (annotated by) <*pr143924.aj>DeclareAnnotation´declare \@method +(targets=1) <*pr143924.aj>DeclareAnnotation´declare \@method (annotates) <*pr143924.aj[BankAccount~debit~QString;~J === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=1 diff --git a/tests/model/expected/pr145963_1.txt b/tests/model/expected/pr145963_1.txt index 9f305f06e..621cfd86e 100644 --- a/tests/model/expected/pr145963_1.txt +++ b/tests/model/expected/pr145963_1.txt @@ -1,22 +1,22 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - pkg [package] + [java source file] + pkg [package] SourceAspect.aj [java source file] TEST_SANDBOX\SourceAspect.aj:1: pkg [package declaration] TEST_SANDBOX\SourceAspect.aj:1: - [import reference] + [import reference] SourceAspect [aspect] TEST_SANDBOX\SourceAspect.aj:3: declare warning: "There should be n.." [declare warning] TEST_SANDBOX\SourceAspect.aj:5: p() [pointcut] TEST_SANDBOX\SourceAspect.aj:7: before(): p.. [advice] TEST_SANDBOX\SourceAspect.aj:9: - pack [package] + pack [package] C.java [java source file] TEST_SANDBOX\C.java:1: pack [package declaration] TEST_SANDBOX\C.java:1: - [import reference] + [import reference] C [class] TEST_SANDBOX\C.java:3: method1() [method] TEST_SANDBOX\C.java:5: field-get(java.io.PrintStream java.lang.System.out) [code] TEST_SANDBOX\C.java:6: - binaries [source folder] - pkg [package] + binaries [source folder] + pkg [package] BinaryAspect.class [file] TEST_SANDBOX\simple.jar!pkg\BinaryAspect.class:1: BinaryAspect [aspect] TEST_SANDBOX\simple.jar!pkg\BinaryAspect.class:1: p() [pointcut] TEST_SANDBOX\simple.jar!pkg\BinaryAspect.class:7: @@ -24,14 +24,14 @@ declare warning: "There should be n.." [declare warning] TEST_SANDBOX\simple.jar!pkg\BinaryAspect.class:5: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) /binariesBinaryAspect´declare warning (matched by) SourceAspect´declare warning (matched by) SourceAspect´declare warning +(targets=2) BinaryAspect´declare warning +(targets=1) SourceAspect§before (advises) BinaryAspect§before (advises) SourceAspect§before +(targets=2) BinaryAspect§before === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=1 diff --git a/tests/model/expected/pr145963_2.txt b/tests/model/expected/pr145963_2.txt index 129ad86e6..d1c024779 100644 --- a/tests/model/expected/pr145963_2.txt +++ b/tests/model/expected/pr145963_2.txt @@ -1,22 +1,22 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - pkg [package] + [java source file] + pkg [package] SourceAspect.aj [java source file] TEST_SANDBOX\SourceAspect.aj:1: pkg [package declaration] TEST_SANDBOX\SourceAspect.aj:1: - [import reference] + [import reference] SourceAspect [aspect] TEST_SANDBOX\SourceAspect.aj:3: declare warning: "There should be n.." [declare warning] TEST_SANDBOX\SourceAspect.aj:5: p() [pointcut] TEST_SANDBOX\SourceAspect.aj:7: before(): p.. [advice] TEST_SANDBOX\SourceAspect.aj:9: - pack [package] + pack [package] C.java [java source file] TEST_SANDBOX\C.java:1: pack [package declaration] TEST_SANDBOX\C.java:1: - [import reference] + [import reference] C [class] TEST_SANDBOX\C.java:3: method1() [method] TEST_SANDBOX\C.java:5: field-get(java.io.PrintStream java.lang.System.out) [code] TEST_SANDBOX\C.java:6: - binaries [source folder] - pkg [package] + binaries [source folder] + pkg [package] BinaryAspect.class [file] TEST_SANDBOX!pkg\BinaryAspect.class:1: BinaryAspect [aspect] TEST_SANDBOX!pkg\BinaryAspect.class:1: p() [pointcut] TEST_SANDBOX!pkg\BinaryAspect.class:7: @@ -24,14 +24,14 @@ declare warning: "There should be n.." [declare warning] TEST_SANDBOX!pkg\BinaryAspect.class:5: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) /binariesBinaryAspect´declare warning (matched by) SourceAspect´declare warning (matched by) SourceAspect´declare warning +(targets=2) BinaryAspect´declare warning +(targets=1) SourceAspect§before (advises) BinaryAspect§before (advises) SourceAspect§before +(targets=2) BinaryAspect§before === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=1 diff --git a/tests/model/expected/pr145963_3.txt b/tests/model/expected/pr145963_3.txt index 9aa81022c..02304db68 100644 --- a/tests/model/expected/pr145963_3.txt +++ b/tests/model/expected/pr145963_3.txt @@ -1,20 +1,20 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - [package] + [java source file] + [package] C.java [java source file] TEST_SANDBOX\C.java:1: - [import reference] + [import reference] C [class] TEST_SANDBOX\C.java:3: method1() [method] TEST_SANDBOX\C.java:5: field-get(java.io.PrintStream java.lang.System.out) [code] TEST_SANDBOX\C.java:6: - binaries [source folder] - [package] + binaries [source folder] + [package] AspectInDefaultPackage.class [file] TEST_SANDBOX\simple.jar!\AspectInDefaultPackage.class:1: AspectInDefaultPackage [aspect] TEST_SANDBOX\simple.jar!\AspectInDefaultPackage.class:1: declare warning: "There should be n.." [declare warning] TEST_SANDBOX\simple.jar!\AspectInDefaultPackage.class:4: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) /binaries<(AspectInDefaultPackage.class'AspectInDefaultPackage`declare warning (matched by) <{C.java[C~method1?field-get(java.io.PrintStream java.lang.System.out) -(targets=1) <{C.java[C~method1?field-get(java.io.PrintStream java.lang.System.out) (matches declare) /binaries<(AspectInDefaultPackage.class'AspectInDefaultPackage`declare warning +(targets=1) /binaries<(AspectInDefaultPackage.class>AspectInDefaultPackage´declare warning (matched by) <{C.java[C~method1?field-get(java.io.PrintStream java.lang.System.out) +(targets=1) <{C.java[C~method1?field-get(java.io.PrintStream java.lang.System.out) (matches declare) /binaries<(AspectInDefaultPackage.class>AspectInDefaultPackage´declare warning === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=1 diff --git a/tests/model/expected/pr145963_4.txt b/tests/model/expected/pr145963_4.txt index 03a4691cf..63b152dfa 100644 --- a/tests/model/expected/pr145963_4.txt +++ b/tests/model/expected/pr145963_4.txt @@ -1,21 +1,21 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - pack [package] + [java source file] + pack [package] C.java [java source file] TEST_SANDBOX\C.java:1: pack [package declaration] TEST_SANDBOX\C.java:1: - [import reference] + [import reference] C [class] TEST_SANDBOX\C.java:3: method1() [method] TEST_SANDBOX\C.java:5: field-get(java.io.PrintStream java.lang.System.out) [code] TEST_SANDBOX\C.java:6: - binaries [source folder] - [package] + binaries [source folder] + [package] A.class [file] TEST_SANDBOX\simple.jar!\A.class:1: A [aspect] TEST_SANDBOX\simple.jar!\A.class:1: declare warning: "There should be n.." [declare warning] TEST_SANDBOX\simple.jar!\A.class:4: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) /binaries<(A.class'A`declare warning (matched by) A´declare warning (matched by) A´declare warning === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=1 diff --git a/tests/model/expected/pr148027.txt b/tests/model/expected/pr148027.txt index b9995df89..8ba59922d 100644 --- a/tests/model/expected/pr148027.txt +++ b/tests/model/expected/pr148027.txt @@ -1,15 +1,15 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - pkg [package] + [java source file] + pkg [package] A.aj [java source file] TEST_SANDBOX\A.aj:1: - import declarations [import reference] + import declarations [import reference] A [aspect] TEST_SANDBOX\A.aj:3: before(): pointcutInClass.. [advice] TEST_SANDBOX\A.aj:5: pointcutInAspect() [pointcut] TEST_SANDBOX\A.aj:8: before(): pointcutInAspect.. [advice] TEST_SANDBOX\A.aj:10: aMethod() [method] TEST_SANDBOX\A.aj:13: C.aj [java source file] TEST_SANDBOX\C.aj:1: - import declarations [import reference] + import declarations [import reference] C [class] TEST_SANDBOX\C.aj:3: pointcutInClass() [pointcut] TEST_SANDBOX\C.aj:5: cMethod() [method] TEST_SANDBOX\C.aj:7: diff --git a/tests/model/expected/pr160469_1.txt b/tests/model/expected/pr160469_1.txt index b17657949..a870d68cb 100644 --- a/tests/model/expected/pr160469_1.txt +++ b/tests/model/expected/pr160469_1.txt @@ -1,13 +1,13 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - test [package] + [java source file] + test [package] Simple.java [java source file] TEST_SANDBOX\Simple.java:1: test [package declaration] TEST_SANDBOX\Simple.java:1: - [import reference] + [import reference] Simple [class] TEST_SANDBOX\Simple.java:3: Simple() [constructor] TEST_SANDBOX\Simple.java:5: - binaries [source folder] - pkg [package] + binaries [source folder] + pkg [package] AbstractBeanConfigurerAspect.class [file] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: AbstractBeanConfigurerAspect [aspect] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: beanCreation() [pointcut] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: @@ -15,10 +15,10 @@ before(): beanCreation.. [advice] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:11: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) /binariesAbstractBeanConfigurerAspect§before (advises) AbstractBeanConfigurerAspect§afterReturning +(targets=2) AbstractBeanConfigurerAspect§before +(targets=1) /binariesAbstractBeanConfigurerAspect§afterReturning (advises) [java source file] - test [package] + [java source file] + test [package] Simple.java [java source file] TEST_SANDBOX\Simple.java:1: test [package declaration] TEST_SANDBOX\Simple.java:1: - [import reference] + [import reference] Simple [class] TEST_SANDBOX\Simple.java:3: Simple() [constructor] TEST_SANDBOX\Simple.java:5: - binaries [source folder] - pkg [package] + binaries [source folder] + pkg [package] AbstractBeanConfigurerAspect.class [file] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: AbstractBeanConfigurerAspect [aspect] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: beanCreation() [pointcut] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:1: declare warning: "warning" [declare warning] TEST_SANDBOX\aspects.jar!pkg\AbstractBeanConfigurerAspect.class:7: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) AbstractBeanConfigurerAspect´declare warning +(targets=1) /binariesAbstractBeanConfigurerAspect´declare warning (matched by) [java source file] + [java source file] pr238054.aj [java source file] TEST_SANDBOX\pr238054.aj:1: - import declarations [import reference] + import declarations [import reference] A [class] TEST_SANDBOX\pr238054.aj:1: x() [method] TEST_SANDBOX\pr238054.aj:2: y() [method] TEST_SANDBOX\pr238054.aj:3: diff --git a/tests/model/expected/pr77269_1.txt b/tests/model/expected/pr77269_1.txt index 84cdb85f6..af84e73bb 100644 --- a/tests/model/expected/pr77269_1.txt +++ b/tests/model/expected/pr77269_1.txt @@ -1,9 +1,9 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - pack [package] + [java source file] + pack [package] pr77269.aj [java source file] TEST_SANDBOX\pack\pr77269.aj:1: pack [package declaration] TEST_SANDBOX\pack\pr77269.aj:1: - [import reference] + [import reference] Test [class] TEST_SANDBOX\pack\pr77269.aj:2: testMethod() [method] TEST_SANDBOX\pack\pr77269.aj:4: new Runnable() {..} [class] TEST_SANDBOX\pack\pr77269.aj:5: @@ -15,8 +15,8 @@ before(): p.. [advice] TEST_SANDBOX\pack\pr77269.aj:21: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) A§before +(targets=1) A§before (advises) [java source file] - [package] + [java source file] + [package] pr77269b.aj [java source file] TEST_SANDBOX\pr77269b.aj:1: - [import reference] + [import reference] Test [class] TEST_SANDBOX\pr77269b.aj:1: testMethod() [method] TEST_SANDBOX\pr77269b.aj:3: new Runnable() {..} [class] TEST_SANDBOX\pr77269b.aj:4: @@ -14,8 +14,8 @@ before(): p.. [advice] TEST_SANDBOX\pr77269b.aj:20: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) <*pr77269b.aj'A&before (advises) <*pr77269b.aj[Test~testMethod[C~m -(targets=1) <*pr77269b.aj[Test~testMethod[C~m (advised by) <*pr77269b.aj'A&before +(targets=1) <*pr77269b.aj>A§before (advises) <*pr77269b.aj[Test~testMethod[C~m +(targets=1) <*pr77269b.aj[Test~testMethod[C~m (advised by) <*pr77269b.aj>A§before === END OF RELATIONSHIPS REPORT == === Properties of the model and relationships map ===== method=3 diff --git a/tests/model/expected/pr77269_3.txt b/tests/model/expected/pr77269_3.txt index ec2c7bdad..c197cef4b 100644 --- a/tests/model/expected/pr77269_3.txt +++ b/tests/model/expected/pr77269_3.txt @@ -1,9 +1,9 @@ === MODEL STATUS REPORT ========= After a batch build - [java source file] - pack [package] + [java source file] + pack [package] pr77269c.aj [java source file] TEST_SANDBOX\pack\pr77269c.aj:1: pack [package declaration] TEST_SANDBOX\pack\pr77269c.aj:1: - [import reference] + [import reference] Test [class] TEST_SANDBOX\pack\pr77269c.aj:3: testMethod() [method] TEST_SANDBOX\pack\pr77269c.aj:5: new Runnable() {..} [class] TEST_SANDBOX\pack\pr77269c.aj:6: @@ -14,8 +14,8 @@ declare warning: "blah blah blah" [declare warning] TEST_SANDBOX\pack\pr77269c.aj:18: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) A´declare warning +(targets=1) A´declare warning (matched by) [java source file] + [java source file] X.java [java source file] TEST_SANDBOX\X.java:1: - import declarations [import reference] + import declarations [import reference] X [aspect] TEST_SANDBOX\X.java:1: before(): .. [advice] TEST_SANDBOX\X.java:2: === END OF MODEL REPORT ========= diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc153/JDTLikeHandleProviderTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc153/JDTLikeHandleProviderTests.java index cae886edf..db793222c 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc153/JDTLikeHandleProviderTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc153/JDTLikeHandleProviderTests.java @@ -44,25 +44,25 @@ public class JDTLikeHandleProviderTests extends XMLBasedAjcTestCase { runTest("aspect handle"); IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); IProgramElement pe = top.findElementForType("pkg", "A1"); - String expected = "", "", "A2§before"); } public void testPointcutHandle() { runTest("pointcut handle"); - compareHandles(IProgramElement.Kind.POINTCUT, "p()", "A4©p"); } public void testGetIPEWithAspectHandle() { runTest("get IProgramElement with aspect handle"); IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); - String handle = "", "", "A3§before"); } public void testPointcutHandleWithArgs() { runTest("pointcut handle with args"); - compareHandles(IProgramElement.Kind.POINTCUT, "p(java.lang.Integer)", "<*A6.aj'A6\"p\"QInteger;"); + compareHandles(IProgramElement.Kind.POINTCUT, "p(java.lang.Integer)", "<*A6.aj>A6©p©QInteger;"); } public void testAdviceHandleWithArgs() { runTest("advice handle with args"); compareHandles(IProgramElement.Kind.ADVICE, "afterReturning(java.lang.Integer): p..", - "A8§afterReturning§QInteger;"); } public void testFieldITD() { runTest("field itd handle"); - compareHandles(IProgramElement.Kind.INTER_TYPE_FIELD, "C.x", "A9,C.x"); } public void testMethodITD() { runTest("method itd handle"); - compareHandles(IProgramElement.Kind.INTER_TYPE_METHOD, "C.method()", "A9°C.method"); } public void testMethodITDWithArgs() { runTest("method itd with args handle"); - compareHandles(IProgramElement.Kind.INTER_TYPE_METHOD, "C.methodWithArgs(int)", "A9°C.methodWithArgs°I"); } public void testConstructorITDWithArgs() { runTest("constructor itd with args"); compareHandles(IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR, "C.C(int,java.lang.String)", - "A13°C.C_new°I°QString;"); } public void testDeclareParentsHandle() { runTest("declare parents handle"); - compareHandles(IProgramElement.Kind.DECLARE_PARENTS, "declare parents: implements C2", "A7´declare parents"); } public void testTwoDeclareParents() { runTest("two declare parents in same file"); - compareHandles(IProgramElement.Kind.DECLARE_PARENTS, "declare parents: extends C5", "A7´declare parents!2"); } public void testMethodCallHandle() { @@ -125,28 +125,28 @@ public class JDTLikeHandleProviderTests extends XMLBasedAjcTestCase { // AJDT: =AJHandleProject/srcA´declare \\@type"); } public void testDeclareAtField() { // AJDT: =AJHandleProject/srcA´declare \\@field"); } public void testDeclareAtMethod() { // AJDT: =AJHandleProject/srcA´declare \\@method"); } public void testDeclareAtConstructor() { // AJDT: =AJHandleProject/srcA´declare \\@constructor"); } // what about 2 pieces of before advice with the same @@ -168,8 +168,8 @@ public class JDTLikeHandleProviderTests extends XMLBasedAjcTestCase { } } } - String expected1 = "A11´declare warning"); } public void testTwoDeclareWarningHandles() { runTest("two declare warning handles"); - compareHandles(IProgramElement.Kind.DECLARE_WARNING, "declare warning: \"blah\"", "A11´declare warning!2"); } // this is to ensure the logic for not including '1' in the count @@ -196,9 +196,9 @@ public class JDTLikeHandleProviderTests extends XMLBasedAjcTestCase { public void testTenDeclareWarningHandles() { runTest("ten declare warning handles"); compareHandles(IProgramElement.Kind.DECLARE_WARNING, "declare warning: \"warning 1\"", - "<*DeclareWarnings.aj'DeclareWarnings`declare warning"); + "<*DeclareWarnings.aj>DeclareWarnings´declare warning"); compareHandles(IProgramElement.Kind.DECLARE_WARNING, "declare warning: \"warning 10\"", - "<*DeclareWarnings.aj'DeclareWarnings`declare warning!10"); + "<*DeclareWarnings.aj>DeclareWarnings´declare warning!10"); } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc161/Ajc161Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc161/Ajc161Tests.java index 0766faf3e..5822a3f7c 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc161/Ajc161Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc161/Ajc161Tests.java @@ -139,7 +139,7 @@ public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase { IRelationshipMap irm = AsmManager.lastActiveStructureModel.getRelationshipMap(); Set entries = irm.getEntries(); boolean gotSomethingValid = false; - String expected = " Ship.i(List[][] u) - assertEquals("<{Handles.java'Handles)Ship.i)\\[\\[QList\\;", ipe.getHandleIdentifier()); + assertEquals("<{Handles.java>Handles°Ship.i°\\[\\[QList\\;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 7);// public java.util.List Ship.i(Set[][] u) - assertEquals("<{Handles.java'Handles)Ship.i)\\[\\[QSet\\;", ipe.getHandleIdentifier()); + assertEquals("<{Handles.java>Handles°Ship.i°\\[\\[QSet\\;", ipe.getHandleIdentifier()); // public java.util.Set i(java.util.Set[][] u) ipe = findElementAtLine(top.getRoot(), 10); - assertEquals("<{Handles.java'Handles~i~\\[\\[Qjava.util.Set\\;", ipe.getHandleIdentifier()); + assertEquals("<{Handles.java>Handles~i~\\[\\[Qjava.util.Set\\;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 13);// public java.util.Set i(java.util.Set[][] u,int i) { - assertEquals("<{Handles.java'Handles~i~\\[\\[Qjava.util.Set\\;~I", ipe.getHandleIdentifier()); + assertEquals("<{Handles.java>Handles~i~\\[\\[Qjava.util.Set\\;~I", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 16);// public java.util.Set i2(java.util.Set>[][] u) { - assertEquals("<{Handles.java'Handles~i2~\\[\\[Qjava.util.Set\\<+QCollection\\;>;", ipe.getHandleIdentifier()); + assertEquals("<{Handles.java>Handles~i2~\\[\\[Qjava.util.Set\\<+QCollection\\;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 19);// public java.util.Set i3(java.util.Set>[][] u) - assertEquals("<{Handles.java'Handles~i3~\\[\\[Qjava.util.Set\\<+QCollection\\<\\[QString;>;>;", ipe.getHandleIdentifier()); + assertEquals("<{Handles.java>Handles~i3~\\[\\[Qjava.util.Set\\<+QCollection\\<\\[QString;>;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 22); - assertEquals("<{Handles.java'Handles~i4~Qjava.util.Set\\<+QCollection\\;>;", ipe.getHandleIdentifier()); + assertEquals("<{Handles.java>Handles~i4~Qjava.util.Set\\<+QCollection\\;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 25); - assertEquals("<{Handles.java'Handles~i5~Qjava.util.Set\\<*>;", ipe.getHandleIdentifier()); + assertEquals("<{Handles.java>Handles~i5~Qjava.util.Set\\<*>;", ipe.getHandleIdentifier()); } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java index affdd6093..04b4b15d3 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java @@ -84,7 +84,7 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { String itdMethodHandle = ir.getTargets().get(0); // handle when all source: <{Aspect.java}Aspect)Orange.getColor // assertEquals("/binaries<{Aspect.java}Aspect)Orange.getColor", itdMethodHandle); - assertEquals("/binaries<(Aspect.class'Aspect)Orange.getColor", itdMethodHandle); + assertEquals("/binaries<(Aspect.class>Aspect°Orange.getColor", itdMethodHandle); IProgramElement itdpe = model.getHierarchy().findElementForHandle(itdMethodHandle); assertEquals("java.awt.Color", itdpe.getCorrespondingType(true)); @@ -98,7 +98,7 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { String itdFieldHandle = ir.getTargets().get(0); // source handle <{Aspect.java}Aspect)Strawberry.color // assertEquals("/binaries<{Aspect.java}Aspect)Strawberry.color", itdFieldHandle); - assertEquals("/binaries<(Aspect.class'Aspect,Strawberry.color", itdFieldHandle); + assertEquals("/binaries<(Aspect.class>Aspect,Strawberry.color", itdFieldHandle); IProgramElement itdfpe = model.getHierarchy().findElementForHandle(itdMethodHandle); assertEquals("java.awt.Color", itdfpe.getCorrespondingType(true)); @@ -111,7 +111,7 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { String itdCtorHandle = ir.getTargets().get(0); // source handle <{Aspect.java}Aspect)Fruit.Fruit_new)QColor;)QString; // assertEquals("/binaries<{Aspect.java}Aspect)Fruit.Fruit_new)QColor;)QString;", itdCtorHandle); - assertEquals("/binaries<(Aspect.class'Aspect)Fruit.Fruit_new)QColor;)QString;", itdCtorHandle); + assertEquals("/binaries<(Aspect.class>Aspect°Fruit.Fruit_new°QColor;°QString;", itdCtorHandle); IProgramElement itdcpe = model.getHierarchy().findElementForHandle(itdCtorHandle); List ptypes = itdcpe.getParameterTypes(); assertEquals("java.awt.Color", new String(ptypes.get(0))); @@ -179,7 +179,7 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); IProgramElement ipe = null; ipe = findElementAtLine(top.getRoot(), 13); - assertEquals("HandleTestingAspect[InnerClass>InnerInnerAspect|1", ipe.getHandleIdentifier()); // ipe = findElementAtLine(top.getRoot(), 29); // assertEquals("OverrideOptions§around", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 29); - assertEquals("OverrideOptions§around!2", ipe.getHandleIdentifier()); } // Only one of two aspects named diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc169/IntertypeTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc169/IntertypeTests.java index 7b9503ceb..49d9699ff 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc169/IntertypeTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc169/IntertypeTests.java @@ -157,7 +157,7 @@ public class IntertypeTests extends org.aspectj.testing.XMLBasedAjcTestCase { pw.flush(); String model = baos.toString(); assertTrue(model.contains("<{Choice.java[Choice=[aspect declarations]")); - assertTrue(model.contains("<{Choice.java'X[Keys=[declared on]")); + assertTrue(model.contains("<{Choice.java>X[Keys=[declared on]")); } public void testGenerics1() throws Exception { diff --git a/tests/src/test/java/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java b/tests/src/test/java/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java index 54cfa7bec..a9d1fbab4 100644 --- a/tests/src/test/java/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java @@ -146,14 +146,14 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental checkWasFullBuild(); AspectJElementHierarchy model = (AspectJElementHierarchy) getModelFor(p).getHierarchy(); IProgramElement ipe = null; - ipe = model.findElementForHandleOrCreate("=annoRemovalRemover´declare \\@field", false); System.out.println(ipe); assertTrue(ipe.isAnnotationRemover()); String[] annos = ipe.getRemovedAnnotationTypes(); assertEquals(1, annos.length); assertEquals("a.Anno", annos[0]); assertNull(ipe.getAnnotationType()); - ipe = model.findElementForHandleOrCreate("=annoRemovalRemover´declare \\@field!2", false); System.out.println(ipe); assertFalse(ipe.isAnnotationRemover()); assertEquals("a.Anno", ipe.getAnnotationType()); @@ -835,7 +835,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental AspectJElementHierarchy model = (AspectJElementHierarchy) getModelFor(p).getHierarchy(); IProgramElement ipe = model.findElementForHandleOrCreate( - "=PR278496_4MyInnerInnerAspect", false); assertNotNull(ipe); } @@ -1026,7 +1026,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental AspectJElementHierarchy model = (AspectJElementHierarchy) getModelFor(p).getHierarchy(); // check handle to anonymous inner: IProgramElement ipe = model.findElementForHandleOrCreate( - "=pr278496_8DeleteActionAspect~main~\\[QString;[", false); assertNotNull(ipe); } } diff --git a/tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 4249f1578..e0b3000a2 100644 --- a/tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -228,10 +228,10 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa initialiseProject(p); build(p); IRelationshipMap irm = getModelFor(p).getRelationshipMap(); - List rels = irm.get("=pr284771 rels = irm.get("=pr284771AspectTrace§before"); assertNotNull(rels); assertEquals(2, ((Relationship) rels.get(0)).getTargets().size()); - rels = irm.get("=pr284771AspectTrace§before!2"); assertNotNull(rels); assertEquals(2, ((Relationship) rels.get(0)).getTargets().size()); } @@ -242,21 +242,21 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa build(p); printModel(p); IRelationshipMap irm = getModelFor(p).getRelationshipMap(); - List rels = irm.get("=pr329111<{AJ.java'AJ`declare soft"); + List rels = irm.get("=pr329111<{AJ.java>AJ´declare soft"); assertNotNull(rels); - rels = irm.get("=pr329111<{AJ2.java'AJ2`declare soft"); + rels = irm.get("=pr329111<{AJ2.java>AJ2´declare soft"); assertNotNull(rels); - rels = irm.get("=pr329111<{AJ2.java'AJ2`declare soft!2"); + rels = irm.get("=pr329111<{AJ2.java>AJ2´declare soft!2"); assertNotNull(rels); - rels = irm.get("=pr329111<{AJ2.java'AJ2`declare soft!3"); + rels = irm.get("=pr329111<{AJ2.java>AJ2´declare soft!3"); assertNotNull(rels); - rels = irm.get("=pr329111<{AJ3.java'AJ3`declare warning"); + rels = irm.get("=pr329111<{AJ3.java>AJ3´declare warning"); assertNotNull(rels); - rels = irm.get("=pr329111<{AJ3.java'AJ3`declare warning!2"); + rels = irm.get("=pr329111<{AJ3.java>AJ3´declare warning!2"); assertNotNull(rels); - rels = irm.get("=pr329111<{AJ3.java'AJ3`declare error"); + rels = irm.get("=pr329111<{AJ3.java>AJ3´declare error"); assertNotNull(rels); - rels = irm.get("=pr329111<{AJ3.java'AJ3`declare error!2"); + rels = irm.get("=pr329111<{AJ3.java>AJ3´declare error!2"); assertNotNull(rels); } @@ -271,7 +271,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // Hid:1:(targets=1) =pr322446<{Class.java[Class (aspect declarations) =pr322446<{AbstractAspect.java'AbstractAspect`declare // parents // Hid:2:(targets=1) =pr322446<{AbstractAspect.java'AbstractAspect`declare parents (declared on) =pr322446<{Class.java[Class - List rels = irm.get("=pr322446<{AbstractAspect.java'AbstractAspect`declare parents"); + List rels = irm.get("=pr322446<{AbstractAspect.java>AbstractAspect´declare parents"); assertNotNull(rels); } @@ -290,11 +290,11 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // Check the 'standard build' - the library also has a type affected by the decp so we can check what happens on an 'all // source' build - IProgramElement theAspect = getModelFor(lib).getHierarchy().findElementForHandleOrCreate("=pr343001_lib<{Super.java'Super", + IProgramElement theAspect = getModelFor(lib).getHierarchy().findElementForHandleOrCreate("=pr343001_lib<{Super.java>Super", false); assertNotNull(theAspect); IProgramElement sourcelevelDecp = getModelFor(lib).getHierarchy().findElementForHandleOrCreate( - "=pr343001_lib<{Super.java'Super`declare parents", false); + "=pr343001_lib<{Super.java>Super´declare parents", false); assertNotNull(sourcelevelDecp); assertEquals("[java.io.Serializable]", sourcelevelDecp.getParentTypes().toString()); @@ -304,10 +304,10 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa build(p); IProgramElement theBinaryAspect = getModelFor(p).getHierarchy().findElementForHandleOrCreate( - "=pr343001/binaries<(Super.class'Super", false); + "=pr343001/binaries<(Super.class>Super", false); assertNotNull(theBinaryAspect); IProgramElement binaryDecp = getModelFor(p).getHierarchy().findElementForHandleOrCreate( - "=pr343001/binaries<(Super.class'Super`declare parents", false); + "=pr343001/binaries<(Super.class>Super´declare parents", false); assertNotNull(binaryDecp); assertEquals("[java.io.Serializable]", (binaryDecp.getParentTypes() == null ? "" : binaryDecp.getParentTypes().toString())); } @@ -372,35 +372,34 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa initialiseProject(p); build(p); printModel(p); - IProgramElement decpPE = getModelFor(p).getHierarchy().findElementForHandle( - "=pr286539Asp´declare parents"); assertNotNull(decpPE); String s = ((decpPE.getParentTypes()).get(0)); assertEquals("p.q.r.Int", s); - decpPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539Asp´declare parents!2"); assertNotNull(decpPE); s = ((decpPE.getParentTypes()).get(0)); assertEquals("p.q.r.Int", s); IProgramElement decaPE = getModelFor(p).getHierarchy().findElementForHandle( - "=pr286539Asp´declare \\@type"); assertNotNull(decaPE); assertEquals("p.q.r.Foo", decaPE.getAnnotationType()); - decaPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539Asp´declare \\@type!2"); assertNotNull(decaPE); assertEquals("p.q.r.Goo", decaPE.getAnnotationType()); - decaPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539Asp´declare \\@field"); assertNotNull(decaPE); assertEquals("p.q.r.Foo", decaPE.getAnnotationType()); - decaPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539Asp´declare \\@method"); assertNotNull(decaPE); assertEquals("p.q.r.Foo", decaPE.getAnnotationType()); - decaPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539Asp´declare \\@constructor"); assertNotNull(decaPE); assertEquals("p.q.r.Foo", decaPE.getAnnotationType()); } @@ -598,14 +597,14 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // Hid:5:(targets=1) =pr280380AnAspect,AClass.xxxx")); alter(p, "inc2"); build(p); assertNoErrors(p); printModel(p); // On this build the relationship should have changed to include the fully qualified target assertEquals(4, getModelFor(p).getRelationshipMap().getEntries().size()); - assertNotNull(getModelFor(p).getRelationshipMap().get("=pr280380AnAspect,AClass.xxxx")); // Hid:1:(targets=3) =pr280380 rels = irm.get("=pr322039 rels = irm.get("=pr322039Azpect°q2.Code.something2"); assertNotNull(rels); } @@ -630,7 +629,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa build(p); printModel(p); IRelationshipMap irm = getModelFor(p).getRelationshipMap(); - List rels = irm.get("=pr280383 rels = irm.get("=pr280383AnAspect°f.AClass.f_AClass_new"); assertNotNull(rels); } @@ -654,9 +653,9 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // Hid:3:(targets=2) =pr283657<{Aspect.java[Target (aspect declarations) =pr283657<{Aspect.java}Aspect)Target.foo // Hid:4:(targets=2) =pr283657<{Aspect.java[Target (aspect declarations) =pr283657<{Aspect.java}Aspect)Target.foo!2 IRelationshipMap irm = getModelFor(p).getRelationshipMap(); - List rels = irm.get("=pr283657<{Aspect.java'Aspect,Target.foo"); + List rels = irm.get("=pr283657<{Aspect.java>Aspect,Target.foo"); assertNotNull(rels); - rels = irm.get("=pr283657<{Aspect.java'Aspect)Target.foo!2"); + rels = irm.get("=pr283657<{Aspect.java>Aspect°Target.foo!2"); assertNotNull(rels); } @@ -667,13 +666,13 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa addSourceFolderForSourceFile(p, getProjectRelativePath(p, "src/C.java"), "src"); build(p); IRelationshipMap irm = getModelFor(p).getRelationshipMap(); - IRelationship ir = irm.get("=pr276399/src<*X.aj'X&after").get(0); + IRelationship ir = irm.get("=pr276399/src<*X.aj>X§after").get(0); assertNotNull(ir); alter(p, "inc1"); build(p); printModel(p); irm = getModelFor(p).getRelationshipMap(); - List rels = irm.get("=pr276399/src<*X.aj'X&after"); // should be gone after the inc build + List rels = irm.get("=pr276399/src<*X.aj>X§after"); // should be gone after the inc build assertNull(rels); } @@ -685,7 +684,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa printModelAndRelationships(p); } IRelationshipMap irm = getModelFor(p).getRelationshipMap(); - List l = irm.get("=pr278255<{A.java'X`declare \\@type"); + List l = irm.get("=pr278255<{A.java>X´declare \\@type"); assertNotNull(l); IRelationship ir = l.get(0); assertNotNull(ir); @@ -883,9 +882,9 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa } // ITD from the test program: // public String InterTypeAspectInterface.foo(int i,List list,App a) { - assertEquals("=pr265729_client/binariesInterTypeAspect´declare parents", h1); assertEquals( - "=pr265729_client/binariesInterTypeAspect°InterTypeAspectInterface.foo°I°QList;°QSerializable;", h2); IProgramElement binaryDecp = getModelFor(cli).getHierarchy().getElement(h1); assertNotNull(binaryDecp); @@ -929,7 +928,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa String p = "decps"; initialiseProject(p); build(p); - IProgramElement decp = getModelFor(p).getHierarchy().findElementForHandle("=decpsA´declare parents"); List ps = decp.getParentTypes(); assertNotNull(ps); assertEquals(2, ps.size()); @@ -950,7 +949,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa initialiseProject(p); build(p); IRelationshipMap irm = getModelFor(p).getRelationshipMap(); - IRelationship ir = irm.get("=261380X§before").get(0); List targets = ir.getTargets(); assertEquals(1, targets.size()); System.out.println(targets.get(0)); @@ -1115,7 +1114,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa assertEquals("java.io.Serializable", l.get(0)); ProgramElement ctorDecp = (ProgramElement) findElementAtLine(root, 16); String ctordecphandle = ctorDecp.getHandleIdentifier(); - assertEquals("=itdfqXX°B.B_new°QString;", ctordecphandle); // 252702 // , // comment // 7 @@ -1133,11 +1132,11 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa IProgramElement root = model.getHierarchy().getRoot(); IProgramElement ipe = findElementAtLine(root, 4); - assertEquals("=BrokenHandlesGetInfo´declare warning", ipe.getHandleIdentifier()); ipe = findElementAtLine(root, 5); - assertEquals("=BrokenHandlesGetInfo´declare warning!2", ipe.getHandleIdentifier()); ipe = findElementAtLine(root, 6); - assertEquals("=BrokenHandlesGetInfo´declare parents", ipe.getHandleIdentifier()); } public void testNPEIncremental_pr262218() { @@ -1312,7 +1311,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // the advice relationship IProgramElement root = getModelFor(p).getHierarchy().getRoot(); IProgramElement code = findElementAtLine(root, 5); - assertEquals("=pr253067AdvisesC°C.nothing?method-call(int aa.C.nothing())", code.getHandleIdentifier()); // dumptree(getModelFor(p).getHierarchy().getRoot(), 0); // Ajc.dumpAJDEStructureModel(getModelFor("pr253067"), // "after inc build where first advised line is gone"); @@ -1325,7 +1324,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa IProgramElement root = getModelFor(p).getHierarchy().getRoot(); IProgramElement code = findElementAtLine(root, 4); // the @ should be escapified - assertEquals("=pr249216<{Deca.java'X`declare \\@type", code.getHandleIdentifier()); + assertEquals("=pr249216<{Deca.java>X´declare \\@type", code.getHandleIdentifier()); // dumptree(getModelFor(p).getHierarchy().getRoot(), 0); // Ajc.dumpAJDEStructureModel(getModelFor(p), // "after inc build where first advised line is gone"); @@ -1424,48 +1423,48 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa build(p); IProgramElement root = getModelFor(p).getHierarchy().getRoot(); IProgramElement typeDecl = findElementAtLine(root, 4); - assertEquals("=AdviceHandles/srcHandles", typeDecl.getHandleIdentifier()); IProgramElement advice1 = findElementAtLine(root, 7); - assertEquals("=AdviceHandles/srcHandles§before", advice1.getHandleIdentifier()); IProgramElement advice2 = findElementAtLine(root, 11); - assertEquals("=AdviceHandles/srcHandles§before!2", advice2.getHandleIdentifier()); IProgramElement advice3 = findElementAtLine(root, 15); - assertEquals("=AdviceHandles/srcHandles§before§I", advice3.getHandleIdentifier()); IProgramElement advice4 = findElementAtLine(root, 20); - assertEquals("=AdviceHandles/srcHandles§before§I!2", advice4.getHandleIdentifier()); IProgramElement advice5 = findElementAtLine(root, 25); - assertEquals("=AdviceHandles/srcHandles§after", advice5.getHandleIdentifier()); IProgramElement advice6 = findElementAtLine(root, 30); - assertEquals("=AdviceHandles/srcHandles§afterReturning", advice6.getHandleIdentifier()); IProgramElement advice7 = findElementAtLine(root, 35); - assertEquals("=AdviceHandles/srcHandles§afterThrowing", advice7.getHandleIdentifier()); IProgramElement advice8 = findElementAtLine(root, 40); - assertEquals("=AdviceHandles/srcHandles§afterThrowing§I", advice8.getHandleIdentifier()); IProgramElement namedInnerClass = findElementAtLine(root, 46); - assertEquals("=AdviceHandles/srcHandles~x[NamedClass", namedInnerClass.getHandleIdentifier()); - assertEquals("=AdviceHandles/srcHandles~foo[", findElementAtLine(root, 55).getHandleIdentifier()); + assertEquals("=AdviceHandles/srcHandles~foo[!2", findElementAtLine(root, 56).getHandleIdentifier()); // From 247742: comment 3: two anon class declarations - assertEquals("=AdviceHandles/srcHandles~b~QString;[", findElementAtLine(root, 62) .getHandleIdentifier()); - assertEquals("=AdviceHandles/srcHandles~b~QString;[!2", findElementAtLine(root, 63) .getHandleIdentifier()); // From 247742: comment 6: two diff anon class declarations - assertEquals("=AdviceHandles/srcHandles~c~QString;[", findElementAtLine(root, 66) .getHandleIdentifier()); - assertEquals("=AdviceHandles/srcHandles~c~QString;[!2", findElementAtLine(root, 67) .getHandleIdentifier()); // // From 247742: comment 4 @@ -1661,8 +1660,8 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa getModelFor(bug2).dumprels(pw); pw.flush(); IProgramElement root = getModelFor(bug2).getHierarchy().getRoot(); - assertEquals("=AspectPathTwo/binariesAsp§before", findElementAtLine(root, 5).getHandleIdentifier()); + assertEquals("=AspectPathTwo/binaries<(Asp2.class>Asp2§before", findElementAtLine(root, 16).getHandleIdentifier()); } public void testAspectPath_pr274558() throws Exception { @@ -1676,7 +1675,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa build(depending); printModel(depending); IProgramElement root = getModelFor(depending).getHierarchy().getRoot(); - assertEquals("=bug274558base/binariesDeclaresITD,InterfaceForITD.x", findElementAtLine(root, 5) .getHandleIdentifier()); // assertEquals("=AspectPathTwo/binaries<(Asp2.class}Asp2&before", findElementAtLine(root, 16).getHandleIdentifier()); } @@ -1764,7 +1763,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa assertEquals("=pr269286<{Logger.java[Logger~aroo", findElementAtLine(root, 15).getHandleIdentifier()); // around // pointcuts are not fixed - seems to buggy handling of them internally - assertEquals("=pr269286<{Logger.java[Logger\"ooo", findElementAtLine(root, 20).getHandleIdentifier()); + assertEquals("=pr269286<{Logger.java[Logger©ooo", findElementAtLine(root, 20).getHandleIdentifier()); // DeclareWarning assertEquals("=pr269286<{Logger.java[Logger^message", findElementAtLine(root, 24).getHandleIdentifier()); @@ -1784,9 +1783,9 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // getModelFor(p).dumprels(pw); // pw.flush(); IProgramElement ff = findFile(root, "ProcessAspect.aj"); - assertEquals("=prxProcessAspect§after§QMyProcessor;", findElementAtLine(root, 22) .getHandleIdentifier()); - assertEquals("=prxProcessAspect§after§QMyProcessor;!2", findElementAtLine(root, 68) .getHandleIdentifier()); } @@ -3174,7 +3173,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa build("JDTLikeHandleProvider"); IHierarchy top = getModelFor("JDTLikeHandleProvider").getHierarchy(); IProgramElement pe = top.findElementForType("pkg", "A"); - String expectedHandle = "=JDTLikeHandleProvider expectedFileContents = new ArrayList<>(fileContents); @@ -150,6 +152,8 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase { String foundLine = null; List foundFileContents = new ArrayList<>(); while ((foundLine = found.readLine()) != null) { + // Remove trailing whitespace + foundLine = foundLine.replaceAll("[\t ]+$", ""); // int i = foundLine.indexOf(sandboxDir); // if (i == -1) { // int j = foundLine.indexOf("(targets=");