Fixed a bunch of trivial javac warnings

This commit is contained in:
Cristian Maglie 2017-03-22 12:12:46 +01:00
parent 804d890ce2
commit 674419a464
7 changed files with 9 additions and 10 deletions

View File

@ -98,7 +98,7 @@ public class EditorStatus extends JPanel {
this.message = NO_MESSAGE;
this.mode = NOTICE;
this.font = Theme.getFont("status.font");
this.compilerProgressListeners = new ArrayList<CompilerProgressListener>();
this.compilerProgressListeners = new ArrayList<>();
this.compilerProgressListeners.add(this::progressUpdate);
initialize();
}

View File

@ -382,6 +382,9 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
case SERIAL:
editor.handleSerial();
break;
default:
break;
}
}

View File

@ -76,6 +76,8 @@ public class SerialMonitor extends AbstractTextMonitor {
case 3:
s += "\r\n";
break;
default:
break;
}
if ("".equals(s) && lineEndings.getSelectedIndex() == 0 && !PreferencesData.has("runtime.line.ending.alert.notified")) {
noLineEndingAlert.setForeground(Color.RED);

View File

@ -153,7 +153,7 @@ public class Compiler implements MessageConsumer {
}
public String build(CompilerProgressListener progListener, boolean exportHex) throws RunnerException, PreferencesMapException, IOException {
ArrayList<CompilerProgressListener> listeners = new ArrayList<CompilerProgressListener>();
ArrayList<CompilerProgressListener> listeners = new ArrayList<>();
listeners.add(progListener);
return this.build(listeners, exportHex);
}

View File

@ -34,7 +34,6 @@ import cc.arduino.packages.Discovery;
import processing.app.BaseNoGui;
import javax.jmdns.*;
import java.io.IOException;
import java.net.InetAddress;
import java.util.*;
@ -42,8 +41,6 @@ import cc.arduino.packages.discoverers.network.BoardReachabilityFilter;
public class NetworkDiscovery implements Discovery, ServiceListener {
private static final int MAX_TIME_AWAITING_FOR_PACKAGES = 5000;
private final List<BoardPort> reachableBoardPorts = new LinkedList<>();
private final List<BoardPort> boardPortsDiscoveredWithJmDNS = new LinkedList<>();
private Timer reachabilityTimer;

View File

@ -34,16 +34,12 @@ import cc.arduino.packages.discoverers.NetworkDiscovery;
import processing.app.helpers.NetUtils;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.net.UnknownHostException;
import java.util.*;
public class BoardReachabilityFilter extends TimerTask {
private final NetworkDiscovery networkDiscovery;
private Enumeration<NetworkInterface> staticNetworkInterfaces;
private final List<String> staticNetworkInterfacesList = new LinkedList<>();
public BoardReachabilityFilter(NetworkDiscovery networkDiscovery) {
this.networkDiscovery = networkDiscovery;

View File

@ -33,6 +33,7 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import cc.arduino.contributions.libraries.ContributedLibrary;
import processing.app.helpers.FileUtils;
@SuppressWarnings("serial")
@ -79,7 +80,7 @@ public class LibraryList extends LinkedList<UserLibrary> {
}
public synchronized void sort() {
Collections.sort(this, UserLibrary.CASE_INSENSITIVE_ORDER);
Collections.sort(this, ContributedLibrary.CASE_INSENSITIVE_ORDER);
}
public synchronized LibraryList filterLibrariesInSubfolder(File subFolder) {