Ref: add new static analyser rule: category/java/bestpractices.xml/MissingOverride

This commit is contained in:
Laurent Clouet
2024-06-07 14:30:24 +00:00
parent bcb9eff255
commit 705203708b
11 changed files with 15 additions and 12 deletions

View File

@@ -14,6 +14,7 @@
<rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod" /> <rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod" />
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" /> <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
<rule ref="category/java/bestpractices.xml/CheckResultSet" /> <rule ref="category/java/bestpractices.xml/CheckResultSet" />
<rule ref="category/java/bestpractices.xml/MissingOverride" />
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine" /> <rule ref="category/java/bestpractices.xml/OneDeclarationPerLine" />
<rule ref="category/java/bestpractices.xml/PrimitiveWrapperInstantiation" /> <rule ref="category/java/bestpractices.xml/PrimitiveWrapperInstantiation" />
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter" /> <rule ref="category/java/bestpractices.xml/UnusedFormalParameter" />

View File

@@ -121,7 +121,7 @@ import lombok.Data;
/** /**
* @return string formatted with SheepIt Admin Log Viewer in mind * @return string formatted with SheepIt Admin Log Viewer in mind
*/ */
public String toString() { @Override public String toString() {
String c = " CFG: "; String c = " CFG: ";
String n ="\n"; String n ="\n";
return return

View File

@@ -133,6 +133,7 @@ import java.util.regex.Pattern;
return render; return render;
} }
@Override
public String toString() { public String toString() {
return String return String
.format("Job (numFrame '%s' archiveChunks %s rendererMD5 '%s' ID '%s' pictureFilename '%s' jobPath '%s' gpu %s name '%s' updateRenderingStatusMethod '%s' render %s)", .format("Job (numFrame '%s' archiveChunks %s rendererMD5 '%s' ID '%s' pictureFilename '%s' jobPath '%s' gpu %s name '%s' updateRenderingStatusMethod '%s' render %s)",
@@ -570,7 +571,7 @@ import java.util.regex.Pattern;
final String filename_without_extension = getPrefixOutputImage() + getFrameNumber(); final String filename_without_extension = getPrefixOutputImage() + getFrameNumber();
FilenameFilter textFilter = new FilenameFilter() { FilenameFilter textFilter = new FilenameFilter() {
public boolean accept(File dir, String name) { @Override public boolean accept(File dir, String name) {
return name.startsWith(filename_without_extension); return name.startsWith(filename_without_extension);
} }
}; };

View File

@@ -116,6 +116,7 @@ public class Server extends Thread {
this.httpClient = getOkHttpClient(); this.httpClient = getOkHttpClient();
} }
@Override
public void run() { public void run() {
this.stayAlive(); this.stayAlive();
} }
@@ -191,7 +192,7 @@ public class Server extends Thread {
} }
} }
public String toString() { @Override public String toString() {
return String.format("Server (base_url '%s', user_config %s", this.base_url, this.user_config); return String.format("Server (base_url '%s', user_config %s", this.base_url, this.user_config);
} }

View File

@@ -35,7 +35,7 @@ public class BaseHWInfoImpl implements BasicHWInfoStrategy {
return Optional.of(hardware.getProcessor().getProcessorIdentifier().getName()); return Optional.of(hardware.getProcessor().getProcessorIdentifier().getName());
} }
public Optional<String> getHarddriveID() { @Override public Optional<String> getHarddriveID() {
String rootMountpoint; String rootMountpoint;
if (Platform.isWindows()) { if (Platform.isWindows()) {
rootMountpoint = "C:"; rootMountpoint = "C:";

View File

@@ -32,7 +32,7 @@ public class ProxyAuthenticator extends Authenticator {
this.password = password; this.password = password;
} }
protected PasswordAuthentication getPasswordAuthentication() { @Override protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(user, password.toCharArray()); return new PasswordAuthentication(user, password.toCharArray());
} }
} }

View File

@@ -188,7 +188,7 @@ public class WinProcess {
return result; return result;
} }
public String toString() { @Override public String toString() {
return "WinProcess(pid: " + this.pid + ", handle " + this.handle + ")"; return "WinProcess(pid: " + this.pid + ", handle " + this.handle + ")";
} }
} }

View File

@@ -163,7 +163,7 @@ public class GuiSwing extends JFrame implements Gui {
sysTray = SystemTray.getSystemTray(); sysTray = SystemTray.getSystemTray();
if (SystemTray.isSupported()) { if (SystemTray.isSupported()) {
addWindowStateListener(new WindowStateListener() { addWindowStateListener(new WindowStateListener() {
public void windowStateChanged(WindowEvent e) { @Override public void windowStateChanged(WindowEvent e) {
if (e.getNewState() == ICONIFIED) { if (e.getNewState() == ICONIFIED) {
hideToTray(); hideToTray();
} }

View File

@@ -557,7 +557,7 @@ public class Settings implements Activity {
} }
} }
public void resizeWindow() {} @Override public void resizeWindow() {}
public boolean checkDisplaySaveButton() { public boolean checkDisplaySaveButton() {
boolean selected = useCPU.isSelected(); boolean selected = useCPU.isSelected();

View File

@@ -297,7 +297,7 @@ public class Working implements Activity {
parent.setSize(GuiSwing.WIDTH, 820); parent.setSize(GuiSwing.WIDTH, 820);
} }
public void resizeWindow() { @Override public void resizeWindow() {
parent.revalidate(); parent.revalidate();
parent.repaint(); parent.repaint();
} }

View File

@@ -41,7 +41,7 @@ public class CLIInputObserver implements Runnable {
listeners.add(toAdd); listeners.add(toAdd);
} }
public void run() { @Override public void run() {
in = new BufferedReader(new InputStreamReader(System.in)); in = new BufferedReader(new InputStreamReader(System.in));
String line = ""; String line = "";