NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #815 (closed defect: fixed)

Opened 2011-10-10T15:23:37-05:00

Last modified 2011-11-22T10:41:55-06:00

Exception when adding axes: possible race condition

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b1-initial
Component: Display API Version:
Severity: serious Keywords:
Cc: Blocked By:


Open Boats. Add axes (size 2 each) in this order (polarization, z, t). Each time an axis is added an exception is dumped to the console. The bad array index always equals the last one in the changed dataset which may be one beyond the view's index. The view may have not yet been updated and thus cannot find a given dimension.

Caused by: java.lang.ArrayIndexOutOfBoundsException: 4

at net.imglib2.display.XYProjector.getLongPosition(
at imagej.ui.swing.display.AbstractSwingImageDisplay$2.onEvent(
at imagej.ui.swing.display.AbstractSwingImageDisplay$2.onEvent(
at org.bushe.swing.event.ThreadSafeEventService.publish(

Change History

comment:1 Changed 2011-10-12T09:20:06-05:00 by bdezonia

42 hours later, at rev 4116, cannot duplicate

comment:2 Changed 2011-10-12T09:26:46-05:00 by bdezonia

I think earlier I had tested with rev 4107 or later. Since no code changes since then seem relevant this does seem like a race condition.

comment:3 Changed 2011-11-22T10:05:42-06:00 by bdezonia

Tested with f2539ec742ef9a8957c832faea72e3caacec11cd and still exists. Just adding a Z axis size 2 to Boats caused it.

[ERROR] Exception during event handling:

context = 0
consumed = false
object = boats.gif
[Subscriber] imagej.ui.swing.sdi.display.SwingSdiImageDisplay@5d66bddc
[Method] protected void

java.lang.ArrayIndexOutOfBoundsException: 2

at net.imglib2.display.XYProjector.getLongPosition(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

comment:4 Changed 2011-11-22T10:41:55-06:00 by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

Found issue and fixed in 9de2360eff61f119722b544de551596bd195da31