Changeset 2905 in josm for trunk


Ignore:
Timestamp:
2010-01-29T21:26:50+01:00 (14 years ago)
Author:
jttt
Message:

Fixed #3275 Exception when number of values and display_values don't match

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r2903 r2905  
    2121import java.util.Arrays;
    2222import java.util.Collection;
    23 import java.util.Collections;
    2423import java.util.HashMap;
    2524import java.util.LinkedHashMap;
     
    327326            String[] value_array = values.split(",");
    328327            String[] display_array;
     328
    329329            if(locale_display_values != null) {
    330330                display_array = locale_display_values.split(",");
     
    332332                display_array = display_values.split(",");
    333333            } else {
     334                display_array = value_array;
     335            }
     336
     337            if (display_array.length != value_array.length) {
     338                System.err.println(tr("Broken tagging preset \"{0}-{1}\" - number of items in display_values must be the same as in values", key, text));
    334339                display_array = value_array;
    335340            }
     
    642647                MirroredInputStream s = new MirroredInputStream(source);
    643648                InputStream zip = s.getZipEntry("xml","preset");
    644                 if(zip != null)
     649                if(zip != null) {
    645650                    zipIcons = s.getFile();
     651                }
    646652                InputStreamReader r;
    647653                try
Note: See TracChangeset for help on using the changeset viewer.