Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years 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 by Klumbumbus, 7 years ago

What if the object has several parent objects?

comment:2 by bastiK, 7 years ago

Resolution: fixed
Status: newclosed

In 13094/josm:

fixed #15525 - Add parent_osm_id for mapcss

in reply to:  1 comment:3 by bastiK, 7 years ago

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 by Don-vip, 7 years ago

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 by bastiK, 7 years ago

In 13105/josm:

see #15525 - fix NPE

in reply to:  4 comment:6 by bastiK, 7 years ago

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. 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.