Skip to content

Commit 7a50309

Browse files
committed
Optimize EventDrivenConsumer logging
* Replace `insert(0)` with `append()` to avoid shifting operation Signed-off-by: Jooyoung Pyoung <[email protected]>
1 parent 1af554c commit 7a50309

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

spring-integration-core/src/main/java/org/springframework/integration/endpoint/EventDrivenConsumer.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,13 @@ private void logComponentSubscriptionEvent(boolean add) {
112112
componentName =
113113
(StringUtils.hasText(componentName) && componentName.contains("#")) ? "" : ":" + componentName;
114114
StringBuilder buffer = new StringBuilder();
115+
buffer.append(add ? "Adding " : "Removing ");
115116
buffer.append("{")
116117
.append(componentType)
117118
.append(componentName)
118119
.append("} as a subscriber to the '")
119120
.append(namedChannel.getComponentName())
120121
.append("' channel");
121-
if (add) {
122-
buffer.insert(0, "Adding ");
123-
}
124-
else {
125-
buffer.insert(0, "Removing ");
126-
}
127122
logger.info(buffer.toString());
128123
}
129124
}

0 commit comments

Comments
 (0)