Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19913 closed defect (fixed)

IOOBE: Index 254 out of bounds for length 0: Saving a relation, after splitting a child member with open relation editor

Reported by: skyper Owned by: GerdP
Priority: normal Milestone: 20.11
Component: Core Version: latest
Keywords: template_report relation editor refresh conflict Cc:

Description (last modified by Don-vip)

This is a follow up of #19353. Sadly, the situation is not much better.

What steps will reproduce the problem?

  1. Have a relation editor with some ways as member of the relation
  2. Split one way
  3. Change the order in the memberlist
  4. Save relation

What is the expected result?

After 2. the refesh button should be active an autorefresh is needed.
After 4. the relation should be saved without problem.

What happens instead?

After 2. the new way is not in the memberlist of the relation editor
After 4. a conflict and an exception similar to #19055.

Please provide any additional information below. Attach a screenshot if possible.

It seems I do not get around the conflict at all, as the reload is not possible. Strange.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-10-11 00:39:35 +0200 (Sun, 11 Oct 2020)
Revision:17154
Build-Date:2020-10-11 01:30:48
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (17154 en) Linux Debian GNU/Linux 10 (buster)
Java version: 11.0.8+10-post-Debian-1deb10u1, Debian, OpenJDK 64-Bit Server VM
Look and Feel: com.formdev.flatlaf.FlatDarculaLaf
Java package: openjdk-11-jre:amd64-11.0.8+10-1~deb10u1
Dataset consistency test: No problems found

Plugins:
…

Tagging presets:
…

Map paint styles:
…

Validator rules:
…

Last errors/warnings:
- 00206.109 W: java.net.SocketTimeoutException: Read timed out
- 10821.566 W: Conflicts detected - <html>There was 1 conflict detected.</html>
- 14144.366 W: Conflict in data - <html>This relation has been changed outside of the editor.<br>You cannot apply your changes and continue editing.<br><br>Do you want to create a conflict and close the editor?</html>
- 14153.254 W: Unsaved changes - <html>You have unsaved changes in this editor window.<br><br>Do you want to discard these changes and reload data from layer?</html>
- 14160.505 W: Conflict in data - <html>This relation has been changed outside of the editor.<br>You cannot apply your changes and continue editing.<br><br>Do you want to create a conflict and close the editor?</html>
- 14162.641 E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index 254 out of bounds for length 0


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (17) of main
java.lang.IndexOutOfBoundsException: Index 254 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:459)
	at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)
	at java.base/java.util.Spliterators$IntArraySpliterator.forEachRemaining(Spliterators.java:1032)
	at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:699)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getSelectedMembers(MemberTableModel.java:515)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.hasIncompleteSelectedMembers(MemberTableModel.java:415)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.DownloadSelectedIncompleteMembersAction.updateEnabledState(DownloadSelectedIncompleteMembersAction.java:46)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction.tableChanged(AbstractRelationEditorAction.java:76)
	at java.desktop/javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:297)
	at java.desktop/javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:199)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.populate(MemberTableModel.java:226)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.populateModels(GenericRelationEditor.java:331)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.reloadDataFromRelation(GenericRelationEditor.java:317)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.ApplyAction.actionPerformed(ApplyAction.java:32)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6400)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Attachments (0)

Change History (17)

comment:1 by GerdP, 4 years ago

Can you reproduce this with the tested version?

in reply to:  1 ; comment:2 by skyper, 4 years ago

Replying to GerdP:

Can you reproduce this with the tested version?

The problem with the disabled refresh button and always facing a conflict: yes.

The exception only occurs with latest, so far.

in reply to:  2 ; comment:3 by GerdP, 4 years ago

Replying to skyper:

Replying to GerdP:

Can you reproduce this with the tested version?

The problem with the disabled refresh button and always facing a conflict: yes.

OK, I see the same.

The exception only occurs with latest, so far.

The traceback contains DownloadSelectedIncompleteMembersAction. You don't mention this action in the description. Maybe you clicked the wrong button?
I can reproduce the problem with the latest version.

Last edited 4 years ago by GerdP (previous) (diff)

comment:4 by GerdP, 4 years ago

Owner: changed from team to GerdP
Status: newassigned

in reply to:  3 comment:5 by skyper, 4 years ago

Replying to GerdP:

Replying to skyper:

Replying to GerdP:

Can you reproduce this with the tested version?

The problem with the disabled refresh button and always facing a conflict: yes.

OK, I see the same.

Good.

The exception only occurs with latest, so far.

The traceback contains DownloadSelectedIncompleteMembersAction. You don't mention this action in the description. Maybe you clicked the wrong button?
I can reproduce the problem with the latest version.

No, I do not click the wrong button but it seems to be in all the tracebacks as I get this exception all the time and the only way to work around it is to close the relation editor before splitting a way.

