diff options
author | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-13 01:01:58 +0200 |
---|---|---|
committer | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-13 01:01:58 +0200 |
commit | e1bff9a5703baf17ec650b173bdfe776bf87125f (patch) | |
tree | 8b4443759c231a6c46cb70c755fe554a4b621e11 /ajde | |
parent | b6eee2e1052116aa22ebbd3c2baf05c2b709bee5 (diff) | |
download | aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.tar.gz aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.zip |
Use the diamond operator where possible
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'ajde')
6 files changed, 16 insertions, 16 deletions
diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java index 7eb195716..9f0d1c818 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java @@ -24,8 +24,8 @@ import org.aspectj.ajdt.ajc.ConfigParser; */ public class LstBuildConfigFileParser extends ConfigParser { - private List<File> importedFiles = new ArrayList<File>(); - private List<String> problemEntries = new ArrayList<String>(); + private List<File> importedFiles = new ArrayList<>(); + private List<String> problemEntries = new ArrayList<>(); // private String currFilePath; diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java index 4e59e5d74..4ca7316f4 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java @@ -100,7 +100,7 @@ class LstBuildConfigFileUpdater { null); Ajde.getDefault().getMessageHandler().handleMessage(msg); } - List<String> fileContents = new ArrayList<String>(); + List<String> fileContents = new ArrayList<>(); BufferedReader reader = new BufferedReader(new FileReader(configFile)); String line = reader.readLine(); while (line != null) { @@ -146,13 +146,13 @@ class LstBuildConfigFileUpdater { ConfigParser configParser = new ConfigParser(); configParser.parseConfigFile(new File(path)); List<File> files = configParser.getFiles(); - List<String> relativeFiles = new ArrayList<String>(); + List<String> relativeFiles = new ArrayList<>(); for (File file : files) { relativeFiles.add(relativizePath(file.getPath(), rootPath)); } return relativeFiles; } catch (ConfigParser.ParseException pe) { - return new ArrayList<String>(); + return new ArrayList<>(); } } diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java index feda7df0c..cde164cc1 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java @@ -39,7 +39,7 @@ public class LstBuildConfigManager implements BuildConfigManager { private List<String> allBuildConfigFiles; - private List<BuildConfigListener> listeners = new ArrayList<BuildConfigListener>(); + private List<BuildConfigListener> listeners = new ArrayList<>(); private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater(); protected String currConfigFilePath = null; @@ -63,8 +63,8 @@ public class LstBuildConfigManager implements BuildConfigManager { String rootPath = configFile.getParent(); String configFileName = configFile.getName(); BuildConfigModel model = new BuildConfigModel(configFilePath); - List<File> configFiles = new ArrayList<File>(); - List<File> importedFiles = new ArrayList<File>(); + List<File> configFiles = new ArrayList<>(); + List<File> importedFiles = new ArrayList<>(); List<String> badEntries = null; try { LstBuildConfigFileParser configParser = new LstBuildConfigFileParser(configFilePath); @@ -134,7 +134,7 @@ public class LstBuildConfigManager implements BuildConfigManager { } private List<String> relativizeFilePaths(List<File> configFiles, String rootPath) { - List<String> relativePathsList = new ArrayList<String>(); + List<String> relativePathsList = new ArrayList<>(); for (File file : configFiles) { relativePathsList.add(fileUpdater.relativizePath(file.getPath(), rootPath)); } @@ -308,7 +308,7 @@ public class LstBuildConfigManager implements BuildConfigManager { @Override public List<String> getAllBuildConfigFiles() { if (allBuildConfigFiles == null) { - allBuildConfigFiles = new ArrayList<String>(); + allBuildConfigFiles = new ArrayList<>(); if (getActiveConfigFile() != null) { allBuildConfigFiles.add(getActiveConfigFile()); } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java index 560766bf6..659ada21d 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java @@ -71,7 +71,7 @@ public class BuildConfigModel { } public List<BuildConfigNode> getActiveNodes(BuildConfigNode.Kind kind) { - List<BuildConfigNode> nodes = new ArrayList<BuildConfigNode>(); + List<BuildConfigNode> nodes = new ArrayList<>(); getActiveNodesHelper(root, kind, nodes); return nodes; } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java index 73e0bead0..06749bf23 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java @@ -33,7 +33,7 @@ public class BuildConfigNode { protected String name = ""; protected Kind kind; // children.listIterator() should support remove() operation - protected List<BuildConfigNode> children = new ArrayList<BuildConfigNode>(); + protected List<BuildConfigNode> children = new ArrayList<>(); protected IMessage message = null; protected ISourceLocation sourceLocation = null; @@ -78,7 +78,7 @@ public class BuildConfigNode { public void addChild(BuildConfigNode child) { if (children == null) { - children = new ArrayList<BuildConfigNode>(); + children = new ArrayList<>(); } children.add(child); child.setParent(this); @@ -86,7 +86,7 @@ public class BuildConfigNode { public void addChild(int position, BuildConfigNode child) { if (children == null) { - children = new ArrayList<BuildConfigNode>(); + children = new ArrayList<>(); } children.add(position, child); child.setParent(this); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java index 86f7a5025..0e7e09abc 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java @@ -103,7 +103,7 @@ public class JavaDebugOptionsPanel extends OptionsPanel { JComboBox<String> debug = null; if (javaOptionToSet.equals(JavaOptions.PRESERVE_ALL_LOCALS)) { - debug = new JComboBox<String>(preserveOptions); + debug = new JComboBox<>(preserveOptions); String value = javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet); if (value.equals(JavaOptions.PRESERVE)) { debug.setSelectedIndex(0); @@ -111,7 +111,7 @@ public class JavaDebugOptionsPanel extends OptionsPanel { debug.setSelectedIndex(1); } } else { - debug = new JComboBox<String>(debugOptions); + debug = new JComboBox<>(debugOptions); String value = javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet); if (value.equals(JavaOptions.GENERATE)) { debug.setSelectedIndex(0); |