groovy

GroovyRowResult class raise exception when field value is null

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.0-JSR-5
  • Fix Version/s: 1.1-beta-2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

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); }
}

Activity

Hide
Guido Schoepp added a comment -
Show
Guido Schoepp added a comment - same as issue GROOVY-1296 ( http://jira.codehaus.org/browse/GROOVY-1296 )
Hide
Paul King added a comment -

should be fixed as GROOVY-1296 (duplicate) is fixed

Show
Paul King added a comment - should be fixed as GROOVY-1296 (duplicate) is fixed
Hide
Paul King added a comment -

No further feedback, assuming fixed

Show
Paul King added a comment - No further feedback, assuming fixed

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: