Skip to content

Commit 8b12562

Browse files
committed
ScriptService: fix bug in getOrCreate
Without this change, the cache missed every time, due to the wrong key (a File rather than a String path) being used for the lookup. Thanks Eclipse for the warning.
1 parent 4f40d01 commit 8b12562

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/script/DefaultScriptService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ private synchronized void initAliasMap() {
353353
* are registered with the service.
354354
*/
355355
private ScriptInfo getOrCreate(final File file) {
356-
final ScriptInfo info = scripts().get(file);
356+
final ScriptInfo info = scripts().get(file.getAbsolutePath());
357357
if (info != null) return info;
358358
return new ScriptInfo(getContext(), file);
359359
}

0 commit comments

Comments
 (0)