From 04b4354e7fe1776ec69968720240f8a2ed174784 Mon Sep 17 00:00:00 2001 From: Lukas Jungmann Date: Thu, 21 Jul 2022 09:42:01 +0200 Subject: [PATCH] make the build jdk18 friendly (no comp warnings) Signed-off-by: Lukas Jungmann --- api/src/main/java/jakarta/json/EmptyArray.java | 5 ++++- api/src/main/java/jakarta/json/EmptyObject.java | 5 ++++- .../main/java/jakarta/json/stream/JsonParsingException.java | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/jakarta/json/EmptyArray.java b/api/src/main/java/jakarta/json/EmptyArray.java index fcc3f5a7..1d627c3f 100644 --- a/api/src/main/java/jakarta/json/EmptyArray.java +++ b/api/src/main/java/jakarta/json/EmptyArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -32,6 +32,9 @@ final class EmptyArray extends AbstractList implements JsonArray, Ser /** for serialization */ private static final long serialVersionUID = 7295439472061642859L; + /** Default constructor. */ + EmptyArray() {} + @Override public JsonValue get(int index) { throw new IndexOutOfBoundsException("Index: " + index); diff --git a/api/src/main/java/jakarta/json/EmptyObject.java b/api/src/main/java/jakarta/json/EmptyObject.java index f8c4aa8d..5210318b 100644 --- a/api/src/main/java/jakarta/json/EmptyObject.java +++ b/api/src/main/java/jakarta/json/EmptyObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -31,6 +31,9 @@ final class EmptyObject extends AbstractMap implements JsonOb /** for serialization */ private static final long serialVersionUID = -1461653546889072583L; + /** Default constructor. */ + EmptyObject() {} + @Override public Set> entrySet() { return Collections.>emptySet(); diff --git a/api/src/main/java/jakarta/json/stream/JsonParsingException.java b/api/src/main/java/jakarta/json/stream/JsonParsingException.java index 06c52c6d..c657083e 100644 --- a/api/src/main/java/jakarta/json/stream/JsonParsingException.java +++ b/api/src/main/java/jakarta/json/stream/JsonParsingException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -30,7 +30,7 @@ public class JsonParsingException extends JsonException { /** * The location of the incorrect JSON. */ - private final JsonLocation location; + private transient final JsonLocation location; /** * Constructs a new runtime exception with the specified detail message.