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 815 - With SCIFIO enabled, .java files from 'Open Recent' will not open
With SCIFIO enabled, .java files from 'Open Recent' will not open
Status: ASSIGNED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
Macintosh Mac OS
: P4 normal
Assigned To: Curtis Rueden
Depends on:
Blocks:
 
Reported: 2014-06-25 08:29 CDT by Jan Eglinger
Modified: 2014-07-14 11:25 CDT
4 users (show)

See Also:

Description Jan Eglinger 2014-06-25 08:29:02 CDT
A .java file in the 'Open Recent' menu will not open when the SCIFIO option is enabled (Edit > Options > ImageJ2)

When the SCIFIO option is unchecked, any .java file opens in the script editor as expected.

Information about your version of Java:

  os.arch => x86_64
  os.name => Mac OS X
  os.version => 10.9.3
  java.version => 1.6.0_65
  java.vendor => Apple Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_65-b14-462-11M4609
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 20.65-b04-462
  java.vm.vendor => Apple Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => apple.awt.CGraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => null
  file.separator => /

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: null
  imagej.dir => /Users/eglinger/Fiji-debug/Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20140623222553)
Fiji: http://fiji.sc/update/ (last check:20140624002555)
Comment 1 Curtis Rueden 2014-06-25 15:53:53 CDT
It seems the only way to get a .java file into the Open Recent menu is to first disable SCIFIO. So the reproduce this bug, one must:

- disable SCIFIO
- open the .java file
- reenable SCIFIO
- select the .java file from the Open Recent menuy
Comment 2 Mark Hiner 2014-07-14 10:05:07 CDT
I think there is an exception being thrown here.. not sure why it's not being displayed when opening recent files.

If you run File>Import>Image... and open a Java file you can directly expose the exception, without the workaround to reproduce mentioned by Curtis:

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at net.imagej.legacy.DefaultLegacyService.runLegacyCompatibleCommand(DefaultLegacyService.java:218)
	at net.imagej.legacy.DefaultLegacyHooks.interceptRunPlugIn(DefaultLegacyHooks.java:164)
	at ij.IJ.runPlugIn(IJ.java)
	at ij.Executer.runCommand(Executer.java:131)
	at ij.Executer.run(Executer.java:64)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
	at java.util.concurrent.FutureTask.get(FutureTask.java:83)
	at net.imagej.legacy.DefaultLegacyService.runLegacyCompatibleCommand(DefaultLegacyService.java:214)
	... 5 more
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at io.scif.AbstractMetadata.get(AbstractMetadata.java:123)
	at io.scif.filters.PlaneSeparatorMetadata.wrap(PlaneSeparatorMetadata.java:89)
	at io.scif.filters.AbstractReaderFilter.setParent(AbstractReaderFilter.java:155)
	at io.scif.filters.MasterFilterHelper.updateParents(MasterFilterHelper.java:194)
	at io.scif.filters.MasterFilterHelper.enable(MasterFilterHelper.java:130)
	at io.scif.filters.ReaderFilter.enable(ReaderFilter.java:66)
	at io.scif.img.ImgOpener.createReader(ImgOpener.java:544)
	at io.scif.img.ImgOpener.openImgs(ImgOpener.java:144)
	at net.imagej.DefaultDatasetService.open(DefaultDatasetService.java:266)
Comment 3 Mark Hiner 2014-07-14 11:03:35 CDT
OK.. when a .java file is opened via OpenRecent it gets picked up by the ScriptIOPlugin, which seems reasonable, and then this happens:

https://github.com/scijava/scijava-common/blob/master/src/main/java/org/scijava/script/io/ScriptIOPlugin.java#L70

The ScriptIOPlugin is not implemented and it returns null, which we interpret in the LegacyOpener as a "canceled" action:
https://github.com/imagej/imagej-legacy/blob/master/src/main/java/net/imagej/legacy/plugin/DefaultLegacyOpener.java#L136-139

Thus it does not get passed back to the ImageJ 1.x layer but instead simply does nothing (which is the correct action if the operation were actually canceled).



The Import>Image... exception is actually a different issue related to SCIFIO assuming a Reader exists for a format. I opened a new ticket for that in the SCIFIO trac:

https://github.com/scifio/scifio/issues/211
Comment 4 Mark Hiner 2014-07-14 11:25:25 CDT
See also this issue for the ScriptIOPlugin:
https://github.com/scijava/scijava-common/issues/94