]> source.dussan.org Git - aspectj.git/commitdiff
fixed eclipse warnings
authoraclement <aclement>
Thu, 28 Aug 2008 03:19:50 +0000 (03:19 +0000)
committeraclement <aclement>
Thu, 28 Aug 2008 03:19:50 +0000 (03:19 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTMatcher.java
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java
org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjASTTest.java

index a645d3fd74bc21b38db6dea7f8afe45ef4d38e6c..b4ccb53a41651c5bd03ef00172da1d5bcfa54ffb 100644 (file)
@@ -266,7 +266,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
 
                int[] pcLoc = new int[2];
                String perClause = getStringLiteralFor("value", aspectAnnotation, pcLoc);
-               AspectDeclaration aspectDecl = new AspectDeclaration(typeDecl.compilationResult);
+               // AspectDeclaration aspectDecl = new AspectDeclaration(typeDecl.compilationResult);
 
                try {
                        if (perClause != null && !perClause.equals("")) {
@@ -326,7 +326,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
                        int[] throwingLocation = new int[2];
                        String thrownFormal = getStringLiteralFor("throwing", ajAnnotations.adviceAnnotation, throwingLocation);
                        if (thrownFormal != null) {
-                               Argument[] arguments = methodDeclaration.arguments;
+                               // Argument[] arguments = methodDeclaration.arguments;
                                if (!toArgumentNames(methodDeclaration.arguments).contains(thrownFormal)) {
                                        methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart,
                                                        methodDeclaration.sourceEnd,
index dfb1379cbdf2d31017cb9d6aac434e424de97f42..c56182eff35bfd30df5814185a48275e433a3ff4 100644 (file)
@@ -603,7 +603,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
        public AnnotationX convertEclipseAnnotation(Annotation eclipseAnnotation, World w) {
                // TODO if it is sourcevisible, we shouldn't let it through!!!!!!!!! testcase!
                ResolvedType annotationType = factory.fromTypeBindingToRTX(eclipseAnnotation.type.resolvedType);
-               long bs = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK);
+               // long bs = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK);
                boolean isRuntimeVisible = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention;
                AnnotationAJ annotationAJ = new AnnotationAJ(annotationType.getSignature(), isRuntimeVisible);
                generateAnnotation(eclipseAnnotation, annotationAJ);
index c9043ffc5d0290e96d298e47f31147f379aa3ee0..600abfc379fa92dabc18b3547d3d328dedc20a90 100644 (file)
@@ -350,7 +350,6 @@ public class AjProblemReporter extends ProblemReporter {
         * the other methodMustOverride() method is used.
         */
        public void methodMustOverride(AbstractMethodDeclaration method) {
-               MethodBinding binding = method.binding;
 
                // ignore ajc$ methods
                if (new String(method.selector).startsWith("ajc$"))
index 9b0f93144e594e9e50c4b27ad7db9a045f0e4fb6..3a1c3a0571f2725eb3640aaaeda7697d468f8444 100644 (file)
@@ -921,19 +921,19 @@ public class AjState {
        // }
        // }
 
-       private void maybeDeleteResource(String resName, List oldResources) {
-               if (resources.contains(resName)) {
-                       oldResources.remove(resName);
-                       List outputDirs = getOutputLocations(buildConfig);
-                       for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) {
-                               File dir = (File) iterator.next();
-                               File source = new File(dir, resName);
-                               if (source.exists() && (source.lastModified() >= lastSuccessfulBuildTime)) {
-                                       resources.remove(resName); // will ensure it is re-copied
-                               }
-                       }
-               }
-       }
+       // private void maybeDeleteResource(String resName, List oldResources) {
+       // if (resources.contains(resName)) {
+       // oldResources.remove(resName);
+       // List outputDirs = getOutputLocations(buildConfig);
+       // for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) {
+       // File dir = (File) iterator.next();
+       // File source = new File(dir, resName);
+       // if (source.exists() && (source.lastModified() >= lastSuccessfulBuildTime)) {
+       // resources.remove(resName); // will ensure it is re-copied
+       // }
+       // }
+       // }
+       // }
 
        // private void deleteResourcesFromDirectory(File dir, List oldResources) {
        // File[] files = FileUtil.listFiles(dir, new FileFilter() {
index 8e3e135875f19714f9f90d409d09b28249b11a80..586508bd70b99ca7a72e602b63ddb4e116fa5d4e 100644 (file)
@@ -119,21 +119,22 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto
                le.factory = eFactory;
                forCompiler.lookupEnvironment = le;
 
-               AjBuildNotifier ajNotifier = (AjBuildNotifier) notifier;
+               // AjBuildNotifier ajNotifier = (AjBuildNotifier) notifier;
                if (fileNameProvider == null)
                        fileNameProvider = new OutputFileNameProvider(getProject());
 
                // * the set of binary source entries for this compile -- from analyzing deltas, or everything if batch
                // * the full set of binary source entries for the project -- from IAspectJProject
                // TODO deal with inpath, injars here...
-               IBinarySourceProvider bsProvider = new NullBinarySourceProvider();
-               Map fullBinarySourceEntries = new HashMap();
+               // IBinarySourceProvider bsProvider = new NullBinarySourceProvider();
+               // Map fullBinarySourceEntries = new HashMap();
 
                // * the intermediate result set from the last batch compile
                if (isBatchBuild) {
                        unwovenResultCollector = new UnwovenResultCollector();
                }
-               Collection resultSetForFullWeave = unwovenResultCollector.getIntermediateResults();
+               // Collection resultSetForFullWeave =
+               unwovenResultCollector.getIntermediateResults();
 
                throw new UnsupportedOperationException("Is anyone actually using the AspectJBuilder class??");
                // return new AjCompilerAdapter(forCompiler,isBatchBuild,myBcelWorld,
index 8ec7b29a19fcc600926166f17dbdfe741aaaf391..822d80b6c167c29157444ed3312b32521dcfa84c 100644 (file)
@@ -101,7 +101,7 @@ public class AjASTMatcher extends ASTMatcher {
                if (!(other instanceof PerTypeWithin)) {
                        return false;
                }
-               PerTypeWithin o = (PerTypeWithin) other;
+               // PerTypeWithin o = (PerTypeWithin) other;
                return true; // ajh02: stub, should look at the type pattern
        }
 
index 6702208d14a3dc268b5a5a43c6bb3fecfbffd957..d42ed6355786bcf4b26ade0142c09b4f68cbcac4 100644 (file)
@@ -193,7 +193,7 @@ public class AjdtCommandTestCase extends TestCase {
                }
 
                String text = byteArrayOut.toString();
-               String text2 = byteArrayErr.toString();
+               // String text2 = byteArrayErr.toString();
                assertTrue("version output does not include 'AspectJ Compiler', output was:\n'" + text + "'", text
                                .indexOf("AspectJ Compiler") != -1);
        }
index bd0a05a32db3c40ee6026eb1a7a4a537c33d8390..69ed7dd1e08a0984f04e2c25e08cbe4a6248ab21 100644 (file)
@@ -12,63 +12,60 @@ package org.aspectj.ajdt.internal.compiler.batch;
 
 import java.io.File;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
-import org.aspectj.bridge.IMessage;
 import org.aspectj.tools.ajc.AjcTestCase;
 import org.aspectj.tools.ajc.CompilationResult;
 
-
 public class JavadocTest extends AjcTestCase {
-    public static final String PROJECT_DIR = "javadoc";
+       public static final String PROJECT_DIR = "javadoc";
+
+       private File baseDir;
+
+       protected void setUp() throws Exception {
+               super.setUp();
+               baseDir = new File("../org.aspectj.ajdt.core/testdata", PROJECT_DIR);
+       }
+
+       /**
+        * Aim: Check javadoc warning that appear are appropriate
+        * 
+        * ajc -warn:allJavadoc World.java
+        * 
+        */
+       public void testMissingJavadoc() {
+               String[] args = new String[] { "World.java", "-warn:allJavadoc" };
+
+               List warningMessages = new ArrayList();
+               // These warnings are against public textX() methods declared in the World.java
+               // type. These test methods are spread between AJ constructuts, meaning
+               // if someone messes up and the javadoc is not associated with the aspectj
+               // construct then it will associated by accident with one of the testX() methods.
+               // By checking we get a warning against every testX() method, we are verifying
+               // that the javadoc is being attached to the aspectj constructs.
+               warningMessages.add(new Message(10, "Missing comment for public declaration"));
+               warningMessages.add(new Message(18, "Missing comment for public declaration"));
+               warningMessages.add(new Message(28, "Missing comment for public declaration"));
+               warningMessages.add(new Message(36, "Missing comment for public declaration"));
+               warningMessages.add(new Message(44, "Missing comment for public declaration"));
+               warningMessages.add(new Message(53, "Missing comment for public declaration"));
+               warningMessages.add(new Message(61, "Missing comment for public declaration"));
+               warningMessages.add(new Message(69, "Missing comment for public declaration"));
+               MessageSpec spec = new MessageSpec(warningMessages, null);
+
+               CompilationResult result = ajc(baseDir, args);
+               assertMessages(result, spec);
+
+               // dump(result.getWarningMessages());
+               // System.err.println("-----------\n"+ajc.getLastCompilationResult().getStandardError());
+               // List l = result.getWarningMessages();
+               // IMessage m = ((IMessage)l.get(0));
+       }
 
-    private File baseDir;
-    
-    protected void setUp() throws Exception {
-        super.setUp();
-        baseDir = new File("../org.aspectj.ajdt.core/testdata",PROJECT_DIR);
-    }
-    
-    /**
-     * Aim: Check javadoc warning that appear are appropriate
-     * 
-     *   ajc -warn:allJavadoc World.java
-     * 
-     */
-    public void testMissingJavadoc () {
-        String[] args = new String[] {"World.java","-warn:allJavadoc"};
-        
-        List warningMessages = new ArrayList();
-        // These warnings are against public textX() methods declared in the World.java
-        // type.  These test methods are spread between AJ constructuts, meaning
-        // if someone messes up and the javadoc is not associated with the aspectj
-        // construct then it will associated by accident with one of the testX() methods.
-        // By checking we get a warning against every testX() method, we are verifying
-        // that the javadoc is being attached to the aspectj constructs.
-        warningMessages.add(new Message(10,"Missing comment for public declaration"));
-        warningMessages.add(new Message(18,"Missing comment for public declaration"));
-        warningMessages.add(new Message(28,"Missing comment for public declaration"));
-        warningMessages.add(new Message(36,"Missing comment for public declaration"));
-        warningMessages.add(new Message(44,"Missing comment for public declaration"));
-        warningMessages.add(new Message(53,"Missing comment for public declaration"));
-        warningMessages.add(new Message(61,"Missing comment for public declaration"));
-        warningMessages.add(new Message(69,"Missing comment for public declaration"));
-        MessageSpec spec = new MessageSpec(warningMessages,null);
-        
-        CompilationResult result = ajc(baseDir,args);
-        assertMessages(result,spec);
-        
-//        dump(result.getWarningMessages());
-//        System.err.println("-----------\n"+ajc.getLastCompilationResult().getStandardError());
-//        List l = result.getWarningMessages();
-//        IMessage m = ((IMessage)l.get(0));
-    }
-    
-    private void dump(List l) {
-         for (Iterator iter = l.iterator(); iter.hasNext();) {
-                       IMessage element = (IMessage) iter.next();
-                       System.err.println("Warning: "+element);
-               }
-    }
+       // private void dump(List l) {
+       // for (Iterator iter = l.iterator(); iter.hasNext();) {
+       // IMessage element = (IMessage) iter.next();
+       // System.err.println("Warning: "+element);
+       // }
+       // }
 }
index 298040112142a370228f73203ad7f182193c7f44..7b32dad3003d19fd5389adac53604f84cccd2f7a 100644 (file)
@@ -283,7 +283,8 @@ public class AjASTTest extends AjASTTestCase {
 
        public void testPropertyDescriptorsForDefaultTypePattern() {
                AjAST ajast = createAjAST();
-               DefaultTypePattern d = ajast.newDefaultTypePattern();
+               // DefaultTypePattern d =
+               ajast.newDefaultTypePattern();
                List props = DefaultTypePattern.propertyDescriptors(AST.JLS3);
                assertEquals("there should be no properties for the DefaultTypePattern", 0, props.size());
        }
@@ -314,7 +315,8 @@ public class AjASTTest extends AjASTTestCase {
 
        public void testPropertyDescriptorsForSignaturePattern() {
                AjAST ajast = createAjAST();
-               SignaturePattern p = ajast.newSignaturePattern();
+               // SignaturePattern p =
+               ajast.newSignaturePattern();
                List props = SignaturePattern.propertyDescriptors(AST.JLS3);
                assertEquals("there should be no properties for the DefaultTypePattern", 0, props.size());
        }
@@ -718,7 +720,8 @@ public class AjASTTest extends AjASTTestCase {
 
        public void testPropertyDescriptorsForAjTypeDeclaration() {
                AjAST ajast = createAjAST();
-               AjTypeDeclaration d = ajast.newAjTypeDeclaration();
+               // AjTypeDeclaration d =
+               ajast.newAjTypeDeclaration();
                List props = AjTypeDeclaration.propertyDescriptors(AST.JLS3);
                boolean foundAspect = false;
                for (Iterator iter = props.iterator(); iter.hasNext();) {