From aa5ae56bce0716836f7f0dc528d5d2d148889528 Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Tue, 29 Oct 2024 21:19:39 +0000 Subject: [PATCH] PMD: Variables can be final. --- .../src/main/java/VASSAL/script/ExpressionInterpreter.java | 4 ++-- vassal-app/src/main/java/VASSAL/tools/DataArchive.java | 2 +- vassal-app/src/main/java/VASSAL/tools/PropertiesEncoder.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java b/vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java index 9b351554b3..ad66708783 100644 --- a/vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java +++ b/vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java @@ -1116,7 +1116,7 @@ public Object countMapLocation(Object locationName, Object mapName, Object prope final PieceFilter filter = createFilter(expression, ps); final Map targetMap = findVassalMap(mapName.toString()); - String propValue; + final String propValue; if (property == null || property.toString().isEmpty()) { propValue = null; } @@ -1251,7 +1251,7 @@ public Object countZone(Object zoneName, Object mapName, Object property, Object final PieceFilter filter = createFilter(expression, ps); final Map targetMap = findVassalMap(mapName.toString()); - String propValue; + final String propValue; if (property == null || property.toString().isEmpty()) { propValue = null; } diff --git a/vassal-app/src/main/java/VASSAL/tools/DataArchive.java b/vassal-app/src/main/java/VASSAL/tools/DataArchive.java index 855068b7c6..dec709ab28 100644 --- a/vassal-app/src/main/java/VASSAL/tools/DataArchive.java +++ b/vassal-app/src/main/java/VASSAL/tools/DataArchive.java @@ -322,7 +322,7 @@ protected SortedSet getLocalImageNames() { /* Localized directories always take the form images_XX with XX being a i18n code */ protected void buildLocalizedDirectoryList(List list) { - List files; + final List files; try { files = archive.getFiles(""); } diff --git a/vassal-app/src/main/java/VASSAL/tools/PropertiesEncoder.java b/vassal-app/src/main/java/VASSAL/tools/PropertiesEncoder.java index ddbae0e58c..155112ce36 100644 --- a/vassal-app/src/main/java/VASSAL/tools/PropertiesEncoder.java +++ b/vassal-app/src/main/java/VASSAL/tools/PropertiesEncoder.java @@ -42,7 +42,7 @@ public PropertiesEncoder(String stringValue) throws IOException { } private String encode(Properties p) { - String s; + final String s; try { final ByteArrayOutputStream out = new ByteArrayOutputStream(); p.store(out, null);