Revision 45693
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeature.java | ||
---|---|---|
204 | 204 |
this.data.set(i, value); |
205 | 205 |
return; |
206 | 206 |
} |
207 |
} else if (attribute.getType() == DataTypes.GEOMETRY) { |
|
208 |
if (!attribute.getGeomType().equals(((Geometry) value).getGeometryType())) { |
|
209 |
try { |
|
210 |
Coercion coercer = attribute.getDataType().getCoercion(); |
|
211 |
value = coercer.coerce(value, attribute.getCoercionContext()); |
|
212 |
} catch (CoercionException e) { |
|
213 |
throw new IllegalArgumentException("Can't convert to " |
|
214 |
+ attribute.getDataType().getName() |
|
215 |
+ " from '" |
|
216 |
+ value == null ? "NULL" : value.getClass().getName() |
|
217 |
+ "' with value '" |
|
218 |
+ Objects.toString(value) |
|
219 |
+ "' and context '" |
|
220 |
+ attribute.getCoercionContext() |
|
221 |
+ "'."); |
|
222 |
} |
|
223 |
} |
|
224 |
this.data.set(i, value); |
|
225 |
return; |
|
207 | 226 |
} else { |
208 | 227 |
this.data.set(i, value); |
209 | 228 |
return; |
Also available in: Unified diff