[jira] [Commented] (GROOVY-7834) Calling hashCode on IntRange iterates through all elements in the range.

2016-08-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-7834:


Github user asfgit closed the pull request at:

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


> Calling hashCode on IntRange iterates through all elements in the range.
> 
>
> Key: GROOVY-7834
> URL: https://issues.apache.org/jira/browse/GROOVY-7834
> Project: Groovy
>  Issue Type: Bug
>Reporter: howard zhang
>
> {code}
> new IntRange(0, Integer.MAX_VALUE-1).hashCode()
> {code}
> The above code takes a few seconds to complete.
> I believe the hashCode method is not overridden and it defaults to 
> AbstractList which iterates through all elements.  I don't think this should 
> be the default behavior.
> http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/AbstractList.java/?v=source



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


[jira] [Commented] (GROOVY-7834) Calling hashCode on IntRange iterates through all elements in the range.

2016-08-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-7834:


GitHub user upadhyayap opened a pull request:

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

Calculating hashcode of IntRange by pairing function


https://issues.apache.org/jira/browse/GROOVY-7834?jql=project%20%3D%20GROOVY%20AND%20id%20%3D%20GROOVY-7834

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/upadhyayap/incubator-groovy GROOVY-7834

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/388.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #388


commit da39cc1fda39f61424471cff23df3f13867ab9d3
Author: Anand upadhyay 
Date:   2016-08-19T11:43:08Z

Calculating hashcode of IntRange by pairing function




> Calling hashCode on IntRange iterates through all elements in the range.
> 
>
> Key: GROOVY-7834
> URL: https://issues.apache.org/jira/browse/GROOVY-7834
> Project: Groovy
>  Issue Type: Bug
>Reporter: howard zhang
>
> {code}
> new IntRange(0, Integer.MAX_VALUE-1).hashCode()
> {code}
> The above code takes a few seconds to complete.
> I believe the hashCode method is not overridden and it defaults to 
> AbstractList which iterates through all elements.  I don't think this should 
> be the default behavior.
> http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/AbstractList.java/?v=source



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


[jira] [Commented] (GROOVY-7834) Calling hashCode on IntRange iterates through all elements in the range.

2016-08-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-7834:


Github user upadhyayap closed the pull request at:

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


> Calling hashCode on IntRange iterates through all elements in the range.
> 
>
> Key: GROOVY-7834
> URL: https://issues.apache.org/jira/browse/GROOVY-7834
> Project: Groovy
>  Issue Type: Bug
>Reporter: howard zhang
>
> {code}
> new IntRange(0, Integer.MAX_VALUE-1).hashCode()
> {code}
> The above code takes a few seconds to complete.
> I believe the hashCode method is not overridden and it defaults to 
> AbstractList which iterates through all elements.  I don't think this should 
> be the default behavior.
> http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/AbstractList.java/?v=source



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


[jira] [Commented] (GROOVY-7834) Calling hashCode on IntRange iterates through all elements in the range.

2016-08-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-7834:


GitHub user upadhyayap opened a pull request:

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

Calculating IntRange hashcode by pairing function


https://issues.apache.org/jira/browse/GROOVY-7834?jql=project%20%3D%20GROOVY%20AND%20id%20%3D%20GROOVY-7834

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/upadhyayap/incubator-groovy GROOVY-7834

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/387.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #387


commit ddc925a2d80e0a05c633287497ff1c86678b
Author: Anand upadhyay 
Date:   2016-08-19T11:03:30Z

Calculating IntRange hashcode by pairing function




> Calling hashCode on IntRange iterates through all elements in the range.
> 
>
> Key: GROOVY-7834
> URL: https://issues.apache.org/jira/browse/GROOVY-7834
> Project: Groovy
>  Issue Type: Bug
>Reporter: howard zhang
>
> {code}
> new IntRange(0, Integer.MAX_VALUE-1).hashCode()
> {code}
> The above code takes a few seconds to complete.
> I believe the hashCode method is not overridden and it defaults to 
> AbstractList which iterates through all elements.  I don't think this should 
> be the default behavior.
> http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/AbstractList.java/?v=source



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


[jira] [Commented] (GROOVY-7834) Calling hashCode on IntRange iterates through all elements in the range.

2016-08-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-7834:


Github user upadhyayap closed the pull request at:

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


> Calling hashCode on IntRange iterates through all elements in the range.
> 
>
> Key: GROOVY-7834
> URL: https://issues.apache.org/jira/browse/GROOVY-7834
> Project: Groovy
>  Issue Type: Bug
>Reporter: howard zhang
>
> {code}
> new IntRange(0, Integer.MAX_VALUE-1).hashCode()
> {code}
> The above code takes a few seconds to complete.
> I believe the hashCode method is not overridden and it defaults to 
> AbstractList which iterates through all elements.  I don't think this should 
> be the default behavior.
> http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/AbstractList.java/?v=source



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


[jira] [Commented] (GROOVY-7834) Calling hashCode on IntRange iterates through all elements in the range.

2016-08-19 Thread Jochen Theodorou (JIRA)

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

Jochen Theodorou commented on GROOVY-7834:
--

which means to ranges with different steppings have the same hashcode... 
probably no problem

> Calling hashCode on IntRange iterates through all elements in the range.
> 
>
> Key: GROOVY-7834
> URL: https://issues.apache.org/jira/browse/GROOVY-7834
> Project: Groovy
>  Issue Type: Bug
>Reporter: howard zhang
>
> {code}
> new IntRange(0, Integer.MAX_VALUE-1).hashCode()
> {code}
> The above code takes a few seconds to complete.
> I believe the hashCode method is not overridden and it defaults to 
> AbstractList which iterates through all elements.  I don't think this should 
> be the default behavior.
> http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/AbstractList.java/?v=source



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


[jira] [Commented] (GROOVY-7834) Calling hashCode on IntRange iterates through all elements in the range.

2016-08-19 Thread Anand (JIRA)

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

Anand commented on GROOVY-7834:
---

I am taking only lower and upper bound to generate hash code. Pairing function 
grantees the output no to be deterministic. Have look at the pull request and 
let me know

> Calling hashCode on IntRange iterates through all elements in the range.
> 
>
> Key: GROOVY-7834
> URL: https://issues.apache.org/jira/browse/GROOVY-7834
> Project: Groovy
>  Issue Type: Bug
>Reporter: howard zhang
>
> {code}
> new IntRange(0, Integer.MAX_VALUE-1).hashCode()
> {code}
> The above code takes a few seconds to complete.
> I believe the hashCode method is not overridden and it defaults to 
> AbstractList which iterates through all elements.  I don't think this should 
> be the default behavior.
> http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/AbstractList.java/?v=source



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