Modify

Opened 5 years ago

Last modified 4 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 GerdP, 5 years ago

Seems the problem is caused by plugin shapetools which doesn't check if a way has nodes before trying to draw it.

comment:2 by Don-vip, 5 years ago

Component: CorePlugin shapetools
Summary: .AIOOBE at DrawableSegment.paint

comment:3 by GerdP, 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

     
    4545
    4646    @Override
    4747    public void paint(Graphics2D g, MapView mv, Bounds bbox) {
    48         if (segment != null) {
     48        if (segment != null && segment.way.getNodesCount() > 1) {
    4949            g.setColor(color);
    5050            g.setStroke(stroke);

I think the plugin should instead react on a delete by removing the invalid DrawableSegment instance?

comment:4 by Don-vip, 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 GerdP, 5 years ago

I also can't think of a use case for this plugin. I'll commit this patch tomorrow.

comment:6 by GerdP, 5 years ago

Cc: stoecker 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?

in reply to:  6 comment:7 by stoecker, 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.

Last edited 5 years ago by stoecker (previous) (diff)

comment:8 by GerdP, 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.

comment:9 by stoecker, 5 years ago

@Vincent: Can you answer?

I never published jar's for the Git plugins.

comment:10 by GerdP, 4 years ago

Ticket #18575 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to anonymous.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


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