mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-25 06:22:11 +03:00
Fixed a bunch of code inspection warnings
This commit is contained in:
@ -353,7 +353,7 @@ public class ContributedLibraryTableCell extends InstallerTableCell {
|
||||
String sentence = selected.getSentence();
|
||||
String paragraph = selected.getParagraph();
|
||||
// String availableVer = selectedLib.getVersion();
|
||||
String url = selected.getUrl();
|
||||
// String url = selected.getUrl();
|
||||
|
||||
String midcolor = isSelected ? "#000000" : "#888888";
|
||||
|
||||
@ -379,8 +379,6 @@ public class ContributedLibraryTableCell extends InstallerTableCell {
|
||||
} else {
|
||||
desc += " " + format(_("Version <b>{0}</b>"), installedVer);
|
||||
}
|
||||
} else {
|
||||
// not installed...
|
||||
}
|
||||
desc += "</font>";
|
||||
|
||||
|
@ -44,9 +44,9 @@ public class LibrariesIndexTableModel extends FilteredAbstractTableModel<Contrib
|
||||
public final static int DESCRIPTION_COL = 0;
|
||||
|
||||
public static class ContributedLibraryReleases implements Comparable<ContributedLibraryReleases> {
|
||||
public String name;
|
||||
public List<ContributedLibrary> releases = new ArrayList<ContributedLibrary>();
|
||||
public List<String> versions = new ArrayList<String>();
|
||||
public final String name;
|
||||
public final List<ContributedLibrary> releases = new ArrayList<ContributedLibrary>();
|
||||
public final List<String> versions = new ArrayList<String>();
|
||||
public ContributedLibrary selected = null;
|
||||
|
||||
public ContributedLibraryReleases(ContributedLibrary library) {
|
||||
@ -122,11 +122,11 @@ public class LibrariesIndexTableModel extends FilteredAbstractTableModel<Contrib
|
||||
}
|
||||
}
|
||||
|
||||
private List<ContributedLibraryReleases> contributions = new ArrayList<ContributedLibraryReleases>();
|
||||
private final List<ContributedLibraryReleases> contributions = new ArrayList<ContributedLibraryReleases>();
|
||||
|
||||
private String[] columnNames = {"Description"};
|
||||
private final String[] columnNames = {"Description"};
|
||||
|
||||
private Class<?>[] columnTypes = {ContributedPlatform.class};
|
||||
private final Class<?>[] columnTypes = {ContributedPlatform.class};
|
||||
|
||||
private LibrariesIndexer indexer;
|
||||
|
||||
|
@ -55,18 +55,17 @@ public class LibraryInstaller {
|
||||
}
|
||||
}
|
||||
|
||||
private LibrariesIndexer indexer;
|
||||
private File stagingFolder;
|
||||
private DownloadableContributionsDownloader downloader;
|
||||
private final LibrariesIndexer indexer;
|
||||
private final DownloadableContributionsDownloader downloader;
|
||||
|
||||
public LibraryInstaller(LibrariesIndexer _indexer) {
|
||||
indexer = _indexer;
|
||||
stagingFolder = _indexer.getStagingFolder();
|
||||
File stagingFolder = _indexer.getStagingFolder();
|
||||
downloader = new DownloadableContributionsDownloader(stagingFolder) {
|
||||
@Override
|
||||
protected void onProgress(Progress progress) {
|
||||
LibraryInstaller.this.onProgress(progress);
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -160,8 +159,7 @@ public class LibraryInstaller {
|
||||
rescanLibraryIndex(progress);
|
||||
}
|
||||
|
||||
private void rescanLibraryIndex(MultiStepProgress progress)
|
||||
throws IOException {
|
||||
private void rescanLibraryIndex(MultiStepProgress progress) {
|
||||
progress.setStatus(_("Updating list of installed libraries"));
|
||||
onProgress(progress);
|
||||
indexer.rescanLibraries();
|
||||
|
@ -61,9 +61,7 @@ public class ContributionIndexTableModel extends FilteredAbstractTableModel<Cont
|
||||
public boolean shouldContain(ContributedPlatform platform) {
|
||||
if (platform.getParentPackage() != packager)
|
||||
return false;
|
||||
if (!platform.getArchitecture().equals(arch))
|
||||
return false;
|
||||
return true;
|
||||
return platform.getArchitecture().equals(arch);
|
||||
}
|
||||
|
||||
public void add(ContributedPlatform platform) {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cc.arduino.contributions.ui;
|
||||
|
||||
import cc.arduino.contributions.libraries.ContributedLibrary;
|
||||
import cc.arduino.contributions.filters.NoopPredicate;
|
||||
import cc.arduino.contributions.packages.DownloadableContribution;
|
||||
import cc.arduino.contributions.ui.DropdownItem;
|
||||
|
@ -40,7 +40,7 @@ import javax.swing.event.DocumentListener;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class FilterJTextField extends JTextField {
|
||||
private String filterHint;
|
||||
private final String filterHint;
|
||||
|
||||
private boolean showingHint;
|
||||
|
||||
|
@ -50,13 +50,13 @@ public abstract class InstallerJDialog<T> extends JDialog {
|
||||
|
||||
// Toolbar on top of the window:
|
||||
// - Categories drop-down menu
|
||||
protected JLabel categoryLabel;
|
||||
protected JComboBox categoryChooser;
|
||||
protected Component categoryStrut1;
|
||||
protected Component categoryStrut2;
|
||||
protected Component categoryStrut3;
|
||||
protected final JLabel categoryLabel;
|
||||
protected final JComboBox categoryChooser;
|
||||
protected final Component categoryStrut1;
|
||||
protected final Component categoryStrut2;
|
||||
protected final Component categoryStrut3;
|
||||
// - Search text-field
|
||||
protected FilterJTextField filterField;
|
||||
protected final FilterJTextField filterField;
|
||||
// Currently selected category and filters
|
||||
protected Predicate<T> categoryFilter;
|
||||
protected String[] filters;
|
||||
@ -75,9 +75,9 @@ public abstract class InstallerJDialog<T> extends JDialog {
|
||||
|
||||
// Bottom:
|
||||
// - Progress bar
|
||||
protected ProgressJProgressBar progressBar;
|
||||
protected Box progressBox;
|
||||
protected Box errorMessageBox;
|
||||
protected final ProgressJProgressBar progressBar;
|
||||
protected final Box progressBox;
|
||||
protected final Box errorMessageBox;
|
||||
private final JLabel errorMessage;
|
||||
|
||||
public InstallerJDialog(Frame parent, String title, ModalityType applicationModal, String noConnectionErrorMessage) {
|
||||
@ -136,7 +136,7 @@ public abstract class InstallerJDialog<T> extends JDialog {
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent keyEvent) {
|
||||
if (keyEvent.getKeyCode() != keyEvent.VK_DOWN && keyEvent.getKeyCode() != KeyEvent.VK_UP) {
|
||||
if (keyEvent.getKeyCode() != KeyEvent.VK_DOWN && keyEvent.getKeyCode() != KeyEvent.VK_UP) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ public abstract class InstallerJDialog<T> extends JDialog {
|
||||
}
|
||||
}
|
||||
|
||||
protected ActionListener categoryChooserActionListener = new ActionListener() {
|
||||
protected final ActionListener categoryChooserActionListener = new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
|
@ -42,7 +42,7 @@ import static processing.app.I18n._;
|
||||
|
||||
public class AStyle implements Tool {
|
||||
|
||||
private static String FORMATTER_CONF = "formatter.conf";
|
||||
private static final String FORMATTER_CONF = "formatter.conf";
|
||||
|
||||
private final AStyleInterface aStyleInterface;
|
||||
private final String formatterConfiguration;
|
||||
|
@ -48,10 +48,7 @@ public class Event extends ActionEvent {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(super.toString());
|
||||
sb.append("\n").append(payload.toString());
|
||||
return sb.toString();
|
||||
return super.toString() + "\n" + payload.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ import java.util.Map;
|
||||
public class SplashScreenHelper {
|
||||
|
||||
private final Map desktopHints;
|
||||
private SplashScreen splash;
|
||||
private final SplashScreen splash;
|
||||
private Rectangle2D.Double splashTextArea;
|
||||
private Graphics2D splashGraphics;
|
||||
|
||||
|
Reference in New Issue
Block a user