Modify

Opened 6 years ago

Closed 6 years ago

#17509 closed defect (fixed)

[PATCH] NPE at auto_tools.actions.SplittingTool$1.keyPressed

Reported by: anonymous Owned by: Rub21
Priority: normal Milestone:
Component: Plugin auto_tools Version:
Keywords: template_report Cc:

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-03-03 00:16:03 +0100 (Sun, 03 Mar 2019)
Build-Date:2019-03-02 23:16:53
Revision:14824
Relative:URL: ^/trunk

Identification: JOSM/1.5 (14824 en) Mac OS X 10.14.3
OS Build number: Mac OS X 10.14.3 (18D109)
Memory Usage: 648 MB / 1820 MB (241 MB allocated, but free)
Java version: 1.8.0_201-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: Display 188945226 1920x1080, Display 69988428 2048x1152
Maximum Screen Size: 2048x1152
VM arguments: [-Djava.security.policy=file:<java.home>/lib/security/javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>/bin, -Djava.security.manager, -Djnlpx.origFilenameArg=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/56/1ee8cfb8-43cfc93f, -Djnlpx.remove=false, -Dsun.awt.warmup=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Dmacosx.jnlpx.dock.name=JOSM, -Dmacosx.jnlpx.dock.icon=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/25/4c122699-382dd66c.icns, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp , -Djnlpx.jvm="<java.home>/bin/java"]
Dataset consistency test: No problems found

Plugins:
+ auto_tools (67)
+ buildings_tools (34904)
+ markseen (11)
+ osm-obj-info (51)
+ utilsplugin2 (34915)

Map paint styles:
+ ${HOME}/Desktop/JOSM Paintstyles and Screenshots/MX_Import.mapcss
+ ${HOME}/Desktop/JOSM Paintstyles and Screenshots/Kaart Paintstyles/Overlapping Ways.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1

Validator rules:
- https://raw.githubusercontent.com/KaartGroup/KaartValidator/master/kaart.mexicobrazil.validator.mapcss

Last errors/warnings:
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- W: Region [WMS_BLOCK_v2] Resetting cache
- W: Region [WMTS_BLOCK_v2] Resetting cache
- W: Conflicts detected - <html>There were 7 conflicts detected.</html>
- E: Handled by bug report queue: java.lang.NullPointerException
- E: Handled by bug report queue: java.lang.NullPointerException
- W: Warning - <html>JOSM could not find information about the following plugins:<ul><li>auto_tools</li><li>utilsplugin2</li><li>markseen</li><li>buildings_tools</li><li>osm-obj-info</li></ul>The plugins are not going to be loaded.</html>


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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-2 (36) of javawsApplicationThreadGroup
java.lang.NullPointerException
	at org.openstreetmap.josm.plugins.auto_tools.actions.SplittingTool$1.keyPressed(SplittingTool.java:92)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:249)
	at java.awt.Component.processKeyEvent(Component.java:6497)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2832)
	at java.awt.Component.processEvent(Component.java:6316)
	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.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:835)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1103)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:974)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:800)
	at java.awt.Component.dispatchEventImpl(Component.java:4760)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	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)

Attachments (1)

17509.patch (1.1 KB ) - added by taylor.smock 6 years ago.
Add check for null MainApplication.getMap().mapMode since it is possible to have a null value as MainApplication.getMap().mapMode.

Download all attachments as: .zip

Change History (7)

comment:1 by Don-vip, 6 years ago

Component: CorePlugin auto_tools
Owner: changed from team to Rub21
Summary: Autotools plugin could not update.NPE at auto_tools.actions.SplittingTool$1.keyPressed

by taylor.smock, 6 years ago

Attachment: 17509.patch added

Add check for null MainApplication.getMap().mapMode since it is possible to have a null value as MainApplication.getMap().mapMode.

comment:3 by tsmock, 6 years ago

Summary: NPE at auto_tools.actions.SplittingTool$1.keyPressed[PATCH] NPE at auto_tools.actions.SplittingTool$1.keyPressed

comment:4 by Don-vip, 6 years ago

Thanks, patch applied. auto_tools is one of the few GitHub plugins, so you can also send pull requests if you prefer. For a new release, the plugin must first replace calls to deprecated JOSM API. Would you like to do it?

comment:5 by taylor.smock, 6 years ago

OK. I replaced the calls to the deprecated JOSM API in https://github.com/JOSM/auto-tools/pull/24. It was fairly easy -- all I had to do was replace OsmPrimitive.getFilteredSet with Utils.filteredCollection inside its appropriate constructor. Eclipse was warning about dead code in SplittingTool.java#L138 as well. I left that alone so the patch was more focused though.

if (n != null) {
    ...
} else {
    if (n != null) {
        ...
    } else {
        ...
    }
}

comment:6 by Don-vip, 6 years ago

Resolution: fixed
Status: newclosed

Modify Ticket

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