Skip to content

Commit a7dcd40

Browse files
committed
Merge pull request mybatis#358 from kazuki43zoo/polish-binding-package
Polish binding package classes
2 parents 819fb32 + 7c3a4fa commit a7dcd40

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,23 +332,22 @@ private String getParamNameFromAnnotation(Method method, int i, String paramName
332332
for (Object paramAnno : paramAnnos) {
333333
if (paramAnno instanceof Param) {
334334
paramName = ((Param) paramAnno).value();
335+
break;
335336
}
336337
}
337338
return paramName;
338339
}
339340

340341
private boolean hasNamedParams(Method method) {
341-
boolean hasNamedParams = false;
342342
final Object[][] paramAnnos = method.getParameterAnnotations();
343343
for (Object[] paramAnno : paramAnnos) {
344344
for (Object aParamAnno : paramAnno) {
345345
if (aParamAnno instanceof Param) {
346-
hasNamedParams = true;
347-
break;
346+
return true;
348347
}
349348
}
350349
}
351-
return hasNamedParams;
350+
return false;
352351
}
353352

354353
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
public class MapperProxyFactory<T> {
2929

3030
private final Class<T> mapperInterface;
31-
private Map<Method, MapperMethod> methodCache = new ConcurrentHashMap<Method, MapperMethod>();
31+
private final Map<Method, MapperMethod> methodCache = new ConcurrentHashMap<Method, MapperMethod>();
3232

3333
public MapperProxyFactory(Class<T> mapperInterface) {
3434
this.mapperInterface = mapperInterface;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
public class MapperRegistry {
3535

36-
private Configuration config;
36+
private final Configuration config;
3737
private final Map<Class<?>, MapperProxyFactory<?>> knownMappers = new HashMap<Class<?>, MapperProxyFactory<?>>();
3838

3939
public MapperRegistry(Configuration config) {

0 commit comments

Comments
 (0)