summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java19
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/Util.java16
-rw-r--r--ajdoc/testdata/coverage/foo/ModelCoverage.java2
-rw-r--r--ajdoc/testdata/coverage/foo/NoMembers.java10
-rw-r--r--ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java34
-rw-r--r--ajdoc/testsrc/org/aspectj/tools/ajdoc/JDKVersionTest.java23
6 files changed, 78 insertions, 26 deletions
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java
index f189b6c61..43d7b1851 100644
--- a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java
@@ -401,11 +401,12 @@ class HtmlDecorator {
String MARKER_2 = "<!-- ======== CONSTRUCTOR SUMMARY ======== -->";
int index1 = fbs.indexOf(MARKER_1, index);
int index2 = fbs.indexOf(MARKER_2, index);
- if (index1 < index2) {
+ if (index1 < index2 && index1 != -1) {
return index1;
- }
- else {
+ } else if (index2 != -1){
return index2;
+ } else {
+ return index;
}
}
@@ -416,15 +417,15 @@ class HtmlDecorator {
String MARKER_3 = "<!-- ============ METHOD DETAIL ========== -->";
int index1 = fbs.indexOf(MARKER_1, index);
int index2 = fbs.indexOf(MARKER_2, index);
- int index3 = fbs.indexOf(MARKER_3, index);
- if (index1 < index2 && index1 < index3) {
+ int index3 = fbs.indexOf(MARKER_3, index);
+ if (index1 != -1 && index1 < index2 && index1 < index3) {
return index1;
- }
- else if (index2 < index1 && index2 < index3) {
+ } else if (index2 != -1 && index2 < index1 && index2 < index3) {
return index2;
- }
- else {
+ } else if (index3 != -1) {
return index3;
+ } else {
+ return index;
}
}
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/Util.java b/ajdoc/src/org/aspectj/tools/ajdoc/Util.java
new file mode 100644
index 000000000..e3c53f301
--- /dev/null
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/Util.java
@@ -0,0 +1,16 @@
+/*
+ * Created on Jan 12, 2005
+ */
+package org.aspectj.tools.ajdoc;
+
+/**
+ * @author Mik Kersten
+ */
+public class Util {
+
+ public static boolean isExecutingOnJava5() {
+ String version = System.getProperty("java.class.version","44.0");
+ return version.equals("49.0");
+ }
+
+}
diff --git a/ajdoc/testdata/coverage/foo/ModelCoverage.java b/ajdoc/testdata/coverage/foo/ModelCoverage.java
index 5c14055c6..b05d7bc72 100644
--- a/ajdoc/testdata/coverage/foo/ModelCoverage.java
+++ b/ajdoc/testdata/coverage/foo/ModelCoverage.java
@@ -119,7 +119,7 @@ aspect DeclareCoverage {
declare warning: call(* Point.setX(..)): "Illegal call.";
declare parents: Point extends java.io.Serializable;
- declare parents: Point+ implements java.util.Observable;
+// declare parents: Point+ implements java.util.Observable;
declare parents: Point && Line implements java.util.Observable;
declare soft: SizeException : call(* Point.getX());
declare precedence: AdviceCoverage, InterTypeDecCoverage, *;
diff --git a/ajdoc/testdata/coverage/foo/NoMembers.java b/ajdoc/testdata/coverage/foo/NoMembers.java
new file mode 100644
index 000000000..d8dfcb3ce
--- /dev/null
+++ b/ajdoc/testdata/coverage/foo/NoMembers.java
@@ -0,0 +1,10 @@
+/*
+ * Created on Jan 12, 2005
+ */
+
+/**
+ * @author Mik Kersten
+ */
+public class NoMembers {
+
+}
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
index 25182eaf7..34f22a03d 100644
--- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
+++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
@@ -33,7 +33,8 @@ public class CoverageTestCase extends TestCase {
File file7 = new File("testdata/coverage/fluffy/bunny/rocks/Rocks.java");
File file8 = new File("testdata/coverage/fluffy/bunny/rocks/UseThisAspectForLinkCheckToo.java");
File file9 = new File("testdata/coverage/foo/PkgVisibleClass.java");
-
+ File file10 = new File("testdata/coverage/foo/NoMembers.java");
+
File outdir = new File("testdata/coverage/doc");
public void testOptions() {
@@ -54,6 +55,20 @@ public class CoverageTestCase extends TestCase {
assertTrue(true);
}
+ public void testCoveragePublicMode() {
+ outdir.delete();
+ String[] args = {
+ "-public",
+ "-source",
+ "1.4",
+ "-d",
+ outdir.getAbsolutePath(),
+ file3.getAbsolutePath(),
+ file9.getAbsolutePath()
+ };
+ org.aspectj.tools.ajdoc.Main.main(args);
+ }
+
public void testCoverage() {
outdir.delete();
String[] args = {
@@ -73,21 +88,8 @@ public class CoverageTestCase extends TestCase {
file6.getAbsolutePath(),
file7.getAbsolutePath(),
file8.getAbsolutePath(),
- file9.getAbsolutePath()
- };
- org.aspectj.tools.ajdoc.Main.main(args);
- }
-
- public void testCoveragePublicMode() {
- outdir.delete();
- String[] args = {
- "-public",
- "-source",
- "1.4",
- "-d",
- outdir.getAbsolutePath(),
- file3.getAbsolutePath(),
- file9.getAbsolutePath()
+ file9.getAbsolutePath(),
+ file10.getAbsolutePath()
};
org.aspectj.tools.ajdoc.Main.main(args);
}
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/JDKVersionTest.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/JDKVersionTest.java
new file mode 100644
index 000000000..9e8b06b5f
--- /dev/null
+++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/JDKVersionTest.java
@@ -0,0 +1,23 @@
+/*
+ * Created on Jan 12, 2005
+ */
+package org.aspectj.tools.ajdoc;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Mik Kersten
+ */
+public class JDKVersionTest extends TestCase {
+
+// public void testIsUsing1point4() {
+// String v = System.getProperty("java.class.version","44.0");
+// assertTrue(("49.0".compareTo(v) > 0) && ("48.0".compareTo(v) <= 0));
+// assertFalse(Util.isExecutingOnJava5());
+// }
+
+ public void testIsUsing1point5() {
+ assertTrue(Util.isExecutingOnJava5());
+ }
+
+}