The JavaAgent lives in ij1-patcher.jar now, not in ij-legacy.jar

It moved quite a while ago; Therefore should suggest to use
ij1-patcher.jar as Java agent instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add more cautious commitClass(String) method

The commitClass() method is used to make sure that the class loader has
a definition of the given class, possibly after patching said class. If,
however, the class loader in question is the same as the ij1-patcher
lives in, and a Class<?> parameter is required for the commitClass()
method, the class is loaded already, and cannot be patched later
anymore.

Therefore, let's just add a method that takes the class *name*, but keep
the old method for convenience in case we want to commit a class that we
do *not* want to patch anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Avoid loading the EssentialLegacyHooks class before patching it

The recent changes to make the LegacyEnvironment configurable involve
optional patches to the EssentialLegacyHooks class. However, if the
class loader to load the patched classes is the very same that hosts
ij1-patcher (i.e. if there is no separate LegacyClassLoader instance),
we really cannot load said class before patching it. So let's be extra
careful.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Allow disabling the execution of the initializer class

The initializer class is supposed to be loaded via the PluginClassLoader
first thing after the encapsulated ImageJ 1.x instance has initialized.
It is used at the moment to guarantee a nice startup of Fiji, by letting
the initializer set up a full ImageJ2 context and install the
Fiji-specific extensions.

However, in the near future, we will switch to letting ImageJ2 start
everything up, defaulting to the LegacyUI. So we need a way to disable
the initializer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reformat LegacyEnvironment's source code

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add some well-needed Javadoc for disableIJ1PluginDirs()

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: Allow disabling the PluginClassLoader

TODO: move code from LegacyInjector to LegacyExtensions.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a test for the new noPluginClassLoader() method

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>