Author: clopes
Date: 2011-12-02 16:27:30 -0800 (Fri, 02 Dec 2011)
New Revision: 27688
Modified:
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
Log:
Temporary workaround for NumberFormatException when handling CyTable PKs that
are not numbers.
Modified:
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
===================================================================
---
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
2011-12-03 00:23:42 UTC (rev 27687)
+++
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
2011-12-03 00:27:30 UTC (rev 27688)
@@ -361,7 +361,14 @@
final int rowCount = table.getRowCount();
for(int i=0; i<rowCount; i++) {
final ValidatedObjectAndEditString tableKey =
(ValidatedObjectAndEditString) table.getValueAt(i, tablePKeyIndex);
-
if(suidMap.keySet().contains(Long.parseLong(tableKey.getEditString()))) {
+ Long pk = null;
+ try{
+ // TODO: Temp fix: is it a requirement that all
CyTables have a Long SUID column as PK?
+ pk = Long.parseLong(tableKey.getEditString());
+ } catch (NumberFormatException nfe) {
+ System.out.println("Error parsing long from
table " + table.getName() + ": " + nfe.getMessage());
+ }
+ if(pk != null && suidMap.keySet().contains(pk)) {
table.addRowSelectionInterval(i, i);
table.addColumnSelectionInterval(0,
table.getColumnCount() - 1);
}
--
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.