Skip to content
Snippets Groups Projects
Commit 87b27a26 authored by buczekp's avatar buczekp
Browse files

[LMS-1894] minor: extracted constant

SVN: 18989
parent de657fa3
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,8 @@ public class ReflectingStringEscaper ...@@ -39,6 +39,8 @@ public class ReflectingStringEscaper
private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION,
ReflectingStringEscaper.class); ReflectingStringEscaper.class);
private static int MIN_TIME_LOGGED_MS = 100;
/** /**
* Escape all the string fields on the bean. * Escape all the string fields on the bean.
*/ */
...@@ -67,7 +69,7 @@ public class ReflectingStringEscaper ...@@ -67,7 +69,7 @@ public class ReflectingStringEscaper
T result = doEscapeDeep(beanClone); T result = doEscapeDeep(beanClone);
long escapeTime = System.currentTimeMillis(); long escapeTime = System.currentTimeMillis();
long timeSpent = escapeTime - startTime; long timeSpent = escapeTime - startTime;
if (timeSpent > 100) if (timeSpent >= MIN_TIME_LOGGED_MS)
{ {
operationLog.info((timeSpent) + "ms for escaping (cloning: " operationLog.info((timeSpent) + "ms for escaping (cloning: "
+ (cloneTime - startTime) + "ms) " + (cloneTime - startTime) + "ms) "
...@@ -93,7 +95,7 @@ public class ReflectingStringEscaper ...@@ -93,7 +95,7 @@ public class ReflectingStringEscaper
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
T result = doEscapeDeep(bean); T result = doEscapeDeep(bean);
long timeSpent = System.currentTimeMillis() - time; long timeSpent = System.currentTimeMillis() - time;
if (timeSpent > 100) if (timeSpent >= MIN_TIME_LOGGED_MS)
{ {
operationLog.info((timeSpent) + "ms for escaping " operationLog.info((timeSpent) + "ms for escaping "
+ (bean == null ? "" : bean.getClass().getSimpleName())); + (bean == null ? "" : bean.getClass().getSimpleName()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment