Skip to content

Commit

Permalink
[TAP] Fix bug, reported by A. Oberto, about Character formatting in V…
Browse files Browse the repository at this point in the history
…OTable

format. A ClassCastException was thrown about an impossible cast from String to
Character.
  • Loading branch information
gmantele committed Sep 10, 2015
1 parent 271e03c commit 0e60969
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tap/data/ResultSetTableIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* </i></p>
*
* @author Gr&eacute;gory Mantelet (ARI)
* @version 2.1 (07/2015)
* @version 2.1 (09/2015)
* @since 2.0
*/
public class ResultSetTableIterator implements TableIterator {
Expand Down Expand Up @@ -362,6 +362,9 @@ public Object nextCol() throws NoSuchElementException, IllegalStateException, Da
// if the column value is a Timestamp object, format it in ISO8601:
if (o instanceof Timestamp)
o = ISO8601Format.format(((Timestamp)o).getTime());
// if the column should be only a character:
else if (colType != null && o != null && colType.type == DBDatatype.CHAR && (colType.length == 1 || colType.length <= 0) && o instanceof String)
o = ((String)o).charAt(0);
// if the column value is a geometrical object, it must be serialized in STC-S:
else if (translator != null && colType != null && colType.isGeometry()){
Region region = translator.translateGeometryFromDB(o);
Expand Down

0 comments on commit 0e60969

Please sign in to comment.