Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#20824 closed defect (fixed)

NPE while sorting some special Notes.

Reported by: maraf Owned by: simon04
Priority: normal Milestone: 21.05
Component: Core notes Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Download Notes from this area: https://www.openstreetmap.org/#map=17/50.71739/23.26743 especially a Note located in the centre of this roundabout: https://www.openstreetmap.org/way/758219175.
  2. Ensure there are at least 2 notes downloaded.
  3. Sort Notes by username.

What is the expected result?

Sorted list.

What happens instead?

NPE and not sorted list of notes.

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

The problem is caused be this note: https://www.openstreetmap.org/api/0.6/notes/1396945
This is empty note, probably created by someone who deleted his osm account.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-04-27 20:35:33 +0200 (Tue, 27 Apr 2021)
Build-Date:2021-04-27 21:58:39
Revision:17833
Relative:URL: ^/trunk

Identification: JOSM/1.5 (17833 en) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19042)
Memory Usage: 579 MB / 3406 MB (211 MB allocated, but free)
Java version: 1.8.0_261-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1250
System property sun.jnu.encoding: Cp1250
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djosm.home=c:/Users/<user.name>/AppData/Roaming/JOSM-test]

Last errors/warnings:
- 00135.664 E: Handled by bug report queue: java.lang.reflect.InvocationTargetException. Cause: java.lang.NullPointerException
- 00165.753 E: Handled by bug report queue: java.lang.NullPointerException



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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (19) of main
java.lang.NullPointerException
	at org.openstreetmap.josm.data.notes.Note.lambda$static$2(Note.java:56)
	at java.util.TimSort.countRunAndMakeAscending(Unknown Source)
	at java.util.TimSort.sort(Unknown Source)
	at java.util.Arrays.sort(Unknown Source)
	at java.util.ArrayList.sort(Unknown Source)
	at org.openstreetmap.josm.data.osm.NoteData.getSortedNotes(NoteData.java:92)
	at org.openstreetmap.josm.gui.dialogs.NotesDialog.noteDataUpdated(NotesDialog.java:191)
	at org.openstreetmap.josm.data.osm.NoteData.lambda$dataUpdated$1(NoteData.java:253)
	at org.openstreetmap.josm.tools.ListenerList.fireEvent(ListenerList.java:155)
	at org.openstreetmap.josm.data.osm.NoteData.dataUpdated(NoteData.java:253)
	at org.openstreetmap.josm.data.osm.NoteData.setSortMethod(NoteData.java:296)
	at org.openstreetmap.josm.gui.dialogs.NotesDialog$SortAction.actionPerformed(NotesDialog.java:475)
	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.plaf.basic.BasicButtonListener.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)

Attachments (0)

Change History (6)

comment:1 by simon04, 4 years ago

Milestone: 21.05
Owner: changed from team to simon04
Status: newassigned

comment:2 by simon04, 4 years ago

Resolution: fixed
Status: assignedclosed

In 17837/josm:

fix #20824 - NPE while sorting notes

comment:3 by simon04, 4 years ago

In 17854/josm:

see #20824 - Add com.google.code.findbugs annotations via Apache Ivy

comment:4 by simon04, 4 years ago

In 17855/josm:

see #20824 - Fix NPE found by Coverity Scan

in reply to:  3 comment:5 by Don-vip, 4 years ago

Replying to simon04:

In 17854/josm:

see #20824 - Add com.google.code.findbugs annotations via Apache Ivy

why do we need this?

comment:6 by simon04, 4 years ago

Using those annotations enables nice NPE-warnings in IntelliJ: https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
I'd like to give it a try on a bit larger scale over the next time...

Modify Ticket

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