Modify

Opened 13 days ago

Closed 12 days ago

Last modified 9 days ago

#15525 closed enhancement (fixed)

Add parent_osm_id for mapcss

Reported by: Ialokim <ialokim@…> Owned by: team
Priority: normal Milestone: 17.11
Component: Core mappaint Version:
Keywords: mapcss Cc:

Description

Attachments (0)

Change History (6)

comment:1 Changed 13 days ago by Klumbumbus

What if the object has several parent objects?

comment:2 Changed 12 days ago by bastiK

Resolution: fixed
Status: newclosed

In 13094/josm:

fixed #15525 - Add parent_osm_id for mapcss

comment:3 in reply to:  1 Changed 12 days ago by bastiK

Milestone: 17.11

Replying to Klumbumbus:

What if the object has several parent objects?

It is now restricted to the parent object matched by child selector, i.e. in

relation[type=route][route=foot] > way {...}

it selects the first parent relation with given tags.

comment:4 Changed 9 days ago by Don-vip

This piece of code is not correct:

        public static long parent_osm_id(final Environment env) { // NO_UCD (unused code)
            return env.parent == null ? null : env.parent.getUniqueId();
        }

if env.parent is null, the auto-boxing of (Long) null to long will throw an NPE.

comment:5 Changed 9 days ago by bastiK

In 13105/josm:

see #15525 - fix NPE

comment:6 in reply to:  4 Changed 9 days ago by bastiK

Replying to Don-vip:

This piece of code is not correct:

        public static long parent_osm_id(final Environment env) { // NO_UCD (unused code)
            return env.parent == null ? null : env.parent.getUniqueId();
        }

if env.parent is null, the auto-boxing of (Long) null to long will throw an NPE.

Okay, this happens when you commit code without testing. :)

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.