groovy

Allow for null values in GroovyRowResult

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-JSR-5
  • Fix Version/s: 1.0-RC-1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    2

Description

When calling getProperty() with a property that exists but has the value null you get a MissingPropertyException.

Activity

Hide
Guido Schoepp added a comment -

You're double checking the key by calling result.get after result.containskey although you already know that result.get returned null.
You can replace
> if (result.containsKey(property))
> return result.get(property);
by
> if (result.containsKey(property))
> return null;
which speed things up.

I slightly changed your patch.

Show
Guido Schoepp added a comment - You're double checking the key by calling result.get after result.containskey although you already know that result.get returned null. You can replace > if (result.containsKey(property)) > return result.get(property); by > if (result.containsKey(property)) > return null; which speed things up. I slightly changed your patch.
Hide
Guido Schoepp added a comment -

A slightly updated patch for this issue.

Show
Guido Schoepp added a comment - A slightly updated patch for this issue.
Hide
Ryan Misek added a comment -

I noticed this patch was submitted on the 6th of July and I know JSR-06 dropped at about that time too.

I pulled down the source today and noticed this patch still had not been comitted to the HEAD. Was there an issue with the patch(It looks good to me) or did it just get lost somewhere along the way?

Show
Ryan Misek added a comment - I noticed this patch was submitted on the 6th of July and I know JSR-06 dropped at about that time too. I pulled down the source today and noticed this patch still had not been comitted to the HEAD. Was there an issue with the patch(It looks good to me) or did it just get lost somewhere along the way?
Hide
Guillaume Laforge added a comment -

Sorry it took us so much time to look after that patch.
I've just applied it.
Thanks a lot for submitting the fix, and for reminding us to apply it.
It should be available in RC-1.

Show
Guillaume Laforge added a comment - Sorry it took us so much time to look after that patch. I've just applied it. Thanks a lot for submitting the fix, and for reminding us to apply it. It should be available in RC-1.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: