]> source.dussan.org Git - aspectj.git/commitdiff
tests and fix for pr112027
authoraclement <aclement>
Tue, 18 Oct 2005 15:40:35 +0000 (15:40 +0000)
committeraclement <aclement>
Tue, 18 Oct 2005 15:40:35 +0000 (15:40 +0000)
tests/bugs150/pr112027.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
weaver/src/org/aspectj/weaver/patterns/BindingTypePattern.java
weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java

diff --git a/tests/bugs150/pr112027.aj b/tests/bugs150/pr112027.aj
new file mode 100644 (file)
index 0000000..08b4eac
--- /dev/null
@@ -0,0 +1,4 @@
+public aspect pr112027 {
+  pointcut pc() : this(pr112027);
+  before(pr112027 tis) : pc() && this(tis) { }
+}
index 3462d7f64a67a8c68654ed39037537faa2a2d858..c2ac24822d7992f8358e9a223e7ee4b176220db6 100644 (file)
@@ -50,6 +50,8 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   public void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
   */
   
+  public void testUnboundFormal_pr112027() { runTest("unexpected error unboundFormalInPC");}
+  
   public void testBadDecp_pr110788_1() { runTest("bad generic decp - 1");}
   public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");}
   public void testBadDecp_pr110788_3() { runTest("bad generic decp - 3");}
index 169a814b46e2d2f6725a8b45e612ef60fc0ce586..dc7553ede0335d4e57031d2db93baaea981a6bc3 100644 (file)
      <compile files="pr102357.aj"/>
      <run class="pr102357"/>
    </ajc-test>
+   
+   <ajc-test dir="bugs150" title="unexpected error unboundFormalInPC">
+     <compile files="pr112027.aj"/>
+   </ajc-test>
 
    <ajc-test dir="bugs150" title="ITD varargs in constructor">
      <compile files="pr111481.aj" options="-1.5"/>
index 7afd93fbe4fd3084a4c746660703fce4cf33db5b..e5740b86ab1c6a5e3345f3ed3d49bc062d265be4 100644 (file)
@@ -48,7 +48,7 @@ public class BindingTypePattern extends ExactTypePattern implements BindingPatte
     }
     public int hashCode() {
         int result = 17;
-        result = 37*result + type.hashCode();
+        result = 37*result + super.hashCode();
         result = 37*result + formalIndex;
         return result;
     }
index 5f6c902679239e5f2fa36c1a94a3a5129a65008f..9f99baf17bde68c737e667e94159389f7b8e804f 100644 (file)
@@ -148,6 +148,7 @@ public class ExactTypePattern extends TypePattern {
                
     public boolean equals(Object other) {
        if (!(other instanceof ExactTypePattern)) return false;
+       if (other instanceof BindingTypePattern) return false;
        ExactTypePattern o = (ExactTypePattern)other;
        if (includeSubtypes != o.includeSubtypes) return false;
        if (isVarArgs != o.isVarArgs) return false;     
@@ -158,6 +159,9 @@ public class ExactTypePattern extends TypePattern {
     public int hashCode() {
         int result = 17;
         result = 37*result + type.hashCode();
+        result = 37*result + new Boolean(includeSubtypes).hashCode();
+        result = 37*result + new Boolean(isVarArgs).hashCode();
+        result = 37*result + typeParameters.hashCode();
         result = 37*result + annotationPattern.hashCode();
         return result;
     }