Skip to content

Commit bd7e765

Browse files
committed
Removed redundant type specifiers for generics
1 parent 72a1d92 commit bd7e765

File tree

22 files changed

+52
-52
lines changed

22 files changed

+52
-52
lines changed

app/src/cc/arduino/view/Event.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class Event extends ActionEvent {
3939

4040
public Event(Object source, int id, String command) {
4141
super(source, id, command);
42-
this.payload = new HashMap<String, Object>();
42+
this.payload = new HashMap<>();
4343
}
4444

4545
public Map<String, Object> getPayload() {

app/src/processing/app/Base.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public class Base {
8585
public static volatile Base INSTANCE;
8686

8787
public static SplashScreenHelper splashScreenHelper = new SplashScreenHelper(SplashScreen.getSplashScreen());
88-
public static Map<String, Object> FIND_DIALOG_STATE = new HashMap<String, Object>();
88+
public static Map<String, Object> FIND_DIALOG_STATE = new HashMap<>();
8989
private final ContributionInstaller contributionInstaller;
9090
private final LibraryInstaller libraryInstaller;
9191
private ContributionsSelfCheck contributionsSelfCheck;
@@ -266,7 +266,7 @@ static public File absoluteFile(String path) {
266266

267267
public Base(String[] args) throws Exception {
268268
BaseNoGui.notifier = new GUIUserNotifier(this);
269-
this.recentSketchesMenuItems = new LinkedList<JMenuItem>();
269+
this.recentSketchesMenuItems = new LinkedList<>();
270270

271271
CommandlineParser parser = new CommandlineParser(args);
272272
parser.parseArgumentsPhase1();
@@ -584,15 +584,15 @@ protected void storeRecentSketches(SketchController sketch) {
584584
return;
585585
}
586586

587-
Set<String> sketches = new LinkedHashSet<String>();
587+
Set<String> sketches = new LinkedHashSet<>();
588588
sketches.add(sketch.getSketch().getMainFilePath());
589589
sketches.addAll(PreferencesData.getCollection("recent.sketches"));
590590

591591
PreferencesData.setCollection("recent.sketches", sketches);
592592
}
593593

594594
protected void removeRecentSketchPath(String path) {
595-
Collection<String> sketches = new LinkedList<String>(PreferencesData.getCollection("recent.sketches"));
595+
Collection<String> sketches = new LinkedList<>(PreferencesData.getCollection("recent.sketches"));
596596
sketches.remove(path);
597597
PreferencesData.setCollection("recent.sketches", sketches);
598598
}
@@ -1049,7 +1049,7 @@ protected void rebuildSketchbookMenu(JMenu menu) {
10491049
}
10501050

10511051
private List<ContributedLibrary> getSortedLibraries() {
1052-
List<ContributedLibrary> installedLibraries = new LinkedList<ContributedLibrary>(BaseNoGui.librariesIndexer.getInstalledLibraries());
1052+
List<ContributedLibrary> installedLibraries = new LinkedList<>(BaseNoGui.librariesIndexer.getInstalledLibraries());
10531053
Collections.sort(installedLibraries, new LibraryByTypeComparator());
10541054
Collections.sort(installedLibraries, new LibraryOfSameTypeComparator());
10551055
return installedLibraries;
@@ -1415,7 +1415,7 @@ public void actionPerformed(ActionEvent actionevent) {
14151415
boardMenu.add(new JSeparator());
14161416

14171417
// Generate custom menus for all platforms
1418-
Set<String> customMenusTitles = new HashSet<String>();
1418+
Set<String> customMenusTitles = new HashSet<>();
14191419
for (TargetPackage targetPackage : BaseNoGui.packages.values()) {
14201420
for (TargetPlatform targetPlatform : targetPackage.platforms()) {
14211421
customMenusTitles.addAll(targetPlatform.getCustomMenus().values());
@@ -1427,10 +1427,10 @@ public void actionPerformed(ActionEvent actionevent) {
14271427
boardsCustomMenus.add(customMenu);
14281428
}
14291429

1430-
List<JMenuItem> menuItemsToClickAfterStartup = new LinkedList<JMenuItem>();
1430+
List<JMenuItem> menuItemsToClickAfterStartup = new LinkedList<>();
14311431

14321432
ButtonGroup boardsButtonGroup = new ButtonGroup();
1433-
Map<String, ButtonGroup> buttonGroupsMap = new HashMap<String, ButtonGroup>();
1433+
Map<String, ButtonGroup> buttonGroupsMap = new HashMap<>();
14341434

14351435
// Cycle through all packages
14361436
boolean first = true;
@@ -2129,7 +2129,7 @@ static public byte[] loadBytesRaw(File file) throws IOException {
21292129
* that are separated by = and ignore comments with #.
21302130
*/
21312131
static public HashMap<String, String> readSettings(File inputFile) {
2132-
HashMap<String, String> outgoing = new HashMap<String, String>();
2132+
HashMap<String, String> outgoing = new HashMap<>();
21332133
if (!inputFile.exists()) return outgoing; // return empty hash
21342134

21352135
String lines[] = PApplet.loadStrings(inputFile);

app/src/processing/app/Editor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public void windowActivated(WindowEvent e) {
230230
public void windowDeactivated(WindowEvent e) {
231231
fileMenu.remove(sketchbookMenu);
232232
fileMenu.remove(examplesMenu);
233-
List<Component> toolsMenuItemsToRemove = new LinkedList<Component>();
233+
List<Component> toolsMenuItemsToRemove = new LinkedList<>();
234234
for (Component menuItem : toolsMenu.getMenuComponents()) {
235235
if (menuItem instanceof JComponent) {
236236
Object removeOnWindowDeactivation = ((JComponent) menuItem).getClientProperty("removeOnWindowDeactivation");
@@ -816,7 +816,7 @@ private void addTools(JMenu menu, File sourceFolder) {
816816
if (sourceFolder == null)
817817
return;
818818

819-
Map<String, JMenuItem> toolItems = new HashMap<String, JMenuItem>();
819+
Map<String, JMenuItem> toolItems = new HashMap<>();
820820

821821
File[] folders = sourceFolder.listFiles(new FileFilter() {
822822
public boolean accept(File folder) {
@@ -906,7 +906,7 @@ public void actionPerformed(ActionEvent e) {
906906
e.printStackTrace();
907907
}
908908
}
909-
ArrayList<String> toolList = new ArrayList<String>(toolItems.keySet());
909+
ArrayList<String> toolList = new ArrayList<>(toolItems.keySet());
910910
if (toolList.size() == 0) return;
911911

912912
menu.addSeparator();

app/src/processing/app/PresentMode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class PresentMode {
5959
devices = environment.getScreenDevices();
6060
GraphicsDevice defaultDevice = environment.getDefaultScreenDevice();
6161

62-
Vector<String> names = new Vector<String>();
62+
Vector<String> names = new Vector<>();
6363
for (int i = 0; i < devices.length; i++) {
6464
String name = String.valueOf(i + 1);
6565
if (devices[i] == defaultDevice) {

app/src/processing/app/SerialPlotter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public SerialPlotter(BoardPort port) {
185185
});
186186

187187
messageBuffer = new StringBuffer();
188-
graphs = new ArrayList<Graph>();
188+
graphs = new ArrayList<>();
189189
}
190190

191191
protected void onCreateWindow(Container mainPane) {

app/src/processing/app/Theme.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,12 @@ public static Map<String, Object> getStyledFont(String what, Font font) {
228228
Font styledFont = new Font(font.getFamily(),
229229
(bold ? Font.BOLD : 0) | (italic ? Font.ITALIC : 0), font.getSize());
230230
if (underlined) {
231-
Map<TextAttribute, Object> attr = new Hashtable<TextAttribute, Object>();
231+
Map<TextAttribute, Object> attr = new Hashtable<>();
232232
attr.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
233233
styledFont = styledFont.deriveFont(attr);
234234
}
235235

236-
Map<String, Object> result = new HashMap<String, Object>();
236+
Map<String, Object> result = new HashMap<>();
237237
result.put("color", color);
238238
result.put("font", styledFont);
239239

arduino-core/src/cc/arduino/UploaderUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public boolean upload(Sketch data, Uploader uploader, String suggestedClassName,
7070

7171
boolean useNewWarningsAccumulator = false;
7272
if (warningsAccumulator == null) {
73-
warningsAccumulator = new LinkedList<String>();
73+
warningsAccumulator = new LinkedList<>();
7474
useNewWarningsAccumulator = true;
7575
}
7676

arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndex.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public String toString() {
6666
}
6767

6868
public List<String> getCategories() {
69-
List<String> categories = new LinkedList<String>();
69+
List<String> categories = new LinkedList<>();
7070
for (ContributedLibrary lib : getLibraries()) {
7171
if (lib.getCategory() != null && !categories.contains(lib.getCategory())) {
7272
categories.add(lib.getCategory());
@@ -78,14 +78,14 @@ public List<String> getCategories() {
7878
}
7979

8080
public List<String> getTypes() {
81-
Collection<String> typesAccumulator = new HashSet<String>();
81+
Collection<String> typesAccumulator = new HashSet<>();
8282
for (ContributedLibrary lib : getLibraries()) {
8383
if (lib.getTypes() != null) {
8484
typesAccumulator.addAll(lib.getTypes());
8585
}
8686
}
8787

88-
List<String> types = new LinkedList<String>(typesAccumulator);
88+
List<String> types = new LinkedList<>(typesAccumulator);
8989
Collections.sort(types);
9090

9191
return types;

arduino-core/src/cc/arduino/contributions/packages/ContributedTargetPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ContributedTargetPackage implements TargetPackage {
4343

4444
public ContributedTargetPackage(String _id) {
4545
id = _id;
46-
platforms = new HashMap<String, TargetPlatform>();
46+
platforms = new HashMap<>();
4747
}
4848

4949
void addPlatform(TargetPlatform p) {

arduino-core/src/cc/arduino/files/DeleteFilesOnShutdown.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static void add(File file) {
4848
private final List<File> files;
4949

5050
public DeleteFilesOnShutdown() {
51-
this.files = new LinkedList<File>();
51+
this.files = new LinkedList<>();
5252
}
5353

5454
public synchronized void addFile(File file) {
@@ -63,7 +63,7 @@ public void run() {
6363
}
6464
List<File> copyOfFiles;
6565
synchronized (this) {
66-
copyOfFiles = new LinkedList<File>(files);
66+
copyOfFiles = new LinkedList<>(files);
6767
}
6868
Collections.reverse(copyOfFiles);
6969
for (File file : copyOfFiles) {

0 commit comments

Comments
 (0)