NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 363 - LOCI package name collides with reserved operator in Javascript
LOCI package name collides with reserved operator in Javascript
Status: RESOLVED WONTFIX
Product: Fiji
Classification: Unclassified
Component: Other
unspecified
PC Mac OS
: P2 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2011-09-15 14:21 CDT by Jan Eglinger
Modified: 2011-09-15 17:05 CDT
1 user (show)

See Also:

Description Jan Eglinger 2011-09-15 14:21:50 CDT
The LOCI Bioformats package loci.plugins.in is in conflict with the reserved word "in" of Javascript, which makes it impossible to import one of its subclasses. To reproduce, please try the following in a js script:

importClass(Packages.loci.plugins.in.ImporterOptions);

This raises the EvaluatorException "missing name after . operator"

Cheers,
Jan
Comment 1 Curtis Rueden 2011-09-15 16:34:26 CDT
As you say, "in" is a reserved word in Javascript. I'm not sure of an explicit fix for this, but there is a workaround, in that you can use an alternative syntax. Try this:

importClass(Packages['loci.plugins.in.ImporterOptions']);

I learned of this trick from the following blog post:
  http://blogs.oracle.com/sundararajan/entry/java_method_overload_resolution_in
Comment 2 Jan Eglinger 2011-09-15 17:05:19 CDT
(In reply to comment #1)
> importClass(Packages['loci.plugins.in.ImporterOptions']);

Great! Thanks Curtis for the quick hint.
I guess we can put this to WONTFIX then..