From 3cadffc3529d94894dfa955497edcfae257c95a6 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 9 Jan 2006 11:31:40 +0000 Subject: [PATCH] fix from comment #14 on bug 119453 to do with incorrect results for decp statements. (from helen) --- ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java | 3 +++ ajdoc/testdata/pr119453/src/pack/A.aj | 2 ++ ajdoc/testsrc/org/aspectj/tools/ajdoc/ITDTest.java | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java index c43e78f64..4b8b679cf 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -704,6 +704,9 @@ class HtmlDecorator { */ private static String generateModifierInformation(IProgramElement decl, boolean isDetails) { String intro = ""; + if (decl.getKind().isDeclare()) { + return intro + ""; + } if (isDetails || !decl.getAccessibility().equals(IProgramElement.Accessibility.PUBLIC)) { intro += "" + decl.getAccessibility().toString() + " " ; diff --git a/ajdoc/testdata/pr119453/src/pack/A.aj b/ajdoc/testdata/pr119453/src/pack/A.aj index 2a4a61a9d..21517b07f 100644 --- a/ajdoc/testdata/pr119453/src/pack/A.aj +++ b/ajdoc/testdata/pr119453/src/pack/A.aj @@ -4,6 +4,8 @@ public aspect A { private int C.y = 3; + declare warning : execution(* C.method()) : "warning.."; + /** * blah */ diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/ITDTest.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/ITDTest.java index f2c3cd0ad..58da282a0 100644 --- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/ITDTest.java +++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/ITDTest.java @@ -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 C.C") != -1 ) { containsCorrectConstInfo = true; } + if (nextLine.indexOf("package 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 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. -- 2.39.5