- Timestamp:
- 06/24/13 13:38:40 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/params/PropertiesAccess.java
r84 r85 40 40 assert properties != null; 41 41 assert param != null; 42 Object object = null; 42 Object object = properties.get(param.getId()); 43 if (object != null) { 44 try { 45 return type.cast(object); 46 } catch (ClassCastException e) { 47 throw (ClassCastException) new ClassCastException("property " + param + " type is " + object.getClass().getName() + ", not " + type.getName()).initCause(e); 48 } 49 } 43 50 try { 44 object = properties.get(param.getId()); 45 if (object == null) { 46 return param.getDef(type); 47 } 48 return type.cast(object); 51 return param.getDef(type); 49 52 } catch (ClassCastException e) { 50 throw new ClassCastException("property " + param.getId() + " type is " + object.getClass().getName() + ", not " + type.getName());53 throw (ClassCastException) new ClassCastException("default value of property " + param + " is not of type " + type.getName()).initCause(e); 51 54 } 52 55
Note: See TracChangeset
for help on using the changeset viewer.