aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-04-19 13:36:39 +0000
committeraclement <aclement>2006-04-19 13:36:39 +0000
commit1535ee721c16509713642e20316b226ece69fda9 (patch)
tree097169ea851e1a120054d5e1b29a58c1e643c35b
parentedcb418c39b11e244cf70c9c68bc98419bdf8921 (diff)
downloadaspectj-1535ee721c16509713642e20316b226ece69fda9.tar.gz
aspectj-1535ee721c16509713642e20316b226ece69fda9.zip
test and fix for 136585: NullPointerException in PerObjectInterfaceTypeMunger.java:33
-rw-r--r--tests/multiIncremental/PR136585/base/Aspect.aj3
-rw-r--r--tests/multiIncremental/PR136585/base/Hello.java6
-rw-r--r--tests/multiIncremental/PR136585/inc1/Aspect.aj3
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java9
-rw-r--r--weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java6
5 files changed, 24 insertions, 3 deletions
diff --git a/tests/multiIncremental/PR136585/base/Aspect.aj b/tests/multiIncremental/PR136585/base/Aspect.aj
new file mode 100644
index 000000000..9fe594ec3
--- /dev/null
+++ b/tests/multiIncremental/PR136585/base/Aspect.aj
@@ -0,0 +1,3 @@
+public aspect Aspect perthis(staticinitialization(Hello)) {
+
+} \ No newline at end of file
diff --git a/tests/multiIncremental/PR136585/base/Hello.java b/tests/multiIncremental/PR136585/base/Hello.java
new file mode 100644
index 000000000..13b7c1864
--- /dev/null
+++ b/tests/multiIncremental/PR136585/base/Hello.java
@@ -0,0 +1,6 @@
+public class Hello {
+
+ public static void main(String[] args) {
+ System.err.println("Hello");
+ }
+} \ No newline at end of file
diff --git a/tests/multiIncremental/PR136585/inc1/Aspect.aj b/tests/multiIncremental/PR136585/inc1/Aspect.aj
new file mode 100644
index 000000000..7644bf5e8
--- /dev/null
+++ b/tests/multiIncremental/PR136585/inc1/Aspect.aj
@@ -0,0 +1,3 @@
+public aspect Aspect perthis(staticinitialization(Hello)) {
+ public void foo() {}
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index c6f6672a5..a5bd9edc1 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -821,6 +821,15 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
checkXMLAspectCount("PR131505","A",1);
checkXMLAspectCount("PR131505","pkg.A",1);
}
+
+ public void testPr136585() {
+ initialiseProject("PR136585");
+ build("PR136585");
+ alter("PR136585","inc1");
+ build("PR136585");
+ assertTrue("There should be no errors reported:\n"+MyTaskListManager.getErrorMessages(),
+ MyTaskListManager.getErrorMessages().isEmpty());
+ }
public void testPr133532() {
initialiseProject("PR133532");
diff --git a/weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java b/weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java
index 6f473c749..219ad3277 100644
--- a/weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java
@@ -28,10 +28,10 @@ public class PerObjectInterfaceTypeMunger extends ResolvedTypeMunger {
private TypePattern lazyTestTypePattern;
public boolean equals(Object other) {
- if (!(other instanceof PerObjectInterfaceTypeMunger)) return false;
+ if (other==null || !(other instanceof PerObjectInterfaceTypeMunger)) return false;
PerObjectInterfaceTypeMunger o = (PerObjectInterfaceTypeMunger)other;
- return ((o.testPointcut == null) ? (testPointcut == null ) : testPointcut.equals(o.testPointcut))
- && ((o.lazyTestTypePattern == null) ? (lazyTestTypePattern == null ) : lazyTestTypePattern.equals(o.lazyTestTypePattern));
+ return ((testPointcut == null) ? (o.testPointcut == null ) : testPointcut.equals(o.testPointcut))
+ && ((lazyTestTypePattern == null) ? (o.lazyTestTypePattern == null ) : lazyTestTypePattern.equals(o.lazyTestTypePattern));
}
private volatile int hashCode = 0;