Merge branch 'pmd/new-rule-9' into 'master'

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

See merge request sheepitrenderfarm/client!322
This commit is contained in:
Laurent Clouet
2024-06-07 14:30:24 +00:00
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/AvoidUsingHardCodedIP" />
<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/PrimitiveWrapperInstantiation" />
<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
*/
public String toString() {
@Override public String toString() {
String c = " CFG: ";
String n ="\n";
return

View File

@@ -133,6 +133,7 @@ import java.util.regex.Pattern;
return render;
}
@Override
public String toString() {
return String
.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();
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);
}
};

View File

@@ -116,6 +116,7 @@ public class Server extends Thread {
this.httpClient = getOkHttpClient();
}
@Override
public void run() {
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);
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -556,8 +556,8 @@ public class Settings implements Activity {
new SaveAction().actionPerformed(null);
}
}
public void resizeWindow() {}
@Override public void resizeWindow() {}
public boolean checkDisplaySaveButton() {
boolean selected = useCPU.isSelected();

View File

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

View File

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