]> source.dussan.org Git - aspectj.git/commitdiff
307120: more damn fixes
authoraclement <aclement>
Fri, 23 Apr 2010 00:10:16 +0000 (00:10 +0000)
committeraclement <aclement>
Fri, 23 Apr 2010 00:10:16 +0000 (00:10 +0000)
12 files changed:
tests/multiIncremental/pr307120_3/base/src/Advisor.java [new file with mode: 0644]
tests/multiIncremental/pr307120_3/base/src/Anno.java [new file with mode: 0644]
tests/multiIncremental/pr307120_3/base/src/Target.java [new file with mode: 0644]
tests/multiIncremental/pr307120_3/base/src/TargetAugmenter.java [new file with mode: 0644]
tests/multiIncremental/pr307120_3/inc1/src/TargetAugmenter.java [new file with mode: 0644]
tests/multiIncremental/pr307120_4/base/src/Advisor.java [new file with mode: 0644]
tests/multiIncremental/pr307120_4/base/src/Anno.java [new file with mode: 0644]
tests/multiIncremental/pr307120_4/base/src/Target.java [new file with mode: 0644]
tests/multiIncremental/pr307120_4/base/src/TargetAugmenter.java [new file with mode: 0644]
tests/multiIncremental/pr307120_4/inc1/src/TargetAugmenter.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
tests/src/org/aspectj/systemtest/serialVerUID/serialVerUID-tests.xml

diff --git a/tests/multiIncremental/pr307120_3/base/src/Advisor.java b/tests/multiIncremental/pr307120_3/base/src/Advisor.java
new file mode 100644 (file)
index 0000000..96231dd
--- /dev/null
@@ -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 (file)
index 0000000..148fd7c
--- /dev/null
@@ -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 (file)
index 0000000..dfd2ba3
--- /dev/null
@@ -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 (file)
index 0000000..be2965c
--- /dev/null
@@ -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 (file)
index 0000000..be2965c
--- /dev/null
@@ -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 (file)
index 0000000..292ea47
--- /dev/null
@@ -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 (file)
index 0000000..148fd7c
--- /dev/null
@@ -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 (file)
index 0000000..dfd2ba3
--- /dev/null
@@ -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 (file)
index 0000000..be2965c
--- /dev/null
@@ -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 (file)
index 0000000..be2965c
--- /dev/null
@@ -0,0 +1,9 @@
+privileged aspect TargetAugmenter {
+//  public String Target.getIt() {
+//    return it;
+//  }
+
+  public void Target.setIt(String newit) {
+    this.it = newit;
+  }
+}
index b114bf7dc216ecd593248af88bb602e66df998fb..b37a2f79d123615c892e4dcb0353a8103956c57e 100644 (file)
@@ -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";
index 52ac0a0b9bccbac73deffc1e9998d11a6c5cef4e..1fafc783e362f2381a76ca5dbdd53d982610b509 100644 (file)
                <compile files="Test.java, Util.java"/>
         <run class="Test"/>
                <compile files="Test.java, Util.java, PrivilegedAspect.aj" options="-Xlint:warning">
-            <message kind="warning" line="1"/>
+            <message kind="warning" line="0"/>
                </compile>
         <run class="Util" options="-fail"/>
        </ajc-test>