[
https://issues.apache.org/jira/browse/GROOVY-8026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15842347#comment-15842347
]
ASF GitHub Bot commented on GROOVY-8026:
----------------------------------------
GitHub user paulk-asert opened a pull request:
https://github.com/apache/groovy/pull/483
GROOVY-8026: Matcher indexed via IntRange with startIdx..-1 does not …
…return "intermediate" range matches
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/paulk-asert/groovy groovy8026
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/483.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 #483
----
commit c7ae6ef5a9d8206b9a5051adb99f1e86969cc1d8
Author: paulk <[email protected]>
Date: 2017-01-27T06:58:50Z
GROOVY-8026: Matcher indexed via IntRange with startIdx..-1 does not return
"intermediate" range matches
----
> Matcher indexed via IntRange with startIdx..-1 does not return "intermediate"
> range matches
> -------------------------------------------------------------------------------------------
>
> Key: GROOVY-8026
> URL: https://issues.apache.org/jira/browse/GROOVY-8026
> Project: Groovy
> Issue Type: Bug
> Components: groovy-jdk
> Affects Versions: 2.4.7
> Environment: Zulu OpenJDK 1.8.0_102-b14
> Windows 7 Pro
> Reporter: Brian Ray
> Priority: Minor
>
> Maybe this isn't a bug, and I realize that a {{Matcher}} is not exactly a
> {{List}} or any other {{Collection}}, but the inconsistency is a little
> mysterious. Here's a simple Groovysh script with several comparative indexes:
> {code:java}
> txt = 'abcd 1 efgh 2 ijkl 3 mnop'
> m = txt =~ /\d/
> println m.collect { it } // as expected: [1, 2, 3]
> println m[ 0..2 ] // as expected: [1, 2, 3]
> println m[ 0..m.size()-1 ] // as expected: [1, 2, 3]
> println m[ 0..<m.size() ] // as expected: [1, 2, 3]
> println m[ 0..-1 ] // bug?: [1, 3]
> //for comparison
> a = [ 1, 2, 3 ]
> println a.collect { it } // [1, 2, 3]
> println a[ 0..2 ] // [1, 2, 3]
> println a[ 0..a.size()-1 ] // [1, 2, 3]
> println a[ 0..<a.size() ] // [1, 2, 3]
> println a[ 0..-1 ] // [1, 2, 3]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)