Skip to content

Commit 814d755

Browse files
authored
Merge pull request #3351 from hazendaz/next
Use imports instead of fully qualified
2 parents f979843 + 8f55d3d commit 814d755

File tree

11 files changed

+25
-15
lines changed

11 files changed

+25
-15
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.apache.ibatis.builder;
1717

18+
import java.sql.ResultSet;
1819
import java.util.ArrayList;
1920
import java.util.Collections;
2021
import java.util.HashMap;
@@ -452,7 +453,7 @@ private Class<?> resolveParameterJavaType(Class<?> resultType, String property,
452453
JdbcType jdbcType) {
453454
if (javaType == null) {
454455
if (JdbcType.CURSOR.equals(jdbcType)) {
455-
javaType = java.sql.ResultSet.class;
456+
javaType = ResultSet.class;
456457
} else if (Map.class.isAssignableFrom(resultType)) {
457458
javaType = Object.class;
458459
} else {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.apache.ibatis.builder;
1717

18+
import java.sql.ResultSet;
1819
import java.util.ArrayList;
1920
import java.util.List;
2021
import java.util.Map;
@@ -99,7 +100,7 @@ private ParameterMapping buildParameterMapping(String content) {
99100
} else if (typeHandlerRegistry.hasTypeHandler(parameterType)) {
100101
propertyType = parameterType;
101102
} else if (JdbcType.CURSOR.name().equals(propertiesMap.get("jdbcType"))) {
102-
propertyType = java.sql.ResultSet.class;
103+
propertyType = ResultSet.class;
103104
} else if (property == null || Map.class.isAssignableFrom(parameterType)) {
104105
propertyType = Object.class;
105106
} else {

src/main/java/org/apache/ibatis/type/TypeHandlerRegistry.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.lang.reflect.Type;
2323
import java.math.BigDecimal;
2424
import java.math.BigInteger;
25+
import java.sql.Time;
26+
import java.sql.Timestamp;
2527
import java.time.Instant;
2628
import java.time.LocalDate;
2729
import java.time.LocalDateTime;
@@ -159,8 +161,8 @@ public TypeHandlerRegistry(Configuration configuration) {
159161
register(JdbcType.TIME, new TimeOnlyTypeHandler());
160162

161163
register(java.sql.Date.class, new SqlDateTypeHandler());
162-
register(java.sql.Time.class, new SqlTimeTypeHandler());
163-
register(java.sql.Timestamp.class, new SqlTimestampTypeHandler());
164+
register(Time.class, new SqlTimeTypeHandler());
165+
register(Timestamp.class, new SqlTimestampTypeHandler());
164166

165167
register(String.class, JdbcType.SQLXML, new SqlxmlTypeHandler());
166168

src/test/java/org/apache/ibatis/scripting/xmltags/OgnlCacheTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static org.junit.jupiter.api.Assertions.assertEquals;
1919
import static org.junit.jupiter.api.Assertions.assertNotNull;
2020

21+
import java.sql.Date;
2122
import java.util.ArrayList;
2223
import java.util.HashMap;
2324
import java.util.List;
@@ -53,8 +54,8 @@ class DataClass {
5354
@Test
5455
void issue2609() throws Exception {
5556
Map<String, Object> context = new HashMap<>();
56-
context.put("d1", java.sql.Date.valueOf("2022-01-01"));
57-
context.put("d2", java.sql.Date.valueOf("2022-01-02"));
57+
context.put("d1", Date.valueOf("2022-01-01"));
58+
context.put("d2", Date.valueOf("2022-01-02"));
5859
assertEquals(-1, OgnlCache.getValue("d1.compareTo(d2)", context));
5960
}
6061
}

src/test/java/org/apache/ibatis/submitted/custom_collection_handling/CustomObjectWrapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
import org.apache.ibatis.reflection.MetaObject;
2121
import org.apache.ibatis.reflection.factory.ObjectFactory;
2222
import org.apache.ibatis.reflection.property.PropertyTokenizer;
23+
import org.apache.ibatis.reflection.wrapper.ObjectWrapper;
2324

24-
public class CustomObjectWrapper implements org.apache.ibatis.reflection.wrapper.ObjectWrapper {
25+
public class CustomObjectWrapper implements ObjectWrapper {
2526

2627
private final CustomCollection collection;
2728

src/test/java/org/apache/ibatis/submitted/custom_collection_handling/CustomObjectWrapperFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
import org.apache.ibatis.reflection.MetaObject;
1919
import org.apache.ibatis.reflection.wrapper.ObjectWrapper;
20+
import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory;
2021

21-
public class CustomObjectWrapperFactory implements org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory {
22+
public class CustomObjectWrapperFactory implements ObjectWrapperFactory {
2223

2324
@Override
2425
public boolean hasWrapperFor(Object object) {
@@ -27,7 +28,7 @@ public boolean hasWrapperFor(Object object) {
2728

2829
@Override
2930
public ObjectWrapper getWrapperFor(MetaObject metaObject, Object object) {
30-
return new org.apache.ibatis.submitted.custom_collection_handling.CustomObjectWrapper((CustomCollection) object);
31+
return new CustomObjectWrapper((CustomCollection) object);
3132
}
3233

3334
}

src/test/java/org/apache/ibatis/submitted/language/VelocitySqlSourceBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.apache.ibatis.submitted.language;
1717

18+
import java.sql.ResultSet;
1819
import java.util.ArrayList;
1920
import java.util.List;
2021
import java.util.Map;
@@ -77,7 +78,7 @@ private ParameterMapping buildParameterMapping(String content) {
7778
if (typeHandlerRegistry.hasTypeHandler(parameterType)) {
7879
propertyType = parameterType;
7980
} else if (JdbcType.CURSOR.name().equals(jdbcType)) {
80-
propertyType = java.sql.ResultSet.class;
81+
propertyType = ResultSet.class;
8182
} else if (property != null) {
8283
MetaClass metaClass = MetaClass.forClass(parameterType, configuration.getReflectorFactory());
8384
if (metaClass.hasGetter(property)) {

src/test/java/org/apache/ibatis/type/DateTypeHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DateTypeHandlerTest extends BaseTypeHandlerTest {
3636
@Test
3737
public void shouldSetParameter() throws Exception {
3838
TYPE_HANDLER.setParameter(ps, 1, DATE, null);
39-
verify(ps).setTimestamp(1, new java.sql.Timestamp(DATE.getTime()));
39+
verify(ps).setTimestamp(1, new Timestamp(DATE.getTime()));
4040
}
4141

4242
@Override

src/test/java/org/apache/ibatis/type/SqlTimeTypeHandlerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
import static org.mockito.Mockito.verify;
2121
import static org.mockito.Mockito.when;
2222

23+
import java.sql.Time;
2324
import java.util.Date;
2425

2526
import org.junit.jupiter.api.Test;
2627

2728
class SqlTimeTypeHandlerTest extends BaseTypeHandlerTest {
2829

29-
private static final TypeHandler<java.sql.Time> TYPE_HANDLER = new SqlTimeTypeHandler();
30-
private static final java.sql.Time SQL_TIME = new java.sql.Time(new Date().getTime());
30+
private static final TypeHandler<Time> TYPE_HANDLER = new SqlTimeTypeHandler();
31+
private static final Time SQL_TIME = new Time(new Date().getTime());
3132

3233
@Override
3334
@Test

src/test/java/org/apache/ibatis/type/SqlTimetampTypeHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class SqlTimetampTypeHandlerTest extends BaseTypeHandlerTest {
2929

3030
private static final TypeHandler<Timestamp> TYPE_HANDLER = new SqlTimestampTypeHandler();
31-
private static final java.sql.Timestamp SQL_TIME = new java.sql.Timestamp(new Date().getTime());
31+
private static final Timestamp SQL_TIME = new Timestamp(new Date().getTime());
3232

3333
@Override
3434
@Test

src/test/java/org/apache/ibatis/type/TimeOnlyTypeHandlerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.mockito.Mockito.verify;
2222
import static org.mockito.Mockito.when;
2323

24+
import java.sql.Time;
2425
import java.util.Date;
2526

2627
import org.junit.jupiter.api.Test;
@@ -29,7 +30,7 @@ class TimeOnlyTypeHandlerTest extends BaseTypeHandlerTest {
2930

3031
private static final TypeHandler<Date> TYPE_HANDLER = new TimeOnlyTypeHandler();
3132
private static final Date DATE = new Date();
32-
private static final java.sql.Time SQL_TIME = new java.sql.Time(DATE.getTime());
33+
private static final Time SQL_TIME = new Time(DATE.getTime());
3334

3435
@Override
3536
@Test

0 commit comments

Comments
 (0)