Skip to content

Commit 27c924c

Browse files
committed
Re-format with mvn formatter:format
1 parent f59b155 commit 27c924c

File tree

5 files changed

+40
-30
lines changed

5 files changed

+40
-30
lines changed

doma-spring-boot-autoconfigure/src/main/java/org/seasar/doma/boot/autoconfigure/DomaAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public EntityListenerProvider entityListenerProvider() {
8383
return new TryLookupEntityListenerProvider();
8484
}
8585

86-
@Bean
86+
@Bean
8787
@ConditionalOnMissingBean
8888
public DomaConfigBuilder domaConfigBuilder() {
8989
return new DomaConfigBuilder();

doma-spring-boot-autoconfigure/src/main/java/org/seasar/doma/boot/autoconfigure/TryLookupEntityListenerProvider.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,24 @@
2525
import org.springframework.context.ApplicationContextAware;
2626

2727
/**
28-
* {@link EntityListenerProvider} implementation that
29-
* {@link EntityListener} managed by Spring Framework, or else created by Doma.
28+
* {@link EntityListenerProvider} implementation that {@link EntityListener} managed by
29+
* Spring Framework, or else created by Doma.
3030
*
3131
* @author backpaper0
3232
*
3333
*/
34-
class TryLookupEntityListenerProvider implements EntityListenerProvider, ApplicationContextAware {
34+
class TryLookupEntityListenerProvider implements EntityListenerProvider,
35+
ApplicationContextAware {
3536

3637
private ApplicationContext context;
37-
38+
3839
@Override
3940
public <ENTITY, LISTENER extends EntityListener<ENTITY>> LISTENER get(
4041
Class<LISTENER> listenerClass, Supplier<LISTENER> listenerSupplier) {
4142
Map<String, LISTENER> beans = context.getBeansOfType(listenerClass);
4243
if (beans.size() > 1) {
43-
throw new IllegalStateException(
44-
"Bean type of " + listenerClass + " bean must be unique!");
44+
throw new IllegalStateException("Bean type of " + listenerClass
45+
+ " bean must be unique!");
4546
}
4647
return beans.values().stream().findAny().orElseGet(listenerSupplier);
4748
}

doma-spring-boot-autoconfigure/src/test/java/org/seasar/doma/boot/autoconfigure/DomaPersistenceExceptionTranslatorTest.java

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ public void testOccurNotJdbcException() {
4343

4444
@Test
4545
public void testOccurSqlExecutionException() {
46-
DataAccessException dataAccessException = translator.translateExceptionIfPossible(
47-
new SqlExecutionException(SqlLogType.FORMATTED, SqlKind.SELECT,
46+
DataAccessException dataAccessException = translator
47+
.translateExceptionIfPossible(new SqlExecutionException(
48+
SqlLogType.FORMATTED, SqlKind.SELECT,
4849
"select * from todo where todo_id = ?",
4950
"select * from todo where todo_id = '000000001'",
5051
"TodoDao/findOne.sql", new SQLException(), null));
@@ -55,8 +56,10 @@ public void testOccurSqlExecutionException() {
5556

5657
@Test
5758
public void testOccurUniqueConstraintException() {
58-
DataAccessException dataAccessException = translator.translateExceptionIfPossible(
59-
new UniqueConstraintException(SqlLogType.FORMATTED, SqlKind.INSERT,
59+
DataAccessException dataAccessException = translator
60+
.translateExceptionIfPossible(new UniqueConstraintException(
61+
SqlLogType.FORMATTED,
62+
SqlKind.INSERT,
6063
"insert into todo (todo_id, title) values (?, ?)",
6164
"insert into todo (todo_id, title) values ('000000001', 'Title')",
6265
"TodoDao/insert.sql", new SQLException()));
@@ -67,8 +70,10 @@ public void testOccurUniqueConstraintException() {
6770

6871
@Test
6972
public void testThrowOptimisticLockingFailureException() {
70-
DataAccessException dataAccessException = translator.translateExceptionIfPossible(
71-
new OptimisticLockException(SqlLogType.FORMATTED, SqlKind.SELECT,
73+
DataAccessException dataAccessException = translator
74+
.translateExceptionIfPossible(new OptimisticLockException(
75+
SqlLogType.FORMATTED,
76+
SqlKind.SELECT,
7277
"update todo set title = ? where todo_id = ? and version = ?",
7378
"update todo set title = 'Modified Title' where todo_id = '000000001' and version = 1",
7479
"TodoDao/update.sql"));
@@ -78,8 +83,10 @@ public void testThrowOptimisticLockingFailureException() {
7883

7984
@Test
8085
public void testThrowDuplicateKeyException() {
81-
DataAccessException dataAccessException = translator.translateExceptionIfPossible(
82-
new UniqueConstraintException(SqlLogType.FORMATTED, SqlKind.INSERT,
86+
DataAccessException dataAccessException = translator
87+
.translateExceptionIfPossible(new UniqueConstraintException(
88+
SqlLogType.FORMATTED,
89+
SqlKind.INSERT,
8390
"insert into todo (todo_id, title) values (?, ?)",
8491
"insert into todo (todo_id, title) values ('000000001', 'Title')",
8592
"TodoDao/insert.sql", null));
@@ -101,7 +108,8 @@ public void testThrowIncorrectResultSizeDataAccessException() {
101108
{
102109
DataAccessException dataAccessException = translator
103110
.translateExceptionIfPossible(new NonSingleColumnException(
104-
SqlLogType.FORMATTED, SqlKind.SELECT,
111+
SqlLogType.FORMATTED,
112+
SqlKind.SELECT,
105113
"select todo_id, title from todo where created_at = ?",
106114
"select todo_id, title from todo where created_at = '2016-03-06'",
107115
"TodoDao/findBy.sql"));
@@ -136,9 +144,11 @@ public void testThrowTypeMismatchDataAccessException() {
136144
{
137145
DataAccessException dataAccessException = translator
138146
.translateExceptionIfPossible(new ResultMappingException(
139-
SqlLogType.FORMATTED, "Todo",
147+
SqlLogType.FORMATTED,
148+
"Todo",
140149
Collections.singletonList("finished"),
141-
Collections.singletonList("modified_at"), SqlKind.SELECT,
150+
Collections.singletonList("modified_at"),
151+
SqlKind.SELECT,
142152
"select todo_id, title from todo where created_at = ?",
143153
"select todo_id, title from todo where created_at = '2016-03-06'",
144154
"TodoDao/findBy.sql"));
@@ -149,8 +159,9 @@ public void testThrowTypeMismatchDataAccessException() {
149159

150160
@Test
151161
public void testThrowUncategorizedDataAccessException() {
152-
DataAccessException dataAccessException = translator.translateExceptionIfPossible(
153-
new ConfigException("DomaConfig", "configure"));
162+
DataAccessException dataAccessException = translator
163+
.translateExceptionIfPossible(new ConfigException("DomaConfig",
164+
"configure"));
154165
assertThat(dataAccessException,
155166
is(instanceOf(UncategorizedDataAccessException.class)));
156167
}

doma-spring-boot-autoconfigure/src/test/java/org/seasar/doma/boot/autoconfigure/TryLookupEntityListenerProviderTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public void testManaged() throws Exception {
3535
context.refresh();
3636
TryLookupEntityListenerProvider provider = new TryLookupEntityListenerProvider();
3737
provider.setApplicationContext(context);
38-
FooListener listener = provider
39-
.get(FooListener.class, FooListener::new);
38+
FooListener listener = provider.get(FooListener.class, FooListener::new);
4039
assertThat(listener.managed, is(true));
4140
}
4241

@@ -55,8 +54,7 @@ public void testNotManaged() throws Exception {
5554
context.refresh();
5655
TryLookupEntityListenerProvider provider = new TryLookupEntityListenerProvider();
5756
provider.setApplicationContext(context);
58-
FooListener listener = provider
59-
.get(FooListener.class, FooListener::new);
57+
FooListener listener = provider.get(FooListener.class, FooListener::new);
6058
assertThat(listener.managed, is(false));
6159
}
6260

@@ -65,12 +63,12 @@ public static class FooListener implements EntityListener<Object> {
6563

6664
final boolean managed;
6765

68-
//Invoked by Doma
66+
// Invoked by Doma
6967
public FooListener() {
7068
managed = false;
7169
}
7270

73-
//Invoked by Spring
71+
// Invoked by Spring
7472
@Autowired
7573
public FooListener(ApplicationContext context) {
7674
managed = true;

doma-spring-boot-samples/doma-spring-boot-sample-entity-listener/src/main/java/org/seasar/doma/boot/MessageListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
@Component
1010
public class MessageListener implements EntityListener<Message> {
11-
@Override
12-
public void preInsert(Message message, PreInsertContext<Message> context) {
13-
message.createdAt = LocalDate.now();
14-
}
11+
@Override
12+
public void preInsert(Message message, PreInsertContext<Message> context) {
13+
message.createdAt = LocalDate.now();
14+
}
1515
}

0 commit comments

Comments
 (0)