Skip to content

Commit e224381

Browse files
committed
Merge pull request mybatis#442 from mybatis/revert-439-issues/437_polishing
Revert "mybatis#437: Polishing some logics and comments"
2 parents 8001f83 + f68788c commit e224381

File tree

8 files changed

+10
-22
lines changed

8 files changed

+10
-22
lines changed

src/main/java/org/apache/ibatis/binding/MapperMethod.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
* @author Clinton Begin
3636
* @author Eduardo Macarron
3737
* @author Lasse Voss
38-
* @author Kazuki Shimizu
3938
*/
4039
public class MapperMethod {
4140

@@ -246,7 +245,7 @@ public MethodSignature(Configuration configuration, Method method) {
246245
this.returnType = method.getReturnType();
247246
this.returnsVoid = void.class.equals(this.returnType);
248247
this.returnsMany = (configuration.getObjectFactory().isCollection(this.returnType) || this.returnType.isArray());
249-
this.returnsCursor = Cursor.class.isAssignableFrom(this.returnType);
248+
this.returnsCursor = Cursor.class.equals(this.returnType);
250249
this.mapKey = getMapKey(method);
251250
this.returnsMap = (this.mapKey != null);
252251
this.hasNamedParameters = hasNamedParams(method);

src/main/java/org/apache/ibatis/cursor/defaults/DefaultCursor.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
package org.apache.ibatis.cursor.defaults;
1717

1818
import org.apache.ibatis.cursor.Cursor;
19-
import org.apache.ibatis.exceptions.ExceptionFactory;
20-
import org.apache.ibatis.executor.ErrorContext;
2119
import org.apache.ibatis.executor.resultset.DefaultResultSetHandler;
2220
import org.apache.ibatis.executor.resultset.ResultSetWrapper;
2321
import org.apache.ibatis.mapping.ResultMap;
@@ -33,7 +31,6 @@
3331

3432
/**
3533
* @author Guillaume Darmont / guillaume@dropinocean.com
36-
* @author Kazuki Shimizu
3734
*/
3835
public class DefaultCursor<T> implements Cursor<T> {
3936

@@ -114,7 +111,7 @@ protected T fetchNextObjectFromDatabase() {
114111
opened = true;
115112
resultSetHandler.handleRowValues(rsw, resultMap, objectWrapperResultHandler, RowBounds.DEFAULT, null);
116113
} catch (SQLException e) {
117-
ExceptionFactory.wrapException("Error fetching next object from database at the DefaultCursor.", e);
114+
throw new RuntimeException(e);
118115
}
119116

120117
T next = objectWrapperResultHandler.result;
@@ -163,11 +160,7 @@ public CursorIterator() {
163160
@Override
164161
public boolean hasNext() {
165162
if (object == null) {
166-
try {
167-
object = fetchNextUsingRowBound();
168-
} finally {
169-
ErrorContext.instance().reset();
170-
}
163+
object = fetchNextUsingRowBound();
171164
}
172165
return object != null;
173166
}
@@ -178,11 +171,7 @@ public T next() {
178171
T next = object;
179172

180173
if (next == null) {
181-
try {
182-
next = fetchNextUsingRowBound();
183-
} finally {
184-
ErrorContext.instance().reset();
185-
}
174+
next = fetchNextUsingRowBound();
186175
}
187176

188177
if (next != null) {

src/test/java/org/apache/ibatis/submitted/cursor_nested/CreateDB.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
--
3-
-- Copyright 2009-2015 The MyBatis Team
3+
-- Copyright 2009-2012 The MyBatis Team
44
--
55
-- Licensed under the Apache License, Version 2.0 (the "License");
66
-- you may not use this file except in compliance with the License.

src/test/java/org/apache/ibatis/submitted/cursor_nested/Mapper.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright 2009-2015 The MyBatis Team
3+
Copyright 2009-2012 The MyBatis Team
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

src/test/java/org/apache/ibatis/submitted/cursor_nested/mybatis-config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
3-
Copyright 2009-2015 The MyBatis Team
3+
Copyright 2009-2012 The MyBatis Team
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

src/test/java/org/apache/ibatis/submitted/cursor_simple/CreateDB.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--
2-
-- Copyright 2009-2015 The MyBatis Team
2+
-- Copyright 2009-2012 The MyBatis Team
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.

src/test/java/org/apache/ibatis/submitted/cursor_simple/Mapper.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright 2009-2015 The MyBatis Team
3+
Copyright 2009-2012 The MyBatis Team
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

src/test/java/org/apache/ibatis/submitted/cursor_simple/mybatis-config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
3-
Copyright 2009-2015 The MyBatis Team
3+
Copyright 2009-2012 The MyBatis Team
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)