LegacyExtensions: make sure that the FolderOpener is patched properly

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

We will want to ask the ExprEditor whether it bothered to replace
any code.

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

This typo was introduced (most likely by typing 'i' in vi's "I beep"
mode once too many) in 77bc9519(ij-legacy: add "Convert to 8-bit
Grayscale" to File>Import>Image Sequence).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyExtensions: Fix overriding macro recorder's create macro

We want to initialize a Script Editor in that case, after all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: complain when code should have been replaced, but was not

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: make it easier to debug 'No code replaced' issues

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyExtensions: Handle StartupMacros.fiji.ijm again

This developer thought that ImageJ 1.x learnt the trick to handle that
file, but it did not, at least not completely.

So let's revert the breakage introduced in Fiji's commit 10a7e737(No
longer patch ImageJ 1.x to know about StartupMacros.fiji.ijm).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: refactor custom ExprEditor

We will want to convert almost all of the anonymous ExprEditor
subclasses to verify that they actually patched some code.

Let's just reuse the work we did with the replaceCallInMethod()
function and generalize it further.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: ensure that exception handlers were appropriately patched

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: some style fixes

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: ensure that replaceParameterInNew patched code

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyExtensions: Fix AppearanceOptions patching

The AppearanceOptions class superseded the Options#appearance()
method since ImageJ 1.46e. Oops.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: ensure that replaceParameterInCall() patched code

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: ensure that overrideFieldWrite() patched code

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: ensure that handleHTTPS() patched code

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: rename a couple of app name-related functions

They really did not replace parameters, but the application name *in*
said parameters...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'legacy-fixes'

The most important fix of this topic branch is certainly that the
legacy mode (read: Fiji) parses macros/StartupMacros.fiji.ijm again.

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