Skip to content
Snippets Groups Projects
Commit 59a08a54 authored by pdowler.cadc's avatar pdowler.cadc
Browse files

added logging for failed serialisation of resultset values

added support for Integer[] and Double[]


git-svn-id: https://opencadc.googlecode.com/svn/trunk@700 728ff76a-78ac-11de-a72b-d90af8dea425
parent 5f6d5280
No related branches found
No related tags found
No related merge requests found
...@@ -102,10 +102,13 @@ public class IntArrayFormatter implements Formatter ...@@ -102,10 +102,13 @@ public class IntArrayFormatter implements Formatter
throw new IllegalArgumentException("Error accessing array data for " + object.getClass().getCanonicalName(), e); throw new IllegalArgumentException("Error accessing array data for " + object.getClass().getCanonicalName(), e);
} }
} }
if (!(object instanceof int[])) if (object instanceof int[])
throw new IllegalArgumentException("Expecting int[], " + object.getClass().getCanonicalName() + " not supported.");
return toString((int[]) object); return toString((int[]) object);
if (object instanceof Integer[])
return toString((Integer[]) object);
throw new IllegalArgumentException(object.getClass().getCanonicalName() + " not supported.");
} }
private String toString(int[] iarray) private String toString(int[] iarray)
...@@ -118,4 +121,15 @@ public class IntArrayFormatter implements Formatter ...@@ -118,4 +121,15 @@ public class IntArrayFormatter implements Formatter
} }
return sb.substring(0, sb.length() - 1); // trim trailing comma return sb.substring(0, sb.length() - 1); // trim trailing comma
} }
private String toString(Integer[] iarray)
{
StringBuffer sb = new StringBuffer();
for (Integer i : iarray)
{
sb.append(i.toString());
sb.append(",");
}
return sb.substring(0, sb.length() - 1); // trim trailing comma
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment