[jira] [Resolved] (GROOVY-6696) @attribute on groovy.util.Node does not work when meta class is modified

2016-04-24 Thread John Wagenleitner (JIRA)

 [ 
https://issues.apache.org/jira/browse/GROOVY-6696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Wagenleitner resolved GROOVY-6696.
---
Resolution: Fixed
  Assignee: John Wagenleitner

Resolving this since I can't reproduce.  Please reopen if it's still an issue.

> @attribute on groovy.util.Node does not work when meta class is modified
> 
>
> Key: GROOVY-6696
> URL: https://issues.apache.org/jira/browse/GROOVY-6696
> Project: Groovy
>  Issue Type: Bug
>  Components: XML Processing
>Affects Versions: 2.2.2
>Reporter: Baptiste Mesta
>Assignee: John Wagenleitner
>Priority: Minor
>
> if a closure is added to the meta class it seems that the node.@attribute is 
> not working anymore
> however it is still working when we use quotes, i.e. node.'@attribute'
> here is some tests that reproduce the probleme, they have to be run alone
> {code:java}
> @Test
> public void working() throws Exception {
> //given
> def root = new XmlParser().parseText('''value''')
> //when
> String id = root.@id;
> //then
> assertEquals("12", id);
> }
> @Test
> public void notWorking() throws Exception {
> //given
> Node.metaClass.findParent = { closure ->
> def parent = delegate.parent()
> if(parent == null){
> return null
> }
> if(closure(parent)){
> return parent
> }
> return parent.findParent(closure)
> }
> def root = new XmlParser().parseText('''value''')
> //when
> String id = root.@id;
> //then
> assertEquals("12", id);
> }
> @Test
> public void workingOnlyWithQuotes() throws Exception {
> //given
> Node.metaClass.findParent = { closure ->
> def parent = delegate.parent()
> if(parent == null){
> return null
> }
> if(closure(parent)){
> return parent
> }
> return parent.findParent(closure)
> }
> def root = new XmlParser().parseText('''value''')
> //when
> String id = root.'@id';
> //then
> assertEquals("12", id);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] groovy pull request: JSON refactoring/cleanup

2016-04-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/318


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] groovy pull request: Fixed a typo in groovy Documentation

2016-04-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/321


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---