Skip to content

Commit 40a8f55

Browse files
committed
Fix Formatting & Checkstyle
Signed-off-by: Rob Winch <[email protected]>
1 parent 53d1ed2 commit 40a8f55

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

spring-session-jdbc/src/main/java/org/springframework/session/jdbc/JdbcIndexedSessionRepository.java

+21-21
Original file line numberDiff line numberDiff line change
@@ -911,42 +911,42 @@ private void save() {
911911
if (JdbcSession.this.changed) {
912912
deltaActions.add(() -> {
913913
Map<String, String> indexes = JdbcIndexedSessionRepository.this.indexResolver
914-
.resolveIndexesFor(JdbcSession.this);
914+
.resolveIndexesFor(JdbcSession.this);
915915
JdbcIndexedSessionRepository.this.jdbcOperations
916-
.update(JdbcIndexedSessionRepository.this.updateSessionQuery, (ps) -> {
917-
ps.setString(1, getId());
918-
ps.setLong(2, getLastAccessedTime().toEpochMilli());
919-
ps.setInt(3, (int) getMaxInactiveInterval().getSeconds());
920-
ps.setLong(4, getExpiryTime().toEpochMilli());
921-
ps.setString(5, indexes.get(PRINCIPAL_NAME_INDEX_NAME));
922-
ps.setString(6, JdbcSession.this.primaryKey);
923-
});
916+
.update(JdbcIndexedSessionRepository.this.updateSessionQuery, (ps) -> {
917+
ps.setString(1, getId());
918+
ps.setLong(2, getLastAccessedTime().toEpochMilli());
919+
ps.setInt(3, (int) getMaxInactiveInterval().getSeconds());
920+
ps.setLong(4, getExpiryTime().toEpochMilli());
921+
ps.setString(5, indexes.get(PRINCIPAL_NAME_INDEX_NAME));
922+
ps.setString(6, JdbcSession.this.primaryKey);
923+
});
924924
});
925925
}
926926

927927
List<String> addedAttributeNames = JdbcSession.this.delta.entrySet()
928-
.stream()
929-
.filter((entry) -> entry.getValue() == DeltaValue.ADDED)
930-
.map(Map.Entry::getKey)
931-
.collect(Collectors.toList());
928+
.stream()
929+
.filter((entry) -> entry.getValue() == DeltaValue.ADDED)
930+
.map(Map.Entry::getKey)
931+
.collect(Collectors.toList());
932932
if (!addedAttributeNames.isEmpty()) {
933933
deltaActions.add(() -> insertSessionAttributes(JdbcSession.this, addedAttributeNames));
934934
}
935935

936936
List<String> updatedAttributeNames = JdbcSession.this.delta.entrySet()
937-
.stream()
938-
.filter((entry) -> entry.getValue() == DeltaValue.UPDATED)
939-
.map(Map.Entry::getKey)
940-
.collect(Collectors.toList());
937+
.stream()
938+
.filter((entry) -> entry.getValue() == DeltaValue.UPDATED)
939+
.map(Map.Entry::getKey)
940+
.collect(Collectors.toList());
941941
if (!updatedAttributeNames.isEmpty()) {
942942
deltaActions.add(() -> updateSessionAttributes(JdbcSession.this, updatedAttributeNames));
943943
}
944944

945945
List<String> removedAttributeNames = JdbcSession.this.delta.entrySet()
946-
.stream()
947-
.filter((entry) -> entry.getValue() == DeltaValue.REMOVED)
948-
.map(Map.Entry::getKey)
949-
.collect(Collectors.toList());
946+
.stream()
947+
.filter((entry) -> entry.getValue() == DeltaValue.REMOVED)
948+
.map(Map.Entry::getKey)
949+
.collect(Collectors.toList());
950950
if (!removedAttributeNames.isEmpty()) {
951951
deltaActions.add(() -> deleteSessionAttributes(JdbcSession.this, removedAttributeNames));
952952
}

spring-session-jdbc/src/test/java/org/springframework/session/jdbc/JdbcIndexedSessionRepositoryTests.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
import static org.mockito.Mockito.mock;
6868
import static org.mockito.Mockito.times;
6969
import static org.mockito.Mockito.verify;
70-
import static org.mockito.Mockito.verifyNoInteractions;
7170
import static org.mockito.Mockito.verifyNoMoreInteractions;
7271

7372
/**
@@ -92,17 +91,18 @@ class JdbcIndexedSessionRepositoryTests {
9291
@BeforeEach
9392
void setUp() {
9493
// Mock transaction callbacks to the real consumer
95-
lenient().doAnswer(answer -> {
94+
lenient().doAnswer((answer) -> {
9695
answer.getArgument(0, Consumer.class).accept(mock(TransactionStatus.class));
9796
return null;
98-
}).when(transactionOperations).executeWithoutResult(any());
97+
}).when(this.transactionOperations).executeWithoutResult(any());
9998

100-
lenient().doAnswer(answer ->
101-
answer.getArgument(0, TransactionCallback.class).doInTransaction(mock(TransactionStatus.class))
102-
).when(transactionOperations).execute(any());
99+
lenient()
100+
.doAnswer((answer) -> answer.getArgument(0, TransactionCallback.class)
101+
.doInTransaction(mock(TransactionStatus.class)))
102+
.when(this.transactionOperations)
103+
.execute(any());
103104

104-
this.repository = new JdbcIndexedSessionRepository(this.jdbcOperations,
105-
transactionOperations);
105+
this.repository = new JdbcIndexedSessionRepository(this.jdbcOperations, this.transactionOperations);
106106
}
107107

108108
@Test

0 commit comments

Comments
 (0)