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;
}
}
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;
}
}
--- /dev/null
+/*
+ * 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");
+ }
+
+}
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, *;
--- /dev/null
+/*
+ * Created on Jan 12, 2005
+ */
+
+/**
+ * @author Mik Kersten
+ */
+public class NoMembers {
+
+}
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() {
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 = {
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);
}
--- /dev/null
+/*
+ * 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());
+ }
+
+}