From: aclement Date: Fri, 23 Apr 2010 00:10:16 +0000 (+0000) Subject: 307120: more damn fixes X-Git-Tag: V1_6_9M2~35 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cee6b8b8cb6c7f4e6501d1cb054d6586f7ff128b;p=aspectj.git 307120: more damn fixes --- diff --git a/tests/multiIncremental/pr307120_3/base/src/Advisor.java b/tests/multiIncremental/pr307120_3/base/src/Advisor.java new file mode 100644 index 000000000..96231dd88 --- /dev/null +++ b/tests/multiIncremental/pr307120_3/base/src/Advisor.java @@ -0,0 +1,9 @@ +aspect Advisor { +// Object around(Object o): get(@Anno * *) && this(o) { +// return proceed(o); +// } + + Object around(Object o,Object newval): set(@Anno * *) && this(o) && args(newval) { + return proceed(o,newval); + } +} diff --git a/tests/multiIncremental/pr307120_3/base/src/Anno.java b/tests/multiIncremental/pr307120_3/base/src/Anno.java new file mode 100644 index 000000000..148fd7c4c --- /dev/null +++ b/tests/multiIncremental/pr307120_3/base/src/Anno.java @@ -0,0 +1,4 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno {} diff --git a/tests/multiIncremental/pr307120_3/base/src/Target.java b/tests/multiIncremental/pr307120_3/base/src/Target.java new file mode 100644 index 000000000..dfd2ba34f --- /dev/null +++ b/tests/multiIncremental/pr307120_3/base/src/Target.java @@ -0,0 +1,4 @@ +class Target { + @Anno + private String it; +} diff --git a/tests/multiIncremental/pr307120_3/base/src/TargetAugmenter.java b/tests/multiIncremental/pr307120_3/base/src/TargetAugmenter.java new file mode 100644 index 000000000..be2965c0b --- /dev/null +++ b/tests/multiIncremental/pr307120_3/base/src/TargetAugmenter.java @@ -0,0 +1,9 @@ +privileged aspect TargetAugmenter { +// public String Target.getIt() { +// return it; +// } + + public void Target.setIt(String newit) { + this.it = newit; + } +} diff --git a/tests/multiIncremental/pr307120_3/inc1/src/TargetAugmenter.java b/tests/multiIncremental/pr307120_3/inc1/src/TargetAugmenter.java new file mode 100644 index 000000000..be2965c0b --- /dev/null +++ b/tests/multiIncremental/pr307120_3/inc1/src/TargetAugmenter.java @@ -0,0 +1,9 @@ +privileged aspect TargetAugmenter { +// public String Target.getIt() { +// return it; +// } + + public void Target.setIt(String newit) { + this.it = newit; + } +} diff --git a/tests/multiIncremental/pr307120_4/base/src/Advisor.java b/tests/multiIncremental/pr307120_4/base/src/Advisor.java new file mode 100644 index 000000000..292ea4721 --- /dev/null +++ b/tests/multiIncremental/pr307120_4/base/src/Advisor.java @@ -0,0 +1,9 @@ +aspect Advisor { +// Object around(Object o): get(@Anno * *) && this(o) { +// return proceed(o); +// } + + Object around(Object o,Object newval): set(* *) && !set(@Anno * *) && this(o) && args(newval) { + return proceed(o,newval); + } +} diff --git a/tests/multiIncremental/pr307120_4/base/src/Anno.java b/tests/multiIncremental/pr307120_4/base/src/Anno.java new file mode 100644 index 000000000..148fd7c4c --- /dev/null +++ b/tests/multiIncremental/pr307120_4/base/src/Anno.java @@ -0,0 +1,4 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno {} diff --git a/tests/multiIncremental/pr307120_4/base/src/Target.java b/tests/multiIncremental/pr307120_4/base/src/Target.java new file mode 100644 index 000000000..dfd2ba34f --- /dev/null +++ b/tests/multiIncremental/pr307120_4/base/src/Target.java @@ -0,0 +1,4 @@ +class Target { + @Anno + private String it; +} diff --git a/tests/multiIncremental/pr307120_4/base/src/TargetAugmenter.java b/tests/multiIncremental/pr307120_4/base/src/TargetAugmenter.java new file mode 100644 index 000000000..be2965c0b --- /dev/null +++ b/tests/multiIncremental/pr307120_4/base/src/TargetAugmenter.java @@ -0,0 +1,9 @@ +privileged aspect TargetAugmenter { +// public String Target.getIt() { +// return it; +// } + + public void Target.setIt(String newit) { + this.it = newit; + } +} diff --git a/tests/multiIncremental/pr307120_4/inc1/src/TargetAugmenter.java b/tests/multiIncremental/pr307120_4/inc1/src/TargetAugmenter.java new file mode 100644 index 000000000..be2965c0b --- /dev/null +++ b/tests/multiIncremental/pr307120_4/inc1/src/TargetAugmenter.java @@ -0,0 +1,9 @@ +privileged aspect TargetAugmenter { +// public String Target.getIt() { +// return it; +// } + + public void Target.setIt(String newit) { + this.it = newit; + } +} diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index b114bf7dc..b37a2f79d 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -256,27 +256,102 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa assertEquals(4, getRelationshipCount(p)); } + public void testIncrementalAdvisingItdJoinpointsAccessingPrivFields_307120_pipelineOff() throws Exception { + String p = "pr307120"; + initialiseProject(p); + configureNonStandardCompileOptions(p, "-Xset:pipelineCompilation=false"); + build(p); + // Hid:1:(targets=1) =pr307120<{Test.java}Test)A.getFoo?field-get(int A.foo) (advised by) =pr307120<{Test.java}Test&before + // Hid:2:(targets=1) =pr307120<{A.java[A (aspect declarations) =pr307120<{Test.java}Test)A.getFoo + // Hid:3:(targets=1) =pr307120<{Test.java}Test&before (advises) =pr307120<{Test.java}Test)A.getFoo?field-get(int A.foo) + // Hid:4:(targets=1) =pr307120<{Test.java}Test)A.getFoo (declared on) =pr307120<{A.java[A + alter(p, "inc1"); + assertEquals(4, getRelationshipCount(p)); + build(p); + // Hid:1:(targets=1) =pr307120<{A.java[A (aspect declarations) =pr307120<{Test.java}Test)A.getFoo + // Hid:2:(targets=1) =pr307120<{Test.java}Test)A.getFoo (declared on) =pr307120<{A.java[A + // These two are missing without the fix: + // Hid:1:(targets=1) =pr307120<{Test.java}Test)A.getFoo?field-get(int A.foo) (advised by) =pr307120<{Test.java}Test&before + // Hid:7:(targets=1) =pr307120<{Test.java}Test&before (advises) =pr307120<{Test.java}Test)A.getFoo?field-get(int A.foo) + assertNoErrors(p); + assertEquals(4, getRelationshipCount(p)); + } + + // More sophisticated variant of above. + public void testIncrementalAdvisingItdJoinpointsAccessingPrivFields_307120_2_pipelineOff() throws Exception { + String p = "pr307120_3"; + initialiseProject(p); + configureNonStandardCompileOptions(p, "-Xset:pipelineCompilation=false"); + build(p); + assertNoErrors(p); + // Hid:1:(targets=1) =pr307120_3<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString; (declared on) + // =pr307120_3<{Target.java[Target + + // Hid:2:(targets=1) =pr307120_3<{Target.java[Target (aspect declarations) + // =pr307120_3<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString; + + // these are missing under this bug: + + // Hid:3:(targets=1) =pr307120_3<{Advisor.java}Advisor&around&QObject;&QObject; (advises) + // =pr307120_3<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;?field-set(java.lang.String Target.it) + + // Hid:4:(targets=1) =pr307120_3<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;?field-set(java.lang.String + // Target.it) (advised by) =pr307120_3<{Advisor.java}Advisor&around&QObject;&QObject; + + assertEquals(4, getRelationshipCount(p)); + alter(p, "inc1"); + build(p); + + assertEquals(4, getRelationshipCount(p)); + assertNoErrors(p); + } + // More sophisticated variant of above. public void testIncrementalAdvisingItdJoinpointsAccessingPrivFields_307120_2() throws Exception { String p = "pr307120_2"; initialiseProject(p); build(p); assertNoErrors(p); - // Hid:2:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString; (declared on) =pr307120_2<{Target.java[Target - // Hid:8:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt (declared on) =pr307120_2<{Target.java[Target - // Hid:5:(targets=2) =pr307120_2<{Target.java[Target (aspect declarations) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt - // Hid:6:(targets=2) =pr307120_2<{Target.java[Target (aspect declarations) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString; - // Hid:1:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;?field-set(java.lang.String Target.it) (advised by) =pr307120_2<{Advisor.java}Advisor&around&QObject;&QObject; - // Hid:3:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt?field-get(java.lang.String Target.it) (advised by) =pr307120_2<{Advisor.java}Advisor&around&QObject; - // Hid:4:(targets=1) =pr307120_2<{Advisor.java}Advisor&around&QObject; (advises) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt?field-get(java.lang.String Target.it) - // Hid:7:(targets=1) =pr307120_2<{Advisor.java}Advisor&around&QObject;&QObject; (advises) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;?field-set(java.lang.String Target.it) + // Hid:2:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString; (declared on) + // =pr307120_2<{Target.java[Target + // Hid:8:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt (declared on) + // =pr307120_2<{Target.java[Target + // Hid:5:(targets=2) =pr307120_2<{Target.java[Target (aspect declarations) + // =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt + // Hid:6:(targets=2) =pr307120_2<{Target.java[Target (aspect declarations) + // =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString; + // Hid:1:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;?field-set(java.lang.String + // Target.it) (advised by) =pr307120_2<{Advisor.java}Advisor&around&QObject;&QObject; + // Hid:3:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt?field-get(java.lang.String Target.it) + // (advised by) =pr307120_2<{Advisor.java}Advisor&around&QObject; + // Hid:4:(targets=1) =pr307120_2<{Advisor.java}Advisor&around&QObject; (advises) + // =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt?field-get(java.lang.String Target.it) + // Hid:7:(targets=1) =pr307120_2<{Advisor.java}Advisor&around&QObject;&QObject; (advises) + // =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;?field-set(java.lang.String Target.it) assertEquals(8, getRelationshipCount(p)); alter(p, "inc1"); build(p); - assertEquals(8, getRelationshipCount(p)); + assertEquals(8, getRelationshipCount(p)); assertNoErrors(p); } + // // More sophisticated variant of above. + // public void testIncrementalAdvisingItdJoinpointsAccessingPrivFields_307120_4_pipelineOff() throws Exception { + // String p = "pr307120_4"; + // initialiseProject(p); + // configureNonStandardCompileOptions(p, "-Xset:pipelineCompilation=false"); + // build(p); + // assertNoErrors(p); + // + // printModel(p); + // assertEquals(4, getRelationshipCount(p)); + // alter(p, "inc1"); + // build(p); + // + // assertEquals(4, getRelationshipCount(p)); + // assertNoErrors(p); + // } + // modified aspect so target is fully qualified on the incremental change public void testIncrementalFqItds_280380_2() throws Exception { String p = "pr280380"; diff --git a/tests/src/org/aspectj/systemtest/serialVerUID/serialVerUID-tests.xml b/tests/src/org/aspectj/systemtest/serialVerUID/serialVerUID-tests.xml index 52ac0a0b9..1fafc783e 100644 --- a/tests/src/org/aspectj/systemtest/serialVerUID/serialVerUID-tests.xml +++ b/tests/src/org/aspectj/systemtest/serialVerUID/serialVerUID-tests.xml @@ -149,7 +149,7 @@ - +