Author: mes
Date: 2011-04-29 11:01:23 -0700 (Fri, 29 Apr 2011)
New Revision: 24856
Modified:
core3/model-impl/trunk/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
Log:
allowing CyRow.get() to work for list types, even if this is not type safe
Modified:
core3/model-impl/trunk/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
===================================================================
---
core3/model-impl/trunk/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
2011-04-29 18:00:11 UTC (rev 24855)
+++
core3/model-impl/trunk/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
2011-04-29 18:01:23 UTC (rev 24856)
@@ -636,7 +636,7 @@
synchronized private <T> T getX(final Object key, final String
columnName, final Class<? extends T> type) {
if (type.isAssignableFrom(List.class))
- throw new IllegalArgumentException("use getList() to
retrieve lists!");
+ logger.debug("risky use of get() instead of getList()
for retrieving list");
lastInternalError = null;
final VirtualColumn virtColumn =
virtualColumnMap.get(columnName);
@@ -919,10 +919,8 @@
final String columnName = column.getName();
final Class<?> type = column.getType();
if (type == List.class) {
- final Class<?> elementType =
- column.getListElementType();
- nameToValueMap.put(columnName,
getListX(key, columnName,
-
elementType));
+ final Class<?> elementType =
column.getListElementType();
+ nameToValueMap.put(columnName,
getListX(key, columnName, elementType));
} else
nameToValueMap.put(columnName,
getX(key, columnName, type));
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.