c2nes / javalang

Pure Python Java parser and tools
MIT License
736 stars 161 forks source link

parse_element_values always returns a list with only the last value #22

Closed BooNooNooNouS closed 8 years ago

BooNooNooNouS commented 8 years ago

I've been playing around with TestNg annotations and I noticed that javalang has a small bug where parse_element_values correctly iterates through all of the elements and adds them to the list of element_values but instead of returning the list, it returns only the last element that was found. e.g.:

@Test(groups = {"groupA", "groupB"})
public void TestMethod() {}

for the code above an ElementValuePair Node is created with name="groups" and value having only a literal "groupB" instead of a list with both literals.

Instead of filing an issue I figured I would send a PR.

BooNooNooNouS commented 8 years ago

ping @c2nes , @larubbio , @brakhane , @atheriel , @dbaxa ?

c2nes commented 8 years ago

Hey, sorry about the delay @BooNooNooNouS. Looks good! Thanks for the fix!