[jira] [Commented] (COLLECTIONS-673) ListUtils.partition potential integer overflow
[ https://issues.apache.org/jira/browse/COLLECTIONS-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510251#comment-16510251 ] ASF GitHub Bot commented on COLLECTIONS-673: Github user asfgit closed the pull request at: https://github.com/apache/commons-collections/pull/37 > ListUtils.partition potential integer overflow > -- > > Key: COLLECTIONS-673 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-673 > Project: Commons Collections > Issue Type: Bug > Components: List >Affects Versions: 4.1 >Reporter: John Mark >Priority: Major > > When calling {{ListUtils.partition()}} with a large size and large list, it > is possible that an integer overflow will occur in the {{size()}} method that > causes incorrect behavior. This will occur when using a size that, when added > to list.size() will be larger than {{Integer.MAX_VALUE}} > Current version of Guava's {{Lists.partition()}} handle this correctly, so > perhaps the code for {{ListUtils.partition()}} needs to be updated based on > the latest Guava code. > A simple illustration of this: > {code} > List aList = Arrays.asList("1", "2", "3", "4", "5"); > List> partitioned = ListUtils.partition(aList, > Integer.MAX_VALUE); > System.out.println("Number of partitions: " + partitioned.size()); > for(List l : partitioned) { > System.out.println(l); > } > {code} > The above code works correctly when using Guava's {{Lists.partition()}} > instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (COLLECTIONS-673) ListUtils.partition potential integer overflow
[ https://issues.apache.org/jira/browse/COLLECTIONS-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16510252#comment-16510252 ] ASF GitHub Bot commented on COLLECTIONS-673: Github user asfgit closed the pull request at: https://github.com/apache/commons-collections/pull/37 > ListUtils.partition potential integer overflow > -- > > Key: COLLECTIONS-673 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-673 > Project: Commons Collections > Issue Type: Bug > Components: List >Affects Versions: 4.1 >Reporter: John Mark >Priority: Major > > When calling {{ListUtils.partition()}} with a large size and large list, it > is possible that an integer overflow will occur in the {{size()}} method that > causes incorrect behavior. This will occur when using a size that, when added > to list.size() will be larger than {{Integer.MAX_VALUE}} > Current version of Guava's {{Lists.partition()}} handle this correctly, so > perhaps the code for {{ListUtils.partition()}} needs to be updated based on > the latest Guava code. > A simple illustration of this: > {code} > List aList = Arrays.asList("1", "2", "3", "4", "5"); > List> partitioned = ListUtils.partition(aList, > Integer.MAX_VALUE); > System.out.println("Number of partitions: " + partitioned.size()); > for(List l : partitioned) { > System.out.println(l); > } > {code} > The above code works correctly when using Guava's {{Lists.partition()}} > instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (COLLECTIONS-673) ListUtils.partition potential integer overflow
[ https://issues.apache.org/jira/browse/COLLECTIONS-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16507087#comment-16507087 ] ASF GitHub Bot commented on COLLECTIONS-673: Github user coveralls commented on the issue: https://github.com/apache/commons-collections/pull/37 [![Coverage Status](https://coveralls.io/builds/17407790/badge)](https://coveralls.io/builds/17407790) Coverage increased (+0.007%) to 86.582% when pulling **faf27f611f4429c77a800124b5fb6f641f871c0f on sfuhrm:COLLECTIONS-673** into **13ba1cc91ea441ab012fa4e9724fbca397f1b1cf on apache:master**. > ListUtils.partition potential integer overflow > -- > > Key: COLLECTIONS-673 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-673 > Project: Commons Collections > Issue Type: Bug > Components: List >Affects Versions: 4.1 >Reporter: John Mark >Priority: Major > > When calling {{ListUtils.partition()}} with a large size and large list, it > is possible that an integer overflow will occur in the {{size()}} method that > causes incorrect behavior. This will occur when using a size that, when added > to list.size() will be larger than {{Integer.MAX_VALUE}} > Current version of Guava's {{Lists.partition()}} handle this correctly, so > perhaps the code for {{ListUtils.partition()}} needs to be updated based on > the latest Guava code. > A simple illustration of this: > {code} > List aList = Arrays.asList("1", "2", "3", "4", "5"); > List> partitioned = ListUtils.partition(aList, > Integer.MAX_VALUE); > System.out.println("Number of partitions: " + partitioned.size()); > for(List l : partitioned) { > System.out.println(l); > } > {code} > The above code works correctly when using Guava's {{Lists.partition()}} > instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (COLLECTIONS-673) ListUtils.partition potential integer overflow
[ https://issues.apache.org/jira/browse/COLLECTIONS-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16507085#comment-16507085 ] ASF GitHub Bot commented on COLLECTIONS-673: GitHub user sfuhrm opened a pull request: https://github.com/apache/commons-collections/pull/37 COLLECTIONS-673: Fix inspired by the Guava partition() implementation A fix for the COLLECTIONS-673 bug and a unit test proving the fix for the shown defect. See https://issues.apache.org/jira/browse/COLLECTIONS-673 You can merge this pull request into a Git repository by running: $ git pull https://github.com/sfuhrm/commons-collections COLLECTIONS-673 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/commons-collections/pull/37.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 #37 commit faf27f611f4429c77a800124b5fb6f641f871c0f Author: Stephan Fuhrmann Date: 2018-06-09T17:30:13Z COLLECTIONS-673: Fix inspired by the Guava partition() implementation > ListUtils.partition potential integer overflow > -- > > Key: COLLECTIONS-673 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-673 > Project: Commons Collections > Issue Type: Bug > Components: List >Affects Versions: 4.1 >Reporter: John Mark >Priority: Major > > When calling {{ListUtils.partition()}} with a large size and large list, it > is possible that an integer overflow will occur in the {{size()}} method that > causes incorrect behavior. This will occur when using a size that, when added > to list.size() will be larger than {{Integer.MAX_VALUE}} > Current version of Guava's {{Lists.partition()}} handle this correctly, so > perhaps the code for {{ListUtils.partition()}} needs to be updated based on > the latest Guava code. > A simple illustration of this: > {code} > List aList = Arrays.asList("1", "2", "3", "4", "5"); > List> partitioned = ListUtils.partition(aList, > Integer.MAX_VALUE); > System.out.println("Number of partitions: " + partitioned.size()); > for(List l : partitioned) { > System.out.println(l); > } > {code} > The above code works correctly when using Guava's {{Lists.partition()}} > instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (COLLECTIONS-673) ListUtils.partition potential integer overflow
[ https://issues.apache.org/jira/browse/COLLECTIONS-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16507084#comment-16507084 ] ASF GitHub Bot commented on COLLECTIONS-673: GitHub user sfuhrm opened a pull request: https://github.com/apache/commons-collections/pull/37 COLLECTIONS-673: Fix inspired by the Guava partition() implementation A fix for the COLLECTIONS-673 bug and a unit test proving the fix for the shown defect. See https://issues.apache.org/jira/browse/COLLECTIONS-673 You can merge this pull request into a Git repository by running: $ git pull https://github.com/sfuhrm/commons-collections COLLECTIONS-673 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/commons-collections/pull/37.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 #37 commit faf27f611f4429c77a800124b5fb6f641f871c0f Author: Stephan Fuhrmann Date: 2018-06-09T17:30:13Z COLLECTIONS-673: Fix inspired by the Guava partition() implementation > ListUtils.partition potential integer overflow > -- > > Key: COLLECTIONS-673 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-673 > Project: Commons Collections > Issue Type: Bug > Components: List >Affects Versions: 4.1 >Reporter: John Mark >Priority: Major > > When calling {{ListUtils.partition()}} with a large size and large list, it > is possible that an integer overflow will occur in the {{size()}} method that > causes incorrect behavior. This will occur when using a size that, when added > to list.size() will be larger than {{Integer.MAX_VALUE}} > Current version of Guava's {{Lists.partition()}} handle this correctly, so > perhaps the code for {{ListUtils.partition()}} needs to be updated based on > the latest Guava code. > A simple illustration of this: > {code} > List aList = Arrays.asList("1", "2", "3", "4", "5"); > List> partitioned = ListUtils.partition(aList, > Integer.MAX_VALUE); > System.out.println("Number of partitions: " + partitioned.size()); > for(List l : partitioned) { > System.out.println(l); > } > {code} > The above code works correctly when using Guava's {{Lists.partition()}} > instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (COLLECTIONS-673) ListUtils.partition potential integer overflow
[ https://issues.apache.org/jira/browse/COLLECTIONS-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16351143#comment-16351143 ] Gary Gregory commented on COLLECTIONS-673: -- Thank for your report [~jmark]. We welcome patches, with unit tests of course! :) > ListUtils.partition potential integer overflow > -- > > Key: COLLECTIONS-673 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-673 > Project: Commons Collections > Issue Type: Bug > Components: List >Affects Versions: 4.1 >Reporter: John Mark >Priority: Major > > When calling {{ListUtils.partition()}} with a large size and large list, it > is possible that an integer overflow will occur in the {{size()}} method that > causes incorrect behavior. This will occur when using a size that, when added > to list.size() will be larger than {{Integer.MAX_VALUE}} > Current version of Guava's {{Lists.partition()}} handle this correctly, so > perhaps the code for {{ListUtils.partition()}} needs to be updated based on > the latest Guava code. > A simple illustration of this: > {code} > List aList = Arrays.asList("1", "2", "3", "4", "5"); > Listpartitioned = ListUtils.partition(aList, > Integer.MAX_VALUE); > System.out.println("Number of partitions: " + partitioned.size()); > for(List l : partitioned) { > System.out.println(l); > } > {code} > The above code works correctly when using Guava's {{Lists.partition()}} > instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)