Modify

Opened 3 years ago

Closed 3 years ago

#20994 closed defect (fixed)

[Patch] OutOfBoundsException when removing node of highlighted way

Reported by: Bjoeni Owned by: team
Priority: normal Milestone: 21.06
Component: Core Version: tested
Keywords: template_report Cc:

Description

Exception occurs when a node is deleted from a currently highlighted way (e.g. highlighted by the DeleteAction or the SplitWayAction)

Revision:17921
Is-Local-Build:true
Build-Date:2021-06-12 11:15:35

Identification: JOSM/1.5 (17921 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (21390)
Memory Usage: 224 MB / 4028 MB (89 MB allocated, but free)
Java version: 15.0.1+9-18, Oracle Corporation, OpenJDK 64-Bit Server VM
Look and Feel: com.formdev.flatlaf.FlatDarkLaf
Screen: \Display0 1920×1080 (scaling 1.00×1.00) \Display1 2560×1440 (scaling 1.00×1.00)
Maximum Screen Size: 2560×1440
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: Cp1252
Locale info: en_DE
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:51124, -javaagent:C:\Users\nburc\eclipse\java-2021-03\eclipse\configuration\org.eclipse.osgi\222\0\.cp\lib\javaagent-shaded.jar, -Dfile.encoding=UTF-8]
Program arguments: [--debug]
Dataset consistency test: No problems found

Plugins:
+ BusRouteMaintenance (1619878317)
+ InfoMode (35543)
+ apache-commons (35524)
+ flatlaf (35734)
+ photo_geotagging (35738)
+ photoadjust (35770)

Last errors/warnings:
- 00000.711 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.712 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00023.354 E: Failed to locate image 'segment'
- 00023.357 E: Failed to locate image 'average'
- 00023.361 E: Failed to locate image 'maintenance'
- 00080.941 E: Handled by bug report queue: java.lang.ArrayIndexOutOfBoundsException: Index 6 out of bounds for length 6
- 00108.002 E: Handled by bug report queue: java.lang.ArrayIndexOutOfBoundsException: Index 6 out of bounds for length 6



=== REPORTED CRASH DATA ===
StyledMapRenderer#paintRecord:
 - record: StyleRecord [style=LineElemStyle{z_idx=[3.0/0.03/0.0] width=2.0 realWidth=0.0 color=#C0C0C0 dashed=null dashedColor=null linejoin=round linecap=round}, osm={Way id=23787040 version=15 MVT nodes=[{Node id=59996607 version=5 V lat=47.9757001,lon=7.9157131}, {Node id=7141042245 version=8 VT lat=47.9754685,lon=7.9152594}, {Node id=420818123 version=3 V lat=47.9749719,lon=7.9143142}, {Node id=420834539 version=2 V lat=47.974424,lon=7.91322}, {Node id=2502437688 version=2 V lat=47.9740273,lon=7.9124713}, {Node id=29383149 version=4 V lat=47.9739117,lon=7.912307}]}, flags=0]

BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (26) of main
java.lang.ArrayIndexOutOfBoundsException: Index 6 out of bounds for length 6
	at org.openstreetmap.josm.data.osm.Way.getNode(Way.java:101)
	at org.openstreetmap.josm.data.osm.Way.getNode(Way.java:1)
	at org.openstreetmap.josm.data.osm.IWaySegment.getSecondNode(IWaySegment.java:76)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.drawWay(StyledMapRenderer.java:1301)
	at org.openstreetmap.josm.gui.mappaint.styleelement.LineElement.paintPrimitive(LineElement.java:160)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer$StyleRecord.paintPrimitive(StyledMapRenderer.java:227)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.paintRecord(StyledMapRenderer.java:1714)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.paintWithLock(StyledMapRenderer.java:1696)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.render(StyledMapRenderer.java:1645)
	at org.openstreetmap.josm.gui.layer.OsmDataLayer.paint(OsmDataLayer.java:545)
	at org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable$CompatibilityModeLayerPainter.paint(AbstractMapViewPaintable.java:27)
	at org.openstreetmap.josm.gui.MapView.paintLayer(MapView.java:468)
	at org.openstreetmap.josm.gui.MapView.drawMapContent(MapView.java:583)
	at org.openstreetmap.josm.gui.MapView.paint(MapView.java:490)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5255)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1643)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1618)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1556)
	at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
	at java.desktop/javax.swing.JComponent._paintImmediately(JComponent.java:5203)
	at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5013)
	at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:865)
	at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
	at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
	at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1884)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	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(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	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 (2)

comment:1 by Bjoeni, 3 years ago

Milestone: 21.06
Owner: changed from Bjoeni to team
Status: assignednew
Summary: OutOfBoundsException when removing node of highlighted way[Patch] OutOfBoundsException when removing node of highlighted way
Version: tested
  • src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

     
    12901290        if (!way.isHighlighted() && highlightWaySegments != null) {
    12911291            MapViewPath highlightSegs = null;
    12921292            for (WaySegment ws : highlightWaySegments) {
    1293                 if (ws.getWay() != way || ws.getLowerIndex() < offset) {
     1293                if (ws.getWay() != way || ws.getLowerIndex() < offset || !ws.isUsable()) {
    12941294                    continue;
    12951295                }
    12961296                if (highlightSegs == null) {
  • src/org/openstreetmap/josm/data/osm/IWaySegment.java

     
    6161    }
    6262
    6363    /**
     64     * Returns whether the IWaySegment is usable (node not deleted)
     65     * @return true if the segment is usable
     66     */
     67    public boolean isUsable() {
     68        return getUpperIndex() < way.getNodesCount();
     69    }
     70
     71    /**
    6472     * Returns the first node of the way segment.
    6573     * @return the first node
    6674     */

comment:2 by Don-vip, 3 years ago

Resolution: fixed
Status: newclosed

In 17986/josm:

fix #20994 - OOBE when removing node of highlighted way (patch by Bjoeni)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.