diff options
author | 2018-02-02 09:43:33 -0500 | |
---|---|---|
committer | 2018-02-02 09:45:19 -0500 | |
commit | 4723527133e158ba48bf5a1eb9eec731af2ae1f8 (patch) | |
tree | 01e55e3fba2b9f849435ea3a82cfa903c323ea3b /PolicyEngineAPI/src/main/java/org/onap/policy/std/StdPolicyEngine.java | |
parent | e8c14515d3f48aad6d42a31d7489a3ef25557f2d (diff) |
Technical debt reduction
* empty constructor
* Unnecessary imports
* try-with-resources
* missing @Override
* useless parens
* proper boolean detection
* useless imports
* Use Set vs HashSet
* moving statements to separate lines
Issue-ID: POLICY-477
Change-Id: I5fae9c5c8e7d30f731a1caefc8a5271cf382e0a0
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'PolicyEngineAPI/src/main/java/org/onap/policy/std/StdPolicyEngine.java')
-rw-r--r-- | PolicyEngineAPI/src/main/java/org/onap/policy/std/StdPolicyEngine.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/std/StdPolicyEngine.java b/PolicyEngineAPI/src/main/java/org/onap/policy/std/StdPolicyEngine.java index d08ea29f9..e0a6d2d76 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/std/StdPolicyEngine.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/std/StdPolicyEngine.java @@ -632,11 +632,11 @@ public class StdPolicyEngine { try { switch (policyConfigResponse.getType()) { case JSON: - JsonReader jsonReader = Json - .createReader(new StringReader(policyConfigResponse.getConfig())); - JsonObject object = jsonReader.readObject(); - jsonReader.close(); - policyConfig.setJsonObject(object); + try (JsonReader jsonReader = Json + .createReader(new StringReader(policyConfigResponse.getConfig())) ) { + JsonObject object = jsonReader.readObject(); + policyConfig.setJsonObject(object); + } break; case OTHER: policyConfig.setOther(policyConfigResponse.getConfig()); |