aboutsummaryrefslogtreecommitdiffstats
path: root/ajdoc
diff options
context:
space:
mode:
Diffstat (limited to 'ajdoc')
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java2
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java2
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java15
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java1
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java4
-rw-r--r--ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java13
-rw-r--r--ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java4
7 files changed, 10 insertions, 31 deletions
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java
index 41d13e37e..42d029e06 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java
@@ -897,7 +897,7 @@ class HtmlDecorator {
};
file.walk(walker);
- return (IProgramElement[]) nodes.toArray(new IProgramElement[nodes.size()]);
+ return (IProgramElement[]) nodes.toArray(new IProgramElement[0]);
}
/**
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java
index adf22bf12..e1bbd9ad4 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java
@@ -28,7 +28,7 @@ import javax.tools.ToolProvider;
*/
class JavadocRunner {
- public static void callJavadocViaToolProvider(Vector<String> options, List<String> files) {
+ public static void callJavadocViaToolProvider(Iterable<String> options, List<String> files) {
DocumentationTool doctool = ToolProvider.getSystemDocumentationTool();
StandardJavaFileManager fm = doctool.getStandardFileManager(null, null, null);
Iterable<? extends JavaFileObject> jfos = fm.getJavaFileObjects(files.toArray(new String[0]));
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 26857b41c..e65c8901f 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
@@ -22,14 +22,7 @@ import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.*;
import org.aspectj.asm.AsmManager;
import org.aspectj.bridge.IMessage;
@@ -164,7 +157,7 @@ public class Main implements Config {
* package-summary properly.
*/
private static void packageHTML(AsmManager model, File[] inputFiles) throws IOException {
- ArrayList<String> dirList = new ArrayList<>();
+ List<String> dirList = new ArrayList<>();
for (File inputFile : inputFiles) {
String packageName = StructureUtil.getPackageDeclarationFromFile(model, inputFile);
// Only copy the package.html file once.
@@ -262,9 +255,7 @@ public class Main implements Config {
javadocargs[numExtraArgs + options.size() + packageList.size() + k] = fileList.elementAt(k);
}
options = new Vector<>();
- for (String a: javadocargs) {
- options.add(a);
- }
+ Collections.addAll(options, javadocargs);
} else {
javadocargs = new String[options.size() + signatureFiles.length];
for (int k = 0; k < options.size(); k++) {
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java
index d4cdb9cd5..4db92d66a 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java
@@ -13,7 +13,6 @@ package org.aspectj.tools.ajdoc;
import java.io.File;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.aspectj.asm.AsmManager;
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java
index 4b9301ce8..64d7aebf2 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java
@@ -20,8 +20,8 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IProgramElement;
@@ -32,7 +32,7 @@ import org.aspectj.util.FileUtil;
*/
class StubFileGenerator {
- static Hashtable declIDTable = null;
+ static Map declIDTable = null;
static void doFiles(AsmManager model, Hashtable table, File[] inputFiles, File[] signatureFiles) throws DocException {
declIDTable = table;
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 6dfd5633f..acfb5eda4 100644
--- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java
+++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java
@@ -12,7 +12,6 @@ package org.aspectj.tools.ajdoc;
import java.io.File;
import java.io.IOException;
-import java.util.Iterator;
import java.util.List;
import org.aspectj.testing.util.TestUtil;
@@ -178,9 +177,7 @@ public abstract class AjdocTestCase extends TestCase {
args[3] = AjdocTests.ASPECTJRT_PATH.getPath();
args[4] = "-d";
args[5] = getAbsolutePathOutdir();
- for (int i = 0; i < ajOptions.length; i++) {
- args[6 + i] = ajOptions[i];
- }
+ System.arraycopy(ajOptions, 0, args, 6, ajOptions.length);
for (int i = 0; i < inputFiles.length; i++) {
args[6 + i + ajOptions.length] = inputFiles[i].getAbsolutePath();
}
@@ -252,9 +249,7 @@ public abstract class AjdocTestCase extends TestCase {
args[4] = getAbsolutePathOutdir();
args[5] = "-sourcepath";
args[6] = getAbsoluteProjectDir();
- for (int i = 0; i < directoryNames.length; i++) {
- args[7 + i] = directoryNames[i];
- }
+ System.arraycopy(directoryNames, 0, args, 7, directoryNames.length);
org.aspectj.tools.ajdoc.Main.main(args);
}
@@ -272,9 +267,7 @@ public abstract class AjdocTestCase extends TestCase {
args[3] = getAbsolutePathOutdir();
args[4] = "-sourcepath";
args[5] = getAbsoluteProjectDir();
- for (int i = 0; i < directoryNames.length; i++) {
- args[6 + i] = directoryNames[i];
- }
+ System.arraycopy(directoryNames, 0, args, 6, directoryNames.length);
org.aspectj.tools.ajdoc.Main.main(args);
}
diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java
index 787a4160d..2fbe19b44 100644
--- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java
+++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java
@@ -17,10 +17,6 @@ import java.io.File;
import org.aspectj.util.FileUtil;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
public class AjdocTests {//extends TestCase {
public static File ASPECTJRT_PATH;