Ignore:
Timestamp:
2023-09-20T17:53:20+02:00 (12 months ago)
Author:
taylor.smock
Message:

Fix #23171: UnknownHostException may cause issues in GeoChat

This appears to be something that can occur when running under WebStart.
To fix this, we check if (a) the JOSM website is offline and (b) if we are
running under webstart. If so, we don't check for messages.

Additionally, this patch converts geochat from the older time classes to the
newer java.time classes and fixes some lint issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/geochat/src/geochat/JsonQueryUtil.java

    r36122 r36146  
    66import java.io.InputStream;
    77import java.net.URI;
     8import java.util.ServiceConfigurationError;
    89
    910import jakarta.json.Json;
     
    5253        if (inp == null)
    5354            throw new IOException("Empty response");
    54         try (JsonReader reader = Json.createReader(inp)){
     55        try (JsonReader reader = Json.createReader(inp)) {
    5556            return reader.readObject();
    56         } catch (JsonException e) {
     57        } catch (ServiceConfigurationError | JsonException e) {
    5758            throw new IOException("Failed to parse JSON: " + e.getMessage(), e);
    5859        } finally {
     
    6364    // Asynchronous operation
    6465
    65     private String query;
    66     private JsonQueryCallback callback;
    67 
    68     private JsonQueryUtil() {}
     66    private final String query;
     67    private final JsonQueryCallback callback;
    6968
    7069    private JsonQueryUtil(String query, JsonQueryCallback callback) {
Note: See TracChangeset for help on using the changeset viewer.