Ticket #3565: typo_and_unification.diff

File typo_and_unification.diff, 14.2 KB (added by Claudius, 17 years ago)
  • org/openstreetmap/josm/io/OsmApi.java

     
    7979    static public OsmApi getOsmApi() {
    8080        String serverUrl = Main.pref.get("osm-server.url", "http://api.openstreetmap.org/api");
    8181        if (serverUrl == null)
    82             throw new IllegalStateException(tr("preference ''{0}'' missing. Can't initialize OsmApi", "osm-server.url"));
     82            throw new IllegalStateException(tr("Preference ''{0}'' missing. Can't initialize OsmApi", "osm-server.url"));
    8383        return getOsmApi(serverUrl);
    8484    }
    8585
     
    131131     */
    132132    protected OsmApi(String serverUrl)  {
    133133        if (serverUrl == null)
    134             throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "serverUrl"));
     134            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "serverUrl"));
    135135        this.serverUrl = serverUrl;
    136136    }
    137137
     
    250250            ret = sendRequest("PUT", OsmPrimitiveType.from(osm).getAPIName()+"/create", toXml(osm, true),monitor);
    251251            osm.setOsmId(Long.parseLong(ret.trim()), 1);
    252252        } catch(NumberFormatException e){
    253             throw new OsmTransferException(tr("unexpected format of id replied by the server, got ''{0}''", ret));
     253            throw new OsmTransferException(tr("Unexpected format of id replied by the server. Got ''{0}''", ret));
    254254        }
    255255    }
    256256
     
    276276                osm.setOsmId(osm.getId(), Integer.parseInt(ret.trim()));
    277277            }
    278278        } catch(NumberFormatException e) {
    279             throw new OsmTransferException(tr("unexpected format of new version of modified primitive ''{0}'', got ''{1}''", osm.getId(), ret));
     279            throw new OsmTransferException(tr("Unexpected format of new version of modified primitive ''{0}''. got ''{1}''", osm.getId(), ret));
    280280        }
    281281    }
    282282
     
    310310     */
    311311    public void openChangeset(Changeset changeset, ProgressMonitor progressMonitor) throws OsmTransferException {
    312312        if (changeset == null)
    313             throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "changeset"));
     313            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "changeset"));
    314314        try {
    315315            progressMonitor.beginTask((tr("Creating changeset...")));
    316316            initialize(progressMonitor);
     
    320320                changeset.setId(Long.parseLong(ret.trim()));
    321321                changeset.setOpen(true);
    322322            } catch(NumberFormatException e){
    323                 throw new OsmTransferException(tr("unexpected format of id replied by the server, got ''{0}''", ret));
     323                throw new OsmTransferException(tr("Unexpected format of id replied by the server. got ''{0}''", ret));
    324324            }
    325325            progressMonitor.setCustomText((tr("Successfully opened changeset {0}",changeset.getId())));
    326326        } finally {
     
    342342     */
    343343    public void updateChangeset(Changeset changeset, ProgressMonitor monitor) throws OsmTransferException {
    344344        if (changeset == null)
    345             throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "changeset"));
     345            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "changeset"));
    346346        if (monitor == null) {
    347347            monitor = NullProgressMonitor.INSTANCE;
    348348        }
     
    377377     */
    378378    public void closeChangeset(Changeset changeset, ProgressMonitor monitor) throws OsmTransferException {
    379379        if (changeset == null)
    380             throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "changeset"));
     380            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "changeset"));
    381381        if (monitor == null) {
    382382            monitor = NullProgressMonitor.INSTANCE;
    383383        }
     
    595595        if (changeset == null)
    596596            throw new OsmTransferException(tr("Current changeset is null. Can't upload data."));
    597597        if (changeset.getId() <= 0)
    598             throw new OsmTransferException(tr("id of current changeset > 0 required. Current id is {0}", changeset.getId()));
     598            throw new OsmTransferException(tr("Id of current changeset > 0 required. Current id is {0}", changeset.getId()));
    599599    }
    600600    /**
    601601     * Replies the changeset data uploads are currently directed to
  • org/openstreetmap/josm/io/OsmChangesetParser.java

     
    6969            // -- id
    7070            String value = atts.getValue("id");
    7171            if (value == null) {
    72                 throwException(tr("missing mandatory attribute ''{0}''", "id"));
     72                throwException(tr("Missing mandatory attribute ''{0}''", "id"));
    7373            }
    7474            long id = 0;
    7575            try {
    7676                id = Long.parseLong(value);
    7777            } catch(NumberFormatException e) {
    78                 throwException(tr("illegal value for attribute ''{0}''. Got ''{1}''", "id", value));
     78                throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''", "id", value));
    7979            }
    8080            if (id <= 0) {
    81                 throwException(tr("illegal nummeric value for attribute ''{0}''. Got ''{1}''", "id", id));
     81                throwException(tr("Illegal numeric value for attribute ''{0}''. Got ''{1}''", "id", id));
    8282            }
    8383            current.setId(id);
    8484
     
    106106            //  -- open
    107107            value = atts.getValue("open");
    108108            if (value == null) {
    109                 throwException(tr("missing mandatory attribute ''{0}''", "open"));
     109                throwException(tr("Missing mandatory attribute ''{0}''", "open"));
    110110            } else if (value.equals("true")) {
    111111                current.setOpen(true);
    112112            } else if (value.equals("false")) {
    113113                current.setOpen(false);
    114114            } else {
    115                 throwException(tr("illegal boolean value for attribute ''{0}''. Got ''{1}''", "open", value));
     115                throwException(tr("Illegal boolean value for attribute ''{0}''. Got ''{1}''", "open", value));
    116116            }
    117117
    118118            // -- min_lon and min_lat
     
    125125                try {
    126126                    minLon = Double.parseDouble(min_lon);
    127127                } catch(NumberFormatException e) {
    128                     throwException(tr("illegal value for attribute ''{0}''. Got ''{1}''", "min_lon", min_lon));
     128                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''", "min_lon", min_lon));
    129129                }
    130130                double minLat = 0;
    131131                try {
    132132                    minLat = Double.parseDouble(min_lat);
    133133                } catch(NumberFormatException e) {
    134                     throwException(tr("illegal value for attribute ''{0}''. Got ''{1}''", "min_lat", min_lat));
     134                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''", "min_lat", min_lat));
    135135                }
    136136                current.setMin(new LatLon(minLat, minLon));
    137137
     
    141141                try {
    142142                    maxLon = Double.parseDouble(max_lon);
    143143                } catch(NumberFormatException e) {
    144                     throwException(tr("illegal value for attribute ''{0}''. Got ''{1}''", "max_lon", max_lon));
     144                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''", "max_lon", max_lon));
    145145                }
    146146                double maxLat = 0;
    147147                try {
    148148                    maxLat = Double.parseDouble(max_lat);
    149149                } catch(NumberFormatException e) {
    150                     throwException(tr("illegal value for attribute ''{0}''. Got ''{1}''", "max_lat", max_lat));
     150                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''", "max_lat", max_lat));
    151151                }
    152152                current.setMax(new LatLon(maxLon, maxLat));
    153153            }
  • org/openstreetmap/josm/io/OsmHistoryReader.java

     
    6565        protected long getMandatoryAttributeLong(Attributes attr, String name) throws SAXException{
    6666            String v = attr.getValue(name);
    6767            if (v == null) {
    68                 throwException(tr("mandatory attribute ''{0}'' missing", name));
     68                throwException(tr("Mandatory attribute ''{0}'' missing", name));
    6969            }
    7070            Long l = 0l;
    7171            try {
    7272                l = Long.parseLong(v);
    7373            } catch(NumberFormatException e) {
    74                 throwException(tr("illegal value for mandatory attribute ''{0}'' of type long, got ''{1}''", name, v));
     74                throwException(tr("Illegal value for mandatory attribute ''{0}'' of type long, got ''{1}''", name, v));
    7575            }
    7676            if (l < 0) {
    77                 throwException(tr("illegal value for mandatory attribute ''{0}'' of type long (>=0), got ''{1}''", name, v));
     77                throwException(tr("Illegal value for mandatory attribute ''{0}'' of type long (>=0), got ''{1}''", name, v));
    7878            }
    7979            return l;
    8080        }
     
    8282        protected int getMandatoryAttributeInt(Attributes attr, String name) throws SAXException{
    8383            String v = attr.getValue(name);
    8484            if (v == null) {
    85                 throwException(tr("mandatory attribute ''{0}'' missing", name));
     85                throwException(tr("Mandatory attribute ''{0}'' missing", name));
    8686            }
    8787            Integer i = 0;
    8888            try {
    8989                i = Integer.parseInt(v);
    9090            } catch(NumberFormatException e) {
    91                 throwException(tr("illegal value for mandatory attribute ''{0}'' of type int, got ''{1}''", name, v));
     91                throwException(tr("Illegal value for mandatory attribute ''{0}'' of type int, got ''{1}''", name, v));
    9292            }
    9393            if (i < 0) {
    94                 throwException(tr("illegal value for mandatory attribute ''{0}'' of type int (>=0), got ''{1}''", name, v));
     94                throwException(tr("Illegal value for mandatory attribute ''{0}'' of type int (>=0), got ''{1}''", name, v));
    9595            }
    9696            return i;
    9797        }
     
    9999        protected String getMandatoryAttributeString(Attributes attr, String name) throws SAXException{
    100100            String v = attr.getValue(name);
    101101            if (v == null) {
    102                 throwException(tr("mandatory attribute ''{0}'' missing", name));
     102                throwException(tr("Mandatory attribute ''{0}'' missing", name));
    103103            }
    104104            return v;
    105105        }
     
    107107        protected boolean getMandatoryAttributeBoolean(Attributes attr, String name) throws SAXException{
    108108            String v = attr.getValue(name);
    109109            if (v == null) {
    110                 throwException(tr("mandatory attribute ''{0}'' missing", name));
     110                throwException(tr("Mandatory attribute ''{0}'' missing", name));
    111111            }
    112112            if (v.equals("true")) return true;
    113113            if (v.equals("false")) return false;
    114             throwException(tr("illegal value for mandatory attribute ''{0}'' of type boolean, got ''{1}''", name, v));
     114            throwException(tr("Illegal value for mandatory attribute ''{0}'' of type boolean, got ''{1}''", name, v));
    115115            // not reached
    116116            return false;
    117117        }
     
    171171            try {
    172172                type = OsmPrimitiveType.fromApiTypeName(v);
    173173            } catch(IllegalArgumentException e) {
    174                 throwException(tr("illegal value for mandatory attribute ''{0}'' of type OsmPrimitiveType, got ''{1}''", "type", v));
     174                throwException(tr("Illegal value for mandatory attribute ''{0}'' of type OsmPrimitiveType, got ''{1}''", "type", v));
    175175            }
    176176            String role = getMandatoryAttributeString(atts, "role");
    177177            org.openstreetmap.josm.data.osm.history.RelationMember member = new org.openstreetmap.josm.data.osm.history.RelationMember(role, type,ref);
  • org/openstreetmap/josm/io/OsmReader.java

     
    225225                Collection<Long> list = ways.get(current.id);
    226226                if (list == null) {
    227227                    throwException(
    228                             tr("found XML element <nd> element not as direct child of element <way>")
     228                            tr("Found XML element <nd> element not as direct child of element <way>")
    229229                    );
    230230                }
    231231                if (atts.getValue("ref") == null) {
     
    415415                    if (id <= 0)
    416416                        throw new IllegalDataException (
    417417                                tr(
    418                                         "way with external id ''{0}'' includes missing node with external id ''{1}''",
     418                                        "Way with external id ''{0}'' includes missing node with external id ''{1}''",
    419419                                        externalWayId,
    420420                                        id
    421421                                )
     
    428428            }
    429429            w.setNodes(wayNodes);
    430430            if (incomplete) {
    431                 logger.warning(tr("marked way {0} with {1} nodes incomplete because at least one node was missing in the " +
     431                logger.warning(tr("Marked way {0} with {1} nodes incomplete because at least one node was missing in the " +
    432432                        "loaded data and is therefore incomplete too", externalWayId, w.getNodesCount()));
    433433                w.incomplete = true;
    434434                ds.addPrimitive(w);