Ticket #877 (closed enhancement: wontfix)

Opened 8 years ago

Last modified 5 years ago

Consider whether we can have a Help>Refresh Menus

Reported by: dscho Owned by: dscho
Priority: major Milestone: imagej-2.5.0
Component: Other Version:
Severity: major Keywords:
Cc: Blocked By:
Blocking:

Description

Original ImageJ 1.x has a feature where you can drop new or updated .jar files in the plugins/ directory and hit Help>Refresh Menus which then picks up the changed plugins and adjusts the menus.

There were substantial problems with classes still in use whose corresponding .jar files were updated.

So we need to think seriously about whether we can support this feature, or a stripped-down version thereof, or go the Eclipse way ("We really recommend you restart now. Do you want to restart? Hint: you should say yes").

Change History

comment:1 Changed 8 years ago by dscho

With the current ImageJ launcher, there is a minimal ij-launcher.jar with support classes. This .jar file is the only one in the system class path, to allow for relaunching any class with any class path (except the three classes in ij-launcher: ClassLauncher, JarLauncher and ClassLoaderPlus).

comment:2 Changed 8 years ago by dscho

The ij-launcher acquired the method ClassLauncher.restart() for exactly that purpose. This required a bunch of changes in both ij-launcher.jar and ImageJ.c:

  • ClassLoaderPlus learnt how to discover class paths both for setting the class loader's class path and for setting a "-classpath <path list>" parameter for things such as javac or javadoc.

The relevant code is accessible via ClassLauncher's -classpath, -ijclasspath, -jarpath and -ijjarpath options which add a class path or all .jar files in a given directory and all its subdirectories. The options prefixed by '-ij' look specifically in locations relative to the ImageJ root directory, no matter what the current working directory may be.

  • the ImageJ launcher no longer discovers any class path itself, but rather hands off to ClassLoader which in turn hands that task over to ClassLoaderPlus.
  • ClassLauncher now remembers the original command-line arguments, including -classpath and friends. This allows us to restart ImageJ rediscovering all the available .jar files (even if some might be removed or added).

Furthermore, the ClassLauncher also supports the option to start a completely independent main() method of a given class using a new class loader. This will allow us to start only a new version of the Updater without affecting anything else ImageJ2 (although we can no longer put the ImageJ2 Updater window into the existing Window menu when we do that, but that is a minor annoyance in this developer's opinion).

If need be, we might consider adding yet another ClassLoader implementation which always searches in the given class path first before handing off to the parent class loader. This might even allow us to replace just the Updater and nothing else!

comment:3 Changed 8 years ago by dscho

  • Status changed from new to accepted

comment:4 Changed 5 years ago by curtis

  • Status changed from accepted to reviewing

Dscho, can you comment on the current thinking with respect to this feature? I'm guessing that at this point, this ticket can be closed as either "fixed" or "wontfix" thanks to imagej-legacy's new tiered class loader approach.

comment:5 Changed 5 years ago by curtis

  • Status changed from reviewing to closed
  • Resolution set to wontfix

We won't be able to support this any time soon.

Note: See TracTickets for help on using tickets.