Opened 5 years ago
Last modified 5 years ago
#18076 new defect
AIOOBE at DrawableSegment.paint
Reported by: | anonymous | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin shapetools | Version: | |
Keywords: | template_report | Cc: | stoecker |
Description
What steps will reproduce the problem?
What is the expected result?
What happens instead?
Please provide any additional information below. Attach a screenshot if possible.
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2019-07-10 00:52:47 +0200 (Wed, 10 Jul 2019) Build-Date:2019-07-10 01:30:51 Revision:15238 Relative:URL: ^/trunk Identification: JOSM/1.5 (15238 es) Windows 10 64-Bit OS Build number: Windows 10 Enterprise 1809 (17763) Memory Usage: 489 MB / 989 MB (195 MB allocated, but free) Java version: 1.8.0_221-b11, Oracle Corporation, Java HotSpot(TM) Client VM Screen: \Display0 3840x2160 Maximum Screen Size: 3840x2160 Dataset consistency test: No problems found Plugins: + AddrInterpolation (34908) + BuildingGeneralization (23) + FastDraw (34977) + ImportImagePlugin (34908) + ImproveWay (26) + PicLayer (35030) + ShapeTools (1240) + apache-commons (34908) + areaselector (349) + austriaaddresshelper (57) + auto_tools (73) + buildings_tools (34982) + continuosDownload (82) + contourmerge (v0.1.4) + ejml (35049) + geotools (34908) + imagery_offset_db (34908) + jaxb (35014) + jts (35064) + log4j (34908) + measurement (35051) + merge-overlap (35072) + opendata (35102) + photoadjust (34977) + reltoolbox (34977) + reverter (35084) + routing (35039) + splinex (34908) + terracer (34977) + turnrestrictions (34977) + undelete (34977) + utilsplugin2 (35098) Last errors/warnings: - W: Cannot lock cache directory. Will not use disk cache - W: No configuration settings found. Using hardcoded default values for all pools. - E: Thread main-worker-0 raised java.lang.IllegalArgumentException: bytes must be >= 0 - E: Thread main-worker-0 raised java.lang.IllegalArgumentException: bytes must be >= 0 - E: Thread main-worker-0 raised java.lang.IllegalArgumentException: bytes must be >= 0 - E: Thread main-worker-0 raised java.lang.IllegalArgumentException: bytes must be >= 0 - E: Thread main-worker-0 raised java.lang.IllegalArgumentException: bytes must be >= 0 - E: Thread main-worker-0 raised java.lang.IllegalArgumentException: bytes must be >= 0 - E: Handled by bug report queue: java.lang.ArrayIndexOutOfBoundsException: 0 - W: Atención - <html>JOSM no ha podido encontrar información sobre los complementos siguientes:<ul><li>ImproveWay</li><li>apache-commons</li><li>reltoolbox</li><li>geotools</li><li>opendata</li><li>ShapeTools</li><li>measurement</li><li>continuosDownload</li><li>jaxb</li><li>routing</li><li>utilsplugin2</li><li>AddrInterpolation</li><li>terracer</li><li>turnrestrictions</li><li>PicLayer</li><li>contourmerge</li><li>log4j</li><li>BuildingGeneralization</li><li>auto_tools</li><li>imagery_offset_db</li><li>photoadjust</li><li>jts</li><li>splinex</li><li>ejml</li><li>reverter</li><li>FastDraw</li><li>ImportImagePlugin</li><li>areaselector</li><li>undelete</li><li>buildings_tools</li><li>austriaaddresshelper</li><li>merge-overlap</li></ul>Los complementos no serán cargados.</html> === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: AWT-EventQueue-0 (15) of main java.lang.ArrayIndexOutOfBoundsException: 0 at org.openstreetmap.josm.data.osm.Way.getNode(Way.java:97) at org.openstreetmap.josm.data.osm.WaySegment.getFirstNode(WaySegment.java:42) at org.openstreetmap.josm.plugins.shapetools.DrawableSegment.paint(DrawableSegment.java:52) at org.openstreetmap.josm.gui.MapView.drawTemporaryLayers(MapView.java:651) at org.openstreetmap.josm.gui.MapView.drawMapContent(MapView.java:588) at org.openstreetmap.josm.gui.MapView.paint(MapView.java:491) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintToOffscreen(Unknown Source) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source) at javax.swing.RepaintManager$PaintManager.paint(Unknown Source) at javax.swing.RepaintManager.paint(Unknown Source) at javax.swing.JComponent._paintImmediately(Unknown Source) at javax.swing.JComponent.paintImmediately(Unknown Source) at javax.swing.RepaintManager$4.run(Unknown Source) at javax.swing.RepaintManager$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.access$1200(Unknown Source) at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
Attachments (0)
Change History (10)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Component: | Core → Plugin shapetools |
---|---|
Summary: | . → AIOOBE at DrawableSegment.paint |
comment:3 by , 5 years ago
I can easily reproduce the error when I first rotate a building using the plugin and next delete the building way.
It's easy to avoid the AIOOBE by adding a check that the way has nodes, but I wonder if that is the right place to handle this:
-
src/org/openstreetmap/josm/plugins/shapetools/DrawableSegment.java
45 45 46 46 @Override 47 47 public void paint(Graphics2D g, MapView mv, Bounds bbox) { 48 if (segment != null ) {48 if (segment != null && segment.way.getNodesCount() > 1) { 49 49 g.setColor(color); 50 50 g.setStroke(stroke);
I think the plugin should instead react on a delete by removing the invalid DrawableSegment
instance?
comment:4 by , 5 years ago
The plugin is unmaintained and I have no idea what it is doing. A simple fix that removes the exception (and avoids future bug reports for us) is enough for me.
comment:5 by , 5 years ago
I also can't think of a use case for this plugin. I'll commit this patch tomorrow.
follow-up: 7 comment:6 by , 5 years ago
Cc: | added |
---|
I just found our that I cannot commit the patch, source is on github.
@Dirk: I see you added some I18n changes so maybe you can commit it?
comment:7 by , 5 years ago
Replying to GerdP:
I just found our that I cannot commit the patch, source is on github.
@Dirk: I see you added some I18n changes so maybe you can commit it?
You should now have the rights to commit there. Please try. If not I don't understand the rights management of GitHub.
comment:8 by , 5 years ago
svn commit worked. I did not even try it before when I was requested a github login. What has to be done to publish the jar file? It is not contained in the josm dist directory.
Seems the problem is caused by plugin shapetools which doesn't check if a way has nodes before trying to draw it.