[jira] [Commented] (GROOVY-7937) CLONE - same linkedlist code different behavior between groovy and java (fix priority of DGM methods vs actual methods on an object)

2016-09-16 Thread Paul King (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-7937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15497500#comment-15497500
 ] 

Paul King commented on GROOVY-7937:
---

Thanks for spotting the error!

> CLONE - same linkedlist code different behavior between groovy and java (fix 
> priority of DGM methods vs actual methods on an object)
> 
>
> Key: GROOVY-7937
> URL: https://issues.apache.org/jira/browse/GROOVY-7937
> Project: Groovy
>  Issue Type: Bug
>  Components: jdk conflict
>Reporter: boshi 
>Assignee: Paul King
>  Labels: breaking
> Fix For: 2.5.0-beta-1
>
>
> I am using `linkedlist` as a stack in groovy 
> as doc says, `pop()` take elm from the first
> Stack Method  Equivalent Deque Method  
> push(e)   addFirst(e) 
> pop() removeFirst()
> so a `linkedlist` [1,2,3] should pop() 1 2 3
> and it does in Java, but does NOT in groovy. WHY?
> test below
> {code:title=A.java}
> import java.util.*;
> 
> public class A{
> 
> 
> public static void main(String[] args){
> 
> String[] x = "1/2/3/".split("/");
> LinkedList  stack = new LinkedList(Arrays.asList(x));
> System.out.println(stack.pop());
> }
> }
> {code}
> compile and run
> {noformat}
> $ javac A.java
> $ java A
> 1
> {noformat}
> runing in groovy
> {noformat}
> $ ln -s A.java A.groovy
> $ groovy A.groovy
> 3
> {noformat}
> here is my java and groovy version
> {noformat}
> $ java -version
> java version "1.6.0_51"
> Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
> Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
> $ groovy -version
> Groovy Version: 2.1.5 JVM: 1.6.0_51 Vendor: Apple Inc. OS: Mac OS X
> {noformat}



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


[jira] [Commented] (GROOVY-7937) CLONE - same linkedlist code different behavior between groovy and java (fix priority of DGM methods vs actual methods on an object)

2016-09-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-7937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15497484#comment-15497484
 ] 

ASF GitHub Bot commented on GROOVY-7937:


Github user asfgit closed the pull request at:

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


> CLONE - same linkedlist code different behavior between groovy and java (fix 
> priority of DGM methods vs actual methods on an object)
> 
>
> Key: GROOVY-7937
> URL: https://issues.apache.org/jira/browse/GROOVY-7937
> Project: Groovy
>  Issue Type: Bug
>  Components: jdk conflict
>Reporter: boshi 
>Assignee: Paul King
>  Labels: breaking
>
> I am using `linkedlist` as a stack in groovy 
> as doc says, `pop()` take elm from the first
> Stack Method  Equivalent Deque Method  
> push(e)   addFirst(e) 
> pop() removeFirst()
> so a `linkedlist` [1,2,3] should pop() 1 2 3
> and it does in Java, but does NOT in groovy. WHY?
> test below
> {code:title=A.java}
> import java.util.*;
> 
> public class A{
> 
> 
> public static void main(String[] args){
> 
> String[] x = "1/2/3/".split("/");
> LinkedList  stack = new LinkedList(Arrays.asList(x));
> System.out.println(stack.pop());
> }
> }
> {code}
> compile and run
> {noformat}
> $ javac A.java
> $ java A
> 1
> {noformat}
> runing in groovy
> {noformat}
> $ ln -s A.java A.groovy
> $ groovy A.groovy
> 3
> {noformat}
> here is my java and groovy version
> {noformat}
> $ java -version
> java version "1.6.0_51"
> Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
> Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
> $ groovy -version
> Groovy Version: 2.1.5 JVM: 1.6.0_51 Vendor: Apple Inc. OS: Mac OS X
> {noformat}



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