Skip to content

Commit dfa3700

Browse files
committed
DefaultJava3DService: test existence of dir once
1 parent 6c9db47 commit dfa3700

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/java/org/scijava/java3d/DefaultJava3DService.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,21 @@ protected void onEvent(@SuppressWarnings("unused") final UIShownEvent evt) {
9393
private void checkLibExtDirectory(final ArrayList<File> files,
9494
final String dirPath)
9595
{
96-
checkFile(files, new File(dirPath, "j3dcore.jar"));
97-
checkFile(files, new File(dirPath, "vecmath.jar"));
98-
checkFile(files, new File(dirPath, "j3dutils.jar"));
99-
checkFilePattern(files, dirPath, "j3d-core.*");
100-
checkFilePattern(files, dirPath, "vecmath.*");
101-
checkFilePattern(files, dirPath, "jogl.*");
96+
final File dirFile = new File(dirPath.isEmpty() ? "." : dirPath);
97+
if (!dirFile.exists()) return;
98+
99+
checkFile(files, new File(dirFile, "j3dcore.jar"));
100+
checkFile(files, new File(dirFile, "vecmath.jar"));
101+
checkFile(files, new File(dirFile, "j3dutils.jar"));
102+
checkFilePattern(files, dirFile, "j3d-core.*");
103+
checkFilePattern(files, dirFile, "vecmath.*");
104+
checkFilePattern(files, dirFile, "jogl.*");
102105
// Maybe libJ3DUtils.jnilib libJ3DAudio.jnilib
103106
}
104107

105108
private void checkFilePattern(final ArrayList<File> files,
106-
final String dirPath, final String regex)
109+
final File dirFile, final String regex)
107110
{
108-
final File dirFile = new File(dirPath.isEmpty() ? "." : dirPath);
109-
if (!dirFile.exists()) return;
110-
111111
final FilenameFilter filter = new FilenameFilter() {
112112

113113
@Override

0 commit comments

Comments
 (0)