Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18764 closed defect (fixed)

Adding a tag button and hotkey is not working

Reported by: anonymous Owned by: team
Priority: normal Milestone: 20.02
Component: Core Version:
Keywords: template_report, regression Cc: simon04

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: 2020-02-23 19:11:30 +0100 (Sun, 23 Feb 2020)
Build-Date:2020-02-23 19:47:25
Revision:15915
Relative:URL: ^/trunk

Identification: JOSM/1.5 (15915 en) Mac OS X 10.15.3
OS Build number: Mac OS X 10.15.3 (19D76)
Memory Usage: 904 MB / 1820 MB (651 MB allocated, but free)
Java version: 1.8.0_241-b07, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: Display 188945226 1920x1080, Display 69952924 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}/Desktop/josm.jnlp, -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-154c0b6c.icns, -Djnlpx.jvm="<java.home>/bin/java"]
Dataset consistency test: No problems found

Plugins:
+ EasyPresets (1537621333)
+ Mapillary (1.5.20)
+ apache-commons (35092)
+ apache-http (35092)
+ auto_tools (73)
+ buildings_tools (35248)
+ changeset-viewer (22)
+ graphview (35313)
+ intersection (0.0.7)
+ jna (35092)
+ markseen (14)
+ openqa (0.1.9)
+ osm-obj-info (56)
+ rex (53)
+ tageditor (35258)
+ turnlanes-tagging (283)
+ turnrestrictions (35313)
+ utilsplugin2 (35334)

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
+ https://raw.githubusercontent.com/KaartGroup/Kaart-Styles/master/Kaart-Styles.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
+ https://raw.githubusercontent.com/KaartGroup/Kaart-Styles/master/Overlapping%20Ways.mapcss

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

Last errors/warnings:
- 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-2 (37) of javawsApplicationThreadGroup
java.lang.NullPointerException
	at org.openstreetmap.josm.gui.mappaint.mapcss.Selector$ChildOrParentSelector.matches(Selector.java:442)
	at org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource.apply(MapCSSStyleSource.java:704)
	at org.openstreetmap.josm.gui.mappaint.ElemStyles.generateStyles(ElemStyles.java:384)
	at org.openstreetmap.josm.tools.ImageProvider.getTaggedPadded(ImageProvider.java:1582)
	at org.openstreetmap.josm.tools.ImageProvider.getPadded(ImageProvider.java:1542)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper$AbstractTagsDialog.findIcon(TagEditHelper.java:696)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper$AddTagsDialog.buildRecentTagsPanel(TagEditHelper.java:966)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper$AddTagsDialog.suggestRecentlyAddedTags(TagEditHelper.java:902)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper$AddTagsDialog.<init>(TagEditHelper.java:786)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper.getAddTagsDialog(TagEditHelper.java:269)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper.addTag(TagEditHelper.java:250)
	at org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog$AddAction.actionPerformed(PropertiesDialog.java:1201)
	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1668)
	at javax.swing.JComponent.processKeyBinding(JComponent.java:2882)
	at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:307)
	at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:263)
	at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2974)
	at javax.swing.JComponent.processKeyBindings(JComponent.java:2966)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2845)
	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 (2)

18764.patch (934 bytes) - added by taylor.smock 3 years ago.
Add check to avoid NPE
18764.1.patch (4.6 KB) - added by taylor.smock 3 years ago.
Add non-regression test (uses reflection)

Download all attachments as: .zip

Change History (20)

comment:1 Changed 3 years ago by taylor.smock

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

comment:2 Changed 3 years ago by taylor.smock

The https://raw.githubusercontent.com/KaartGroup/Kaart-Styles/master/Kaart-Styles.mapcss is the necessary bit for reproducing.

I'll work on this, unless someone else already is.

Changed 3 years ago by taylor.smock

Attachment: 18764.patch added

Add check to avoid NPE

comment:3 Changed 3 years ago by taylor.smock

Cc: simon04 added
Keywords: regression added

Introduced in r15889.

comment:4 Changed 3 years ago by Klumbumbus

We may need a hotfix for this?

comment:5 Changed 3 years ago by taylor.smock

