Issue Details (XML | Word | Printable)

Key: GROOVY-1342
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Paul King
Reporter: Alexey Potapov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
groovy

GroovyRowResult class raise exception when field value is null

Created: 13/Jun/06 04:45 AM   Updated: 26/Sep/07 08:31 PM
Component/s: None
Affects Version/s: 1.0-JSR-5
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified


 Description  « Hide
GroovyRowResult.getProperty always raise exception when field value is null

I offer implementation of getProperty(String property):

public Object getProperty(String property) {
try {
Object value = result.get(property);
if (value==null && !result.containsKey(property)) { // with some databases/drivers, the columns names are stored uppercase. String propUpper = property.toUpperCase(); value = result.get(propUpper); if (value==null && !result.containsKey(propUpper)) throw new MissingPropertyException(property, GroovyRowResult.class); }
return(value);
}
catch (Exception e) { throw new MissingPropertyException(property, GroovyRowResult.class, e); }
}



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Guido Schoepp added a comment - 06/Jul/06 03:32 AM

Paul King added a comment - 15/Jun/07 11:34 PM
should be fixed as GROOVY-1296 (duplicate) is fixed

Paul King added a comment - 26/Sep/07 08:31 PM
No further feedback, assuming fixed