Added all missing @Override annotations

This commit is contained in:
Cristian Maglie 2016-09-29 20:03:48 +02:00
parent 46dfd7603c
commit ec2e9a642a
24 changed files with 65 additions and 0 deletions

View File

@ -516,6 +516,7 @@ public class Compiler implements MessageConsumer {
* out from the compiler. The errors are parsed for their contents * out from the compiler. The errors are parsed for their contents
* and line number, which is then reported back to Editor. * and line number, which is then reported back to Editor.
*/ */
@Override
public void message(String s) { public void message(String s) {
int i; int i;

View File

@ -64,6 +64,7 @@ public class MyStreamPumper implements Runnable {
* Copies data from the input stream to the output stream. Terminates as * Copies data from the input stream to the output stream. Terminates as
* soon as the input stream is closed or an error occurs. * soon as the input stream is closed or an error occurs.
*/ */
@Override
public void run() { public void run() {
synchronized (this) { synchronized (this) {
// Just in case this object is reused in the future // Just in case this object is reused in the future

View File

@ -49,6 +49,7 @@ public class GPGDetachedSignatureVerifier extends SignatureVerifier {
this.keyId = keyId; this.keyId = keyId;
} }
@Override
protected boolean verify(File signedFile, File signature, File publicKey) throws IOException { protected boolean verify(File signedFile, File signature, File publicKey) throws IOException {
FileInputStream signatureInputStream = null; FileInputStream signatureInputStream = null;
FileInputStream signedFileInputStream = null; FileInputStream signedFileInputStream = null;

View File

@ -44,6 +44,7 @@ public abstract class ContributedPlatform extends DownloadableContribution {
public abstract String getArchitecture(); public abstract String getArchitecture();
@Override
public abstract String getChecksum(); public abstract String getChecksum();
public abstract List<ContributedToolReference> getToolsDependencies(); public abstract List<ContributedToolReference> getToolsDependencies();

View File

@ -162,6 +162,7 @@ public class CustomProxySelector {
} }
Authenticator.setDefault( Authenticator.setDefault(
new Authenticator() { new Authenticator() {
@Override
public PasswordAuthentication getPasswordAuthentication() { public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, actualPassword.toCharArray()); return new PasswordAuthentication(username, actualPassword.toCharArray());
} }

View File

@ -152,6 +152,7 @@ public abstract class Uploader implements MessageConsumer {
return error; return error;
} }
@Override
public void message(String s) { public void message(String s) {
// selectively suppress a bunch of avrdude output for AVR109/Caterina that should already be quelled but isn't // selectively suppress a bunch of avrdude output for AVR109/Caterina that should already be quelled but isn't
if (!verbose && StringUtils.stringContainsOneOf(s, STRINGS_TO_SUPPRESS)) { if (!verbose && StringUtils.stringContainsOneOf(s, STRINGS_TO_SUPPRESS)) {

View File

@ -52,6 +52,7 @@ public class SerialDiscovery implements Discovery {
return getSerialBoardPorts(false); return getSerialBoardPorts(false);
} }
@Override
public List<BoardPort> listDiscoveredBoards(boolean complete) { public List<BoardPort> listDiscoveredBoards(boolean complete) {
return getSerialBoardPorts(complete); return getSerialBoardPorts(complete);
} }

View File

@ -39,26 +39,32 @@ public class NoInteractionUserInfo implements UserInfo {
this.password = password; this.password = password;
} }
@Override
public String getPassword() { public String getPassword() {
return password; return password;
} }
@Override
public boolean promptYesNo(String str) { public boolean promptYesNo(String str) {
return true; return true;
} }
@Override
public String getPassphrase() { public String getPassphrase() {
return password; return password;
} }
@Override
public boolean promptPassphrase(String message) { public boolean promptPassphrase(String message) {
return true; return true;
} }
@Override
public boolean promptPassword(String message) { public boolean promptPassword(String message) {
return true; return true;
} }
@Override
public void showMessage(String message) { public void showMessage(String message) {
} }

View File

@ -43,6 +43,7 @@ public class SSHConfigFileSetup implements SSHClientSetupChainRing {
this.nextChainRing = nextChainRing; this.nextChainRing = nextChainRing;
} }
@Override
public Session setup(BoardPort port, JSch jSch) throws JSchException, IOException { public Session setup(BoardPort port, JSch jSch) throws JSchException, IOException {
String ipAddress = port.getAddress(); String ipAddress = port.getAddress();
String hostname = port.getBoardName().contains(".local") ? port.getBoardName() : port.getBoardName() + ".local"; String hostname = port.getBoardName().contains(".local") ? port.getBoardName() : port.getBoardName() + ".local";

View File

@ -46,6 +46,7 @@ public class GenericNetworkUploader extends Uploader {
this.port = port; this.port = port;
} }
@Override
public boolean requiresAuthorization() { public boolean requiresAuthorization() {
return this.port.getPrefs().get("auth_upload").contentEquals("yes"); return this.port.getPrefs().get("auth_upload").contentEquals("yes");
} }
@ -55,6 +56,7 @@ public class GenericNetworkUploader extends Uploader {
return "runtime.pwd." + this.port.getAddress(); return "runtime.pwd." + this.port.getAddress();
} }
@Override
public boolean uploadUsingPreferences(File sourcePath, String buildPath, String className, boolean usingProgrammer, List<String> warningsAccumulator) throws Exception { public boolean uploadUsingPreferences(File sourcePath, String buildPath, String className, boolean usingProgrammer, List<String> warningsAccumulator) throws Exception {
TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform(); TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform();
PreferencesMap prefs = PreferencesData.getMap(); PreferencesMap prefs = PreferencesData.getMap();

View File

@ -63,6 +63,7 @@ public class SSHUploader extends Uploader {
this.port = port; this.port = port;
} }
@Override
public boolean requiresAuthorization() { public boolean requiresAuthorization() {
return true; return true;
} }

View File

@ -61,6 +61,7 @@ public class SerialUploader extends Uploader {
super(noUploadPort); super(noUploadPort);
} }
@Override
public boolean uploadUsingPreferences(File sourcePath, String buildPath, String className, boolean usingProgrammer, List<String> warningsAccumulator) throws Exception { public boolean uploadUsingPreferences(File sourcePath, String buildPath, String className, boolean usingProgrammer, List<String> warningsAccumulator) throws Exception {
// FIXME: Preferences should be reorganized // FIXME: Preferences should be reorganized
TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform(); TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform();
@ -347,6 +348,7 @@ public class SerialUploader extends Uploader {
} }
} }
@Override
public boolean burnBootloader() throws Exception { public boolean burnBootloader() throws Exception {
TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform(); TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform();

View File

@ -148,6 +148,7 @@ public class Serial implements SerialPortEventListener {
} }
} }
@Override
public synchronized void serialEvent(SerialPortEvent serialEvent) { public synchronized void serialEvent(SerialPortEvent serialEvent) {
if (serialEvent.isRXCHAR()) { if (serialEvent.isRXCHAR()) {
try { try {

View File

@ -242,6 +242,7 @@ public class SketchFile {
return false; return false;
} }
@Override
public boolean equals(Object o) { public boolean equals(Object o) {
return (o instanceof SketchFile) && file.equals(((SketchFile) o).file); return (o instanceof SketchFile) && file.equals(((SketchFile) o).file);
} }

View File

@ -63,6 +63,7 @@ public class MessageSiphon implements Runnable {
} }
@Override
public void run() { public void run() {
try { try {
// process data until we hit EOF; this will happily block // process data until we hit EOF; this will happily block

View File

@ -75,6 +75,7 @@ public class RunnerException extends Exception {
* Override getMessage() in Throwable, so that I can set * Override getMessage() in Throwable, so that I can set
* the message text outside the constructor. * the message text outside the constructor.
*/ */
@Override
public String getMessage() { public String getMessage() {
return message; return message;
} }
@ -151,6 +152,7 @@ public class RunnerException extends Exception {
*/ */
@Override
public void printStackTrace() { public void printStackTrace() {
if (showStackTrace) { if (showStackTrace) {
super.printStackTrace(); super.printStackTrace();

View File

@ -96,6 +96,7 @@ public class Sizer implements MessageConsumer {
return new long[] { textSize, dataSize, eepromSize }; return new long[] { textSize, dataSize, eepromSize };
} }
@Override
public void message(String s) { public void message(String s) {
if (firstLine == null) if (firstLine == null)
firstLine = s; firstLine = s;

View File

@ -9,6 +9,7 @@ public class BasicUserNotifier extends UserNotifier {
* This is an error that can't be recovered. Use showWarning() * This is an error that can't be recovered. Use showWarning()
* for errors that allow P5 to continue running. * for errors that allow P5 to continue running.
*/ */
@Override
public void showError(String title, String message, Throwable e, int exit_code) { public void showError(String title, String message, Throwable e, int exit_code) {
if (title == null) title = tr("Error"); if (title == null) title = tr("Error");
@ -18,6 +19,7 @@ public class BasicUserNotifier extends UserNotifier {
System.exit(exit_code); System.exit(exit_code);
} }
@Override
public void showMessage(String title, String message) { public void showMessage(String title, String message) {
if (title == null) title = tr("Message"); if (title == null) title = tr("Message");
@ -27,6 +29,7 @@ public class BasicUserNotifier extends UserNotifier {
/** /**
* Non-fatal error message with optional stack trace side dish. * Non-fatal error message with optional stack trace side dish.
*/ */
@Override
public void showWarning(String title, String message, Exception e) { public void showWarning(String title, String message, Exception e) {
if (title == null) title = tr("Warning"); if (title == null) title = tr("Warning");

View File

@ -32,6 +32,7 @@ import java.io.FilenameFilter;
*/ */
public class OnlyDirs implements FilenameFilter { public class OnlyDirs implements FilenameFilter {
@Override
public boolean accept(File dir, String name) { public boolean accept(File dir, String name) {
if (name.charAt(0) == '.') if (name.charAt(0) == '.')
return false; return false;

View File

@ -32,6 +32,7 @@ public class OnlyFilesWithExtension implements FilenameFilter {
this.extensions = ext; this.extensions = ext;
} }
@Override
public boolean accept(File dir, String name) { public boolean accept(File dir, String name) {
for (String ext : extensions) { for (String ext : extensions) {
if (name.endsWith(ext)) { if (name.endsWith(ext)) {

View File

@ -36,17 +36,20 @@ public class Platform extends processing.app.Platform {
// TODO Need to be smarter here since KDE people ain't gonna like that GTK. // TODO Need to be smarter here since KDE people ain't gonna like that GTK.
// It may even throw a weird exception at 'em for their trouble. // It may even throw a weird exception at 'em for their trouble.
@Override
public void setLookAndFeel() throws Exception { public void setLookAndFeel() throws Exception {
GTKLookAndFeelFixer.installGtkPopupBugWorkaround(); GTKLookAndFeelFixer.installGtkPopupBugWorkaround();
} }
@Override
public File getDefaultSketchbookFolder() throws Exception { public File getDefaultSketchbookFolder() throws Exception {
File home = new File(System.getProperty("user.home")); File home = new File(System.getProperty("user.home"));
return new File(home, "Arduino"); return new File(home, "Arduino");
} }
@Override
public void openURL(String url) throws Exception { public void openURL(String url) throws Exception {
if (openFolderAvailable()) { if (openFolderAvailable()) {
String launcher = PreferencesData.get("launcher"); String launcher = PreferencesData.get("launcher");
@ -57,6 +60,7 @@ public class Platform extends processing.app.Platform {
} }
@Override
public boolean openFolderAvailable() { public boolean openFolderAvailable() {
if (PreferencesData.get("launcher") != null) { if (PreferencesData.get("launcher") != null) {
return true; return true;
@ -91,6 +95,7 @@ public class Platform extends processing.app.Platform {
} }
@Override
public void openFolder(File file) throws Exception { public void openFolder(File file) throws Exception {
if (openFolderAvailable()) { if (openFolderAvailable()) {
String launcher = PreferencesData.get("launcher"); String launcher = PreferencesData.get("launcher");

View File

@ -49,6 +49,7 @@ public class Platform extends processing.app.Platform {
private String osArch; private String osArch;
@Override
public void setLookAndFeel() throws Exception { public void setLookAndFeel() throws Exception {
} }
@ -58,6 +59,7 @@ public class Platform extends processing.app.Platform {
Toolkit.getDefaultToolkit(); Toolkit.getDefaultToolkit();
} }
@Override
public void init() throws Exception { public void init() throws Exception {
super.init(); super.init();
@ -76,11 +78,13 @@ public class Platform extends processing.app.Platform {
} }
@Override
public File getSettingsFolder() throws Exception { public File getSettingsFolder() throws Exception {
return new File(getLibraryFolder(), "Arduino15"); return new File(getLibraryFolder(), "Arduino15");
} }
@Override
public File getDefaultSketchbookFolder() throws Exception { public File getDefaultSketchbookFolder() throws Exception {
return new File(getDocumentsFolder(), "Arduino"); return new File(getDocumentsFolder(), "Arduino");
/* /*
@ -98,6 +102,7 @@ public class Platform extends processing.app.Platform {
} }
@Override
public void openURL(String url) throws Exception { public void openURL(String url) throws Exception {
Desktop desktop = Desktop.getDesktop(); Desktop desktop = Desktop.getDesktop();
if (url.startsWith("http") || url.startsWith("file:")) { if (url.startsWith("http") || url.startsWith("file:")) {
@ -108,11 +113,13 @@ public class Platform extends processing.app.Platform {
} }
@Override
public boolean openFolderAvailable() { public boolean openFolderAvailable() {
return true; return true;
} }
@Override
public void openFolder(File file) throws Exception { public void openFolder(File file) throws Exception {
//openURL(file.getAbsolutePath()); // handles char replacement, etc //openURL(file.getAbsolutePath()); // handles char replacement, etc
PApplet.open(file.getAbsolutePath()); PApplet.open(file.getAbsolutePath());

View File

@ -41,6 +41,7 @@ public class Platform extends processing.app.Platform {
private File settingsFolder; private File settingsFolder;
private File defaultSketchbookFolder; private File defaultSketchbookFolder;
@Override
public void init() throws Exception { public void init() throws Exception {
super.init(); super.init();
@ -108,15 +109,18 @@ public class Platform extends processing.app.Platform {
} }
} }
@Override
public File getSettingsFolder() { public File getSettingsFolder() {
return settingsFolder; return settingsFolder;
} }
@Override
public File getDefaultSketchbookFolder() throws Exception { public File getDefaultSketchbookFolder() throws Exception {
return defaultSketchbookFolder; return defaultSketchbookFolder;
} }
@Override
public void openURL(String url) throws Exception { public void openURL(String url) throws Exception {
// this is not guaranteed to work, because who knows if the // this is not guaranteed to work, because who knows if the
// path will always be c:\progra~1 et al. also if the user has // path will always be c:\progra~1 et al. also if the user has
@ -148,11 +152,13 @@ public class Platform extends processing.app.Platform {
} }
@Override
public boolean openFolderAvailable() { public boolean openFolderAvailable() {
return true; return true;
} }
@Override
public void openFolder(File file) throws Exception { public void openFolder(File file) throws Exception {
String folder = file.getAbsolutePath(); String folder = file.getAbsolutePath();
@ -180,12 +186,14 @@ public class Platform extends processing.app.Platform {
//noop //noop
} }
@Override
public List<File> postInstallScripts(File folder) { public List<File> postInstallScripts(File folder) {
List<File> scripts = new LinkedList<>(); List<File> scripts = new LinkedList<>();
scripts.add(new File(folder, "post_install.bat")); scripts.add(new File(folder, "post_install.bat"));
return scripts; return scripts;
} }
@Override
public List<File> preUninstallScripts(File folder) { public List<File> preUninstallScripts(File folder) {
List<File> scripts = new LinkedList<>(); List<File> scripts = new LinkedList<>();
scripts.add(new File(folder, "pre_uninstall.bat")); scripts.add(new File(folder, "pre_uninstall.bat"));
@ -195,9 +203,11 @@ public class Platform extends processing.app.Platform {
public void symlink(File something, File somewhere) throws IOException, InterruptedException { public void symlink(File something, File somewhere) throws IOException, InterruptedException {
} }
@Override
public void link(File something, File somewhere) throws IOException, InterruptedException { public void link(File something, File somewhere) throws IOException, InterruptedException {
} }
@Override
public void chmod(File file, int mode) throws IOException, InterruptedException { public void chmod(File file, int mode) throws IOException, InterruptedException {
} }

View File

@ -16,40 +16,49 @@ public class ArduinoDNSTaskStarter implements DNSTaskStarter.Factory.ClassDelega
return new DNSTaskStarter() { return new DNSTaskStarter() {
@Override
public void purgeTimer() { public void purgeTimer() {
delegate.purgeTimer(); delegate.purgeTimer();
timer.purge(); timer.purge();
} }
@Override
public void purgeStateTimer() { public void purgeStateTimer() {
delegate.purgeStateTimer(); delegate.purgeStateTimer();
} }
@Override
public void cancelTimer() { public void cancelTimer() {
delegate.cancelTimer(); delegate.cancelTimer();
timer.cancel(); timer.cancel();
} }
@Override
public void cancelStateTimer() { public void cancelStateTimer() {
delegate.cancelStateTimer(); delegate.cancelStateTimer();
} }
@Override
public void startProber() { public void startProber() {
delegate.startProber(); delegate.startProber();
} }
@Override
public void startAnnouncer() { public void startAnnouncer() {
delegate.startAnnouncer(); delegate.startAnnouncer();
} }
@Override
public void startRenewer() { public void startRenewer() {
delegate.startRenewer(); delegate.startRenewer();
} }
@Override
public void startCanceler() { public void startCanceler() {
delegate.startCanceler(); delegate.startCanceler();
} }
@Override
public void startReaper() { public void startReaper() {
new RecordReaper(jmDNSImpl) { new RecordReaper(jmDNSImpl) {
@Override @Override
@ -61,18 +70,22 @@ public class ArduinoDNSTaskStarter implements DNSTaskStarter.Factory.ClassDelega
}.start(timer); }.start(timer);
} }
@Override
public void startServiceInfoResolver(ServiceInfoImpl info) { public void startServiceInfoResolver(ServiceInfoImpl info) {
delegate.startServiceInfoResolver(info); delegate.startServiceInfoResolver(info);
} }
@Override
public void startTypeResolver() { public void startTypeResolver() {
delegate.startTypeResolver(); delegate.startTypeResolver();
} }
@Override
public void startServiceResolver(String type) { public void startServiceResolver(String type) {
delegate.startServiceResolver(type); delegate.startServiceResolver(type);
} }
@Override
public void startResponder(DNSIncoming in, int port) { public void startResponder(DNSIncoming in, int port) {
delegate.startResponder(in, port); delegate.startResponder(in, port);
} }