Revision 39083 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeature.java

View differences:

DefaultFeature.java
136 136
        if( theClass.isInstance(value) ) {
137 137
            return value;
138 138
        }
139

  
139 140
        
140
        if (value == null) {
141
            /*
142
             * this prevents null pointer exception in coerce
143
             */
144
            return null;
145
        }
146
        
147 141
        try {
148 142
            return this.getDataTypesManager().coerce(type, value);
149 143
        } catch (CoercionException e) {
144
            
145
            if (value == null) {
146
                return null;
147
            }
150 148
            throw new IllegalArgumentException(
151 149
                    "Can't convert to "+theClass.getSimpleName()+" from '"+value.getClass().getName()+"' with value '"+value.toString()+"'.",
152 150
                    e);

Also available in: Unified diff