Author: apico
Date: 2010-09-15 17:17:27 -0700 (Wed, 15 Sep 2010)
New Revision: 21889
Modified:
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/service/CyThesaurusNamespace.java
Log:
switched from throwing an exception to adding a result and message for
isMappingSupported when either source or target is not supported. Checking for
individual support is implied in checking for the support of mapping. Rather
than requiring users to perform each check on source and target before checking
for mapping, we can cover all three checks in this single operation without
throwing an exception.
Modified:
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/service/CyThesaurusNamespace.java
===================================================================
---
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/service/CyThesaurusNamespace.java
2010-09-15 23:58:19 UTC (rev 21888)
+++
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/service/CyThesaurusNamespace.java
2010-09-16 00:17:27 UTC (rev 21889)
@@ -421,14 +421,16 @@
Set<DataSourceWrapper> srcTypes =
IDMapperClientManager.getSupportedSrcTypes();
DataSourceWrapper srcds = DataSourceWrapper.getInstance(srctype);
- if (!srcTypes.contains(srcds))
- throw new CyCommandException(srctype + " is not supported.");
-
+ if (!srcTypes.contains(srcds)){
+ result.addResult(Boolean.FALSE);
+ result.addMessage(srctype + " is not supported.");
+ }
Set<DataSourceWrapper> tgtTypes =
IDMapperClientManager.getSupportedTgtTypes();
DataSourceWrapper tgtds = DataSourceWrapper.getInstance(tgttype);
- if (!tgtTypes.contains(tgtds))
- throw new CyCommandException(tgttype + " is not supported.");
-
+ if (!tgtTypes.contains(tgtds)){
+ result.addResult(Boolean.FALSE);
+ result.addMessage(tgttype + " is not supported.");
+ }
try {
if (IDMapperClientManager.isMappingSupported(srcds, tgtds)) {
result.addResult(Boolean.TRUE);
--
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.