Changeset 7162 in josm


Ignore:
Timestamp:
2014-05-21T23:46:45+02:00 (10 years ago)
Author:
bastiK
Message:

fixes #10061 - mapcss eval: deprecate use of length() for lists, use new function count() instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r7136 r7162  
    166166            return Arrays.asList(args);
    167167        }
     168       
     169        /**
     170         * Returns the number of elements in a list.
     171         * @param lst the list
     172         * @return length of the list
     173         */
     174        public static Integer count(List<?> lst) {
     175            return lst.size();
     176        }
    168177
    169178        /**
     
    717726     * Separate implementation to support overloading for different
    718727     * argument types.
     728     *
     729     * The use for calculating the length of a list is deprecated, use
     730     * {@link Functions#count(java.util.List)} instead (see #10061).
    719731     */
    720732    public static class LengthFunction implements Expression {
Note: See TracChangeset for help on using the changeset viewer.