Author: cbegin
Date: Sun Oct 4 03:36:43 2009
New Revision: 821459
URL: http://svn.apache.org/viewvc?rev=821459&view=rev
Log:
Added types to cache collections
Modified:
ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
Modified:
ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
URL:
http://svn.apache.org/viewvc/ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java?rev=821459&r1=821458&r2=821459&view=diff
==============================================================================
---
ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
(original)
+++
ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java
Sun Oct 4 03:36:43 2009
@@ -33,8 +33,8 @@
private final TypeHandlerRegistry typeHandlerRegistry;
private final ObjectFactory objectFactory;
- private final Map localRowValueCaches = new HashMap();
- private final Map globalRowValueCache = new HashMap();
+ private final Map<CacheKey,Set<CacheKey>> localRowValueCaches = new
HashMap<CacheKey,Set<CacheKey>>();
+ private final Map<CacheKey,Object> globalRowValueCache = new
HashMap<CacheKey,Object>();
private static final CacheKey NULL_ROW_KEY = new CacheKey();
public DefaultResultSetHandler(Executor executor, MappedStatement
mappedStatement, ParameterHandler parameterHandler, ResultHandler
resultHandler, BoundSql boundSql, int offset, int limit) {
@@ -434,7 +434,7 @@
final CacheKey parentRowKey = createRowKey(resultMap, rs);
final CacheKey rowKey = createRowKey(nestedResultMap, rs);
- final Set localRowValueCache = getRowValueCache(parentRowKey);
+ final Set<CacheKey> localRowValueCache =
getRowValueCache(parentRowKey);
final boolean knownValue = localRowValueCache .contains(rowKey);
localRowValueCache.add(rowKey);
Object rowValue = getRowValue(rs, nestedResultMap, rowKey);
@@ -458,10 +458,10 @@
return foundValues;
}
- private Set getRowValueCache(CacheKey rowKey) {
- Set cache = (Set) localRowValueCaches.get(rowKey);
+ private Set<CacheKey> getRowValueCache(CacheKey rowKey) {
+ Set<CacheKey> cache = localRowValueCaches.get(rowKey);
if (cache == null) {
- cache = new HashSet();
+ cache = new HashSet<CacheKey>();
localRowValueCaches.put(rowKey,cache);
}
return cache;