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 1174 - Closing script editor without saving throws exception
Closing script editor without saving throws exception
Status: FIXPENDING
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2015-10-12 07:06 CDT by Jan Eglinger
Modified: 2015-10-12 10:39 CDT
2 users (show)

See Also:

Description Jan Eglinger 2015-10-12 07:06:27 CDT
To reproduce:
 - start Fiji
 - File > New > Script
 - type any code
 - close the script editor window
 - in the dialog ("Do you want to save changes"), choose "No"

the following exception will be thrown:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.Vector.elementAt(Vector.java:430)
	at javax.swing.JTabbedPane.getComponentAt(JTabbedPane.java:1203)
	at net.imagej.ui.swing.script.TextEditor.getTab(TextEditor.java:755)
	at net.imagej.ui.swing.script.TextEditor.getEditorPane(TextEditor.java:775)
	at net.imagej.ui.swing.script.TextEditor.checkForOutsideChanges(TextEditor.java:679)
	at net.imagej.ui.swing.script.TextEditor$10.windowGainedFocus(TextEditor.java:601)
	at java.awt.Window.processWindowFocusEvent(Window.java:1912)
	at java.awt.Window.processEvent(Window.java:1827)
	at java.awt.Component.dispatchEventImpl(Component.java:4652)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4482)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:910)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:371)
	at java.awt.Component.dispatchEventImpl(Component.java:4524)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4482)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
	at java.awt.EventQueue.access$000(EventQueue.java:85)
	at java.awt.EventQueue$1.run(EventQueue.java:603)
	at java.awt.EventQueue$1.run(EventQueue.java:601)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
	at java.awt.EventQueue$2.run(EventQueue.java:617)
	at java.awt.EventQueue$2.run(EventQueue.java:615)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
	at java.awt.SequencedEvent.dispatch(SequencedEvent.java:101)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
	at java.awt.EventQueue.access$000(EventQueue.java:85)
	at java.awt.EventQueue$1.run(EventQueue.java:603)
	at java.awt.EventQueue$1.run(EventQueue.java:601)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
	at java.awt.EventQueue$2.run(EventQueue.java:617)
	at java.awt.EventQueue$2.run(EventQueue.java:615)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Information about your version of Java:

  os.arch => amd64
  os.name => Windows 7
  os.version => 6.1
  java.version => 1.6.0_24
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_24-b07
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 19.1-b02
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: C:\UTILIT~1\FIJI-D~1.APP/java/win64/jdk1.6.0_24//jre
  imagej.dir => C:\UTILIT~1\FIJI-D~1.APP

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20150915154157)
Fiji: http://update.fiji.sc/ (last check:20151008225731)
Comment 1 Mark Hiner 2015-10-12 10:39:41 CDT
Thanks Jan.

I can't currently reproduce this on my system (OSX Yosemite, Java 1.8.0_25). But your helpful stack trace did reveal a potential for the AIOOB.

Hopefully fixed in: https://github.com/imagej/imagej-ui-swing/commit/b02944a31d96186cf88460b95a461703675952b5