summaryrefslogtreecommitdiffstats
path: root/services/services-engine
diff options
context:
space:
mode:
Diffstat (limited to 'services/services-engine')
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/HeaderDelimitedTextBlockReader.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/HeaderDelimitedTextBlockReader.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/HeaderDelimitedTextBlockReader.java
index 5531d9704..67b7cb871 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/HeaderDelimitedTextBlockReader.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/consumer/HeaderDelimitedTextBlockReader.java
@@ -1,19 +1,20 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020-2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -50,7 +51,7 @@ public class HeaderDelimitedTextBlockReader implements TextBlockReader, Runnable
// Indicates that text block processing starts at the first block of text
private final boolean delimiterAtStart;
- private boolean blockEndTokenUsed = false;
+ private boolean blockEndTokenUsed;
// The thread used to read the text from the stream
private Thread textConsumputionThread;
@@ -170,9 +171,7 @@ public class HeaderDelimitedTextBlockReader implements TextBlockReader, Runnable
*/
@Override
public void run() {
- final BufferedReader textReader = new BufferedReader(new InputStreamReader(inputStream));
-
- try {
+ try (BufferedReader textReader = new BufferedReader(new InputStreamReader(inputStream))) {
// Read the input line by line until we see end of file on the stream
String line;
while ((line = textReader.readLine()) != null) {