Skip to content

Commit fd7006e

Browse files
authored
Merge pull request #334 from hazendaz/master
[ci] Turn on mybatis formatting rules
2 parents e1f4672 + 482df3d commit fd7006e

File tree

73 files changed

+805
-781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+805
-781
lines changed

format.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright 2010-2019 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<!DOCTYPE Format>
20+
<Format>
21+
<!-- Dummy format file -->
22+
</Format>

src/main/java/org/mybatis/spring/MyBatisExceptionTranslator.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2010-2017 the original author or authors.
2+
* Copyright 2010-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,10 +29,9 @@
2929
/**
3030
* Default exception translator.
3131
*
32-
* Translates MyBatis SqlSession returned exception into a Spring
33-
* {@code DataAccessException} using Spring's {@code SQLExceptionTranslator}
34-
* Can load {@code SQLExceptionTranslator} eagerly or when the
35-
* first exception is translated.
32+
* Translates MyBatis SqlSession returned exception into a Spring {@code DataAccessException} using Spring's
33+
* {@code SQLExceptionTranslator} Can load {@code SQLExceptionTranslator} eagerly or when the first exception is
34+
* translated.
3635
*
3736
* @author Eduardo Macarron
3837
*/
@@ -45,9 +44,11 @@ public class MyBatisExceptionTranslator implements PersistenceExceptionTranslato
4544
/**
4645
* Creates a new {@code DataAccessExceptionTranslator} instance.
4746
*
48-
* @param dataSource DataSource to use to find metadata and establish which error codes are usable.
49-
* @param exceptionTranslatorLazyInit if true, the translator instantiates internal stuff only the first time will
50-
* have the need to translate exceptions.
47+
* @param dataSource
48+
* DataSource to use to find metadata and establish which error codes are usable.
49+
* @param exceptionTranslatorLazyInit
50+
* if true, the translator instantiates internal stuff only the first time will have the need to translate
51+
* exceptions.
5152
*/
5253
public MyBatisExceptionTranslator(DataSource dataSource, boolean exceptionTranslatorLazyInit) {
5354
this.dataSource = dataSource;
@@ -75,7 +76,7 @@ public DataAccessException translateExceptionIfPossible(RuntimeException e) {
7576
throw (TransactionException) e.getCause();
7677
}
7778
return new MyBatisSystemException(e);
78-
}
79+
}
7980
return null;
8081
}
8182

src/main/java/org/mybatis/spring/MyBatisSystemException.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
import org.springframework.dao.UncategorizedDataAccessException;
1919

2020
/**
21-
* MyBatis specific subclass of {@code UncategorizedDataAccessException}, for MyBatis system errors that do
22-
* not match any concrete {@code org.springframework.dao} exceptions.
21+
* MyBatis specific subclass of {@code UncategorizedDataAccessException}, for MyBatis system errors that do not match
22+
* any concrete {@code org.springframework.dao} exceptions.
2323
*
24-
* In MyBatis 3 {@code org.apache.ibatis.exceptions.PersistenceException} is a {@code RuntimeException},
25-
* but using this wrapper class to bring everything under a single hierarchy will be easier for client code to
26-
* handle.
24+
* In MyBatis 3 {@code org.apache.ibatis.exceptions.PersistenceException} is a {@code RuntimeException}, but using this
25+
* wrapper class to bring everything under a single hierarchy will be easier for client code to handle.
2726
*
2827
* @author Hunter Presnall
2928
*/

0 commit comments

Comments
 (0)