Skip to content

Commit fbb4856

Browse files
Minor auto-refactor code cleanup on a massive scale (#1086)
1 parent 820a42d commit fbb4856

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

server/bootstrap/src/org/apache/tools/ant/util/FileUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public class FileUtils
3737
// constants, for use in subsequent code (e.g., resolveFile()). These simplified versions should be identical.
3838
private static final String OS_NAME = System.getProperty("os.name").toLowerCase(Locale.US);
3939
private static final String PATH_SEP = System.getProperty("path.separator");
40-
private static boolean onNetWare = OS_NAME.contains("netware"); // Essentially what Os.isFamily("netware") does
41-
private static boolean onDos = PATH_SEP.equals(";") && !onNetWare; // Essentially what Os.isFamily("dos") does
40+
private static final boolean onNetWare = OS_NAME.contains("netware"); // Essentially what Os.isFamily("netware") does
41+
private static final boolean onDos = PATH_SEP.equals(";") && !onNetWare; // Essentially what Os.isFamily("dos") does
4242

4343
/**
4444
* Method to retrieve The FileUtils, which is shared by all users of this
@@ -109,7 +109,7 @@ public File resolveFile(File file, String filename) {
109109
* @since Ant 1.7
110110
*/
111111
public static boolean isContextRelativePath(String filename) {
112-
if (!(onDos || onNetWare) || filename.length() == 0) {
112+
if (!(onDos || onNetWare) || filename.isEmpty()) {
113113
return false;
114114
}
115115
char sep = File.separatorChar;
@@ -222,7 +222,7 @@ public String[] dissect(String path) {
222222
if (!isAbsolutePath(path)) {
223223
throw new BuildException(path + " is not an absolute path");
224224
}
225-
String root = null;
225+
String root;
226226
int colon = path.indexOf(':');
227227
if (colon > 0 && (onDos || onNetWare)) {
228228

server/bootstrap/src/org/labkey/bootstrap/ArgumentParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*/
2525
public class ArgumentParser
2626
{
27-
private List<String> _params = new ArrayList<>();
28-
private Map<String, String> _options = new HashMap<>();
27+
private final List<String> _params = new ArrayList<>();
28+
private final Map<String, String> _options = new HashMap<>();
2929

3030
public ArgumentParser(String[] args)
3131
{

server/bootstrap/src/org/labkey/bootstrap/ExplodedModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ public class ExplodedModule
6464

6565
private static final FileComparator _fileComparator = new FileComparator();
6666

67-
private File _rootDirectory;
67+
private final File _rootDirectory;
6868
private File _sourceModuleFile;
69-
private Map<File, Long> _watchedFiles = new HashMap<>();
69+
private final Map<File, Long> _watchedFiles = new HashMap<>();
7070

7171
public ExplodedModule(File rootDirectory)
7272
{

server/bootstrap/src/org/labkey/bootstrap/ModuleArchive.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private String nameFromModuleXML(InputStream is) throws IOException
7777
SAXParser parser = SAXParserFactory.newDefaultInstance().newSAXParser();
7878
parser.parse(is, new DefaultHandler()
7979
{
80-
ArrayList<String> elementStack = new ArrayList<>();
80+
final ArrayList<String> elementStack = new ArrayList<>();
8181

8282
@Override
8383
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException

server/bootstrap/src/org/labkey/bootstrap/ModuleDirectories.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package org.labkey.bootstrap;
1717

1818
import java.io.File;
19-
import java.io.IOException;
2019
import java.util.stream.Stream;
2120

2221
/*
@@ -33,7 +32,7 @@ public class ModuleDirectories
3332
public static final String DEFAULT_MODULES_DIR = "modules";
3433
public static final String DEFAULT_EXTERNAL_MODULES_DIR = "externalModules";
3534

36-
private File _modulesDirectory;
35+
private final File _modulesDirectory;
3736
private File _externalModulesDirectory;
3837

3938
public ModuleDirectories(File webAppDirectory)

0 commit comments

Comments
 (0)