1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-14 11:29:26 +01:00

Removed redundant type specifiers for generics

This commit is contained in:
Cristian Maglie 2016-09-29 19:32:30 +02:00
parent 72a1d928b4
commit bd7e76533a
22 changed files with 52 additions and 52 deletions

View File

@ -39,7 +39,7 @@ public class Event extends ActionEvent {
public Event(Object source, int id, String command) { public Event(Object source, int id, String command) {
super(source, id, command); super(source, id, command);
this.payload = new HashMap<String, Object>(); this.payload = new HashMap<>();
} }
public Map<String, Object> getPayload() { public Map<String, Object> getPayload() {

View File

@ -85,7 +85,7 @@ public class Base {
public static volatile Base INSTANCE; public static volatile Base INSTANCE;
public static SplashScreenHelper splashScreenHelper = new SplashScreenHelper(SplashScreen.getSplashScreen()); public static SplashScreenHelper splashScreenHelper = new SplashScreenHelper(SplashScreen.getSplashScreen());
public static Map<String, Object> FIND_DIALOG_STATE = new HashMap<String, Object>(); public static Map<String, Object> FIND_DIALOG_STATE = new HashMap<>();
private final ContributionInstaller contributionInstaller; private final ContributionInstaller contributionInstaller;
private final LibraryInstaller libraryInstaller; private final LibraryInstaller libraryInstaller;
private ContributionsSelfCheck contributionsSelfCheck; private ContributionsSelfCheck contributionsSelfCheck;
@ -266,7 +266,7 @@ public class Base {
public Base(String[] args) throws Exception { public Base(String[] args) throws Exception {
BaseNoGui.notifier = new GUIUserNotifier(this); BaseNoGui.notifier = new GUIUserNotifier(this);
this.recentSketchesMenuItems = new LinkedList<JMenuItem>(); this.recentSketchesMenuItems = new LinkedList<>();
CommandlineParser parser = new CommandlineParser(args); CommandlineParser parser = new CommandlineParser(args);
parser.parseArgumentsPhase1(); parser.parseArgumentsPhase1();
@ -584,7 +584,7 @@ public class Base {
return; return;
} }
Set<String> sketches = new LinkedHashSet<String>(); Set<String> sketches = new LinkedHashSet<>();
sketches.add(sketch.getSketch().getMainFilePath()); sketches.add(sketch.getSketch().getMainFilePath());
sketches.addAll(PreferencesData.getCollection("recent.sketches")); sketches.addAll(PreferencesData.getCollection("recent.sketches"));
@ -592,7 +592,7 @@ public class Base {
} }
protected void removeRecentSketchPath(String path) { protected void removeRecentSketchPath(String path) {
Collection<String> sketches = new LinkedList<String>(PreferencesData.getCollection("recent.sketches")); Collection<String> sketches = new LinkedList<>(PreferencesData.getCollection("recent.sketches"));
sketches.remove(path); sketches.remove(path);
PreferencesData.setCollection("recent.sketches", sketches); PreferencesData.setCollection("recent.sketches", sketches);
} }
@ -1049,7 +1049,7 @@ public class Base {
} }
private List<ContributedLibrary> getSortedLibraries() { private List<ContributedLibrary> getSortedLibraries() {
List<ContributedLibrary> installedLibraries = new LinkedList<ContributedLibrary>(BaseNoGui.librariesIndexer.getInstalledLibraries()); List<ContributedLibrary> installedLibraries = new LinkedList<>(BaseNoGui.librariesIndexer.getInstalledLibraries());
Collections.sort(installedLibraries, new LibraryByTypeComparator()); Collections.sort(installedLibraries, new LibraryByTypeComparator());
Collections.sort(installedLibraries, new LibraryOfSameTypeComparator()); Collections.sort(installedLibraries, new LibraryOfSameTypeComparator());
return installedLibraries; return installedLibraries;
@ -1415,7 +1415,7 @@ public class Base {
boardMenu.add(new JSeparator()); boardMenu.add(new JSeparator());
// Generate custom menus for all platforms // Generate custom menus for all platforms
Set<String> customMenusTitles = new HashSet<String>(); Set<String> customMenusTitles = new HashSet<>();
for (TargetPackage targetPackage : BaseNoGui.packages.values()) { for (TargetPackage targetPackage : BaseNoGui.packages.values()) {
for (TargetPlatform targetPlatform : targetPackage.platforms()) { for (TargetPlatform targetPlatform : targetPackage.platforms()) {
customMenusTitles.addAll(targetPlatform.getCustomMenus().values()); customMenusTitles.addAll(targetPlatform.getCustomMenus().values());
@ -1427,10 +1427,10 @@ public class Base {
boardsCustomMenus.add(customMenu); boardsCustomMenus.add(customMenu);
} }
List<JMenuItem> menuItemsToClickAfterStartup = new LinkedList<JMenuItem>(); List<JMenuItem> menuItemsToClickAfterStartup = new LinkedList<>();
ButtonGroup boardsButtonGroup = new ButtonGroup(); ButtonGroup boardsButtonGroup = new ButtonGroup();
Map<String, ButtonGroup> buttonGroupsMap = new HashMap<String, ButtonGroup>(); Map<String, ButtonGroup> buttonGroupsMap = new HashMap<>();
// Cycle through all packages // Cycle through all packages
boolean first = true; boolean first = true;
@ -2129,7 +2129,7 @@ public class Base {
* that are separated by = and ignore comments with #. * that are separated by = and ignore comments with #.
*/ */
static public HashMap<String, String> readSettings(File inputFile) { static public HashMap<String, String> readSettings(File inputFile) {
HashMap<String, String> outgoing = new HashMap<String, String>(); HashMap<String, String> outgoing = new HashMap<>();
if (!inputFile.exists()) return outgoing; // return empty hash if (!inputFile.exists()) return outgoing; // return empty hash
String lines[] = PApplet.loadStrings(inputFile); String lines[] = PApplet.loadStrings(inputFile);

View File

@ -230,7 +230,7 @@ public class Editor extends JFrame implements RunnerListener {
public void windowDeactivated(WindowEvent e) { public void windowDeactivated(WindowEvent e) {
fileMenu.remove(sketchbookMenu); fileMenu.remove(sketchbookMenu);
fileMenu.remove(examplesMenu); fileMenu.remove(examplesMenu);
List<Component> toolsMenuItemsToRemove = new LinkedList<Component>(); List<Component> toolsMenuItemsToRemove = new LinkedList<>();
for (Component menuItem : toolsMenu.getMenuComponents()) { for (Component menuItem : toolsMenu.getMenuComponents()) {
if (menuItem instanceof JComponent) { if (menuItem instanceof JComponent) {
Object removeOnWindowDeactivation = ((JComponent) menuItem).getClientProperty("removeOnWindowDeactivation"); Object removeOnWindowDeactivation = ((JComponent) menuItem).getClientProperty("removeOnWindowDeactivation");
@ -816,7 +816,7 @@ public class Editor extends JFrame implements RunnerListener {
if (sourceFolder == null) if (sourceFolder == null)
return; return;
Map<String, JMenuItem> toolItems = new HashMap<String, JMenuItem>(); Map<String, JMenuItem> toolItems = new HashMap<>();
File[] folders = sourceFolder.listFiles(new FileFilter() { File[] folders = sourceFolder.listFiles(new FileFilter() {
public boolean accept(File folder) { public boolean accept(File folder) {
@ -906,7 +906,7 @@ public class Editor extends JFrame implements RunnerListener {
e.printStackTrace(); e.printStackTrace();
} }
} }
ArrayList<String> toolList = new ArrayList<String>(toolItems.keySet()); ArrayList<String> toolList = new ArrayList<>(toolItems.keySet());
if (toolList.size() == 0) return; if (toolList.size() == 0) return;
menu.addSeparator(); menu.addSeparator();

View File

@ -59,7 +59,7 @@ public class PresentMode {
devices = environment.getScreenDevices(); devices = environment.getScreenDevices();
GraphicsDevice defaultDevice = environment.getDefaultScreenDevice(); GraphicsDevice defaultDevice = environment.getDefaultScreenDevice();
Vector<String> names = new Vector<String>(); Vector<String> names = new Vector<>();
for (int i = 0; i < devices.length; i++) { for (int i = 0; i < devices.length; i++) {
String name = String.valueOf(i + 1); String name = String.valueOf(i + 1);
if (devices[i] == defaultDevice) { if (devices[i] == defaultDevice) {

View File

@ -185,7 +185,7 @@ public class SerialPlotter extends AbstractMonitor {
}); });
messageBuffer = new StringBuffer(); messageBuffer = new StringBuffer();
graphs = new ArrayList<Graph>(); graphs = new ArrayList<>();
} }
protected void onCreateWindow(Container mainPane) { protected void onCreateWindow(Container mainPane) {

View File

@ -228,12 +228,12 @@ public class Theme {
Font styledFont = new Font(font.getFamily(), Font styledFont = new Font(font.getFamily(),
(bold ? Font.BOLD : 0) | (italic ? Font.ITALIC : 0), font.getSize()); (bold ? Font.BOLD : 0) | (italic ? Font.ITALIC : 0), font.getSize());
if (underlined) { if (underlined) {
Map<TextAttribute, Object> attr = new Hashtable<TextAttribute, Object>(); Map<TextAttribute, Object> attr = new Hashtable<>();
attr.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON); attr.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
styledFont = styledFont.deriveFont(attr); styledFont = styledFont.deriveFont(attr);
} }
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<>();
result.put("color", color); result.put("color", color);
result.put("font", styledFont); result.put("font", styledFont);

View File

@ -70,7 +70,7 @@ public class UploaderUtils {
boolean useNewWarningsAccumulator = false; boolean useNewWarningsAccumulator = false;
if (warningsAccumulator == null) { if (warningsAccumulator == null) {
warningsAccumulator = new LinkedList<String>(); warningsAccumulator = new LinkedList<>();
useNewWarningsAccumulator = true; useNewWarningsAccumulator = true;
} }

View File

@ -66,7 +66,7 @@ public abstract class LibrariesIndex {
} }
public List<String> getCategories() { public List<String> getCategories() {
List<String> categories = new LinkedList<String>(); List<String> categories = new LinkedList<>();
for (ContributedLibrary lib : getLibraries()) { for (ContributedLibrary lib : getLibraries()) {
if (lib.getCategory() != null && !categories.contains(lib.getCategory())) { if (lib.getCategory() != null && !categories.contains(lib.getCategory())) {
categories.add(lib.getCategory()); categories.add(lib.getCategory());
@ -78,14 +78,14 @@ public abstract class LibrariesIndex {
} }
public List<String> getTypes() { public List<String> getTypes() {
Collection<String> typesAccumulator = new HashSet<String>(); Collection<String> typesAccumulator = new HashSet<>();
for (ContributedLibrary lib : getLibraries()) { for (ContributedLibrary lib : getLibraries()) {
if (lib.getTypes() != null) { if (lib.getTypes() != null) {
typesAccumulator.addAll(lib.getTypes()); typesAccumulator.addAll(lib.getTypes());
} }
} }
List<String> types = new LinkedList<String>(typesAccumulator); List<String> types = new LinkedList<>(typesAccumulator);
Collections.sort(types); Collections.sort(types);
return types; return types;

View File

@ -43,7 +43,7 @@ public class ContributedTargetPackage implements TargetPackage {
public ContributedTargetPackage(String _id) { public ContributedTargetPackage(String _id) {
id = _id; id = _id;
platforms = new HashMap<String, TargetPlatform>(); platforms = new HashMap<>();
} }
void addPlatform(TargetPlatform p) { void addPlatform(TargetPlatform p) {

View File

@ -48,7 +48,7 @@ public class DeleteFilesOnShutdown implements Runnable {
private final List<File> files; private final List<File> files;
public DeleteFilesOnShutdown() { public DeleteFilesOnShutdown() {
this.files = new LinkedList<File>(); this.files = new LinkedList<>();
} }
public synchronized void addFile(File file) { public synchronized void addFile(File file) {
@ -63,7 +63,7 @@ public class DeleteFilesOnShutdown implements Runnable {
} }
List<File> copyOfFiles; List<File> copyOfFiles;
synchronized (this) { synchronized (this) {
copyOfFiles = new LinkedList<File>(files); copyOfFiles = new LinkedList<>(files);
} }
Collections.reverse(copyOfFiles); Collections.reverse(copyOfFiles);
for (File file : copyOfFiles) { for (File file : copyOfFiles) {

View File

@ -44,7 +44,7 @@ public class DiscoveryManager {
private final NetworkDiscovery networkDiscoverer = new NetworkDiscovery(); private final NetworkDiscovery networkDiscoverer = new NetworkDiscovery();
public DiscoveryManager() { public DiscoveryManager() {
discoverers = new ArrayList<Discovery>(); discoverers = new ArrayList<>();
discoverers.add(serialDiscoverer); discoverers.add(serialDiscoverer);
discoverers.add(networkDiscoverer); discoverers.add(networkDiscoverer);
@ -76,7 +76,7 @@ public class DiscoveryManager {
} }
public List<BoardPort> discovery() { public List<BoardPort> discovery() {
List<BoardPort> res = new ArrayList<BoardPort>(); List<BoardPort> res = new ArrayList<>();
for (Discovery d : discoverers) { for (Discovery d : discoverers) {
res.addAll(d.listDiscoveredBoards()); res.addAll(d.listDiscoveredBoards());
} }
@ -84,7 +84,7 @@ public class DiscoveryManager {
} }
public List<BoardPort> discovery(boolean complete) { public List<BoardPort> discovery(boolean complete) {
List<BoardPort> res = new ArrayList<BoardPort>(); List<BoardPort> res = new ArrayList<>();
for (Discovery d : discoverers) { for (Discovery d : discoverers) {
res.addAll(d.listDiscoveredBoards(complete)); res.addAll(d.listDiscoveredBoards(complete));
} }

View File

@ -86,7 +86,7 @@ public class ArchiveExtractor {
// Folders timestamps must be set at the end of archive extraction // Folders timestamps must be set at the end of archive extraction
// (because creating a file in a folder alters the folder's timestamp) // (because creating a file in a folder alters the folder's timestamp)
Map<File, Long> foldersTimestamps = new HashMap<File, Long>(); Map<File, Long> foldersTimestamps = new HashMap<>();
ArchiveInputStream in = null; ArchiveInputStream in = null;
try { try {
@ -106,10 +106,10 @@ public class ArchiveExtractor {
String pathPrefix = ""; String pathPrefix = "";
Map<File, File> hardLinks = new HashMap<File, File>(); Map<File, File> hardLinks = new HashMap<>();
Map<File, Integer> hardLinksMode = new HashMap<File, Integer>(); Map<File, Integer> hardLinksMode = new HashMap<>();
Map<File, String> symLinks = new HashMap<File, String>(); Map<File, String> symLinks = new HashMap<>();
Map<File, Long> symLinksModifiedTimes = new HashMap<File, Long>(); Map<File, Long> symLinksModifiedTimes = new HashMap<>();
// Cycle through all the archive entries // Cycle through all the archive entries
while (true) { while (true) {

View File

@ -100,7 +100,7 @@ public class CIDRUtils {
private byte[] toBytes(byte[] array, int targetSize) { private byte[] toBytes(byte[] array, int targetSize) {
int counter = 0; int counter = 0;
List<Byte> newArr = new ArrayList<Byte>(); List<Byte> newArr = new ArrayList<>();
while (counter < targetSize && (array.length - 1 - counter >= 0)) { while (counter < targetSize && (array.length - 1 - counter >= 0)) {
newArr.add(0, array[array.length - 1 - counter]); newArr.add(0, array[array.length - 1 - counter]);
counter++; counter++;

View File

@ -500,7 +500,7 @@ public class BaseNoGui {
showError(tr("Multiple files not supported"), tr("The --upload option supports only one file at a time"), null); showError(tr("Multiple files not supported"), tr("The --upload option supports only one file at a time"), null);
} }
List<String> warningsAccumulator = new LinkedList<String>(); List<String> warningsAccumulator = new LinkedList<>();
boolean success = false; boolean success = false;
try { try {
// Editor constructor loads the sketch with handleOpenInternal() that // Editor constructor loads the sketch with handleOpenInternal() that
@ -619,7 +619,7 @@ public class BaseNoGui {
} }
indexer.syncWithFilesystem(); indexer.syncWithFilesystem();
packages = new LinkedHashMap<String, TargetPackage>(); packages = new LinkedHashMap<>();
loadHardware(getHardwareFolder()); loadHardware(getHardwareFolder());
loadContributedHardware(indexer); loadContributedHardware(indexer);
loadHardware(getSketchbookHardwareFolder()); loadHardware(getSketchbookHardwareFolder());
@ -794,7 +794,7 @@ public class BaseNoGui {
static public void onBoardOrPortChange() { static public void onBoardOrPortChange() {
examplesFolder = getContentFile("examples"); examplesFolder = getContentFile("examples");
toolsFolder = getContentFile("tools"); toolsFolder = getContentFile("tools");
librariesFolders = new ArrayList<File>(); librariesFolders = new ArrayList<>();
// Add IDE libraries folder // Add IDE libraries folder
librariesFolders.add(getContentFile("libraries")); librariesFolders.add(getContentFile("libraries"));
@ -874,7 +874,7 @@ public class BaseNoGui {
// a list of libraries. Compiler.java will use only the first // a list of libraries. Compiler.java will use only the first
// library on each list. The others are used only to advise // library on each list. The others are used only to advise
// user of ambiguously matched and duplicate libraries. // user of ambiguously matched and duplicate libraries.
importToLibraryTable = new HashMap<String, LibraryList>(); importToLibraryTable = new HashMap<>();
for (UserLibrary lib : librariesIndexer.getInstalledLibraries()) { for (UserLibrary lib : librariesIndexer.getInstalledLibraries()) {
try { try {
String headers[] = headerListFromIncludePath(lib.getSrcFolder()); String headers[] = headerListFromIncludePath(lib.getSrcFolder());

View File

@ -177,7 +177,7 @@ public class Platform {
} }
public List<String> listSerials() { public List<String> listSerials() {
return new ArrayList<String>(Arrays.asList(listSerialsNative())); return new ArrayList<>(Arrays.asList(listSerialsNative()));
} }
public List<String> listSerialsNames(){ public List<String> listSerialsNames(){
@ -233,13 +233,13 @@ public class Platform {
for (TargetPackage targetPackage : packages.values()) { for (TargetPackage targetPackage : packages.values()) {
for (TargetPlatform targetPlatform : targetPackage.getPlatforms().values()) { for (TargetPlatform targetPlatform : targetPackage.getPlatforms().values()) {
for (TargetBoard board : targetPlatform.getBoards().values()) { for (TargetBoard board : targetPlatform.getBoards().values()) {
List<String> vids = new LinkedList<String>(board.getPreferences().subTree("vid", 1).values()); List<String> vids = new LinkedList<>(board.getPreferences().subTree("vid", 1).values());
if (!vids.isEmpty()) { if (!vids.isEmpty()) {
List<String> pids = new LinkedList<String>(board.getPreferences().subTree("pid", 1).values()); List<String> pids = new LinkedList<>(board.getPreferences().subTree("pid", 1).values());
for (int i = 0; i < vids.size(); i++) { for (int i = 0; i < vids.size(); i++) {
String vidPid = vids.get(i) + "_" + pids.get(i); String vidPid = vids.get(i) + "_" + pids.get(i);
if (vid_pid_iSerial.toUpperCase().contains(vidPid.toUpperCase())) { if (vid_pid_iSerial.toUpperCase().contains(vidPid.toUpperCase())) {
Map<String, Object> boardData = new HashMap<String, Object>(); Map<String, Object> boardData = new HashMap<>();
boardData.put("board", board); boardData.put("board", board);
boardData.put("vid", vids.get(i)); boardData.put("vid", vids.get(i));
boardData.put("pid", pids.get(i)); boardData.put("pid", pids.get(i));
@ -286,7 +286,7 @@ public class Platform {
} }
public List<BoardPort> filterPorts(List<BoardPort> ports, boolean aBoolean) { public List<BoardPort> filterPorts(List<BoardPort> ports, boolean aBoolean) {
return new LinkedList<BoardPort>(ports); return new LinkedList<>(ports);
} }
public void fixPrefsFilePermissions(File prefsFile) throws IOException, InterruptedException { public void fixPrefsFilePermissions(File prefsFile) throws IOException, InterruptedException {

View File

@ -310,7 +310,7 @@ public class SerialPortList {
if(portNames == null){ if(portNames == null){
return new String[]{}; return new String[]{};
} }
TreeSet<String> ports = new TreeSet<String>(comparator); TreeSet<String> ports = new TreeSet<>(comparator);
for(String portName : portNames){ for(String portName : portNames){
if(pattern.matcher(portName).find()){ if(pattern.matcher(portName).find()){
ports.add(portName); ports.add(portName);
@ -329,7 +329,7 @@ public class SerialPortList {
if(dir.exists() && dir.isDirectory()){ if(dir.exists() && dir.isDirectory()){
File[] files = dir.listFiles(); File[] files = dir.listFiles();
if(files.length > 0){ if(files.length > 0){
TreeSet<String> portsTree = new TreeSet<String>(comparator); TreeSet<String> portsTree = new TreeSet<>(comparator);
for(File file : files){ for(File file : files){
String fileName = file.getName(); String fileName = file.getName();
if(!file.isDirectory() && !file.isFile() && pattern.matcher(fileName).find()){ if(!file.isDirectory() && !file.isFile() && pattern.matcher(fileName).find()){

View File

@ -27,7 +27,7 @@ public class Sketch {
*/ */
private File folder; private File folder;
private List<SketchFile> files = new ArrayList<SketchFile>(); private List<SketchFile> files = new ArrayList<>();
private File buildPath; private File buildPath;

View File

@ -210,7 +210,7 @@ public class FileUtils {
} }
public static List<String> readFileToListOfStrings(File file) throws IOException { public static List<String> readFileToListOfStrings(File file) throws IOException {
List<String> strings = new LinkedList<String>(); List<String> strings = new LinkedList<>();
BufferedReader reader = null; BufferedReader reader = null;
try { try {
reader = new BufferedReader(new FileReader(file)); reader = new BufferedReader(new FileReader(file));
@ -343,7 +343,7 @@ public class FileUtils {
public static List<File> listFiles(File folder, boolean recursive, public static List<File> listFiles(File folder, boolean recursive,
List<String> extensions) { List<String> extensions) {
List<File> result = new ArrayList<File>(); List<File> result = new ArrayList<>();
for (File file : folder.listFiles()) { for (File file : folder.listFiles()) {
if (isSCCSOrHiddenFile(file)) if (isSCCSOrHiddenFile(file))

View File

@ -182,7 +182,7 @@ public class PreferencesMap extends LinkedHashMap<String, String> {
* @return * @return
*/ */
public Map<String, PreferencesMap> firstLevelMap() { public Map<String, PreferencesMap> firstLevelMap() {
Map<String, PreferencesMap> res = new LinkedHashMap<String, PreferencesMap>(); Map<String, PreferencesMap> res = new LinkedHashMap<>();
for (String key : keySet()) { for (String key : keySet()) {
int dot = key.indexOf('.'); int dot = key.indexOf('.');
if (dot == -1) if (dot == -1)
@ -246,7 +246,7 @@ public class PreferencesMap extends LinkedHashMap<String, String> {
public String toString(String indent) { public String toString(String indent) {
String res = indent + "{\n"; String res = indent + "{\n";
SortedSet<String> treeSet = new TreeSet<String>(keySet()); SortedSet<String> treeSet = new TreeSet<>(keySet());
for (String k : treeSet) for (String k : treeSet)
res += indent + k + " = " + get(k) + "\n"; res += indent + k + " = " + get(k) + "\n";
return res; return res;

View File

@ -49,7 +49,7 @@ public class StringReplacer {
public static String[] quotedSplit(String src, String quoteChars, public static String[] quotedSplit(String src, String quoteChars,
boolean acceptEmptyArguments) boolean acceptEmptyArguments)
throws Exception { throws Exception {
List<String> res = new ArrayList<String>(); List<String> res = new ArrayList<>();
String escapedArg = null; String escapedArg = null;
String escapingChar = null; String escapingChar = null;
for (String i : src.split(" ")) { for (String i : src.split(" ")) {

View File

@ -466,7 +466,7 @@ public class PApplet {
static public String[][] matchAll(String what, String regexp) { static public String[][] matchAll(String what, String regexp) {
Pattern p = Pattern.compile(regexp, Pattern.MULTILINE | Pattern.DOTALL); Pattern p = Pattern.compile(regexp, Pattern.MULTILINE | Pattern.DOTALL);
Matcher m = p.matcher(what); Matcher m = p.matcher(what);
ArrayList<String[]> results = new ArrayList<String[]>(); ArrayList<String[]> results = new ArrayList<>();
int count = m.groupCount() + 1; int count = m.groupCount() + 1;
while (m.find()) { while (m.find()) {
String[] groups = new String[count]; String[] groups = new String[count];

View File

@ -168,7 +168,7 @@ public class Platform extends processing.app.Platform {
return super.filterPorts(ports, true); return super.filterPorts(ports, true);
} }
List<BoardPort> filteredPorts = new LinkedList<BoardPort>(); List<BoardPort> filteredPorts = new LinkedList<>();
for (BoardPort port : ports) { for (BoardPort port : ports) {
if (!port.getAddress().startsWith("/dev/tty.")) { if (!port.getAddress().startsWith("/dev/tty.")) {
filteredPorts.add(port); filteredPorts.add(port);