Changeset 7164 in josm for trunk


Ignore:
Timestamp:
2014-05-22T11:14:47+02:00 (10 years ago)
Author:
simon04
Message:

fix #10062 - MapCSS: add any() according to MapCSS standard, deprecate coalesce()

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/validator/geometry.mapcss

    r6861 r7164  
    1313
    1414/* Building inside building (spatial test) */
    15 *[building][building!~/no|entrance/][coalesce(tag("layer"),"0") = coalesce(parent_tag("layer"),"0")] ∈
     15*[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")] ∈
    1616*[building][building!~/no|entrance/] {
    1717  throwWarning: tr("Building inside building");
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r7162 r7164  
    178178        /**
    179179         * Returns the first non-null object. The name originates from the {@code COALESCE} SQL function.
    180          * @see Utils#firstNonNull(Object[])
     180         * @deprecated Deprecated in favour of {@link #any(Object...)} from the MapCSS standard.
    181181         */
    182182        @NullableArguments
    183183        public static Object coalesce(Object... args) {
     184            return Utils.firstNonNull(args);
     185        }
     186
     187        /**
     188         * Returns the first non-null object.
     189         * The name originates from <a href="http://wiki.openstreetmap.org/wiki/MapCSS/0.2/eval">MapCSS standard</a>.
     190         * @see #coalesce(Object...)
     191         * @see Utils#firstNonNull(Object[])
     192         */
     193        @NullableArguments
     194        public static Object any(Object... args) {
    184195            return Utils.firstNonNull(args);
    185196        }
Note: See TracChangeset for help on using the changeset viewer.