Changeset 2845 in josm


Ignore:
Timestamp:
2010-01-13T19:55:07+01:00 (11 years ago)
Author:
mjulius
Message:

fix messages for data

Location:
trunk/src/org/openstreetmap/josm/data
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Bounds.java

    r2805 r2845  
    66import java.awt.geom.Rectangle2D;
    77import java.text.DecimalFormat;
     8import java.text.MessageFormat;
    89
    910import org.openstreetmap.josm.data.coor.LatLon;
     11import org.openstreetmap.josm.tools.CheckParameterUtil;
    1012
    1113/**
     
    4850
    4951    public Bounds(double [] coords) {
    50         if (coords == null)
    51             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "coords"));
     52        CheckParameterUtil.ensureParameterNotNull(coords, "coords");
    5253        if (coords.length != 4)
    53             throw new IllegalArgumentException(tr("Expected array of length 4, got {0}", coords.length));
     54            throw new IllegalArgumentException(MessageFormat.format("Expected array of length 4, got {0}", coords.length));
    5455        this.minLat = coords[0];
    5556        this.minLon = coords[1];
     
    5960
    6061    public Bounds(String asString, String separator) throws IllegalArgumentException {
    61         if (asString == null)
    62             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "asString"));
     62        CheckParameterUtil.ensureParameterNotNull(asString, "asString");
    6363        String[] components = asString.split(separator);
    6464        if (components.length != 4)
    65             throw new IllegalArgumentException(tr("Exactly four doubles excpected in string, got {0}", components.length));
     65            throw new IllegalArgumentException(MessageFormat.format("Exactly four doubles excpected in string, got {0}", components.length));
    6666        double[] values = new double[4];
    6767        for (int i=0; i<4; i++) {
     
    6969                values[i] = Double.parseDouble(components[i]);
    7070            } catch(NumberFormatException e) {
    71                 throw new IllegalArgumentException(tr("Illegal double value ''{0}''", components[i]));
     71                throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", components[i]));
    7272            }
    7373        }
     
    108108     */
    109109    public Bounds(LatLon center, double latExtent, double lonExtent) {
    110         if (center == null)
    111             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "center"));
     110        CheckParameterUtil.ensureParameterNotNull(center, "center");
    112111        if (latExtent <= 0.0)
    113             throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0.0 exptected, got {1}", "latExtent", latExtent));
     112            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' > 0.0 exptected, got {1}", "latExtent", latExtent));
    114113        if (lonExtent <= 0.0)
    115             throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0.0 exptected, got {1}", "lonExtent", lonExtent));
     114            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' > 0.0 exptected, got {1}", "lonExtent", lonExtent));
    116115
    117116        this.minLat = center.lat() - latExtent / 2;
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r2817 r2845  
    447447        if (prefDir.exists()) {
    448448            if(!prefDir.isDirectory()) {
    449                 System.err.println(tr("Warning: Failed to initialize preferences. Preference directory ''{0}'' isn't a directory.", prefDir.getAbsoluteFile()));
     449                System.err.println(tr("Warning: Failed to initialize preferences. Preference directory ''{0}'' is not a directory.", prefDir.getAbsoluteFile()));
    450450                JOptionPane.showMessageDialog(
    451451                        Main.parent,
    452                         tr("<html>Failed to initialize preferences.<br>Preference directory ''{0}'' isn't a directory.</html>", prefDir.getAbsoluteFile()),
     452                        tr("<html>Failed to initialize preferences.<br>Preference directory ''{0}'' is not a directory.</html>", prefDir.getAbsoluteFile()),
    453453                        tr("Error"),
    454454                        JOptionPane.ERROR_MESSAGE
  • trunk/src/org/openstreetmap/josm/data/Version.java

    r2822 r2845  
    138138        URL u = Main.class.getResource("/REVISION");
    139139        if (u == null) {
    140             System.err.println(tr("Warning: the revision file '/REVISION' is missing."));
     140            System.err.println(tr("Warning: the revision file ''/REVISION'' is missing."));
    141141            version = 0;
    142142            revision = "";
  • trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java

    r2655 r2845  
    1313
    1414import org.openstreetmap.josm.data.osm.OsmPrimitive;
     15import org.openstreetmap.josm.tools.CheckParameterUtil;
    1516
    1617/**
     
    8788     *
    8889     */
    89     public void add(Conflict<?> conflict) throws IllegalStateException, IllegalArgumentException {
    90         if (conflict == null)
    91             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "conflict"));
     90    public void add(Conflict<?> conflict) throws IllegalStateException {
     91        CheckParameterUtil.ensureParameterNotNull(conflict, "conflict");
    9292        addConflict(conflict);
    9393        fireConflictAdded();
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r2711 r2845  
    99import static java.lang.Math.toRadians;
    1010import static org.openstreetmap.josm.tools.I18n.tr;
     11import static org.openstreetmap.josm.tools.I18n.trc;
    1112
    1213import java.text.DecimalFormat;
     
    8384        case DECIMAL_DEGREES: return cDdFormatter.format(y);
    8485        case DEGREES_MINUTES_SECONDS: return dms(y) + ((y < 0) ?
    85                 /* short symbol for South */ tr("S") :
    86                     /* short symbol for North */ tr("N"));
     86                /* short symbol for South */ trc("compass", "S") :
     87                    /* short symbol for North */ trc("compass", "N"));
    8788        default: return "ERR";
    8889        }
     
    9798        case DECIMAL_DEGREES: return cDdFormatter.format(x);
    9899        case DEGREES_MINUTES_SECONDS: return dms(x) + ((x < 0) ?
    99                 /* short symbol for West */ tr("W") :
    100                     /* short symbol for East */ tr("E"));
     100                /* short symbol for West */ trc("compass", "W") :
     101                    /* short symbol for East */ trc("compass", "E"));
    101102        default: return "ERR";
    102103        }
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r2711 r2845  
    205205        if (getPrimitiveById(primitive) != null)
    206206            throw new DataIntegrityProblemException(
    207                     tr("Unable to add primitive {0} to the dataset because it's already included", primitive.toString()));
     207                    tr("Unable to add primitive {0} to the dataset because it is already included", primitive.toString()));
    208208
    209209        if (primitive instanceof Node) {
     
    647647        OsmPrimitive result = getPrimitiveById(primitiveId);
    648648        if (result == null) {
    649             System.out.println(tr("JOSM expected to find primitive [{0} {1}] in dataset but it's not there. Please report this "
     649            System.out.println(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this "
    650650                    + " at http://josm.openstreetmap.de . This is not a critical error, it should be safe to continue in your work.",
    651651                    primitiveId.getType(), Long.toString(primitiveId.getUniqueId())));
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r2753 r2845  
    1313
    1414import org.openstreetmap.josm.data.conflict.ConflictCollection;
     15import org.openstreetmap.josm.tools.CheckParameterUtil;
    1516
    1617/**
     
    5152     */
    5253    public DataSetMerger(DataSet targetDataSet, DataSet sourceDataSet) throws IllegalArgumentException {
    53         if (targetDataSet == null)
    54             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "targetDataSet"));
     54        CheckParameterUtil.ensureParameterNotNull(targetDataSet, "targetDataSet");
    5555        this.targetDataSet = targetDataSet;
    5656        this.sourceDataSet = sourceDataSet;
     
    278278            logger.warning(tr("Target object with id {0} and version {1} is visible although "
    279279                    + "source object with lower version {2} is not visible. "
    280                     + "Can''t deal with this inconsistency. Keeping target object. ",
     280                    + "Cannot deal with this inconsistency. Keeping target object. ",
    281281                    Long.toString(target.getId()),Long.toString(target.getVersion()), Long.toString(source.getVersion())
    282282            ));
  • trunk/src/org/openstreetmap/josm/data/osm/Filters.java

    r2620 r2845  
    140140    public String getColumnName(int column){
    141141        String[] names = { /* translators notes must be in front */
    142                 /* column header: enable filter */             trc("filter","E"),
    143                 /* column header: hide filter */               tr("H"),
    144                 /* column header: filter text */               tr("Text"),
    145                 /* column header: apply filter for children */ tr("C"),
    146                 /* column header: inverted filter */           tr("I"),
    147                 /* column header: filter mode */               tr("M")
     142                /* column header: enable filter */             trc("enable filter","E"),
     143                /* column header: hide filter */               trc("hide filter", "H"),
     144                /* column header: filter text */               trc("filter", "Text"),
     145                /* column header: apply filter for children */ trc("filter children", "C"),
     146                /* column header: inverted filter */           trc("invert filter", "I"),
     147                /* column header: filter mode */               trc("filter mode", "M")
    148148        };
    149149        return names[column];
     
    208208        case 5:
    209209            switch(f.mode){ /* translators notes must be in front */
    210             case replace:      /* filter mode: replace */      return tr("R");
    211             case add:          /* filter mode: add */          return tr("A");
    212             case remove:       /* filter mode: remove */       return tr("D");
    213             case in_selection: /* filter mode: in selection */ return tr("F");
     210            case replace:      /* filter mode: replace */      return trc("filter mode replace", "R");
     211            case add:          /* filter mode: add */          return trc("filter mode add", "A");
     212            case remove:       /* filter mode: remove */       return trc("filter mode remove", "D");
     213            case in_selection: /* filter mode: in selection */ return trc("filter mode in selection", "F");
    214214            }
    215215        }
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r2822 r2845  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.text.MessageFormat;
    67import java.util.ArrayList;
    78import java.util.Arrays;
     
    2627import org.openstreetmap.josm.data.osm.visitor.Visitor;
    2728import org.openstreetmap.josm.gui.mappaint.ElemStyle;
     29import org.openstreetmap.josm.tools.CheckParameterUtil;
    2830
    2931/**
     
    262264        } else {
    263265            if (id < 0)
    264                 throw new IllegalArgumentException(tr("Expected ID >= 0. Got {0}.", id));
     266                throw new IllegalArgumentException(MessageFormat.format("Expected ID >= 0. Got {0}.", id));
    265267            else if (id == 0) {
    266268                this.id = generateUniqueId();
     
    399401    public void setVisible(boolean visible) throws IllegalStateException{
    400402        if (isNew() && visible == false)
    401             throw new IllegalStateException(tr("A primitive with ID = 0 can't be invisible."));
     403            throw new IllegalStateException(tr("A primitive with ID = 0 cannot be invisible."));
    402404        if (visible) {
    403405            flags |= FLAG_VISIBLE;
     
    650652            return;
    651653        if (changesetId < 0)
    652             throw new IllegalArgumentException(tr("Parameter ''{0}'' >= 0 expected, got {1}", "changesetId", changesetId));
     654            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' >= 0 expected, got {1}", "changesetId", changesetId));
    653655        if (isNew() && changesetId > 0)
    654             throw new IllegalStateException(tr("Can''t assign a changesetId > 0 to a new primitive. Value of changesetId is {0}", changesetId));
     656            throw new IllegalStateException(tr("Cannot assign a changesetId > 0 to a new primitive. Value of changesetId is {0}", changesetId));
    655657        int old = this.changesetId;
    656658        this.changesetId = changesetId;
     
    10351037     */
    10361038    public void mergeFrom(OsmPrimitive other) {
    1037         if (other == null)
    1038             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "other"));
     1039        CheckParameterUtil.ensureParameterNotNull(other, "other");
    10391040        if (other.isNew() ^ isNew())
    1040             throw new DataIntegrityProblemException(tr("Can't merge because either of the participating primitives is new and the other is not"));
     1041            throw new DataIntegrityProblemException(tr("Cannot merge because either of the participating primitives is new and the other is not"));
    10411042        if (! other.isNew() && other.getId() != id)
    1042             throw new DataIntegrityProblemException(tr("Can''t merge primitives with different ids. This id is {0}, the other is {1}", id, other.getId()));
     1043            throw new DataIntegrityProblemException(tr("Cannot merge primitives with different ids. This id is {0}, the other is {1}", id, other.getId()));
    10431044
    10441045        setKeys(other.getKeys());
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java

    r2512 r2845  
    22package org.openstreetmap.josm.data.osm;
    33import static org.openstreetmap.josm.tools.I18n.tr;
     4
     5import java.text.MessageFormat;
    46
    57public enum OsmPrimitiveType {
     
    3537            if (type.getAPIName().equals(typeName)) return type;
    3638        }
    37         throw new IllegalArgumentException(tr("Parameter ''{0}'' is not a valid type name. Got ''{1}''.", "typeName", typeName));
     39        throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' is not a valid type name. Got ''{1}''.", "typeName", typeName));
    3840    }
    3941
     
    4648        if (cls.equals(Way.class)) return WAY;
    4749        if (cls.equals(Relation.class)) return RELATION;
    48         throw new IllegalArgumentException(tr("Parameter ''{0}'' is not an acceptable class. Got ''{1}''.", "cls", cls.toString()));
     50        throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' is not an acceptable class. Got ''{1}''.", "cls", cls.toString()));
    4951    }
    5052
     
    5355        if (cls.equals(WayData.class)) return WAY;
    5456        if (cls.equals(RelationData.class)) return RELATION;
    55         throw new IllegalArgumentException(tr("Parameter ''{0}'' is not an acceptable class. Got ''{1}''.", "cls", cls.toString()));
     57        throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' is not an acceptable class. Got ''{1}''.", "cls", cls.toString()));
    5658    }
    5759
  • trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java

    r2512 r2845  
    570570        if (primitive == null) return;
    571571        if (! isApplicableToPrimitive())
    572             throw new IllegalStateException(tr("Tag collection can't be applied to a primitive because there are keys with multiple values."));
     572            throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values."));
    573573        for (Tag tag: tags) {
    574574            if (tag.getValue() == null || tag.getValue().equals("")) {
     
    591591        if (primitives == null) return;
    592592        if (! isApplicableToPrimitive())
    593             throw new IllegalStateException(tr("Tag collection can't be applied to a primitive because there are keys with multiple values."));
     593            throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values."));
    594594        for (Tagged primitive: primitives) {
    595595            applyTo(primitive);
     
    608608        if (primitive == null) return;
    609609        if (! isApplicableToPrimitive())
    610             throw new IllegalStateException(tr("Tag collection can't be applied to a primitive because there are keys with multiple values."));
     610            throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values."));
    611611        primitive.removeAll();
    612612        for (Tag tag: tags) {
     
    626626        if (primitives == null) return;
    627627        if (! isApplicableToPrimitive())
    628             throw new IllegalStateException(tr("Tag collection can't be applied to a primitive because there are keys with multiple values."));
     628            throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values."));
    629629        for (Tagged primitive: primitives) {
    630630            replaceTagsOf(primitive);
  • trunk/src/org/openstreetmap/josm/data/osm/history/History.java

    r2512 r2845  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.text.MessageFormat;
    67import java.util.ArrayList;
    78import java.util.Collections;
     
    1314import org.openstreetmap.josm.data.osm.PrimitiveId;
    1415import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
     16import org.openstreetmap.josm.tools.CheckParameterUtil;
    1517
    1618/**
     
    5254    protected History(long id, OsmPrimitiveType type, List<HistoryOsmPrimitive> versions) {
    5355        if (id <= 0)
    54             throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected, got {1}", "id", id));
    55         if (type == null)
    56             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "type"));
     56            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' > 0 expected, got {1}", "id", id));
     57        CheckParameterUtil.ensureParameterNotNull(type, "type");
    5758        this.id = id;
    5859        this.type = type;
     
    216217    public HistoryOsmPrimitive get(int idx) {
    217218        if (idx < 0 || idx >= versions.size())
    218             throw new IndexOutOfBoundsException(tr("Parameter ''{0}'' in range 0..{1} expected. Got ''{2}''.", "idx", versions.size()-1, idx));
     219            throw new IndexOutOfBoundsException(MessageFormat.format("Parameter ''{0}'' in range 0..{1} expected. Got ''{2}''.", "idx", versions.size()-1, idx));
    219220        return versions.get(idx);
    220221    }
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java

    r2655 r2845  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.text.MessageFormat;
    67import java.util.ArrayList;
    78import java.util.HashMap;
     
    1112import org.openstreetmap.josm.data.osm.PrimitiveId;
    1213import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
     14import org.openstreetmap.josm.tools.CheckParameterUtil;
    1315
    1416/**
     
    7274    public HistoryOsmPrimitive get(long id, OsmPrimitiveType type, long version){
    7375        if (id <= 0)
    74             throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected, got {1}", "id", id));
    75         if (type == null)
    76             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "type"));
     76            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' > 0 expected, got {1}", "id", id));
     77        CheckParameterUtil.ensureParameterNotNull(type, "type");
    7778        if (version <= 0)
    78             throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected, got {1}", "version", version));
     79            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' > 0 expected, got {1}", "version", version));
    7980
    8081        SimplePrimitiveId pid = new SimplePrimitiveId(id, type);
     
    116117    public History getHistory(long id, OsmPrimitiveType type) throws IllegalArgumentException{
    117118        if (id <= 0)
    118             throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected, got {1}", "id", id));
    119         if (type == null)
    120             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "type"));
     119            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' > 0 expected, got {1}", "id", id));
     120        CheckParameterUtil.ensureParameterNotNull(type, "type");
    121121        SimplePrimitiveId pid = new SimplePrimitiveId(id, type);
    122122        return getHistory(pid);
     
    133133     */
    134134    public History getHistory(PrimitiveId pid) throws IllegalArgumentException{
    135         if (pid == null)
    136             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "pid"));
     135        CheckParameterUtil.ensureParameterNotNull(pid, "pid");
    137136        ArrayList<HistoryOsmPrimitive> versions = data.get(pid);
    138137        if (versions == null)
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java

    r2711 r2845  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.text.MessageFormat;
    67import java.util.Collections;
    78import java.util.Date;
     
    1314import org.openstreetmap.josm.data.osm.PrimitiveId;
    1415import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
     16import org.openstreetmap.josm.tools.CheckParameterUtil;
    1517
    1618/**
     
    3234    protected void ensurePositiveLong(long value, String name) {
    3335        if (value <= 0)
    34             throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", name, value));
    35     }
    36 
    37     protected void ensureNotNull(Object obj, String name) {
    38         if (obj == null)
    39             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", name));
     36            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' > 0 expected. Got ''{1}''.", name, value));
    4037    }
    4138
     
    5956            ensurePositiveLong(uid, "uid");
    6057        }
    61         ensureNotNull(user, "user");
    62         ensureNotNull(timestamp, "timestamp");
     58        CheckParameterUtil.ensureParameterNotNull(user, "user");
     59        CheckParameterUtil.ensureParameterNotNull(timestamp, "timestamp");
    6360        this.id = id;
    6461        this.version = version;
     
    113110    public int compareTo(HistoryOsmPrimitive o) {
    114111        if (this.id != o.id)
    115             throw new ClassCastException(tr("Can''t compare primitive with ID ''{0}'' to primitive with ID ''{1}''.", o.id, this.id));
     112            throw new ClassCastException(tr("Cannot compare primitive with ID ''{0}'' to primitive with ID ''{1}''.", o.id, this.id));
    116113        return Long.valueOf(this.version).compareTo(o.version);
    117114    }
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryRelation.java

    r2686 r2845  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.text.MessageFormat;
    67import java.util.ArrayList;
    78import java.util.Collections;
     
    1011
    1112import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     13import org.openstreetmap.josm.tools.CheckParameterUtil;
    1214
    1315/**
     
    8789    public RelationMember getRelationMember(int idx) throws IndexOutOfBoundsException  {
    8890        if (idx < 0 || idx >= members.size())
    89             throw new IndexOutOfBoundsException(tr("Parameter {0} not in range 0..{1}. Got ''{2}''.", "idx", members.size(),idx));
     91            throw new IndexOutOfBoundsException(MessageFormat.format("Parameter {0} not in range 0..{1}. Got ''{2}''.", "idx", members.size(),idx));
    9092        return members.get(idx);
    9193    }
     
    107109     */
    108110    public void addMember(RelationMember member) throws IllegalArgumentException {
    109         if (member == null)
    110             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "member"));
     111        CheckParameterUtil.ensureParameterNotNull(member, "member");
    111112        members.add(member);
    112113    }
  • trunk/src/org/openstreetmap/josm/data/osm/history/RelationMember.java

    r2711 r2845  
    22package org.openstreetmap.josm.data.osm.history;
    33
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    5 
    64import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     5import org.openstreetmap.josm.tools.CheckParameterUtil;
    76
    87/**
     
    2726    public RelationMember(String role, OsmPrimitiveType primitiveType, long primitiveId) {
    2827        this.role = (role == null ? "" : role);
    29         if (primitiveType == null)
    30             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitiveType"));
     28        CheckParameterUtil.ensureParameterNotNull(primitiveType, "primitiveType");
    3129        this.primitiveType = primitiveType;
    3230        this.primitiveId = primitiveId;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java

    r2620 r2845  
    1414import org.openstreetmap.josm.data.osm.RelationMember;
    1515import org.openstreetmap.josm.data.osm.Way;
     16import org.openstreetmap.josm.tools.CheckParameterUtil;
    1617
    1718/**
     
    4142     */
    4243    public MergeSourceBuildingVisitor(DataSet selectionBase) throws IllegalArgumentException {
    43         if (selectionBase == null)
    44             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "selectionBase"));
     44        CheckParameterUtil.ensureParameterNotNull(selectionBase, "selectionBase");
    4545        this.selectionBase = selectionBase;
    4646        this.hull = new DataSet();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintVisitor.java

    r2788 r2845  
    321321            viaNode = (Node) via;
    322322            if(!fromWay.isFirstLastNode(viaNode)) {
    323                 putError(r, tr("The \"from\" way doesn't start or end at a \"via\" node."), true);
     323                putError(r, tr("The \"from\" way does not start or end at a \"via\" node."), true);
    324324                return;
    325325            }
    326326            if(!toWay.isFirstLastNode(viaNode)) {
    327                 putError(r, tr("The \"to\" way doesn't start or end at a \"via\" node."), true);
     327                putError(r, tr("The \"to\" way does not start or end at a \"via\" node."), true);
    328328            }
    329329        }
     
    353353                viaNode = lastNode;
    354354            } else {
    355                 putError(r, tr("The \"from\" way doesn't start or end at the \"via\" way."), true);
     355                putError(r, tr("The \"from\" way does not start or end at the \"via\" way."), true);
    356356                return;
    357357            }
    358358            if(!toWay.isFirstLastNode(viaNode == firstNode ? lastNode : firstNode)) {
    359                 putError(r, tr("The \"to\" way doesn't start or end at the \"via\" way."), true);
     359                putError(r, tr("The \"to\" way does not start or end at the \"via\" way."), true);
    360360            }
    361361        }
Note: See TracChangeset for help on using the changeset viewer.