From 29fc5e63806d133c4ba0812fda3fcd52ffa8d2c2 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Tue, 3 May 2016 09:07:51 -0400 Subject: [PATCH] Fix Call Overridable Method From Ctor https://sonar.spring.io/issues/search#componentRoots=org.springframework.integration%3Aspring-integration|createdAt=2016-05-03T02%3A58%3A49%2B0000|sort=UPDATE_DATE|asc=false --- .../integration/store/AbstractMessageGroupStore.java | 6 +++++- .../integration/store/SimpleMessageStore.java | 8 ++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java index 7074f3463b..638decb3e0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java @@ -62,10 +62,14 @@ public abstract class AbstractMessageGroupStore extends AbstractBatchingMessageG private boolean lazyLoadMessageGroups = true; - public AbstractMessageGroupStore() { + protected AbstractMessageGroupStore() { super(); } + protected AbstractMessageGroupStore(boolean lazyLoadMessageGroups) { + this.lazyLoadMessageGroups = lazyLoadMessageGroups; + } + @Override public final void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java index ff2a6c2cf6..4e37c45272 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java @@ -121,18 +121,14 @@ public class SimpleMessageStore extends AbstractMessageGroupStore * @since 4.3 */ public SimpleMessageStore(int individualCapacity, int groupCapacity, long upperBoundTimeout, - LockRegistry lockRegistry) { + LockRegistry lockRegistry) { + super(false); Assert.notNull(lockRegistry, "The LockRegistry cannot be null"); this.individualUpperBound = new UpperBound(individualCapacity); this.individualCapacity = individualCapacity; this.groupCapacity = groupCapacity; this.lockRegistry = lockRegistry; this.upperBoundTimeout = upperBoundTimeout; - disableLazyLoadMessageGroups(); - } - - private void disableLazyLoadMessageGroups() { - super.setLazyLoadMessageGroups(false); } /**