Skip to content

Commit 0a342ac

Browse files
upgrading snakeyaml and adding serialVersionUIDs to serializable classes to eliminate compiler warnings (#1404)
1 parent 471ea7f commit 0a342ac

File tree

8 files changed

+15
-2
lines changed

8 files changed

+15
-2
lines changed

core/src/main/java/oracle/weblogic/deploy/json/JsonException.java

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* JsonException is the exception used by the JSON parser and translation package.
1212
*/
1313
public class JsonException extends BundleAwareException {
14+
private static final long serialVersionUID = 1L;
1415

1516
/**
1617
* Constructs a default exception.

core/src/main/java/oracle/weblogic/deploy/logging/DeprecationLevel.java

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
public class DeprecationLevel extends Level {
1010
public static final Level DEPRECATION = new DeprecationLevel("DEPRECATION", 850);
1111

12+
private static final long serialVersionUID = 1L;
13+
1214
protected DeprecationLevel(String name, int value) {
1315
super(name, value);
1416
}

core/src/main/java/oracle/weblogic/deploy/logging/NotificationLevel.java

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
public class NotificationLevel extends Level {
1010
public static final Level NOTIFICATION = new NotificationLevel("NOTIFICATION", 840);
11+
12+
private static final long serialVersionUID = 1L;
13+
1114
protected NotificationLevel(String name, int value) {
1215
super(name, value);
1316
}

core/src/main/java/oracle/weblogic/deploy/logging/ToDoLevel.java

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
public class ToDoLevel extends Level {
1010
public static final Level TODO = new ToDoLevel("TODO", 820);
1111

12+
private static final long serialVersionUID = 1L;
13+
1214
protected ToDoLevel(String name, int value) {
1315
super(name, value);
1416
}

core/src/main/java/oracle/weblogic/deploy/util/OrderedMap.java

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* and has a mapping of element keys to a list of comments.
1212
*/
1313
public class OrderedMap extends LinkedHashMap<String, Object> {
14+
private static final long serialVersionUID = 1L;
15+
1416
private transient CommentMap commentMap = new CommentMap();
1517

1618
public OrderedMap() {

core/src/main/java/oracle/weblogic/deploy/util/PyRealBoolean.java

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* boolean values to be distinguished from other types.
1515
*/
1616
public class PyRealBoolean extends PyObject {
17+
private static final long serialVersionUID = 1L;
18+
1719
private final boolean isTrue;
1820

1921
public PyRealBoolean(boolean isTrue) {

core/src/main/java/oracle/weblogic/deploy/yaml/AbstractYamlTranslator.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.yaml.snakeyaml.DumperOptions;
3030
import org.yaml.snakeyaml.LoaderOptions;
3131
import org.yaml.snakeyaml.Yaml;
32+
import org.yaml.snakeyaml.constructor.SafeConstructor;
3233

3334
/**
3435
* This class does the heavy-lifting of walking the parse tree and performing the conversion into a Python dictionary.
@@ -83,7 +84,7 @@ protected PyList parseInternal(InputStream inputStream, boolean allowMultiple) t
8384
// so build a java.util.List and construct PyList(javaList).
8485
List<PyObject> result = new ArrayList<>();
8586
if (inputStream != null) {
86-
Yaml parser = new Yaml(this.getDefaultLoaderOptions());
87+
Yaml parser = new Yaml(new SafeConstructor(this.getDefaultLoaderOptions()));
8788

8889
try {
8990
Iterable<Object> docsIterable = parser.loadAll(inputStream);

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<weblogic-deploy-installer-name>weblogic-deploy</weblogic-deploy-installer-name>
4646
<skipTests>false</skipTests>
4747
<antlr.version>4.9.3</antlr.version>
48-
<snakeyaml.version>1.33</snakeyaml.version>
48+
<snakeyaml.version>2.0</snakeyaml.version>
4949
<picocli.version>4.7.1</picocli.version>
5050

5151
<sonar.organization>oracle</sonar.organization>

0 commit comments

Comments
 (0)