Ignore:
Timestamp:
2014-05-09T04:49:54+02:00 (6 years ago)
Author:
Don-vip
Message:

fixes for unit tests

Location:
trunk/src/org/openstreetmap/josm/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java

    r7058 r7081  
    228228    }
    229229
     230    /**
     231     * Replies the local file.
     232     * @return The local file on disk
     233     */
    230234    public File getFile() {
    231235        return file;
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r7037 r7081  
    615615                url = new URL(new URL(getBaseUrl()), urlSuffix);
    616616                Main.info(requestMethod + " " + url + "... ");
     617                Main.debug(requestBody);
    617618                // fix #5369, see http://www.tikalk.com/java/forums/httpurlconnection-disable-keep-alive
    618619                activeConnection = Utils.openHttpConnection(url, false);
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r7033 r7081  
    439439        }
    440440
    441         // user attribute added in 0.4 API
    442441        String user = parser.getAttributeValue(null, "user");
    443         // uid attribute added in 0.6 API
    444442        String uid = parser.getAttributeValue(null, "uid");
    445443        current.setUser(createUser(uid, user));
    446444
    447         // visible attribute added in 0.4 API
    448445        String visible = parser.getAttributeValue(null, "visible");
    449446        if (visible != null) {
     
    474471        } else {
    475472            // version expected for OSM primitives with an id assigned by the server (id > 0), since API 0.6
    476             //
    477473            if (!current.isNew() && ds.getVersion() != null && "0.6".equals(ds.getVersion())) {
    478474                throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.getUniqueId())));
     
    497493            try {
    498494                current.setChangesetId(Integer.parseInt(v));
    499             } catch(NumberFormatException e) {
     495            } catch (IllegalArgumentException e) {
     496                Main.debug(e.getMessage());
    500497                if (current.isNew()) {
    501498                    // for a new primitive we just log a warning
     
    506503                    throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v), e);
    507504                }
    508             }
    509             if (current.getChangesetId() <=0) {
     505            } catch (IllegalStateException e) {
     506                // thrown for positive changeset id on new primitives
     507                Main.info(e.getMessage());
     508                current.setChangesetId(0);
     509            }
     510            if (current.getChangesetId() <= 0) {
    510511                if (current.isNew()) {
    511512                    // for a new primitive we just log a warning
Note: See TracChangeset for help on using the changeset viewer.