aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java2
-rw-r--r--ajdoc/testdata/coverage/InDefaultPackage.java13
-rw-r--r--ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java4
3 files changed, 17 insertions, 2 deletions
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java b/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
index 330029099..ef5fdbf8d 100644
--- a/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
@@ -46,7 +46,7 @@ class StubFileGenerator {
String packageName = StructureUtil.getPackageDeclarationFromFile(inputFile);
- if (packageName != null ) {
+ if (packageName != null && packageName != "") {
writer.println( "package " + packageName + ";" );
}
diff --git a/ajdoc/testdata/coverage/InDefaultPackage.java b/ajdoc/testdata/coverage/InDefaultPackage.java
new file mode 100644
index 000000000..46c48b088
--- /dev/null
+++ b/ajdoc/testdata/coverage/InDefaultPackage.java
@@ -0,0 +1,13 @@
+
+/**
+ * Test class. This is a comment.
+ */
+public abstract class InDefaultPackage {
+
+ /**
+ * Mumble field.
+ */
+ public String mumble = "xxx";
+ public int pubfield;
+ private String privfield = "mumble";
+} \ No newline at end of file
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
index b3382ca0e..8b7df063e 100644
--- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
+++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
@@ -25,6 +25,7 @@ public class CoverageTestCase extends TestCase {
public void testCoverage() {
// System.err.println(new File("testdata/figures-demo").exists());
+ File file0 = new File("testdata/coverage/InDefaultPackage.java");
File file1 = new File("testdata/coverage/foo/ClassA.java");
File aspect1 = new File("testdata/coverage/foo/UseThisAspectForLinkCheck.aj");
File file2 = new File("testdata/coverage/foo/InterfaceI.java");
@@ -43,7 +44,8 @@ public class CoverageTestCase extends TestCase {
"-private",
"-d",
outdir.getAbsolutePath(),
- aspect1.getAbsolutePath(),
+ aspect1.getAbsolutePath(),
+ file0.getAbsolutePath(),
file1.getAbsolutePath(),
file2.getAbsolutePath(),
file3.getAbsolutePath(),