Skip to content

Commit e2d891a

Browse files
committed
Fix new Sonar smells
1 parent a95c76e commit e2d891a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,18 +445,19 @@ else if (this.namedQuery != null) {
445445
}
446446

447447
private Object executeOutboundJpaOperationOnPersistentMode(Message<?> message) {
448+
Object payload = message.getPayload();
448449
switch (this.persistMode) {
449450
case PERSIST:
450-
this.jpaOperations.persist(message.getPayload(), this.flushSize, this.clearOnFlush);
451-
return message.getPayload();
451+
this.jpaOperations.persist(payload, this.flushSize, this.clearOnFlush);
452+
return payload;
452453
case MERGE:
453-
return this.jpaOperations.merge(message.getPayload(), this.flushSize, this.clearOnFlush);
454+
return this.jpaOperations.merge(payload, this.flushSize, this.clearOnFlush);
454455
case DELETE:
455-
this.jpaOperations.delete(message.getPayload());
456+
this.jpaOperations.delete(payload);
456457
if (this.flush) {
457458
this.jpaOperations.flush();
458459
}
459-
return message.getPayload();
460+
return payload;
460461
default:
461462
throw new IllegalStateException("Unsupported PersistMode: " + this.persistMode.name());
462463
}

spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGateway.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.integration.rsocket.outbound;
1818

19+
import java.util.Arrays;
1920
import java.util.Map;
2021

2122
import org.reactivestreams.Publisher;
@@ -95,9 +96,11 @@ public class RSocketOutboundGateway extends AbstractReplyProducingMessageHandler
9596
* @param route the RSocket endpoint route to use.
9697
* @param routeVariables the variables to expand route template.
9798
*/
98-
public RSocketOutboundGateway(String route, Object... routeVariables) {
99+
public RSocketOutboundGateway(String route, @Nullable Object... routeVariables) {
99100
this(new ValueExpression<>(route));
100-
this.routeVars = routeVariables;
101+
if (routeVariables != null) {
102+
this.routeVars = Arrays.copyOf(routeVariables, routeVariables.length);
103+
}
101104
}
102105

103106
/**

0 commit comments

Comments
 (0)