diff options
Diffstat (limited to 'tools/tools-common')
-rw-r--r-- | tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java | 5 | ||||
-rw-r--r-- | tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/OutputFile.java | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java index 1b80af3f2..59c3c0e73 100644 --- a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java +++ b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 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. @@ -188,7 +189,7 @@ public final class Console { return; } - final StringBuilder err = new StringBuilder(); + final var err = new StringBuilder(); if (appName != null) { err.append(this.getAppName()).append(": "); } @@ -217,7 +218,7 @@ public final class Console { return; } - final StringBuilder warn = new StringBuilder(); + final var warn = new StringBuilder(); if (appName != null) { warn.append(this.getAppName()).append(": "); } diff --git a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/OutputFile.java b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/OutputFile.java index 2a20554b5..4b04b4037 100644 --- a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/OutputFile.java +++ b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/OutputFile.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (c) 2020 Nordix Foundation. + * Modifications Copyright (C) 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. @@ -29,7 +30,6 @@ import java.io.IOException; import java.io.OutputStream; import java.io.Writer; import java.nio.file.FileSystems; -import java.nio.file.Path; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,8 +76,7 @@ public class OutputFile { * @return a File object for this output file */ public File toFile() { - final Path fp = FileSystems.getDefault().getPath(fileName); - return fp.toFile(); + return FileSystems.getDefault().getPath(fileName).toFile(); } /** @@ -115,7 +114,7 @@ public class OutputFile { * @return null on success, an error message on error */ public String validate() { - final File file = toFile(); + final var file = toFile(); if (file.exists()) { if (!overwrite) { return "file already exists"; |