Resolve code quality warnings

This commit is contained in:
Brendan Robert 2023-07-03 20:30:14 -05:00
parent 9b51c7d733
commit dd89499e76
4 changed files with 7 additions and 11 deletions

View File

@ -3,7 +3,6 @@ package jace;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -68,9 +67,6 @@ import javafx.util.StringConverter;
*/
public class JaceUIController {
@FXML
private URL location;
@FXML
private AnchorPane rootPane;

View File

@ -126,7 +126,7 @@ public class Configuration implements Reconfigurable {
public transient ConfigNode root;
public transient ConfigNode parent;
private transient ObservableList<ConfigNode> children;
private final transient ObservableList<ConfigNode> children;
public transient Reconfigurable subject;
private transient boolean changed = true;
@ -147,7 +147,7 @@ public class Configuration implements Reconfigurable {
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException {
if (children == null) {
children = getChildren();
children.setAll(getChildren());
}
children.setAll(super.getChildren());
id = (String) in.readObject();

View File

@ -400,8 +400,7 @@ public class Utility {
}
public static Object setChild(Object object, String fieldName, String value, boolean hex) {
if (object instanceof Map) {
Map map = (Map) object;
if (object instanceof Map map) {
for (Object key : map.entrySet()) {
if (key.toString().equalsIgnoreCase(fieldName)) {
map.put(key, value);

View File

@ -11,6 +11,8 @@ import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -139,7 +141,7 @@ public class LawlessHacks extends Cheats {
try {
return new Media(path.toURI().toString());
} catch (URISyntaxException e) {
e.printStackTrace();
Logger.getLogger(getClass().getName()).log(Level.WARNING, "Unable to load audio track " + number + " from " + pathStr, e);
return null;
}
}
@ -160,7 +162,7 @@ public class LawlessHacks extends Cheats {
private void stopSongEffect() {
if (playbackEffect != null && playbackEffect.isAlive()) {
playbackEffect.interrupt();
Thread.yield();
Thread.onSpinWait();
}
playbackEffect = null;
}
@ -331,7 +333,6 @@ public class LawlessHacks extends Cheats {
}
if (COMMENT.matcher(line).matches() || line.trim().isEmpty()) {
// System.out.println("Ignoring: "+line);
return;
} else if (LABEL.matcher(line).matches()) {
currentScore = line.toLowerCase(Locale.ROOT);
scores.put(currentScore, new HashMap<>());