Changeset 18723 in josm for trunk/src/org


Ignore:
Timestamp:
2023-05-10T19:18:54+02:00 (19 months ago)
Author:
taylor.smock
Message:

Fix #22432, see #22941: Start migrating from javax to jakarta

Parsson was split out from the JSONP repository in 2021 (see
https://github.com/jakartaee/jsonp-api/issues/285 ). It is the default provider,
and will "just work" without additional configuration.

Many plugins use javax.json, so the scheduled removal of the javax.json
dependencies is set to milestone:"24.12" (see #22941).

Changes between javax.json and jakarta.json 2.0:

  • Rename of javax.json to jakarta.json
  • Some additional bug fixes

This will enable us to move easily to jakarta.json 2.1 in the future.
The changes of note with 2.1 includes:

  • Better handling of duplicated keys
  • Additional APIs around primitive types
  • API to get current event from JsonParser

We cannot currently move to jakarta.json 2.1 since it requires Java 11+.

Location:
trunk/src/org/openstreetmap/josm
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/StructUtils.java

    r16645 r18723  
    2020import java.util.stream.Collectors;
    2121
    22 import javax.json.Json;
    23 import javax.json.JsonArray;
    24 import javax.json.JsonArrayBuilder;
    25 import javax.json.JsonObject;
    26 import javax.json.JsonObjectBuilder;
    27 import javax.json.JsonReader;
    28 import javax.json.JsonString;
    29 import javax.json.JsonValue;
    30 import javax.json.JsonWriter;
     22import jakarta.json.Json;
     23import jakarta.json.JsonArray;
     24import jakarta.json.JsonArrayBuilder;
     25import jakarta.json.JsonObject;
     26import jakarta.json.JsonObjectBuilder;
     27import jakarta.json.JsonReader;
     28import jakarta.json.JsonString;
     29import jakarta.json.JsonValue;
     30import jakarta.json.JsonWriter;
    3131
    3232import org.openstreetmap.josm.spi.preferences.IPreferences;
  • trunk/src/org/openstreetmap/josm/data/imagery/DefaultLayer.java

    r16553 r18723  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import javax.json.Json;
    7 import javax.json.JsonObject;
    8 import javax.json.JsonObjectBuilder;
     6import jakarta.json.Json;
     7import jakarta.json.JsonObject;
     8import jakarta.json.JsonObjectBuilder;
    99
    1010import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r18211 r18723  
    2020import java.util.stream.Collectors;
    2121
    22 import javax.json.Json;
    23 import javax.json.JsonObject;
    24 import javax.json.JsonReader;
     22import jakarta.json.Json;
     23import jakarta.json.JsonObject;
     24import jakarta.json.JsonReader;
    2525import javax.swing.ImageIcon;
    2626
  • trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/MapboxVectorTileSource.java

    r17994 r18723  
    1010import java.util.stream.Collectors;
    1111
    12 import javax.json.Json;
    13 import javax.json.JsonException;
    14 import javax.json.JsonObject;
    15 import javax.json.JsonReader;
     12import jakarta.json.Json;
     13import jakarta.json.JsonException;
     14import jakarta.json.JsonObject;
     15import jakarta.json.JsonReader;
    1616
    1717import org.openstreetmap.josm.data.imagery.ImageryInfo;
  • trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Expression.java

    r17867 r18723  
    66import java.util.stream.Collectors;
    77
    8 import javax.json.JsonArray;
    9 import javax.json.JsonObject;
    10 import javax.json.JsonString;
    11 import javax.json.JsonValue;
     8import jakarta.json.JsonArray;
     9import jakarta.json.JsonObject;
     10import jakarta.json.JsonString;
     11import jakarta.json.JsonValue;
    1212
    1313/**
  • trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java

    r18578 r18723  
    1515import java.util.stream.Stream;
    1616
    17 import javax.json.JsonArray;
    18 import javax.json.JsonNumber;
    19 import javax.json.JsonObject;
    20 import javax.json.JsonString;
    21 import javax.json.JsonValue;
     17import jakarta.json.JsonArray;
     18import jakarta.json.JsonNumber;
     19import jakarta.json.JsonObject;
     20import jakarta.json.JsonString;
     21import jakarta.json.JsonValue;
    2222
    2323import org.openstreetmap.josm.gui.mappaint.StyleKeys;
  • trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyle.java

    r18582 r18723  
    2424
    2525import javax.imageio.ImageIO;
    26 import javax.json.Json;
    27 import javax.json.JsonException;
    28 import javax.json.JsonObject;
    29 import javax.json.JsonReader;
    30 import javax.json.JsonValue;
     26import jakarta.json.Json;
     27import jakarta.json.JsonException;
     28import jakarta.json.JsonObject;
     29import jakarta.json.JsonReader;
     30import jakarta.json.JsonValue;
    3131
    3232import org.openstreetmap.josm.data.imagery.vectortile.mapbox.InvalidMapboxVectorTileException;
  • trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Source.java

    r17867 r18723  
    1212import java.util.function.IntFunction;
    1313
    14 import javax.json.JsonArray;
    15 import javax.json.JsonObject;
    16 import javax.json.JsonString;
    17 import javax.json.JsonValue;
     14import jakarta.json.JsonArray;
     15import jakarta.json.JsonObject;
     16import jakarta.json.JsonString;
     17import jakarta.json.JsonValue;
    1818
    1919import org.openstreetmap.josm.data.Bounds;
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuth20Exception.java

    r18650 r18723  
    22package org.openstreetmap.josm.data.oauth;
    33
    4 import javax.json.JsonObject;
     4import jakarta.json.JsonObject;
    55
    66/**
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuth20Parameters.java

    r18650 r18723  
    88import java.util.Objects;
    99
    10 import javax.json.Json;
    11 import javax.json.JsonObject;
    12 import javax.json.JsonObjectBuilder;
    13 import javax.json.JsonReader;
    14 import javax.json.JsonStructure;
    15 import javax.json.JsonValue;
     10import jakarta.json.Json;
     11import jakarta.json.JsonObject;
     12import jakarta.json.JsonObjectBuilder;
     13import jakarta.json.JsonReader;
     14import jakarta.json.JsonStructure;
     15import jakarta.json.JsonValue;
    1616
    1717import org.openstreetmap.josm.spi.preferences.Config;
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuth20Token.java

    r18665 r18723  
    1111import java.time.Instant;
    1212
    13 import javax.json.Json;
    14 import javax.json.JsonObject;
    15 import javax.json.JsonObjectBuilder;
    16 import javax.json.JsonReader;
    17 import javax.json.JsonStructure;
    18 import javax.json.JsonValue;
     13import jakarta.json.Json;
     14import jakarta.json.JsonObject;
     15import jakarta.json.JsonObjectBuilder;
     16import jakarta.json.JsonReader;
     17import jakarta.json.JsonStructure;
     18import jakarta.json.JsonValue;
    1919
    2020import org.openstreetmap.josm.tools.HttpClient;
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java

    r18651 r18723  
    77import java.util.Objects;
    88
    9 import javax.json.Json;
    10 import javax.json.JsonObject;
    11 import javax.json.JsonReader;
    12 import javax.json.JsonStructure;
    13 import javax.json.JsonValue;
     9import jakarta.json.Json;
     10import jakarta.json.JsonObject;
     11import jakarta.json.JsonReader;
     12import jakarta.json.JsonStructure;
     13import jakarta.json.JsonValue;
    1414
    1515import org.openstreetmap.josm.io.OsmApi;
  • trunk/src/org/openstreetmap/josm/data/sources/SourcePreferenceEntry.java

    r16545 r18723  
    44import java.util.Map;
    55
    6 import javax.json.stream.JsonCollectors;
     6import jakarta.json.stream.JsonCollectors;
    77
    88import org.openstreetmap.josm.data.StructUtils.StructEntry;
  • trunk/src/org/openstreetmap/josm/io/GeoJSONMapRouletteWriter.java

    r18636 r18723  
    66import java.util.stream.Stream;
    77
    8 import javax.json.Json;
    9 import javax.json.JsonArray;
    10 import javax.json.JsonArrayBuilder;
    11 import javax.json.JsonObject;
    12 import javax.json.JsonObjectBuilder;
    13 import javax.json.JsonValue;
     8import jakarta.json.Json;
     9import jakarta.json.JsonArray;
     10import jakarta.json.JsonArrayBuilder;
     11import jakarta.json.JsonObject;
     12import jakarta.json.JsonObjectBuilder;
     13import jakarta.json.JsonValue;
    1414
    1515import org.openstreetmap.josm.data.osm.DataSet;
  • trunk/src/org/openstreetmap/josm/io/GeoJSONReader.java

    r18441 r18723  
    1919import java.util.stream.Collectors;
    2020
    21 import javax.json.Json;
    22 import javax.json.JsonArray;
    23 import javax.json.JsonNumber;
    24 import javax.json.JsonObject;
    25 import javax.json.JsonString;
    26 import javax.json.JsonValue;
    27 import javax.json.stream.JsonParser;
    28 import javax.json.stream.JsonParser.Event;
    29 import javax.json.stream.JsonParsingException;
     21import jakarta.json.Json;
     22import jakarta.json.JsonArray;
     23import jakarta.json.JsonNumber;
     24import jakarta.json.JsonObject;
     25import jakarta.json.JsonString;
     26import jakarta.json.JsonValue;
     27import jakarta.json.stream.JsonParser;
     28import jakarta.json.stream.JsonParser.Event;
     29import jakarta.json.stream.JsonParsingException;
    3030
    3131import org.openstreetmap.josm.data.coor.EastNorth;
  • trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java

    r18494 r18723  
    2121import java.util.stream.Stream;
    2222
    23 import javax.json.Json;
    24 import javax.json.JsonArrayBuilder;
    25 import javax.json.JsonObject;
    26 import javax.json.JsonObjectBuilder;
    27 import javax.json.JsonValue;
    28 import javax.json.JsonWriter;
    29 import javax.json.stream.JsonGenerator;
    30 import javax.json.stream.JsonParser;
    31 import javax.json.stream.JsonParsingException;
     23import jakarta.json.Json;
     24import jakarta.json.JsonArrayBuilder;
     25import jakarta.json.JsonObject;
     26import jakarta.json.JsonObjectBuilder;
     27import jakarta.json.JsonValue;
     28import jakarta.json.JsonWriter;
     29import jakarta.json.stream.JsonGenerator;
     30import jakarta.json.stream.JsonParser;
     31import jakarta.json.stream.JsonParsingException;
    3232
    3333import org.openstreetmap.josm.data.Bounds;
  • trunk/src/org/openstreetmap/josm/io/OsmJsonReader.java

    r18695 r18723  
    99import java.util.Map.Entry;
    1010
    11 import javax.json.Json;
    12 import javax.json.JsonArray;
    13 import javax.json.JsonException;
    14 import javax.json.JsonNumber;
    15 import javax.json.JsonObject;
    16 import javax.json.JsonString;
    17 import javax.json.JsonValue;
    18 import javax.json.stream.JsonParser;
    19 import javax.json.stream.JsonParser.Event;
    20 import javax.json.stream.JsonParsingException;
     11import jakarta.json.Json;
     12import jakarta.json.JsonArray;
     13import jakarta.json.JsonException;
     14import jakarta.json.JsonNumber;
     15import jakarta.json.JsonObject;
     16import jakarta.json.JsonString;
     17import jakarta.json.JsonValue;
     18import jakarta.json.stream.JsonParser;
     19import jakarta.json.stream.JsonParser.Event;
     20import jakarta.json.stream.JsonParsingException;
    2121
    2222import org.openstreetmap.josm.data.osm.DataSet;
  • trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java

    r18650 r18723  
    1111import java.util.Set;
    1212
    13 import javax.json.JsonException;
     13import jakarta.json.JsonException;
    1414import javax.swing.text.html.HTMLEditorKit;
    1515
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r18650 r18723  
    2525import java.util.stream.Stream;
    2626
    27 import javax.json.Json;
     27import jakarta.json.Json;
    2828
    2929import org.openstreetmap.josm.data.Version;
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/FeaturesHandler.java

    r16825 r18723  
    88import java.util.stream.Collectors;
    99
    10 import javax.json.Json;
    11 import javax.json.JsonArray;
    12 import javax.json.JsonArrayBuilder;
    13 import javax.json.JsonObject;
    14 import javax.json.JsonObjectBuilder;
     10import jakarta.json.Json;
     11import jakarta.json.JsonArray;
     12import jakarta.json.JsonArrayBuilder;
     13import jakarta.json.JsonObject;
     14import jakarta.json.JsonObjectBuilder;
    1515
    1616import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/OpenApiHandler.java

    r16849 r18723  
    99import java.util.stream.Stream;
    1010
    11 import javax.json.Json;
    12 import javax.json.JsonArrayBuilder;
    13 import javax.json.JsonObjectBuilder;
     11import jakarta.json.Json;
     12import jakarta.json.JsonArrayBuilder;
     13import jakarta.json.JsonObjectBuilder;
    1414
    1515import org.openstreetmap.josm.data.preferences.JosmUrls;
  • trunk/src/org/openstreetmap/josm/tools/Tag2Link.java

    r18629 r18723  
    2323import java.util.stream.Collectors;
    2424
    25 import javax.json.Json;
    26 import javax.json.JsonArray;
    27 import javax.json.JsonReader;
    28 import javax.json.JsonValue;
     25import jakarta.json.Json;
     26import jakarta.json.JsonArray;
     27import jakarta.json.JsonReader;
     28import jakarta.json.JsonValue;
    2929
    3030import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
  • trunk/src/org/openstreetmap/josm/tools/Territories.java

    r16595 r18723  
    2222import java.util.stream.Stream;
    2323
    24 import javax.json.Json;
    25 import javax.json.JsonArray;
    26 import javax.json.JsonString;
    27 import javax.json.JsonValue;
    28 import javax.json.stream.JsonParser;
    29 import javax.json.stream.JsonParser.Event;
    30 import javax.json.stream.JsonParsingException;
     24import jakarta.json.Json;
     25import jakarta.json.JsonArray;
     26import jakarta.json.JsonString;
     27import jakarta.json.JsonValue;
     28import jakarta.json.stream.JsonParser;
     29import jakarta.json.stream.JsonParser.Event;
     30import jakarta.json.stream.JsonParsingException;
    3131
    3232import org.openstreetmap.josm.data.coor.LatLon;
Note: See TracChangeset for help on using the changeset viewer.