diff options
author | Jim Hahn <jrh3@att.com> | 2021-05-06 11:28:53 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-05-06 15:26:24 -0400 |
commit | 1d0aaaa5b31719c1718700bb0d1a99c413fd513c (patch) | |
tree | bd2687f1d38f3e3c4e53a68695c8c91c6866468e /utils-test/src/main/java/org/onap/policy/common/utils/io/Serializer.java | |
parent | 3b00f1c32b89282dcbb74d3d3645e263f005319e (diff) |
Fix sonars in policy-common
Fixed sonars:
- use "var" instead of actual type name
- re-interrupt threads
- use rej2 split() instead of String split()
Issue-ID: POLICY-3285
Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'utils-test/src/main/java/org/onap/policy/common/utils/io/Serializer.java')
-rw-r--r-- | utils-test/src/main/java/org/onap/policy/common/utils/io/Serializer.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/io/Serializer.java b/utils-test/src/main/java/org/onap/policy/common/utils/io/Serializer.java index 7e09cd96..39266a66 100644 --- a/utils-test/src/main/java/org/onap/policy/common/utils/io/Serializer.java +++ b/utils-test/src/main/java/org/onap/policy/common/utils/io/Serializer.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP Policy Engine - Common Modules * ================================================================================ - * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,8 +51,8 @@ public class Serializer { * @throws IOException if an error occurs */ public static <T> byte[] serialize(T object) throws IOException { - try (ByteArrayOutputStream out = factory.makeByteArrayOutputStream()) { - try (ObjectOutputStream oos = factory.makeObjectOutputStream(out)) { + try (var out = factory.makeByteArrayOutputStream()) { + try (var oos = factory.makeObjectOutputStream(out)) { /* * writeObject() is final and mockito can't mock final methods. In * addition, powermock seemed to be having difficulty with the junit test @@ -75,8 +75,8 @@ public class Serializer { */ private static <T> T deserialize(Class<T> clazz, byte[] data) throws IOException { - try (ByteArrayInputStream in = factory.makeByteArrayInputStream(data); - ObjectInputStream ois = factory.makeObjectInputStream(in)) { + try (var in = factory.makeByteArrayInputStream(data); + var ois = factory.makeObjectInputStream(in)) { /* * readObject() is final and mockito can't mock final methods. In addition, * powermock seemed to be having difficulty with the junit test class as well, |