Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#19055 closed defect (fixed)

IndexOutOfBoundsException: relation manager: refreshing data with discarding changes

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

Description

What steps will reproduce the problem?

  1. Open 18018:josm_18018_example_v4.osm.bz2
  2. Open relation manager for route 66
  3. Add new middle node south of node E
  4. Select new node and node E and split way
  5. In relation manager: refresh data and sort completely.
  6. Undo last action (split way)
  7. In relation manager: refresh data and discard changes.

What is the expected result?

Changes in relation manager are discarded and data is refreshed from data layer

What happens instead?

IndexOutOfBoundsException: Index 6 out of bounds for length 6

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

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-04-08 18:20:25 +0200 (Wed, 08 Apr 2020)
Revision:16245
Build-Date:2020-04-09 01:30:48
URL:https://josm.openstreetmap.de/svn/trunk

Last errors/warnings:
- 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>
- E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index 6 out of bounds for length 6


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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (18) of main
java.lang.IndexOutOfBoundsException: Index 6 out of bounds for length 6
	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:458)
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getSelectedMembers(MemberTableModel.java:525)
	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 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:225)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.populateModels(GenericRelationEditor.java:323)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.reloadDataFromRelation(GenericRelationEditor.java:316)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.RefreshAction.actionPerformed(RefreshAction.java:65)
	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:6632)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6397)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	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:4840)
	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)

=== RUNNING THREADS ===
Thread: RemoteControl HTTP Server (48) of main
java.base@11.0.6/java.net.PlainSocketImpl.socketAccept(Native Method)
java.base@11.0.6/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:458)
java.base@11.0.6/java.net.ServerSocket.implAccept(ServerSocket.java:565)
java.base@11.0.6/java.net.ServerSocket.accept(ServerSocket.java:533)
app//org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpServer.run(RemoteControlHttpServer.java:104)

Thread: AWT-EventQueue-0 (18) of main
Stacktrace see above.

Thread: main-worker-0 (53) of main
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
java.base@11.0.6/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
java.base@11.0.6/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: WeakCollectionCleaner (42) of main
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176)
org.geotools.util.WeakCollectionCleaner.run(WeakCollectionCleaner.java:65)

Thread: Weak reference cleaner (31) of main
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176)
app//org.openstreetmap.josm.tools.ListenableWeakReference.clean(ListenableWeakReference.java:60)
app//org.openstreetmap.josm.tools.ListenableWeakReference$$Lambda$349/0x0000000840438840.run(Unknown Source)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: RemoteControl HTTP Server (47) of main
java.base@11.0.6/java.net.PlainSocketImpl.socketAccept(Native Method)
java.base@11.0.6/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:458)
java.base@11.0.6/java.net.ServerSocket.implAccept(ServerSocket.java:565)
java.base@11.0.6/java.net.ServerSocket.accept(ServerSocket.java:533)
app//org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpServer.run(RemoteControlHttpServer.java:104)

Thread: bug-report-display (60) of main
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.lang.Object.wait(Object.java:328)
app//org.openstreetmap.josm.tools.bugreport.BugReportQueue.getNext(BugReportQueue.java:123)
app//org.openstreetmap.josm.tools.bugreport.BugReportQueue.access$100(BugReportQueue.java:17)
app//org.openstreetmap.josm.tools.bugreport.BugReportQueue$BugReportDisplayRunnable.run(BugReportQueue.java:99)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: Map Status Collector (58) of main
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
java.base@11.0.6/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
java.base@11.0.6/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
app//org.openstreetmap.josm.gui.MapStatus$Collector.run(MapStatus.java:434)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: FileSystemWatchService (29) of main
java.base@11.0.6/sun.nio.fs.LinuxWatchService.poll(Native Method)
java.base@11.0.6/sun.nio.fs.LinuxWatchService$Poller.run(LinuxWatchService.java:316)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: Timer-2 (56) of main
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.lang.Object.wait(Object.java:328)
java.base@11.0.6/java.util.TimerThread.mainLoop(Timer.java:527)
java.base@11.0.6/java.util.TimerThread.run(Timer.java:506)

