]> source.dussan.org Git - aspectj.git/commitdiff
fix from comment #14 on bug 119453 to do with incorrect results for decp statements...
authoraclement <aclement>
Mon, 9 Jan 2006 11:31:40 +0000 (11:31 +0000)
committeraclement <aclement>
Mon, 9 Jan 2006 11:31:40 +0000 (11:31 +0000)
ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java
ajdoc/testdata/pr119453/src/pack/A.aj
ajdoc/testsrc/org/aspectj/tools/ajdoc/ITDTest.java

index c43e78f64ff6f37422a54ef102ea030ed15ffcb8..4b8b679cf4a5d83cf7c78ab2137bd5c4f22af22e 100644 (file)
@@ -704,6 +704,9 @@ class HtmlDecorator {
         */
        private static String generateModifierInformation(IProgramElement decl, boolean isDetails) {
                String intro = "";
+               if (decl.getKind().isDeclare()) {
+                       return intro + "</TT>";
+               }
                if (isDetails || 
                                !decl.getAccessibility().equals(IProgramElement.Accessibility.PUBLIC)) {
                        intro += "<TT>" + decl.getAccessibility().toString() + "&nbsp;" ;
index 2a4a61a9d6f11109c5baf15b226036683051a46b..21517b07fa1895bf0581f3fbad322bdee42fb39b 100644 (file)
@@ -4,6 +4,8 @@ public aspect A {
 
        private int C.y = 3;
 
+       declare warning : execution(* C.method()) : "warning..";
+       
        /**
         * blah
         */
index f2c3cd0add488318d611f39a2e3e9082357c5371..58da282a0273cd3f54743181b5896ca0906fdf69 100644 (file)
@@ -158,6 +158,7 @@ public class ITDTest extends TestCase {
                                boolean containsPublicString = false;
                                boolean containsITDFAsHeader = false;
                                boolean containsCorrectConstInfo = false;
+                               boolean containsPackageVoid = false;
                                // walk through the information in this section
                                String nextLine = readerA.readLine();
                                while(nextLine != null 
@@ -176,6 +177,9 @@ public class ITDTest extends TestCase {
                                        if (nextLine.indexOf("public&nbsp;</TT><B>C.C") != -1 ) {
                                                containsCorrectConstInfo = true;
                                        }
+                                       if (nextLine.indexOf("package&nbsp;void") != -1 ) {
+                                               containsPackageVoid = true;
+                                       }
                                        nextLine = readerA.readLine();
                                }
                                assertTrue("Declare detail summary should contain the 'private int' " +
@@ -186,6 +190,8 @@ public class ITDTest extends TestCase {
                                                containsITDFAsHeader);
                                assertTrue("Declare detail summary should have 'public C.C' for the " +
                                                "ITD constructor", containsCorrectConstInfo);
+                               assertFalse("Declare detail summary should not have 'package void' in it",
+                                               containsPackageVoid);
                                
                                // we may have hit the "inter-type field summary" so set this to 
                                // be the next line we look at.
@@ -196,6 +202,7 @@ public class ITDTest extends TestCase {
                                boolean containsInt = false;
                                boolean containsString = false;
                                boolean containsPublic = false;
+                               boolean containsPackageVoid = false;
                                // walk through the information in this section
                                String nextLine = readerA.readLine();
                                while(nextLine != null && (nextLine.indexOf("========") == -1)) {
@@ -211,12 +218,17 @@ public class ITDTest extends TestCase {
                                        if (nextLine.indexOf("String") != -1) {
                                                containsString = true;
                                        }
+                                       if (nextLine.indexOf("package&nbsp;void") != -1) {
+                                               containsPackageVoid = true;
+                                       }
                                        nextLine = readerA.readLine();
                                }
                                assertTrue("Declare summary should contain the 'private' modifier",containsPrivate);
                                assertTrue("Declare summary should contain the 'int' return type",containsInt);
                                assertFalse("Declare summary should not contain the 'public' modifier",containsPublic);
                                assertTrue("Declare summary should contain the 'String' return type",containsString);
+                               assertFalse("Declare summary should not have 'package void' in it",
+                                               containsPackageVoid);
                                
                                // we may have hit the "Declare Details" so set this to 
                                // be the next line we look at.