aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-18 10:33:07 +0000
committeraclement <aclement>2004-08-18 10:33:07 +0000
commit5b902242b00ffaf3105335f231e45291e7d09320 (patch)
tree4d9bff2b8bd2a1beb1385d9e45c99509c6637415
parent8837d683dc44f6c380b25359d7ce90b9a17e8a66 (diff)
downloadaspectj-5b902242b00ffaf3105335f231e45291e7d09320.tar.gz
aspectj-5b902242b00ffaf3105335f231e45291e7d09320.zip
Fix for Bugzilla Bug 71076
Missing Javadoc comments that aren't missing
-rw-r--r--org.aspectj.ajdt.core/testdata/javadoc/World.java84
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java1
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java74
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj-src.zipbin3832874 -> 3833250 bytes
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj.jarbin4280016 -> 4280493 bytes
5 files changed, 159 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/testdata/javadoc/World.java b/org.aspectj.ajdt.core/testdata/javadoc/World.java
new file mode 100644
index 000000000..28591bb2b
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/javadoc/World.java
@@ -0,0 +1,84 @@
+// In this class we use all the constructs and attach javadoc to them all - checking
+// that the compiler doesnt complain that any javadoc is missing.
+
+/**
+ * A comment
+ * @see AspectJavadocComment
+ */
+public aspect World {
+
+ public void test0() {}
+
+ /**
+ * A comment
+ * @see PointcutJavadocComment1
+ */
+ pointcut firstPC() : execution(* *.sayHello(..));
+
+ public void test1() {}
+
+ /**
+ * A comment
+ * @see AfterReturningJavadocComment
+ */
+ after() returning : firstPC() {
+ System.out.println("world");
+ }
+
+ public void test2(){}
+
+ /**
+ * comment2
+ * @see PointcutJavadocComment2
+ */
+ public pointcut secondPC(): execution(* *(..));
+
+ public void test3(){}
+
+ /**
+ * I am a comment attached to a warning
+ * @see declarewarningJavadocComment
+ */
+ declare warning: call(* *elephant*(..)) : "I am a warning";
+
+ public void test4() {}
+
+ /**
+ * comment attached to around advice
+ * @see AroundAdviceJavadocComment
+ */
+ void around(): call(* *abc*(..)) {
+ }
+
+ public void test5() {}
+
+ /**
+ * ITD method attached comment
+ * @see IntertypeMethodComment
+ */
+ public void X.method() { }
+
+ public void test6() {}
+
+ /**
+ * ITD field attached comment
+ * @see IntertypeFieldComment
+ */
+ public int X.i;
+
+ public int test7;
+
+ static class X {
+
+ }
+
+}
+
+// to keep the javadoc processor happy ...
+class AspectJavadocComment {}
+class PointcutJavadocComment1 {}
+class PointcutJavadocComment2 {}
+class AfterReturningJavadocComment {}
+class AroundAdviceJavadocComment {}
+class IntertypeMethodComment {}
+class IntertypeFieldComment {} \ No newline at end of file
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java
index 80710268c..5f9d266a9 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java
@@ -29,6 +29,7 @@ public class AjdtBatchTests extends TestCase {
suite.addTestSuite(PerformanceTestCase.class);
suite.addTestSuite(ImageTestCase.class);
suite.addTestSuite(MultipleCompileTestCase.class);
+ suite.addTestSuite(JavadocTest.class);
// XXX suite.addTestSuite(VerifyWeaveTestCase.class);
//suite.addTestSuite(WorkingCommandTestCase.class);
//$JUnit-END$
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java
new file mode 100644
index 000000000..957e0458c
--- /dev/null
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial implementation
+ *******************************************************************************/
+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";
+
+ 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);
+ }
+ }
+}
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
index 3e7018819..f41d84e60 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
index 004291532..4c486ebb9 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
Binary files differ