Modify

Opened 3 years ago

Closed 3 years ago

#13395 closed defect (fixed)

NPE with "Paste (at source position)"

Reported by: leni Owned by: team
Priority: normal Milestone: 16.08
Component: Core Version:
Keywords: template_report gsoc-core regression Cc: michael2402

Description

What steps will reproduce the problem?

  1. I modified a relation in a calque, I created a new layer ("calque" in french)
  2. I copied this relation
  3. I Pasted at source position in the new layer

What is the expected result? pasted

What happens instead?error message

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

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-08-11 21:54:24 +0200 (Thu, 11 Aug 2016)
Build-Date:2016-08-11 22:36:05
Revision:10786
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10786 fr) Windows 10 64-Bit
Memory Usage: 132 MB / 247 MB (19 MB allocated, but free)
Java version: 1.8.0_91-b15, Oracle Corporation, Java HotSpot(TM) Client VM
VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=%UserProfile%\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\56\1ee8cfb8-2a888c1d, -Djnlpx.remove=false, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.splashport=49847, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp, -Djnlpx.jvm=<java.home>\bin\javaw.exe, -Djnlpx.vmargs=LURqYXZhLnV0aWwuQXJyYXlzLnVzZUxlZ2FjeU1lcmdlU29ydD10cnVlAC1Eam5scC5hcHBsaWNhdGlvbi5ocmVmPWh0dHBzOi8vam9zbS5vcGVuc3RyZWV0bWFwLmRlL2Rvd25sb2FkL2pvc20uam5scAA=]
Dataset consistency test: No problems found

Plugins:
+ apache-commons (32699)
+ buildings_tools (32796)
+ cadastre-fr (32796)
+ download_along (32730)
+ editgpx (32699)
+ ejml (32680)
+ geotools (32813)
+ jts (32699)
+ merge-overlap (32699)
+ opendata (32811)
+ reltoolbox (32796)
+ reverter (32796)
+ todo (29154)
+ undelete (32699)
+ utilsplugin2 (32815)
+ walkingpapers (32796)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/BuildingPreset&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/NewParkingFeatures&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/MaxspeedIcons&zip=1

Last errors/warnings:
- W:  Landuse: Could not get presets icon presets/landuse/farmland.svg
- E: Impossible de trouver l'image "presets/leisure/horse_riding.svg"
- W:  Trail Riding Station: Could not get presets icon presets/leisure/horse_riding.svg
- E: <josm.pref>\plugins\opendata\resources\org\openstreetmap\josm\plugins\opendata\modules\fr\datagouvfr\datasets\agriculture\RegistreParcellaire.mapcss (Le chemin d’accès spécifié est introuvable)
- W: Old style SideButton usage for action org.openstreetmap.josm.plugins.todo.TodoDialog$SelectAction@496614
- W: Old style SideButton usage for action org.openstreetmap.josm.plugins.todo.TodoDialog$AddAction@190b369
- W: Old style SideButton usage for action org.openstreetmap.josm.plugins.todo.TodoDialog$PassAction@fd50ed
- W: Old style SideButton usage for action org.openstreetmap.josm.plugins.todo.TodoDialog$MarkAction@35e73d
- E: java.lang.NullPointerException
- E: java.lang.NullPointerException


=== REPORTED CRASH DATA ===
BugReportExceptionHandler$BugReporterThread#askForBugReport:
No data collected.

=== STACK TRACE ===
Thread: AWT-EventQueue-2 (41) of javawsApplicationThreadGroup
java.lang.NullPointerException
	at org.openstreetmap.josm.gui.datatransfer.importers.PrimitiveDataPaster.createNewPrimitives(PrimitiveDataPaster.java:71)
	at org.openstreetmap.josm.gui.datatransfer.importers.PrimitiveDataPaster.importData(PrimitiveDataPaster.java:54)
	at org.openstreetmap.josm.gui.datatransfer.OsmTransferHandler.importData(OsmTransferHandler.java:56)
	at org.openstreetmap.josm.gui.datatransfer.OsmTransferHandler.pasteOn(OsmTransferHandler.java:99)
	at org.openstreetmap.josm.actions.AbstractPasteAction.doPaste(AbstractPasteAction.java:91)
	at org.openstreetmap.josm.actions.AbstractPasteAction.actionPerformed(AbstractPasteAction.java:87)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.AbstractButton.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(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.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.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)

