Ignore:
Timestamp:
2023-08-09T15:30:01+02:00 (3 years ago)
Author:
taylor.smock
Message:

Fix #22832: Code cleanup and some simplification, documentation fixes (patch by gaben)

There should not be any functional changes in this patch; it is intended to do
the following:

  • Simplify and cleanup code (example: Arrays.asList(item) -> Collections.singletonList(item))
  • Fix typos in documentation (which also corrects the documentation to match what actually happens, in some cases)
File:
1 edited

Legend:

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

    r18779 r18801  
    809809                    errorHeader = response.getHeaderField("Error");
    810810                    Logging.error("Error header: " + errorHeader);
    811                 } else if (retCode != HttpURLConnection.HTTP_OK && responseBody.length() > 0) {
     811                } else if (retCode != HttpURLConnection.HTTP_OK && !responseBody.isEmpty()) {
    812812                    Logging.error("Error body: " + responseBody);
    813813                }
     
    815815
    816816                errorHeader = errorHeader == null ? null : errorHeader.trim();
    817                 String errorBody = responseBody.length() == 0 ? null : responseBody.trim();
     817                String errorBody = responseBody.isEmpty() ? null : responseBody.trim();
    818818                switch(retCode) {
    819819                case HttpURLConnection.HTTP_OK:
Note: See TracChangeset for help on using the changeset viewer.