groovy git commit: Upgrade to Gradle 3.0-milestone-2

2016-06-27 Thread cchampeau
Repository: groovy
Updated Branches:
  refs/heads/master 5158fb56e -> f646e6e12


Upgrade to Gradle 3.0-milestone-2

This commit upgrades to Gradle 3.0 milestone 2 and introduces use of build 
scans.


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/f646e6e1
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/f646e6e1
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/f646e6e1

Branch: refs/heads/master
Commit: f646e6e12abc3d1a9db0dcff74ff22ecadd986ca
Parents: 5158fb5
Author: Cedric Champeau 
Authored: Tue Jun 28 05:07:09 2016 +0200
Committer: Cedric Champeau 
Committed: Tue Jun 28 05:07:09 2016 +0200

--
 build.gradle | 10 ++
 gradle/docs.gradle   |  4 ++--
 gradle/wrapper/gradle-wrapper.properties |  2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/f646e6e1/build.gradle
--
diff --git a/build.gradle b/build.gradle
index c0734f0..678ca72 100644
--- a/build.gradle
+++ b/build.gradle
@@ -16,6 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+
 buildscript {
 repositories {
 jcenter()
@@ -44,6 +45,15 @@ buildscript {
 }
 }
 
+plugins {
+id 'com.gradle.build-scan' version '1.0'
+}
+
+buildScan {
+licenseAgreementUrl = 'https://gradle.com/terms-of-service'
+licenseAgree = 'yes'
+}
+
 apply from: 'gradle/filter.gradle'
 apply from: 'gradle/indy.gradle'
 apply from: 'gradle/bintray.gradle'

http://git-wip-us.apache.org/repos/asf/groovy/blob/f646e6e1/gradle/docs.gradle
--
diff --git a/gradle/docs.gradle b/gradle/docs.gradle
index 2bcaf12..1bedf1f 100644
--- a/gradle/docs.gradle
+++ b/gradle/docs.gradle
@@ -61,7 +61,7 @@ def groovydocSpec = {
 ext.doctitle = doc.title
 header = doc.title
 footer = doc.footer
-overview = rootProject.file('src/main/overview.html')
+overviewText = 
rootProject.resources.text.fromFile('src/main/overview.html')
 includePrivate = false
 link 'http://docs.oracle.com/javaee/7/api/', 'javax.servlet.', 
'javax.management.'
 link 'http://docs.oracle.com/javase/8/docs/api/', 'java.', 'org.xml.', 
'javax.', 'org.w3c.'
@@ -199,4 +199,4 @@ if (JavaVersion.current().isJava8Compatible()) {
 options.addStringOption('Xdoclint:none', '-quiet')
 }
 }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/f646e6e1/gradle/wrapper/gradle-wrapper.properties
--
diff --git a/gradle/wrapper/gradle-wrapper.properties 
b/gradle/wrapper/gradle-wrapper.properties
index 8449038..f5327c3 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-milestone-2-bin.zip



groovy git commit: GROOVY-7875: IntRange fail fast on too large a range out by one

2016-06-27 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X c7ae32bed -> 8725d926c


GROOVY-7875: IntRange fail fast on too large a range out by one


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/8725d926
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/8725d926
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/8725d926

Branch: refs/heads/GROOVY_2_4_X
Commit: 8725d926c06f004d2f3cae3069243eb9917e0d35
Parents: c7ae32b
Author: paulk 
Authored: Mon Jun 27 20:08:14 2016 +1000
Committer: paulk 
Committed: Mon Jun 27 20:11:48 2016 +1000

--
 src/main/groovy/lang/IntRange.java   | 24 
 src/test/groovy/lang/IntRangeTest.groovy | 23 +++
 2 files changed, 23 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/8725d926/src/main/groovy/lang/IntRange.java
--
diff --git a/src/main/groovy/lang/IntRange.java 
b/src/main/groovy/lang/IntRange.java
index 5282a7c..fbb8bc9 100644
--- a/src/main/groovy/lang/IntRange.java
+++ b/src/main/groovy/lang/IntRange.java
@@ -134,12 +134,7 @@ public class IntRange extends AbstractList 
implements Range {
 this.from = from;
 this.to = to;
 }
-
-// size() in the Collection interface returns an integer, so ranges 
can have no more than Integer.MAX_VALUE elements
-Long size = 0L + this.to - this.from;
-if (size >= Integer.MAX_VALUE) {
-throw new IllegalArgumentException("A range must have no more than 
" + Integer.MAX_VALUE + " elements but attempted " + size + " elements");
-}
+checkSize();
 }
 
 /**
@@ -160,12 +155,7 @@ public class IntRange extends AbstractList 
implements Range {
 this.from = from;
 this.to = to;
 this.reverse = reverse;
-
-// size() in the Collection interface returns an integer, so ranges 
can have no more than Integer.MAX_VALUE elements
-Long size = 0L + this.to - this.from;
-if (size >= Integer.MAX_VALUE) {
-throw new IllegalArgumentException("A range must have no more than 
" + Integer.MAX_VALUE + " elements but attempted " + size + " elements");
-}
+checkSize();
 }
 
 /**
@@ -179,6 +169,16 @@ public class IntRange extends AbstractList 
implements Range {
 this.from = from;
 this.to = to;
 this.inclusive = inclusive;
+this.reverse = false; // range may still be reversed, this value is 
ignored for inclusive-aware ranges
+checkSize();
+}
+
+private void checkSize() {
+// size() in the Collection interface returns an integer, so ranges 
can have no more than Integer.MAX_VALUE elements
+Long size = (long) this.to - this.from + 1;
+if (size > Integer.MAX_VALUE) {
+throw new IllegalArgumentException("A range must have no more than 
" + Integer.MAX_VALUE + " elements but attempted " + size + " elements");
+}
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/8725d926/src/test/groovy/lang/IntRangeTest.groovy
--
diff --git a/src/test/groovy/lang/IntRangeTest.groovy 
b/src/test/groovy/lang/IntRangeTest.groovy
index 15b988d..73c5a5e 100644
--- a/src/test/groovy/lang/IntRangeTest.groovy
+++ b/src/test/groovy/lang/IntRangeTest.groovy
@@ -20,18 +20,17 @@ package groovy.lang;
 
 /**
  * Provides unit tests for the IntRange class.
- *
- * @author James Strachan
  */
 class IntRangeTest extends GroovyTestCase {
 
 void testCreateTooBigRange() {
 try {
-new IntRange(0, Integer.MAX_VALUE);
-fail("too large range accepted");
+assert new IntRange(1, Integer.MAX_VALUE).size() == 
Integer.MAX_VALUE // biggest allowed
+new IntRange(0, Integer.MAX_VALUE) // too big
+fail("too large range accepted")
 }
 catch (IllegalArgumentException ignore) {
-assertTrue("expected exception thrown", true);
+assert ignore.message == 'A range must have no more than 
2147483647 elements but attempted 2147483648 elements'
 }
 }
 
@@ -40,11 +39,11 @@ class IntRangeTest extends GroovyTestCase {
  */
 void testInvalidArgumentsToConstructor() {
 try {
-new IntRange(2, 1, true);
-fail("invalid range created");
+new IntRange(2, 1, true)
+fail("invalid range created")
 }
 catch (IllegalArgumentException ignore) {
-assertTrue("expected exception thrown", true);
+assertTrue("expected exception thrown", true)
 }
 }
 
@@ 

groovy git commit: GROOVY-7875: IntRange fail fast on too large a range out by one

2016-06-27 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master fd8932052 -> 5158fb56e


GROOVY-7875: IntRange fail fast on too large a range out by one


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/5158fb56
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/5158fb56
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/5158fb56

Branch: refs/heads/master
Commit: 5158fb56ee046c43bc9b336338036313d3df8893
Parents: fd89320
Author: paulk 
Authored: Mon Jun 27 20:08:14 2016 +1000
Committer: paulk 
Committed: Mon Jun 27 20:08:14 2016 +1000

--
 src/main/groovy/lang/IntRange.java   | 23 +++
 src/test/groovy/lang/IntRangeTest.groovy | 23 +++
 2 files changed, 22 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/5158fb56/src/main/groovy/lang/IntRange.java
--
diff --git a/src/main/groovy/lang/IntRange.java 
b/src/main/groovy/lang/IntRange.java
index d51d514..0cb43ba 100644
--- a/src/main/groovy/lang/IntRange.java
+++ b/src/main/groovy/lang/IntRange.java
@@ -146,12 +146,7 @@ public class IntRange extends AbstractList 
implements Range {
 this.to = to;
 this.reverse = false;
 }
-
-// size() in the Collection interface returns an integer, so ranges 
can have no more than Integer.MAX_VALUE elements
-Long size = 0L + this.to - this.from;
-if (size >= Integer.MAX_VALUE) {
-throw new IllegalArgumentException("A range must have no more than 
" + Integer.MAX_VALUE + " elements but attempted " + size + " elements");
-}
+checkSize();
 }
 
 /**
@@ -172,12 +167,7 @@ public class IntRange extends AbstractList 
implements Range {
 this.from = from;
 this.to = to;
 this.reverse = reverse;
-
-// size() in the Collection interface returns an integer, so ranges 
can have no more than Integer.MAX_VALUE elements
-Long size = 0L + this.to - this.from;
-if (size >= Integer.MAX_VALUE) {
-throw new IllegalArgumentException("A range must have no more than 
" + Integer.MAX_VALUE + " elements but attempted " + size + " elements");
-}
+checkSize();
 }
 
 /**
@@ -192,6 +182,15 @@ public class IntRange extends AbstractList 
implements Range {
 this.to = to;
 this.inclusive = inclusive;
 this.reverse = false; // range may still be reversed, this value is 
ignored for inclusive-aware ranges
+checkSize();
+}
+
+private void checkSize() {
+// size() in the Collection interface returns an integer, so ranges 
can have no more than Integer.MAX_VALUE elements
+Long size = (long) this.to - this.from + 1;
+if (size > Integer.MAX_VALUE) {
+throw new IllegalArgumentException("A range must have no more than 
" + Integer.MAX_VALUE + " elements but attempted " + size + " elements");
+}
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/5158fb56/src/test/groovy/lang/IntRangeTest.groovy
--
diff --git a/src/test/groovy/lang/IntRangeTest.groovy 
b/src/test/groovy/lang/IntRangeTest.groovy
index 15b988d..73c5a5e 100644
--- a/src/test/groovy/lang/IntRangeTest.groovy
+++ b/src/test/groovy/lang/IntRangeTest.groovy
@@ -20,18 +20,17 @@ package groovy.lang;
 
 /**
  * Provides unit tests for the IntRange class.
- *
- * @author James Strachan
  */
 class IntRangeTest extends GroovyTestCase {
 
 void testCreateTooBigRange() {
 try {
-new IntRange(0, Integer.MAX_VALUE);
-fail("too large range accepted");
+assert new IntRange(1, Integer.MAX_VALUE).size() == 
Integer.MAX_VALUE // biggest allowed
+new IntRange(0, Integer.MAX_VALUE) // too big
+fail("too large range accepted")
 }
 catch (IllegalArgumentException ignore) {
-assertTrue("expected exception thrown", true);
+assert ignore.message == 'A range must have no more than 
2147483647 elements but attempted 2147483648 elements'
 }
 }
 
@@ -40,11 +39,11 @@ class IntRangeTest extends GroovyTestCase {
  */
 void testInvalidArgumentsToConstructor() {
 try {
-new IntRange(2, 1, true);
-fail("invalid range created");
+new IntRange(2, 1, true)
+fail("invalid range created")
 }
 catch (IllegalArgumentException ignore) {
-assertTrue("expected exception thrown", true);
+assertTrue("expected exception thrown", true)
 }
 }
 
@@ -59,10 +58,10 @@ class IntRangeTest