Closed imagingbook closed 2 years ago
Hi Wilhelm,
Do you any suggestions for how the ClassChecker can be modified to fix these issues?
Sure, I'd be happy to fix it but I am still unclear about its intent. Apparently ClassChecker is supposed to find plugins with identical names in (evidently) different packages and delete all but the most recent .class file.
I tried to run ImageJ with ClassChecker completely deactivated and it seems to be doing just fine. So perhaps it could be removed all together, or I have overlooked something?
The ImageJ 1.53s6 daily build deactivates ClassChecker except when the Compile and Run command is used.
The ClassChecker in the ImageJ 1.53s7 daily build displays warning messages but no longer deletes files. It only runs when you use the Compile and Run command, which typically creates class files that are not in a package.
I cannot see this change in this repo. Has the 1.53s7 build been pushed?
The new 1.53s10 commit has all the ClassChecker changes.
ClassChecker
"checks for duplicate class and JAR files in the plugins folders and deletes older duplicates": I am not sure about the original purpose of this, since duplicate.class
and.jar
files cannot exist unless they reside in different packages. That is, plugins with the same names but in different packages should be allowed in general. If duplicate "command names" are a problem, the package names could be included.Apart from this, there appear to be 2 issues with
ClassChecker
as it is now:Deletion does not work properly. Assume there are 3 plugins with the same name
My_Inverter.class
in three packagesA
,B
,C
, with identical modification dates. In this case, onlyA.My_Inverter.class
is deleted, but 3 times in a row:Compiled
package-info.class
files should be ignored, since they cannot contain plugin code. They should be allowed to exist, there is no reason to delete them at all:One more issue: The deleted
.class
files get nevertheless listed in thePlugins
menu, so when a user selects any of these a "class-not-found" error occurs!