[ImageJ-bugs] [Bug 835] Fiji hangs when installing macro tool
bugzilla at fiji.sc
bugzilla at fiji.sc
Sun Aug 24 06:33:57 CDT 2014
http://fiji.sc/bugzilla/show_bug.cgi?id=835
--- Comment #9 from Ilan Tal <ilan.tal at gmail.com> ---
Hi Mark,
This is the case "Install from more" which is attachment 181. The process
starts at Toolbar.itemStateChanged:1270 and the critical difference is at
Executer.runCommand:131. The interesting code is
void runCommand(String cmd) {
Hashtable table = Menus.getCommands();
String className = (String)table.get(cmd);
if (className!=null) {
String arg = "";
if (className.endsWith("\")")) {
// extract string argument (e.g. className("arg"))
int argStart = className.lastIndexOf("(\"");
if (argStart>0) {
arg = className.substring(argStart+2,
className.length()-2);
className = className.substring(0, argStart);
}
}
if (IJ.shiftKeyDown() &&
className.startsWith("ij.plugin.Macro_Runner") &&
!Menus.getShortcuts().contains("*"+cmd))
IJ.open(IJ.getDirectory("plugins")+arg);
else
IJ.runPlugIn(cmd, className, arg);
There is a hash table of commands and the question is: what is the command
which gets picked up? In the ImageJ environment the className comes back as
ij.plugin.Macro_Runner("Tools/Postage_Action_Tool.ijm")
This ends with ") so it is parsed into 2 strings:
className = ij.plugin.Macro_Runner
and arg = Tools/Postage_Action_Tool.ijm
In Fiji something else comes out. The className comes back as
script:/home/ilan/Fiji.app/plugins/Tools/Postage_Action_Tool.ijm
Of course no parsing is performed and arg=""
Not surpringly the IJ.runPlugIn(cmd, className, arg)
works totally differently. Later on down the line, this results in the crash.
So the hash table has been changed. Where it has been changed and why it has
been changed, I don't know, but the change results in a crash.
If you have any idea why it isn't picking up "ij.plugin.Macro_Runner" but
instead is using script:/...., I would be interested in hearing about it.
Now I'll go look at the second case.
Thanks,
Ilan
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-bugs/attachments/20140824/d7149b4d/attachment.html>
More information about the Imagej-bugs
mailing list