Changeset 6737 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2014-01-19T18:06:39+01:00 (10 years ago)
Author:
simon04
Message:

fix #8071 - MapCSS: skip null values in concat(), provide join(separator, value1, ..., valueN)

File:
1 edited

Legend:

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

    r6677 r6737  
    240240        /**
    241241         * Assembles the strings to one.
     242         * @see Utils#join
    242243         */
    243244        @NullableArguments
    244245        public static String concat(Object... args) {
    245             StringBuilder res = new StringBuilder();
    246             for (Object f : args) {
    247                 res.append(String.valueOf(f));
    248             }
    249             return res.toString();
     246            return Utils.join("", Arrays.asList(args));
     247        }
     248
     249        /**
     250         * Assembles the strings to one, where the first entry is used as separator.
     251         * @see Utils#join
     252         */
     253        @NullableArguments
     254        public static String join(String... args) {
     255            return Utils.join(args[0], Arrays.asList(args).subList(1, args.length));
    250256        }
    251257
Note: See TracChangeset for help on using the changeset viewer.