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

fix messages for data

File:
1 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;
Note: See TracChangeset for help on using the changeset viewer.