Possibly.

I'm trying to make a minimal mapcss file for reproducing right now. I've got it down to this:

meta {
    title: "Ticket #18764 Minimal MapCSS file";
    version: "1.0.0";
    description: "Causes a crash (see #18764)";
    author: "Taylor Smock";
}


*[building]  *[highway] {
   text: tr("Building crossing highway");
}

If you enter the second tag (in the above example, highway), a crash occurs.

Last edited 3 years ago by taylor.smock (previous) (diff)

Changed 3 years ago by taylor.smock

Attachment: 18764.1.patch added

Add non-regression test (uses reflection)

comment:6 Changed 3 years ago by simon04

Resolution: fixed
Status: newclosed

In 15920/josm:

fix #18764, see #14088 - NPE in findIcon when adding a tag (patch by taylor.smock, extended)

comment:7 Changed 3 years ago by simon04

In 15921/josm:

see #18764, see #14088 - Add non-regression test (patch by taylor.smock)

comment:8 Changed 3 years ago by simon04

I'm sorry for this bug/regression as I did extensive testing, but not having installed enough styles. It seems that the builtin elemstyles.mapcss are not sufficiently complex for developing JOSM. ;)

comment:9 in reply to:  8 Changed 3 years ago by taylor.smock

Replying to simon04:

I'm sorry for this bug/regression as I did extensive testing, but not having installed enough styles. It seems that the builtin elemstyles.mapcss are not sufficiently complex for developing JOSM. ;)

It looks like JOSM only uses for some validator tests, so I'm not surprised that it didn't come up in testing (since it depends upon the user having a paint style installed, and then adding the appropriate tag).

Anyway, I've done worse. Unfortunately.

comment:10 Changed 3 years ago by Don-vip

We all did, don't be sorry :) I'm releasing the hotfix.

comment:11 Changed 3 years ago by Don-vip

Milestone: 20.03

comment:12 in reply to:  10 ; Changed 3 years ago by Klumbumbus

Replying to Don-vip:

I'm releasing the hotfix.

Not sure if #18759 should be part of the hotfix too?

comment:13 in reply to:  12 Changed 3 years ago by Don-vip

Replying to Klumbumbus:

Replying to Don-vip:

I'm releasing the hotfix.

Not sure if #18759 should be part of the hotfix too?

Yep. I wait for this one then :)

comment:14 in reply to:  7 Changed 3 years ago by Don-vip

Replying to simon04:

In 15921/josm:

see #18764, see #14088 - Add non-regression test (patch by taylor.smock)

The test doesn't work in headless mode:

java.awt.HeadlessException
	at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
	at java.awt.Window.init(Window.java:484)
	at java.awt.Window.<init>(Window.java:436)
	at java.awt.Window.<init>(Window.java:591)
	at java.awt.Dialog.<init>(Dialog.java:665)
	at javax.swing.JDialog.<init>(JDialog.java:592)
	at org.openstreetmap.josm.gui.ExtendedDialog.<init>(ExtendedDialog.java:159)
	at org.openstreetmap.josm.gui.ExtendedDialog.<init>(ExtendedDialog.java:136)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper$AbstractTagsDialog.<init>(TagEditHelper.java:577)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper$AddTagsDialog.<init>(TagEditHelper.java:728)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelper.getAddTagsDialog(TagEditHelper.java:269)
	at org.openstreetmap.josm.gui.dialogs.properties.TagEditHelperTest.testTicket18764(TagEditHelperTest.java:113)
	at org.openstreetmap.josm.testutils.JOSMTestRules$TimeoutThread.run(JOSMTestRules.java:736)

comment:15 Changed 3 years ago by simon04

In 15927/josm:

see #18764, see #14088 - Add non-regression test (fix for headless)

comment:16 in reply to:  10 Changed 3 years ago by simon04

Replying to Don-vip:

We all did, don't be sorry :) I'm releasing the hotfix.

:)
Thank you!

comment:17 Changed 3 years ago by skyper

Milestone 20.2

comment:18 Changed 3 years ago by Klumbumbus

Milestone: 20.0320.02

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.