comment:6 by GerdP, 4 years ago

Yes, the crash is a regression of r17140.

comment:7 by GerdP, 4 years ago

Reg. the refresh button:
I wonder what exactly is expected to happen when you click on the refresh button presuming that it is activated. My understanding was that this should give the same result as the sequence Cancel (without saving) ->Reopen editor for the relation. Not sure what whould happen when the relation was deleted, see #19915.
The current code doesn't use the current version that is displayed in the relation list, instead it "reloads" the version that existed when the relation editor was opened. So, this is not a refresh but some kind of "full undo".

comment:8 by Don-vip, 4 years ago

Description: modified (diff)

comment:9 by GerdP, 4 years ago

In 17171/josm:

see #19913: IOOBE: Index 254 out of bounds for length 0: Saving a relation, after splitting a child member with open relation editor

  • prevent IOOBE

comment:10 by GerdP, 4 years ago

Owner: changed from GerdP to skyper
Status: assignedneedinfo

Only fixed the crash. Needinfo reg. refresh button

comment:11 by GerdP, 4 years ago

Owner: changed from skyper to GerdP
Status: needinfoassigned

The refresh button was introduced with #12410, and the description matches the current Wiki, so I guess I can simply change the code to do what the wiki describes.
wiki:Help/Dialog/RelationEditor#RelationChangedOutsideOfEditor

comment:12 by GerdP, 4 years ago

In 17172/josm:

see #19913: IOOBE: Index 254 out of bounds for length 0: Saving a relation, after splitting a child member with open relation editor
see #19915: Crash in relation editor when saving after undo

  • enable Refresh button when snapshot is different to data in layer
  • enable Apply button also when relation was removed by undoing the creation of it
  • move some dispose() code from RelationEditor to GenericRelationEditor

comment:13 by GerdP, 4 years ago

Milestone: 20.10
Resolution: fixed
Status: assignedclosed

comment:14 by GerdP, 4 years ago

Resolution: fixed
Status: closedreopened

I can still reproduce the IOOBE:

  1. draw new closed way
  2. press Ctrl+B to change it to a multipolygon
  3. draw another closed way inside first
  4. select both ways and press Ctrl+Shift+B to update the multipolygon
  5. open relation editor for the multipolygon while both ways are still selected
  6. click undo (of update)
  7. click refresh in the relation editor

I think the problem is that multiple listeners are triggered in MemberTableModel and they both update at the same time.

Build-Date:2020-10-16 15:39:33
Revision:17215
Is-Local-Build:true

Identification: JOSM/1.5 (17215 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Home 2004 (19041)
Memory Usage: 1197 MB / 3641 MB (1068 MB allocated, but free)
Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1080 (scaling 1.0x1.0)
Maximum Screen Size: 1920x1080
Best cursor sizes: 16x16 -> 32x32, 32x32 -> 32x32
VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:51352, -ea, -Dfile.encoding=UTF-8]
Program arguments: [--debug]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (35579)
+ PolygonCutOut (v0.7)
+ apache-commons (35524)
+ buildings_tools (35579)
+ continuosDownload (91)
+ ejml (35313)
+ geotools (35169)
+ jaxb (35092)
+ jts (35122)
+ merge-overlap (35583)
+ o5m (35248)
+ opendata (35513)
+ pbf (35446)
+ poly (35248)
+ reverter (35579)
+ undelete (35521)
+ utilsplugin2 (35580)

Last errors/warnings:
- 00257.455 E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
- 00348.498 E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (20) of main
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:250)
	at java.util.Spliterators$IntArraySpliterator.forEachRemaining(Spliterators.java:1032)
	at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:693)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getSelectedMembers(MemberTableModel.java:516)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.hasIncompleteSelectedMembers(MemberTableModel.java:416)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.DownloadSelectedIncompleteMembersAction.updateEnabledState(DownloadSelectedIncompleteMembersAction.java:46)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction.tableChanged(AbstractRelationEditorAction.java:76)
	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:296)
	at javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:198)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.populate(MemberTableModel.java:227)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.populateModels(GenericRelationEditor.java:327)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.reloadDataFromRelation(GenericRelationEditor.java:320)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.RefreshAction.actionPerformed(RefreshAction.java:65)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6539)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

comment:15 by GerdP, 4 years ago

@Simon: Need your help here. This change fixes the problem:

The effect is that listSelectionModel is build again. I am sure there is a better method to achive that?

comment:16 by GerdP, 4 years ago

Resolution: fixed
Status: reopenedclosed

In 17217/josm:

fix #19913: IOOBE: Index 254 out of bounds for length 0: Saving a relation, after splitting a child member with open relation editor

  • clear selection when model is cleared and re-populated

comment:17 by Don-vip, 4 years ago

Milestone: 20.1020.11

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain GerdP.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.