aboutsummaryrefslogtreecommitdiffstats
path: root/ajdoc
diff options
context:
space:
mode:
Diffstat (limited to 'ajdoc')
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java21
-rw-r--r--ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java2
-rw-r--r--ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java6
3 files changed, 22 insertions, 7 deletions
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
index 313c1af3b..9d8b61140 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
@@ -28,6 +28,7 @@ import java.util.Collections;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
+import java.util.Locale;
import java.util.StringTokenizer;
import java.util.Vector;
@@ -280,10 +281,22 @@ public class Main implements Config {
files.add(StructureUtil.translateAjPathName(signatureFile.getCanonicalPath()));
}
}
- if (LangUtil.is9VMOrGreater()) {
- JavadocRunner.callJavadocViaToolProvider(options, files);
- } else {
- JavadocRunner.callJavadoc(javadocargs);
+ // Since JDK 20, the javadoc tool renders the surrounding HTML according to the JVM default locale. Section headers
+ // such as "Class", "Method Summary" will e.g. in German be named "Klasse", "Methodenübersicht". That would derail
+ // ajdoc, because it matches on English headers hard-codedly.
+ //
+ // The remedy is to temporarily change the JVM default locale while generating javadocs.
+ Locale defaultLocale = Locale.getDefault();
+ try {
+ Locale.setDefault(Locale.ENGLISH);
+ if (LangUtil.is9VMOrGreater()) {
+ JavadocRunner.callJavadocViaToolProvider(options, files);
+ } else {
+ JavadocRunner.callJavadoc(javadocargs);
+ }
+ }
+ finally {
+ Locale.setDefault(defaultLocale);
}
}
diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java
index 8bf87bb73..342435b4d 100644
--- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java
+++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java
@@ -13,6 +13,6 @@ package org.aspectj.tools.ajdoc;
*/
public class AJDocConstants {
- public final static String VERSION = "1.7";
+ public final static String VERSION = "11";
}
diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java
index 35916f030..e9ce22822 100644
--- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java
+++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java
@@ -167,7 +167,8 @@ public abstract class AjdocTestCase extends TestCase {
!sourceLevel.equals("1.7") &&
!sourceLevel.equals("1.8") &&
!sourceLevel.equals("1.9") &&
- !sourceLevel.equals("10")) {
+ !sourceLevel.startsWith("10") &&
+ !sourceLevel.startsWith("11")) {
fail("need to pass ajdoc '1.3' > '1.9' as the source level");
}
String[] args = new String[6 + inputFiles.length + ajOptions.length];
@@ -199,7 +200,8 @@ public abstract class AjdocTestCase extends TestCase {
!sourceLevel.equals("1.8") &&
!sourceLevel.equals("1.9") &&
!sourceLevel.startsWith("9") &&
- !sourceLevel.startsWith("10")) {
+ !sourceLevel.startsWith("10") &&
+ !sourceLevel.startsWith("11")) {
fail("need to pass suitable version to ajdoc as the source level");
}
if (inputFiles.length == 0) {