]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for pr74048, unused private warnings for aspect types.
authoracolyer <acolyer>
Thu, 1 Sep 2005 09:38:36 +0000 (09:38 +0000)
committeracolyer <acolyer>
Thu, 1 Sep 2005 09:38:36 +0000 (09:38 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
tests/bugs150/pr74048.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

index 8615a2eef1658ec892854b38a79949f1327e136e..dc131b38478fda7cdd87a1bebd0a209d83949d93 100644 (file)
@@ -17,6 +17,7 @@ import java.lang.reflect.Modifier;
 import java.util.Iterator;
 import java.util.List;
 
+import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
 import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
 import org.aspectj.ajdt.internal.compiler.ast.Proceed;
 import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
@@ -30,6 +31,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
 import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
 import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
 import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
@@ -398,5 +400,11 @@ public class AjProblemReporter extends ProblemReporter {
        }
        super.visibilityConflict(currentMethod,inheritedMethod);
     }
+    
+    public void unusedPrivateType(TypeDeclaration typeDecl) {
+       // don't output unused type warnings for aspects!
+       if (!(typeDecl instanceof AspectDeclaration))
+               super.unusedPrivateType(typeDecl);
+    }
 
 }
diff --git a/tests/bugs150/pr74048.aj b/tests/bugs150/pr74048.aj
new file mode 100644 (file)
index 0000000..502b0ca
--- /dev/null
@@ -0,0 +1,5 @@
+public class pr74048 {
+       
+       private static aspect StaticInnerAspect {}
+       
+}
\ No newline at end of file
index 9d7053306cef2b455e1b996515028275d117693c..b2d388181b8f1c6d8f1df7d78266c52ef854e5df 100644 (file)
@@ -350,6 +350,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
          runTest("args generated correctly for advice execution join point");
   }
   
+  public void testNoUnusedWarningsOnAspectTypes() {
+         runTest("no unused warnings on aspect types");
+  }
+  
   // helper methods.....
   
   public SyntheticRepository createRepos(File cpentry) {
index eaa4acef4488fc128b15e4ea2ad4d9c5601d9712..f3e301cec8b76c132fa8578def53551ed4f4a525 100644 (file)
         <compile files="pr59196.aj" options="-XnoInline -1.5"/>
     </ajc-test>  
   
+    <ajc-test dir="bugs150" pr="74048" title="no unused warnings on aspect types">
+        <compile files="pr74048.aj" options="-warn:unusedPrivate"/>
+    </ajc-test>  
+  
     <!-- ============================================================================ -->
     <!-- ============================================================================ -->