Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1342

GroovyRowResult class raise exception when field value is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0-JSR-5
    • 1.1-beta-2
    • None
    • None

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

      }

      Attachments

        Activity

          People

            paulk Paul King
            alexey_potapov Alexey Potapov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: