Skip to content

Commit da0b2d3

Browse files
committed
fixed some compiler warnings
1 parent 83f82c0 commit da0b2d3

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ public String getCurrentNamespace() {
3232

3333
public void setCurrentNamespace(String currentNamespace) {
3434
if (currentNamespace == null) {
35-
throw new BuilderException(
36-
"The mapper element requires a namespace attribute to be specified.");
35+
throw new BuilderException("The mapper element requires a namespace attribute to be specified.");
3736
}
3837

3938
if (this.currentNamespace != null && !this.currentNamespace.equals(currentNamespace)) {
4039
throw new BuilderException("Wrong namespace. Expected '"
41-
+ this.currentNamespace + "' but found '" + currentNamespace + "'");
40+
+ this.currentNamespace + "' but found '" + currentNamespace + "'.");
4241
}
4342

4443
this.currentNamespace = currentNamespace;

src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class XMLMapperBuilder extends BaseBuilder {
3535
private XPathParser parser;
3636
private MapperBuilderAssistant builderAssistant;
3737
private Map<String, XNode> sqlFragments;
38-
private String resource;
3938

4039
@Deprecated
4140
public XMLMapperBuilder(Reader reader, Configuration configuration, String resource, Map<String, XNode> sqlFragments, String namespace) {
@@ -64,7 +63,6 @@ private XMLMapperBuilder(XPathParser parser, Configuration configuration, String
6463
this.builderAssistant = new MapperBuilderAssistant(configuration, resource);
6564
this.parser = parser;
6665
this.sqlFragments = sqlFragments;
67-
this.resource = resource;
6866
}
6967

7068
public void parse() {
@@ -75,9 +73,6 @@ public void parse() {
7573
configurationElement(context);
7674
configuration.addLoadedResource(namespace);
7775
bindMapperForNamespace();
78-
79-
// TODO skip current processed statements
80-
// try with pending statements
8176
parsePendingChacheRefs();
8277
parsePendingStatements();
8378
}
@@ -104,7 +99,6 @@ private void configurationElement(XNode context) {
10499
private void buildStatementFromContext(List<XNode> list) {
105100
for (XNode context : list) {
106101
final XMLStatementBuilder statementParser = new XMLStatementBuilder(configuration, builderAssistant, context);
107-
// TODO parse just one time!
108102
try {
109103
statementParser.parseStatementNode();
110104
} catch (IncompleteStatementException e) {

src/main/java/org/apache/ibatis/executor/loader/ResultLoader.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.apache.ibatis.session.RowBounds;
1313
import org.apache.ibatis.transaction.Transaction;
1414
import org.apache.ibatis.transaction.TransactionFactory;
15-
import org.apache.ibatis.transaction.jdbc.JdbcTransaction;
1615

1716
import javax.sql.DataSource;
1817
import java.sql.Connection;

src/test/java/org/apache/ibatis/io/ResourcesTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package org.apache.ibatis.io;
22

3-
import org.apache.ibatis.BaseDataTest;
4-
import static org.junit.Assert.*;
5-
import org.junit.Test;
6-
import sun.nio.cs.US_ASCII;
3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertNotNull;
5+
import static org.junit.Assert.assertTrue;
76

87
import java.io.File;
98
import java.io.IOException;
@@ -13,6 +12,9 @@
1312
import java.nio.charset.Charset;
1413
import java.util.Properties;
1514

15+
import org.apache.ibatis.BaseDataTest;
16+
import org.junit.Test;
17+
1618
public class ResourcesTest extends BaseDataTest {
1719

1820
private static final ClassLoader CLASS_LOADER = ResourcesTest.class.getClassLoader();
@@ -120,7 +122,7 @@ public void shouldGetReader() throws IOException {
120122
Charset charset = Resources.getCharset();
121123

122124
// charset
123-
Resources.setCharset(new US_ASCII());
125+
Resources.setCharset(Charset.forName("US-ASCII"));
124126
assertNotNull(Resources.getResourceAsReader(JPETSTORE_PROPERTIES));
125127

126128
// no charset
@@ -139,7 +141,7 @@ public void shouldGetReaderWithClassLoader() throws IOException {
139141
Charset charset = Resources.getCharset();
140142

141143
// charset
142-
Resources.setCharset(new US_ASCII());
144+
Resources.setCharset(Charset.forName("US-ASCII"));
143145
assertNotNull(Resources.getResourceAsReader(getClass().getClassLoader(), JPETSTORE_PROPERTIES));
144146

145147
// no charset

0 commit comments

Comments
 (0)