Skip to content

Commit 3428035

Browse files
committed
DefaultJava3DService: just pass the regex directly
1 parent c25ef31 commit 3428035

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,23 @@ private void checkLibExtDirectory(final ArrayList<File> files,
9696
checkFile(files, new File(dir, "j3dcore.jar"));
9797
checkFile(files, new File(dir, "vecmath.jar"));
9898
checkFile(files, new File(dir, "j3dutils.jar"));
99-
checkFilePattern(files, dir, "j3d-core*");
100-
checkFilePattern(files, dir, "vecmath*");
101-
checkFilePattern(files, dir, "jogl*");
99+
checkFilePattern(files, dir, "j3d-core.*");
100+
checkFilePattern(files, dir, "vecmath.*");
101+
checkFilePattern(files, dir, "jogl.*");
102102
// Maybe libJ3DUtils.jnilib libJ3DAudio.jnilib
103103
}
104104

105105
private void checkFilePattern(final ArrayList<File> files,
106-
final String dirPath, final String argPattern)
106+
final String dirPath, final String regex)
107107
{
108-
final String pattern = argPattern.replace(".", "\\.").replace("*", ".*");
109-
110108
final File dirFile = new File(dirPath.isEmpty() ? "." : dirPath);
111109
if (!dirFile.exists()) return;
112110

113111
final FilenameFilter filter = new FilenameFilter() {
114112

115113
@Override
116114
public boolean accept(final File dir, final String name) {
117-
return name.matches(pattern);
115+
return name.matches(regex);
118116
}
119117
};
120118
for (final File f : dirFile.listFiles(filter)) {

0 commit comments

Comments
 (0)