Skip to content

Commit 554f223

Browse files
committed
Fix some Sonar smells and typos in JavaDocs
1 parent 5b43b6c commit 554f223

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

spring-integration-ip/src/main/java/org/springframework/integration/ip/dsl/TcpOutboundGatewaySpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public <P> TcpOutboundGatewaySpec remoteTimeout(Function<Message<P>, ?> remoteTi
9090
}
9191

9292
/**
93-
* Set to true to close the connection ouput stream after sending without
93+
* Set to true to close the connection output stream after sending without
9494
* closing the connection. Use to signal EOF to the server, such as when using
9595
* a {@link org.springframework.integration.ip.tcp.serializer.ByteArrayRawSerializer}.
9696
* Requires a single-use connection factory.

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

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -425,46 +425,37 @@ else if (this.flush) {
425425
* @return Either the number of affected entities when using a JPQL query.
426426
* When using a merge/persist the updated/inserted itself is returned.
427427
*/
428-
public Object executeOutboundJpaOperation(final Message<?> message) {
429-
430-
final Object result;
431-
428+
public Object executeOutboundJpaOperation(Message<?> message) {
432429
ParameterSource paramSource = null;
433430
if (this.jpaQuery != null || this.nativeQuery != null || this.namedQuery != null) {
434431
paramSource = determineParameterSource(message);
435432
}
436433
if (this.jpaQuery != null) {
437-
result = this.jpaOperations.executeUpdate(this.jpaQuery, paramSource);
434+
return this.jpaOperations.executeUpdate(this.jpaQuery, paramSource);
438435
}
439436
else if (this.nativeQuery != null) {
440-
result = this.jpaOperations.executeUpdateWithNativeQuery(this.nativeQuery, paramSource);
437+
return this.jpaOperations.executeUpdateWithNativeQuery(this.nativeQuery, paramSource);
441438
}
442439
else if (this.namedQuery != null) {
443-
result = this.jpaOperations.executeUpdateWithNamedQuery(this.namedQuery, paramSource);
440+
return this.jpaOperations.executeUpdateWithNamedQuery(this.namedQuery, paramSource);
444441
}
445442
else {
446443
switch (this.persistMode) {
447444
case PERSIST:
448445
this.jpaOperations.persist(message.getPayload(), this.flushSize, this.clearOnFlush);
449-
result = message.getPayload();
450-
break;
446+
return message.getPayload();
451447
case MERGE:
452-
result = this.jpaOperations.merge(message.getPayload(), this.flushSize, this.clearOnFlush);
453-
break;
448+
return this.jpaOperations.merge(message.getPayload(), this.flushSize, this.clearOnFlush);
454449
case DELETE:
455450
this.jpaOperations.delete(message.getPayload());
456451
if (this.flush) {
457452
this.jpaOperations.flush();
458453
}
459-
result = message.getPayload();
460-
break;
454+
return message.getPayload();
461455
default:
462456
throw new IllegalStateException("Unsupported PersistMode: " + this.persistMode.name());
463457
}
464458
}
465-
466-
return result; // NOSONAR never null
467-
468459
}
469460

470461
/**
@@ -496,6 +487,7 @@ public Object poll(@Nullable final Message<?> requestMessage) {
496487
if (entityClazz == null && requestMessage != null) {
497488
entityClazz = requestMessage.getPayload().getClass();
498489
}
490+
Assert.state(entityClazz != null, "The entity class to retrieve cannot be null.");
499491
payload = this.jpaOperations.find(entityClazz, id);
500492
}
501493
else {

0 commit comments

Comments
 (0)