aboutsummaryrefslogtreecommitdiffstats
path: root/ajdoc
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-13 01:01:58 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-13 01:01:58 +0200
commite1bff9a5703baf17ec650b173bdfe776bf87125f (patch)
tree8b4443759c231a6c46cb70c755fe554a4b621e11 /ajdoc
parentb6eee2e1052116aa22ebbd3c2baf05c2b709bee5 (diff)
downloadaspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.tar.gz
aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.zip
Use the diamond operator where possible
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'ajdoc')
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java8
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java26
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java6
-rw-r--r--ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java4
4 files changed, 22 insertions, 22 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 44708bb01..41d13e37e 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java
@@ -48,7 +48,7 @@ class HtmlDecorator {
private static final String ITD_FIELD_SUMMARY = "Inter-Type Field Summary";
private static final String ITD_CONSTRUCTOR_SUMMARY = "Inter-Type Constructor Summary";
- static List<String> visibleFileList = new ArrayList<String>();
+ static List<String> visibleFileList = new ArrayList<>();
static Hashtable declIDTable = null;
static File rootDir = null;
static String docVisibilityModifier;
@@ -295,9 +295,9 @@ class HtmlDecorator {
}
static void addAspectDocumentation(IProgramElement node, StringBuffer fileBuffer, int index) {
- List<IProgramElement> pointcuts = new ArrayList<IProgramElement>();
- List<IProgramElement> advice = new ArrayList<IProgramElement>();
- List<IProgramElement> declares = new ArrayList<IProgramElement>();
+ List<IProgramElement> pointcuts = new ArrayList<>();
+ List<IProgramElement> advice = new ArrayList<>();
+ List<IProgramElement> declares = new ArrayList<>();
List<IProgramElement> methodsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_METHOD);
if (methodsDeclaredOn != null && !methodsDeclaredOn.isEmpty()) {
insertDeclarationsSummary(fileBuffer, methodsDeclaredOn, ITD_METHOD_SUMMARY, index);
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 0f01a058f..2b2a24a26 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
@@ -86,13 +86,13 @@ public class Main implements Config {
private static String outputWorkingDir = Config.WORKING_DIR;
public static void clearState() {
- options = new Vector<String>();
- ajcOptions = new Vector<String>();
- filenames = new Vector<String>();
- fileList = new Vector<String>();
- packageList = new Vector<String>();
+ options = new Vector<>();
+ ajcOptions = new Vector<>();
+ filenames = new Vector<>();
+ fileList = new Vector<>();
+ packageList = new Vector<>();
docModifier = "package";
- sourcepath = new Vector<String>();
+ sourcepath = new Vector<>();
verboseMode = false;
packageMode = false;
rootDir = null;
@@ -170,7 +170,7 @@ public class Main implements Config {
* package-summary properly.
*/
private static void packageHTML(AsmManager model, File[] inputFiles) throws IOException {
- ArrayList<String> dirList = new ArrayList<String>();
+ ArrayList<String> dirList = new ArrayList<>();
for (File inputFile : inputFiles) {
String packageName = StructureUtil.getPackageDeclarationFromFile(model, inputFile);
// Only copy the package.html file once.
@@ -239,7 +239,7 @@ public class Main implements Config {
System.out.println("> Calling javadoc...");
String[] javadocargs = null;
- List<String> files = new ArrayList<String>();
+ List<String> files = new ArrayList<>();
if (packageMode) {
int numExtraArgs = 2;
if (authorStandardDocletSwitch)
@@ -268,7 +268,7 @@ public class Main implements Config {
javadocargs[numExtraArgs + options.size() + packageList.size() + k] = fileList.elementAt(k);
}
if (LangUtil.is19VMOrGreater()) {
- options = new Vector<String>();
+ options = new Vector<>();
for (String a: javadocargs) {
options.add(a);
}
@@ -362,7 +362,7 @@ public class Main implements Config {
}
static Vector<String> getSourcePath() {
- Vector<String> sourcePath = new Vector<String>();
+ Vector<String> sourcePath = new Vector<>();
boolean found = false;
for (int i = 0; i < options.size(); i++) {
String currOption = options.elementAt(i);
@@ -471,7 +471,7 @@ public class Main implements Config {
String line = "";
line = br.readLine();
StringTokenizer st = new StringTokenizer(line, " ");
- List<String> argList = new ArrayList<String>();
+ List<String> argList = new ArrayList<>();
while (st.hasMoreElements()) {
argList.add(st.nextToken());
}
@@ -490,7 +490,7 @@ public class Main implements Config {
ioe.printStackTrace();
}
}
- List<String> vargs = new LinkedList<String>(Arrays.asList(args));
+ List<String> vargs = new LinkedList<>(Arrays.asList(args));
vargs.add("-Xset:minimalModel=false");
parseArgs(vargs, new File(".")); // !!!
@@ -722,7 +722,7 @@ public class Main implements Config {
}
static void expandAtSignFile(String filename, File currentWorkingDir) {
- List<String> result = new LinkedList<String>();
+ List<String> result = new LinkedList<>();
File atFile = qualifiedFile(filename, currentWorkingDir);
String atFileParent = atFile.getParent();
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 2fdd95698..d4cdb9cd5 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java
@@ -42,7 +42,7 @@ public class StructureUtil {
* @return null if a relationship of that kind is not found
*/
public static List<String> getTargets(IProgramElement node, IRelationship.Kind kind, String relName) {
- List<IRelationship> relations = new ArrayList<IRelationship>();
+ List<IRelationship> relations = new ArrayList<>();
List<IRelationship> rels = node.getModel().getRelationshipMap().get(node);
if (rels != null) {
relations.addAll(rels);
@@ -64,7 +64,7 @@ public class StructureUtil {
}
if (relations == null || relations.isEmpty())
return null;
- List<String> targets = new ArrayList<String>();
+ List<String> targets = new ArrayList<>();
for (IRelationship rtn : relations) {
if (rtn.getKind().equals(kind) && ((relName != null && relName.equals(rtn.getName())) || relName == null)) {
List<String> targs = rtn.getTargets();
@@ -79,7 +79,7 @@ public class StructureUtil {
}
static List<IProgramElement> getDeclareInterTypeTargets(IProgramElement node, IProgramElement.Kind kind) {
- List<IProgramElement> targets = new ArrayList<IProgramElement>();
+ List<IProgramElement> targets = new ArrayList<>();
List<String> stringTargets = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE);
if (stringTargets == null) {
return null;
diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java
index 797c76660..431018401 100644
--- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java
+++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java
@@ -60,7 +60,7 @@ public class AjdocOutputChecker {
* @throws Exception
*/
public static List<String> getMissingStringsInFile(File htmlFile, String[] requiredStrings) throws Exception {
- List<String> missingStrings = new ArrayList<String>();
+ List<String> missingStrings = new ArrayList<>();
for (String string : requiredStrings) {
if (!containsString(htmlFile, string)) {
missingStrings.add(string);
@@ -120,7 +120,7 @@ public class AjdocOutputChecker {
*/
public static List<String> getMissingStringsInSection(File htmlFile,
String[] requiredStrings, String sectionHeader) throws Exception {
- List<String> missingStrings = new ArrayList<String>();
+ List<String> missingStrings = new ArrayList<>();
for (String string : requiredStrings) {
if (!containsStringWithinSection(htmlFile, string, sectionHeader)) {
missingStrings.add(string);