Thread: TimerQueue (20) of system
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
java.base@11.0.6/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
java.base@11.0.6/java.util.concurrent.DelayQueue.take(DelayQueue.java:229)
java.desktop@11.0.6/javax.swing.TimerQueue.run(TimerQueue.java:171)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: message-notifier-0 (49) of main
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
java.base@11.0.6/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
java.base@11.0.6/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
java.base@11.0.6/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: AWT-XAWT (17) of system
java.desktop@11.0.6/sun.awt.X11.XToolkit.waitForEvents(Native Method)
java.desktop@11.0.6/sun.awt.X11.XToolkit.run(XToolkit.java:688)
java.desktop@11.0.6/sun.awt.X11.XToolkit.run(XToolkit.java:652)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: File Watcher (30) of main
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
java.base@11.0.6/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
java.base@11.0.6/java.util.concurrent.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:483)
java.base@11.0.6/java.util.concurrent.LinkedBlockingDeque.take(LinkedBlockingDeque.java:671)
java.base@11.0.6/sun.nio.fs.AbstractWatchService.take(AbstractWatchService.java:118)
app//org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:120)
app//org.openstreetmap.josm.io.FileWatcher$$Lambda$319/0x00000008403bac40.run(Unknown Source)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: Reference Handler (2) of system
java.base@11.0.6/java.lang.ref.Reference.waitForReferencePendingList(Native Method)
java.base@11.0.6/java.lang.ref.Reference.processPendingReferences(Reference.java:241)
java.base@11.0.6/java.lang.ref.Reference$ReferenceHandler.run(Reference.java:213)

Thread: ForkJoinPool.commonPool-worker-5 (86)
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.parkUntil(LockSupport.java:275)
java.base@11.0.6/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1619)
java.base@11.0.6/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

Thread: Common-Cleaner (9) of InnocuousThreadGroup
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
java.base@11.0.6/jdk.internal.ref.CleanerImpl.run(CleanerImpl.java:148)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)
java.base@11.0.6/jdk.internal.misc.InnocuousThread.run(InnocuousThread.java:134)

Thread: AWT-Shutdown (19) of system
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.lang.Object.wait(Object.java:328)
java.desktop@11.0.6/sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:291)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: ForkJoinPool.commonPool-worker-3 (85) of main
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
java.base@11.0.6/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1628)
java.base@11.0.6/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

Thread: Signal Dispatcher (4) of system

Thread: Timer-0 (43) of main
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.util.TimerThread.mainLoop(Timer.java:553)
java.base@11.0.6/java.util.TimerThread.run(Timer.java:506)

Thread: Timer-1 (52) of main
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.util.TimerThread.mainLoop(Timer.java:553)
java.base@11.0.6/java.util.TimerThread.run(Timer.java:506)

Thread: ForkJoinPool.commonPool-worker-1 (72)
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.parkUntil(LockSupport.java:275)
java.base@11.0.6/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1619)
java.base@11.0.6/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

Thread: Finalizer (3) of system
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176)
java.base@11.0.6/java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:170)

Thread: JCS-ElementEventQueue-Thread-1 (40) of main
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
java.base@11.0.6/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
java.base@11.0.6/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: changeset-updater-0 (50) of main
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
java.base@11.0.6/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
java.base@11.0.6/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
java.base@11.0.6/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
java.base@11.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: Java2D Disposer (13) of system
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
java.base@11.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176)
java.desktop@11.0.6/sun.java2d.Disposer.run(Disposer.java:144)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Thread: GT authority factory disposer (41) of main
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.base@11.0.6/java.util.TimerThread.mainLoop(Timer.java:553)
java.base@11.0.6/java.util.TimerThread.run(Timer.java:506)

Thread: DestroyJavaVM (51) of main

