Skip to content

Commit 209575d

Browse files
committed
SystemInformation: also report ToolProvider JARs
It is very useful to know where the detected classes are coming from.
1 parent a58cad0 commit 209575d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/main/java/org/scijava/plugins/commands/debug/SystemInformation.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,10 @@ public static String getMiscellany() {
288288
final HashMap<String, Object> miscellany = new HashMap<String, Object>();
289289

290290
final JavaCompiler sjc = ToolProvider.getSystemJavaCompiler();
291-
final String sjcName = sjc == null ? null : sjc.getClass().getName();
292-
miscellany.put("System Java compiler", sjcName);
291+
miscellany.put("System Java compiler", classNameAndLocation(sjc));
293292

294293
final ClassLoader stcl = ToolProvider.getSystemToolClassLoader();
295-
final String stclName = stcl == null ? null : stcl.getClass().getName();
296-
miscellany.put("System tool class loader", stclName);
294+
miscellany.put("System tool class loader", classNameAndLocation(stcl));
297295

298296
return mapToString(miscellany);
299297
}
@@ -367,4 +365,10 @@ private <PT extends SciJavaPlugin> void dumpPlugins(final StringBuilder sb,
367365
}
368366
}
369367

368+
private static String classNameAndLocation(final Object o) {
369+
if (o == null) return null;
370+
final Class<?> c = o.getClass();
371+
return c.getName() + " [" + ClassUtils.getLocation(c) + "]";
372+
}
373+
370374
}

0 commit comments

Comments
 (0)