diff options
author | 2017-09-27 15:37:33 +0530 | |
---|---|---|
committer | 2017-09-27 15:37:33 +0530 | |
commit | 218eb3e2c66c33a636130115f4b4e1465ca5026a (patch) | |
tree | 2f2e33279c3ae84160808f40b3480bfaa925db11 /bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java | |
parent | fb232fe3a7e5458382caea66d51402963c344515 (diff) |
Replace with the diamnod operator
Issue-Id:SO-118
Change-Id: I96a1fb659bafd204221c5ff8f3d0b680a36dba9d
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java index 9a7c21fba1..161eb74d94 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java @@ -33,19 +33,20 @@ public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset)
throws IOException {
- if (!stream.markSupported()) {
- stream = new BufferedInputStream(stream);
+ InputStream inputStream = stream;
+ if (!inputStream.markSupported()) {
+ inputStream = new BufferedInputStream(inputStream);
}
- stream.mark(maxEntitySize + 1);
+ inputStream.mark(maxEntitySize + 1);
final byte[] entity = new byte[maxEntitySize + 1];
- final int entitySize = stream.read(entity);
+ final int entitySize = inputStream.read(entity);
b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));
if (entitySize > maxEntitySize) {
b.append("...more...");
}
b.append('\n');
- stream.reset();
- return stream;
+ inputStream.reset();
+ return inputStream;
}
@Override
@@ -106,4 +107,4 @@ public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, out.write(i);
}
}
-}
\ No newline at end of file +}
|