]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for pr101606, unused privated method warnings incorrectly generated...
authoracolyer <acolyer>
Fri, 2 Sep 2005 14:44:26 +0000 (14:44 +0000)
committeracolyer <acolyer>
Fri, 2 Sep 2005 14:44:26 +0000 (14:44 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
tests/bugs150/pr101606.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

index dc131b38478fda7cdd87a1bebd0a209d83949d93..34028b337975841213b5248afc365d16e316d6bd 100644 (file)
@@ -407,4 +407,9 @@ public class AjProblemReporter extends ProblemReporter {
                super.unusedPrivateType(typeDecl);
     }
 
+    public void unusedPrivateMethod(AbstractMethodDeclaration methodDecl) {
+       // don't output unused warnings for pointcuts...
+       if (!(methodDecl instanceof PointcutDeclaration))
+                       super.unusedPrivateMethod(methodDecl);
+    }
 }
diff --git a/tests/bugs150/pr101606.aj b/tests/bugs150/pr101606.aj
new file mode 100644 (file)
index 0000000..db234e3
--- /dev/null
@@ -0,0 +1,5 @@
+public aspect pr101606 {
+       
+       private pointcut foo();
+       
+}
\ No newline at end of file
index 2cf9dc7a9664e2f626bd5328710abf1738e918ca..5db8119d18a2fa5e161a455c0c9c71f914f2020c 100644 (file)
@@ -378,6 +378,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
          runTest("synchronized itd interface methods");
   }
   
+  public void testNoWarningOnUnusedPointcut() {
+         runTest("unused private pointcuts");
+  }
+  
   // helper methods.....
   
   public SyntheticRepository createRepos(File cpentry) {
index 7814d3cd8111c2e113e97b9608549836c28373cc..aba23f729c4cad2fdd1c2d0b768dfcec67564849 100644 (file)
         </compile>
         <run class="SynchronizedInterfaceMethods"/>
     </ajc-test>
-         
+
+    <ajc-test dir="bugs150" pr="101606" title="unused private pointcuts">
+        <compile files="pr101606.aj" options="-warn:unusedPrivate">
+        </compile>
+    </ajc-test>
+             
     <!-- ============================================================================ -->
     <!-- ============================================================================ -->