diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-10-06 17:35:51 -0700 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-10-06 17:35:51 -0700 |
commit | c8e951296c5f95e82d4c7c3f8eb9b0a647014e20 (patch) | |
tree | 2eaed5b80ad735e4c91e424098e35e221f4fea44 /ajdoc/src | |
parent | 102173fc11fc6648ed8f2283d3c5ad535e412c73 (diff) | |
download | aspectj-c8e951296c5f95e82d4c7c3f8eb9b0a647014e20.tar.gz aspectj-c8e951296c5f95e82d4c7c3f8eb9b0a647014e20.zip |
Fix 436653: conditional aspect activation plus various polish
Modified test expectation system so it is possible to say
the test cares about one particular message and the rest
do not matter (prefix message string with '*') - crude but
quick.
Polished many places to exploit generics
Upgraded all the tests to work on Java8 - some serious changes
regarding ajdoc on Java8. Hopefully it has stayed backwards
compatible with earlier JDK versions (e.g. if using AspectJ 1.8.3+
with a JDK less than 8) but no explicit testing done for this.
Diffstat (limited to 'ajdoc/src')
-rw-r--r-- | ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java index bad35529f..04af19f2d 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -224,7 +224,20 @@ class HtmlDecorator { classStartIndex = fileContents.toString().indexOf("<H2>\nClass "); br = false; } - if (classStartIndex != -1) { + if (classStartIndex == -1) { + // Java8 looks more like this: + // <h2 title="Class A" class="title">Class A</h2> + classStartIndex = fileContents.toString().indexOf("<h2 title=\"Class "); + int classEndIndex = fileContents.toString().indexOf("</h2>", classStartIndex); + if (classEndIndex != -1) { + // Convert it to "<h2 title="Aspect A" class="title">Aspect A</h2>" + String classLine = fileContents.toString().substring(classStartIndex, classEndIndex); + String aspectLine = classLine.replaceAll("Class ","Aspect "); + fileContents.delete(classStartIndex, classEndIndex); + fileContents.insert(classStartIndex, aspectLine); + } + } + else if (classStartIndex != -1) { int classEndIndex = fileContents.toString().indexOf("</H2>", classStartIndex); if (classStartIndex != -1 && classEndIndex != -1) { String classLine = fileContents.toString().substring(classStartIndex, classEndIndex); @@ -249,6 +262,19 @@ class HtmlDecorator { fileContents.insert(secondClassStartIndex, sb.toString()); } } + else { + // Java8: + // <pre>static class <span class="typeNameLabel">ClassA.InnerAspect</span> + classStartIndex = fileContents.toString().indexOf("class <span class=\"typeNameLabel\">"); + int classEndIndex = fileContents.toString().indexOf("</span>", classStartIndex); + if (classEndIndex != -1) { + // Convert it to "aspect <span class="typeNameLabel">ClassA.InnerAspect</span>" + String classLine = fileContents.toString().substring(classStartIndex, classEndIndex); + String aspectLine = "aspect"+fileContents.substring(classStartIndex+5,classEndIndex); + fileContents.delete(classStartIndex, classEndIndex); + fileContents.insert(classStartIndex, aspectLine); + } + } } } file.delete(); |