=== RUNNING THREADS ===
Thread: AWT-Windows (12) of system
sun.awt.windows.WToolkit.eventLoop(Native Method)
sun.awt.windows.WToolkit.run(Unknown Source)

Thread: Timer-2 (76) of javawsApplicationThreadGroup
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Unknown Source)
java.util.TimerThread.mainLoop(Unknown Source)
java.util.TimerThread.run(Unknown Source)

Thread: TimerQueue (50) of javawsApplicationThreadGroup
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
java.util.concurrent.DelayQueue.take(Unknown Source)
javax.swing.TimerQueue.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Thread: CacheCleanUpThread (21) of javawsSecurityThreadGroup
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Unknown Source)
com.sun.deploy.cache.CleanupThread.run(Unknown Source)

Thread: Map Status Collector (78) of javawsApplicationThreadGroup
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
org.openstreetmap.josm.gui.MapStatus$Collector.run(MapStatus.java:375)
java.lang.Thread.run(Unknown Source)

Thread: RemoteControl HTTP Server (64) of javawsApplicationThreadGroup
java.net.DualStackPlainSocketImpl.accept0(Native Method)
java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
java.net.AbstractPlainSocketImpl.accept(Unknown Source)
java.net.PlainSocketImpl.accept(Unknown Source)
java.net.ServerSocket.implAccept(Unknown Source)
java.net.ServerSocket.accept(Unknown Source)
org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpServer.run(RemoteControlHttpServer.java:103)

Thread: image-fetcher-0 (95) of javawsApplicationThreadGroup
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Thread: message-notifier-0 (71) of javawsApplicationThreadGroup
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Thread: AWT-Shutdown (42) of system
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Unknown Source)
sun.awt.AWTAutoShutdown.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Thread: traceMsgQueueThread (8) of main
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Unknown Source)
com.sun.deploy.trace.Trace$TraceMsgQueueChecker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Thread: AWT-EventQueue-0 (46) of main
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.awt.EventQueue.getNextEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)

Thread: Timer-1 (67) of javawsApplicationThreadGroup
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Unknown Source)
java.util.TimerThread.run(Unknown Source)

Thread: Reference Handler (2) of system
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Unknown Source)
java.lang.ref.Reference.tryHandlePending(Unknown Source)
java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)

Thread: Attach Listener (5) of system

Thread: DestroyJavaVM (17) of main

Thread: MemoryCache-DelayedCleanup (19) of javawsSecurityThreadGroup
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Unknown Source)
java.util.TimerThread.mainLoop(Unknown Source)
java.util.TimerThread.run(Unknown Source)

Thread: CacheMemoryCleanUpThread (18) of javawsSecurityThreadGroup
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
com.sun.deploy.cache.MemoryCache$LoadedResourceCleanupThread.run(Unknown Source)

Thread: AWT-EventQueue-2 (41) of javawsApplicationThreadGroup
Stacktrace see above.

Thread: RemoteControl HTTPS Server (66) of javawsApplicationThreadGroup
java.net.DualStackPlainSocketImpl.accept0(Native Method)
java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
java.net.AbstractPlainSocketImpl.accept(Unknown Source)
java.net.PlainSocketImpl.accept(Unknown Source)
java.net.ServerSocket.implAccept(Unknown Source)
sun.security.ssl.SSLServerSocketImpl.accept(Unknown Source)
org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpsServer.run(RemoteControlHttpsServer.java:406)

Thread: RemoteControl HTTP Server (65) of javawsApplicationThreadGroup
java.net.DualStackPlainSocketImpl.accept0(Native Method)
java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
java.net.AbstractPlainSocketImpl.accept(Unknown Source)
java.net.PlainSocketImpl.accept(Unknown Source)
java.net.ServerSocket.implAccept(Unknown Source)
java.net.ServerSocket.accept(Unknown Source)
org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpServer.run(RemoteControlHttpServer.java:103)

Thread: GT authority factory disposer (58) of javawsApplicationThreadGroup
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Unknown Source)
java.util.TimerThread.run(Unknown Source)