Thread: styled-map-renderer-1 (74) of main
java.base@11.0.6/jdk.internal.misc.Unsafe.park(Native Method)
java.base@11.0.6/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
java.base@11.0.6/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1628)
java.base@11.0.6/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

Thread: Java2D Queue Flusher (15) of system
java.base@11.0.6/java.lang.Object.wait(Native Method)
java.desktop@11.0.6/sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:205)
java.base@11.0.6/java.lang.Thread.run(Thread.java:834)

Attachments (0)

Change History (9)

comment:1 by skyper, 4 years ago

Just happened again. It is annoying as you cannot use the command stack panel to undo changes of relations once two relations are saved from their relation manager.

All changes are adding/deleting members and take place within the relation editors

  1. Have two relation editor with different relations
  2. Edit in the first one and save within relation editor
  3. Edit the second one and save within relation editor
  4. Edit the first one and do not save
  5. Edit the second one and save within relation editor
  6. Close first relation editor discarding changes
  7. Undo last three changes in command stack panel
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-06-08 23:23:28 +0200 (Mon, 08 Jun 2020)
Revision:16584
Build-Date:2020-06-09 01:30:47
URL:https://josm.openstreetmap.de/svn/trunk

Last errors/warnings:
- W: Unsaved changes - <html>The relation has been changed.<br><br>Do you want to save your changes?</html>
- W: Unsaved changes - <html>The relation has been changed.<br><br>Do you want to save your changes?</html>
- E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index 145 out of bounds for length 145


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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (18) of main
java.lang.IndexOutOfBoundsException: Index 145 out of bounds for length 145
	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:458)
	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:227)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.populateModels(GenericRelationEditor.java:323)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.reloadDataFromRelation(GenericRelationEditor.java:316)
	at org.openstreetmap.josm.gui.dialogs.relation.actions.RefreshAction.actionPerformed(RefreshAction.java:65)
	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:6631)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6396)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5007)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4839)
	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:4839)
	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)

comment:2 by skyper, 4 years ago

Keywords: undo added
Version: latest

comment:3 by GerdP, 4 years ago

Owner: changed from team to GerdP
Status: newassigned

comment:4 by GerdP, 4 years ago

Cc: simon04 added
Keywords: regression added

IIGTR this problem is caused by concurrent updates. The undo removes a way which is both in the list of selected ways and in the relation editors selection list.
I think the crash is a regression of r16438. When I change

!#java
    public Collection<RelationMember> getSelectedMembers() {
        return Arrays.stream(getSelectedIndices())
                .mapToObj(members::get)
                .collect(Collectors.toList());
    }

to

    public Collection<RelationMember> getSelectedMembers() {
        return new ArrayList<>(Arrays.stream(getSelectedIndices())
                .mapToObj(members::get)
                .collect(Collectors.toList()));
    }

so that the list is really created at that point in time the problem disappears. With the current code it is not materialized and thus the next stream() operation in

    public Collection<OsmPrimitive> getSelectedChildPrimitives() {
        return getSelectedMembers().stream()
                .map(RelationMember::getMember)
                .collect(Collectors.toList());
    }

fails.
@simon04
I am not sure if this is a java bug or a general stream problem or something that should be fixed with locks.

comment:5 by GerdP, 4 years ago

https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html

"There are no guarantees on the type, mutability, serializability, or thread-safety of the List returned; if more control over the returned List is required, use toCollection(Supplier).

comment:6 by GerdP, 4 years ago

Oops, the problem was reported for r16245, so r16438 cannot be blamed. Still, the usage of Collectors.toList() in routines which care about the isSelected() state looks risky.

comment:7 by GerdP, 4 years ago

Resolution: fixed
Status: assignedclosed

In 17174/josm:

fix #19055: IndexOutOfBoundsException: relation manager: refreshing data with discarding changes
Avoid concurrent update of selected members and evaluation of the selected members

comment:8 by GerdP, 4 years ago

Milestone: 20.10

comment:9 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.