Thread: Thread-14 (44) of javawsApplicationThreadGroup
sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus0(Native Method)
sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus(Unknown Source)
sun.nio.fs.WindowsWatchService$Poller.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Thread: AWT-EventQueue-1 (43) of javawsSecurityThreadGroup
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.awt.EventQueue.getNextEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)

Thread: RemoteControl HTTPS Server (69) of javawsApplicationThreadGroup
java.net.DualStackPlainSocketImpl.accept0(Native Method)
java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
java.net.AbstractPlainSocketImpl.accept(Unknown Source)
java.net.PlainSocketImpl.accept(Unknown Source)
java.net.ServerSocket.implAccept(Unknown Source)
sun.security.ssl.SSLServerSocketImpl.accept(Unknown Source)
org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpsServer.run(RemoteControlHttpsServer.java:406)

Thread: main-worker-0 (75) of javawsApplicationThreadGroup
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Thread: Signal Dispatcher (4) of system

Thread: Finalizer (3) of system
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

Thread: Java2D Disposer (10) of system
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
sun.java2d.Disposer.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Thread: WeakCollectionCleaner (59) of javawsApplicationThreadGroup
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.lang.ref.ReferenceQueue.remove(Unknown Source)
org.geotools.util.WeakCollectionCleaner.run(WeakCollectionCleaner.java:77)

Thread: Javaws Secure Thread (15) of javawsSecurityThreadGroup
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Unknown Source)
com.sun.javaws.ui.JavawsSysRun$SecureThread.run(Unknown Source)

Thread: File Watcher (45) of javawsApplicationThreadGroup
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.util.concurrent.LinkedBlockingDeque.takeFirst(Unknown Source)
java.util.concurrent.LinkedBlockingDeque.take(Unknown Source)
sun.nio.fs.AbstractWatchService.take(Unknown Source)
org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:114)
org.openstreetmap.josm.io.FileWatcher$$Lambda$9/27381845.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Attachments (1)

couleurBusBordeaux.osm (219.7 KB) - added by leni 3 years ago.
copiyng relation 2529556

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by leni

Attachment: couleurBusBordeaux.osm added

copiyng relation 2529556

comment:1 Changed 3 years ago by Don-vip

Keywords: gsoc-core added
Milestone: 16.08

comment:2 Changed 3 years ago by Don-vip

Cc: michael2402 added

comment:3 Changed 3 years ago by michael2402

nodeData.getEastNorth() is null. There may be a problem with missing nodes.

comment:4 Changed 3 years ago by anonymous

Hi!
I would like to be more precise so I complete the ticket.
I have joined, with the ticket, the file josm that I have saved before the error message.
I find the same error when :

  • I load the file,
  • I create a new layer,
  • I come back on the file,
  • in the list of relations, I choose the "route (""bus 20 : Bordeaux ...)"
  • in the menu (french) "Éditer/copier"
  • in the new layer, in the menu "Edit/Paste at source position"
  • error message

comment:5 Changed 3 years ago by michael2402

Thank you.

I traced the problem down to the node 1925320646. That node has no coordinates and no keys but the incomplete flag is not set.

The doc of incomplete says:

    /**
     * A primitive is incomplete if we know its id and type, but nothing more.
     * Typically some members of a relation are incomplete until they are
     * fetched from the server.
     */

But AbstractPrimitive#setOsmId unsets the incomplete flag as soon as the osm id/version is known. clearOsmMetadata() also unsets that flag - it should be set there.

I don't know why, but during serialization/deserialization, the incomplete flag gets removed from the data.

comment:6 Changed 3 years ago by Don-vip

Summary: "Paste at source position"NPE with "Paste at source position"

comment:7 Changed 3 years ago by skyper

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

comment:8 Changed 3 years ago by skyper

This happens also with simple paste to a new layer (Ctrl+V), see #13523.

I did narrow it down to be a problem with relations in my case. Please use the example file for #13521 and try to copy any relation into a new layer. Does not matter weather you use simple paste or paste at source position.

Last edited 3 years ago by skyper (previous) (diff)

comment:9 Changed 3 years ago by skyper

Keywords: regression added
Summary: NPE with "Paste at source position"NPE with "Paste (at source position)"

comment:10 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 10946/josm:

fix #13395 - fix serialization issue causing bugs in copy/paste

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.