[GitHub] groovy pull request #612: GROOVY-8252: AIOOBE in combination of ncurry and r...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/612 GROOVY-8252: AIOOBE in combination of ncurry and rcurry You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8252 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/612.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 #612 commit 1fc4449df4a9359275131a341b9a4e9390705cdd Author: paulk Date: 2017-10-02T01:29:43Z GROOVY-8252: AIOOBE in combination of ncurry and rcurry ---
[GitHub] groovy pull request #614: GROOVY-8341: GDK: eachDirRecurse and eachFileRecur...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/614 GROOVY-8341: GDK: eachDirRecurse and eachFileRecurse are NOT depth-fi⦠â¦rst (clarify wording in javadoc) You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8341 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/614.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 #614 commit 9100c04a8f65b4579ef4aab312190a408be3270d Author: paulk Date: 2017-10-09T11:21:52Z GROOVY-8341: GDK: eachDirRecurse and eachFileRecurse are NOT depth-first (clarify wording in javadoc) ---
[GitHub] groovy pull request #616: GROOVY-8351: groovy-starter.conf could be extended...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/616 GROOVY-8351: groovy-starter.conf could be extended to support configs⦠â¦cript You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8351 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/616.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 #616 commit 35cb8541b5526ee89f8e6e332c706dfbbc992df2 Author: paulk Date: 2017-10-11T11:02:58Z GROOVY-8351: groovy-starter.conf could be extended to support configscript ---
[GitHub] groovy pull request #617: GROOVY-8352
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/617#discussion_r144158718 --- Diff: src/main/groovy/transform/Generated.java --- @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package groovy.transform; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * The Generated annotation is used to mark members that have been generated. + * + * @author Andres Almiray + * @author Jochen Theodorou + * @author Mark Hoffmann --- End diff -- Actually, we are mostly trying not to use @author tags these days - though we haven't made it mandatory. Apache encourage removal of @author tags. It's not a mandated rule but they err on the side of wanting the whole community to own the whole codebase rather than people being put off by not wanting to touch a file "owned" by someone else. Git will tell us who the contributor was on a more fine-grained and accurate level than such tags anyway but obviously won't capture multiple authors committing under one of those names. Make sure anyone who has made a significant contribution is added into the `pomconfigurer.gradle` file. ---
[GitHub] groovy pull request #617: GROOVY-8352
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/617#discussion_r144216960 --- Diff: src/main/groovy/transform/Generated.java --- @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package groovy.transform; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * The Generated annotation is used to mark members that have been generated. + * + * @author Andres Almiray + * @author Jochen Theodorou + * @author Mark Hoffmann --- End diff -- @marchof the pomconfigurer.gradle file is a good option too Marc! :-) ---
[GitHub] groovy pull request #617: GROOVY-8352
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/617#discussion_r144309069 --- Diff: src/main/org/codehaus/groovy/classgen/Verifier.java --- @@ -384,6 +387,7 @@ public void visit(MethodVisitor mv) { protected void addGroovyObjectInterfaceAndMethods(ClassNode node, final String classInternalName) { if (!node.isDerivedFromGroovyObject()) node.addInterface(ClassHelper.make(GroovyObject.class)); FieldNode metaClassField = getMetaClassField(node); +AnnotationNode generatedAnnotation = new AnnotationNode(ClassHelper.make(GENERATED_ANNOTATION)); --- End diff -- I needed a guard on adding the annotation to keep the build happy: ``` boolean shouldAnnotate = classNode.getModule().getContext() != null; ``` ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/4f2f7817dc6369abe464d5ad5239054656a5b21f#commitcomment-25192975 Yes, I put a comment to that effect in the file yesterday. I changed it to false to get the faster build times on 2_6_X and master since we didn't need sudo and it was fine for JDK8 but I couldn't make it work with the smaller container with JDK9. ---
[GitHub] groovy pull request #622: GROOVY-8112: NPE in Groovy compiler when referenci...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/622 GROOVY-8112: NPE in Groovy compiler when referencing @Field in aic You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8112 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/622.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 #622 commit 3839297520e325b8520d856bd2d74fc5ee63cced Author: paulk Date: 2017-10-29T22:47:28Z GROOVY-8112: NPE in Groovy compiler when referencing @Field in aic ---
[GitHub] groovy pull request #623: GROOVY-8357: EncodingGroovyMethods.decodeBase64() ...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/623 GROOVY-8357: EncodingGroovyMethods.decodeBase64() throws "bad charact⦠â¦er in base64 value" when meets \t \r You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8357 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/623.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 #623 commit 37792e912934e0317a1b908ed205a753cdaedf19 Author: paulk Date: 2017-10-30T02:37:05Z GROOVY-8357: EncodingGroovyMethods.decodeBase64() throws "bad character in base64 value" when meets \t \r ---
[GitHub] groovy pull request #624: GROOVY-8367: @Memoized not working for inner class...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/624 GROOVY-8367: @Memoized not working for inner classes You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8367 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/624.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 #624 commit a4af4465cbeafc16411a240c8c4dd2720699a78f Author: paulk Date: 2017-10-30T11:42:53Z GROOVY-8367: @Memoized not working for inner classes ---
[GitHub] groovy pull request #619: GROOVY-8360: Enums that are inner classes should h...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/619#discussion_r147980977 --- Diff: src/test/gls/enums/EnumTest.groovy --- @@ -592,6 +592,80 @@ class EnumTest extends CompilableTestSupport { assert UsState.ID.toString() == 'Idaho' ''' } + +void testNestedEnumHasStaticModifier_GROOVY_8360() { +assertScript ''' +class Foo { +enum Bar { +X('x'), Y +String s +Bar(String s) { this.s = s } +Bar() {} +} +} +assert java.lang.reflect.Modifier.isStatic(Foo.Bar.modifiers) +assert Foo.Bar.X.s == 'x' +''' +} + +void testEnumWithinInnerClassHasStaticModifier_GROOVY_8360() { +assertScript ''' +class Foo { +class Baz { +enum Bar { +X('x'), Y +String s +Bar(String s) { this.s = s } +Bar() {} +} +} +} +assert java.lang.reflect.Modifier.isStatic(Foo.Baz.Bar.modifiers) +assert Foo.Baz.Bar.X.s == 'x' +''' +} + +void testNestedEnumHasStaticModifierSC_GROOVY_8360() { +assertScript ''' +@groovy.transform.CompileStatic +class Foo { +enum Bar { +X('x'), Y +String s +Bar(String s) { this.s = s } +Bar() {} +} +} +@groovy.transform.CompileStatic +void test() { +assert java.lang.reflect.Modifier.isStatic(Foo.Bar.getModifiers()) --- End diff -- I created GROOVY-8369 for this. I can't at first glance see a reason why we'd not support this with @CS. ---
[GitHub] groovy pull request #625: GROOVY-8369: Statically compiled property access o...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/625#discussion_r148194617 --- Diff: src/test/org/codehaus/groovy/classgen/asm/sc/FieldsAndPropertiesStaticCompileTest.groovy --- @@ -696,4 +696,21 @@ import org.codehaus.groovy.transform.sc.ListOfExpressionsExpression assert astTrees['A$_closure1'][1].contains('INVOKESTATIC A.pfaccess$02 (LA;Ljava/lang/String;)Ljava/lang/String;') } } + +//GROOVY-8369 +void testPropertyAccessOnEnumClass() { +try { +assertScript ''' +enum Foo {} + +def test() { +println Foo.getModifiers() // => 16401 // ENUM | FINAL | PUBLIC (see GROOVY_8360 wrt STATIC) +println Foo.modifiers // java.lang.NoSuchFieldError: modifiers +} +test() +''' +} finally { +//println astTrees +} +} --- End diff -- Perhaps a slight improvement to my original test would be comparing property access to the getter result and also confirming that enum constants take preference over property access (which worked before but I couldn't see covered in existing tests). ``` @Deprecated enum Foo { annotations } @groovy.transform.CompileStatic def test() { assert 'annotations' == Foo.annotations.toString() assert Foo.getAnnotations().size() == 1 assert Foo.getModifiers() == Foo.modifiers } test() ``` ---
[GitHub] groovy pull request #625: GROOVY-8369: Statically compiled property access o...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/625#discussion_r148195160 --- Diff: src/test/org/codehaus/groovy/classgen/asm/sc/FieldsAndPropertiesStaticCompileTest.groovy --- @@ -696,4 +696,21 @@ import org.codehaus.groovy.transform.sc.ListOfExpressionsExpression assert astTrees['A$_closure1'][1].contains('INVOKESTATIC A.pfaccess$02 (LA;Ljava/lang/String;)Ljava/lang/String;') } } + +//GROOVY-8369 +void testPropertyAccessOnEnumClass() { +try { +assertScript ''' +enum Foo {} + +def test() { +println Foo.getModifiers() // => 16401 // ENUM | FINAL | PUBLIC (see GROOVY_8360 wrt STATIC) +println Foo.modifiers // java.lang.NoSuchFieldError: modifiers +} +test() +''' +} finally { +//println astTrees +} +} --- End diff -- Actually, I'll merge now and tweak the test as per above. ---
[GitHub] groovy pull request #625: GROOVY-8369: Statically compiled property access o...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/625#discussion_r148197190 --- Diff: src/test/org/codehaus/groovy/classgen/asm/sc/FieldsAndPropertiesStaticCompileTest.groovy --- @@ -696,4 +696,21 @@ import org.codehaus.groovy.transform.sc.ListOfExpressionsExpression assert astTrees['A$_closure1'][1].contains('INVOKESTATIC A.pfaccess$02 (LA;Ljava/lang/String;)Ljava/lang/String;') } } + +//GROOVY-8369 +void testPropertyAccessOnEnumClass() { +try { +assertScript ''' +enum Foo {} + +def test() { +println Foo.getModifiers() // => 16401 // ENUM | FINAL | PUBLIC (see GROOVY_8360 wrt STATIC) +println Foo.modifiers // java.lang.NoSuchFieldError: modifiers +} +test() +''' +} finally { +//println astTrees +} +} --- End diff -- Oops, I just noticed you beat me to it. I'll just make the tweak. ---
[GitHub] groovy pull request #629: GROOVY-8295: Groovyc ant task can overflow Windows...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/629 GROOVY-8295: Groovyc ant task can overflow Windows command line if cl⦠â¦asspath is large. PR based on Eric's patch in the related issue. You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8295 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/629.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 #629 commit b34e1b00101470659fbadf0f23952207d4bfb63b Author: paulk Date: 2017-11-07T02:30:10Z GROOVY-8295: Groovyc ant task can overflow Windows command line if classpath is large ---
[GitHub] groovy pull request #630: GROOVY-8289: STC and default value in ctor is caus...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/630 GROOVY-8289: STC and default value in ctor is causing debugging error PR based on Eric's suggested fix in the issue. Still needs a test. You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8289 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/630.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 #630 commit febbf61f2701bed0e2b03f28031ac0741fba087b Author: paulk Date: 2017-11-07T07:37:16Z GROOVY-8289: STC and default value in ctor is causing debugging error ---
[GitHub] groovy pull request #632: GROOVY-8376: Add @DelegatesTo to SwingBuilder meth...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/632 GROOVY-8376: Add @DelegatesTo to SwingBuilder methods that call setDe⦠â¦legate You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8376 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/632.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 #632 commit fbc6093f5890f0170b568f24681648550f7b4dc1 Author: paulk Date: 2017-11-11T12:49:59Z GROOVY-8376: Add @DelegatesTo to SwingBuilder methods that call setDelegate ---
[GitHub] groovy pull request #634: GROOVY-7315: CompileStatic/TypeChecked cannot crea...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/634 GROOVY-7315: CompileStatic/TypeChecked cannot create non-static neste⦠â¦d inner class using named-arg short-hand syntax You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy7315 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/634.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 #634 commit bbe86ea52512803d155ed0c085f8b0cce0299b13 Author: paulk Date: 2017-11-12T13:07:27Z GROOVY-7315: CompileStatic/TypeChecked cannot create non-static nested inner class using named-arg short-hand syntax ---
[GitHub] groovy pull request #635: GROOVY-8255: Odd problems with flow typing and gen...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/635 GROOVY-8255: Odd problems with flow typing and generics in Groovy 2.4⦠â¦.12+ (target typing for empty literals within Ternary/Elvis) You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8255 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/635.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 #635 commit 6c35dcff589929cf80b2e79a246b35aae4afec2a Author: paulk Date: 2017-11-13T08:43:02Z GROOVY-8255: Odd problems with flow typing and generics in Groovy 2.4.12+ (target typing for empty literals within Ternary/Elvis) ---
[GitHub] groovy pull request #637: GROOVY-8382: Target Typing for empty collections s...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/637 GROOVY-8382: Target Typing for empty collections should work for fiel⦠â¦d/property initialisers You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8382 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/637.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 #637 commit 40f1b2953472fdb20bd1fc35ec26b3d435d6a72b Author: paulk Date: 2017-11-16T13:40:14Z GROOVY-8382: Target Typing for empty collections should work for field/property initialisers ---
[GitHub] groovy pull request #639: GROOVY-8384 - Regression in 2.4.13 snapshot with S...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/639 GROOVY-8384 - Regression in 2.4.13 snapshot with STC and intdiv plus ⦠â¦some cleanup You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8384 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/639.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 #639 commit 6387ed88c22d5b74ec731aba37afec67dd229120 Author: paulk Date: 2017-11-18T14:29:08Z GROOVY-8384 - Regression in 2.4.13 snapshot with STC and intdiv plus some cleanup ---
[GitHub] groovy pull request #640: GROOVY-8383: OptimizerVisitor#setConstField not @C...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/640 GROOVY-8383: OptimizerVisitor#setConstField not @CS friendly You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8383 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/640.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 #640 commit 3ec550a50803f10ba343db7b0a9c1b38c543d9f3 Author: paulk Date: 2017-11-19T04:49:31Z GROOVY-8383: OptimizerVisitor#setConstField not @CS friendly ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/7ea3047fdb65c9c15e80eecd6ba221c5fabbc578#commitcomment-25806906 In src/main/groovy/util/ProxyGenerator.java: In src/main/groovy/util/ProxyGenerator.java on line 212: Won't this be less efficient? ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/7ea3047fdb65c9c15e80eecd6ba221c5fabbc578#commitcomment-25813402 In src/main/groovy/util/ProxyGenerator.java: In src/main/groovy/util/ProxyGenerator.java on line 212: Thanks Patric, that's why I had the ? Wasn't sure if the old wisdom still held. Let's leave the code but add a comment to above in the code - since otherwise folks will come along and "optimise" it back later. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/e1ce4824186f62f5fb05a407da79b8da61bc87a4#commitcomment-26078737 In src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java: In src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java on line 15962: I think we need a Jira issue to track this breaking change. In general, we should discuss such changes on the mailing list(s). ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/f5d0236f93302cf8d1f49f35f1ddf1d0dd1c12e4#commitcomment-26080209 In build.gradle: In build.gradle on line 188: Just a reminder, it is generally undesirable to release artifacts into maven central that have dependencies off into snapshot repos. We should ideally move onto final releases of Spock 1.2 before releasing final releases of Groovy. There are no final releases of Spock that allow a Groovy version number starting with 3. ---
[GitHub] groovy pull request #644: GROOVY-8406: Various DefaultGroovyMethods missing ...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/644 GROOVY-8406: Various DefaultGroovyMethods missing Array variants resu⦠â¦lting in no type inference You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8406 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/644.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 #644 commit 1d5676705a3a39a5f0c73d5a50a60804c5de80a3 Author: paulk Date: 2017-12-11T15:14:26Z GROOVY-8406: Various DefaultGroovyMethods missing Array variants resulting in no type inference ---
[GitHub] groovy pull request #644: GROOVY-8406: Various DefaultGroovyMethods missing ...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/644#discussion_r156233058 --- Diff: src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java --- @@ -3371,77 +3396,179 @@ public static Number count(byte[] self, Object value) { } /** - * Iterates through this aggregate Object transforming each item into a new value using Closure.IDENTITY - * as a transformer, basically returning a list of items copied from the original object. - * assert [1,2,3] == [1,2,3].iterator().collect() + * Iterates through this aggregate Object transforming each item into a new value using the transform closure + * and adding it to the supplied collector. * - * @param self an aggregate Object with an Iterator returning its items + * @param self an aggregate Object with an Iterator returning its items + * @param collector the Collection to which the transformed values are added + * @param transform the closure used to transform each item of the aggregate object + * @return the collector with all transformed values added to it + * @since 1.0 + */ +public static Collection collect(Object self, Collection collector, Closure transform) { +return collect(InvokerHelper.asIterator(self), collector, transform); +} + +/** + * Iterates through this Array transforming each item into a new value using the + * transform closure, returning a list of transformed values. + * + * @param self an Array + * @param transform the closure used to transform each item of the Array * @return a List of the transformed values - * @see Closure#IDENTITY - * @since 1.8.5 + * @since 2.5.0 */ -public static Collection collect(Object self) { -return collect(self, Closure.IDENTITY); +public static List collect(S[] self, @ClosureParams(FirstParam.Component.class) Closure transform) { +return collect(new ArrayIterator(self), transform); } /** - * Iterates through this aggregate Object transforming each item into a new value using the transform closure + * Iterates through this Array transforming each item into a new value using the transform closure * and adding it to the supplied collector. + * + * Integer[] nums = [1,2,3] + * List answer = [] + * nums.collect(answer) { it * 2 } + * assert [2,4,6] == answer + * * - * @param self an aggregate Object with an Iterator returning its items + * @param self an Array * @param collector the Collection to which the transformed values are added - * @param transform the closure used to transform each item of the aggregate object + * @param transform the closure used to transform each item * @return the collector with all transformed values added to it - * @since 1.0 + * @since 2.5.0 */ -public static Collection collect(Object self, Collection collector, Closure transform) { -for (Iterator iter = InvokerHelper.asIterator(self); iter.hasNext(); ) { +public static Collection collect(S[] self, Collection collector, @ClosureParams(FirstParam.Component.class) Closure transform) { +return collect(new ArrayIterator(self), collector, transform); +} + +/** + * Iterates through this Iterator transforming each item into a new value using the + * transform closure, returning a list of transformed values. + * + * @param self an Iterator + * @param transform the closure used to transform each item + * @return a List of the transformed values + * @since 2.5.0 + */ +public static List collect(Iterator self, @ClosureParams(FirstParam.Component.class) Closure transform) { +return (List) collect(self, new ArrayList(), transform); +} + +/** + * Iterates through this Iterator transforming each item into a new value using the transform closure + * and adding it to the supplied collector. + * + * @param self an Iterator + * @param collector the Collection to which the transformed values are added + * @param transform the closure used to transform each item + * @return the collector with all transformed values added to it + * @since 2.5.0 + */ +public static Collection collect(Iterator self, Collection collector, @ClosureParams(FirstParam.FirstGenericType.class) Closure transform) { +Iterator iter = InvokerHelper.asIterator(self); --- End diff -- Good catch. Removed. I'll
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/047c8f29b1f7a1a98b2b003e4d09c1cef05feb0e#commitcomment-26370771 Let's watch it a few more times ... ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/c89393104807cc49859f77ab86c62ab3c7e171e8#commitcomment-26389799 Adding classExcludes added the extra time? Perhaps it has a caching impact? Or using the binaryCompatibilityCheck at all? Locally you can exclude running that task when you run check. ---
[GitHub] groovy pull request #646: GROOVY-8386/GROOVY-8094: Final variable analysis b...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/646 GROOVY-8386/GROOVY-8094: Final variable analysis broken with try/catc⦠â¦h/finally and if/then/else You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy fva Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/646.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 #646 commit be854b73091a1b284efb7682a19df843f09e6df5 Author: paulk Date: 2017-12-22T07:11:51Z GROOVY-8386/GROOVY-8094: Final variable analysis broken with try/catch/finally and if/then/else ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1972c21cb2ccade3109cf9befdbbc3ff9c7dad68#commitcomment-26458323 Does this look related? The latest CI build says: [testStreamOf] (class: java_util_stream_Stream$of, method: call signature: (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool [00:01:02] [testStreamOf] java.lang.VerifyError: (class: java_util_stream_Stream$of, method: call signature: (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool ---
[GitHub] groovy pull request #645: DefaultGroovyMethods bug fix: Set.intersect(Iterab...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/645#discussion_r158594944 --- Diff: subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/completion/ImportsSyntaxCompletor.groovy --- @@ -105,12 +105,12 @@ class ImportsSyntaxCompletor implements IdentifierCompletor { Class clazz = shell.interp.evaluate([className]) as Class if (clazz != null) { List clazzSymbols = ReflectionCompletor.getPublicFieldsAndMethods(clazz, '')*.value -List importedSymbols; +Collection importedSymbols if (symbolName == '*') { -importedSymbols = clazzSymbols; +importedSymbols = clazzSymbols } else { Set acceptableMatches = [symbolName, symbolName + '(', symbolName + '()'] -importedSymbols = acceptableMatches.intersect(clazzSymbols) +importedSymbols = (acceptableMatches as Collection).intersect(clazzSymbols) --- End diff -- Was changing this file needed? ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/a9cc446a9a3ee83e8be3faf14b61c24cfb441c6a#commitcomment-26576581 In buildSrc/src/main/groovy/org/codehaus/groovy/gradle/JarJarTask.groovy: In buildSrc/src/main/groovy/org/codehaus/groovy/gradle/JarJarTask.groovy on line 145: Fairly minor but I just noticed I now get these two warnings for tasks :grooidjar and :groovy-test:grooidjar: [ant:jar] Warning: selected jar files include a META-INF/INDEX.LIST which will be replaced by a newly generated one. ---
[GitHub] groovy pull request #652: fix for: GROOVY-8430: @Field doesn't support final...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/652 fix for: GROOVY-8430: @Field doesn't support final fields You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8430 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/652.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 #652 commit f8a3b9034ce2578199da87b1580aad7d2903a072 Author: paulk Date: 2018-01-02T22:55:35Z fix for: GROOVY-8430: @Field doesn't support final fields ---
[GitHub] groovy pull request #653: GROOVY-8440: Groovy's @Immutable annotation should...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/653 GROOVY-8440: Groovy's @Immutable annotation should be re-vamped to be⦠⦠a meta-annotation You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8440 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/653.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 #653 commit ebf35b3f89e2235921c3312a6173b38275ef982a Author: paulk Date: 2018-01-10T13:24:25Z GROOVY-8440: Groovy's @Immutable annotation should be re-vamped to be a meta-annotation ---
[GitHub] groovy pull request #655: GROOVY-8455: @TupleConstructor gives wrong orderin...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/655 GROOVY-8455: @TupleConstructor gives wrong ordering when includeSuper⦠â¦Fields is set You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8455 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/655.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 #655 commit bdaea09057cc2428df67441df4770c0b196c6f0d Author: paulk Date: 2018-01-22T13:28:56Z GROOVY-8455: @TupleConstructor gives wrong ordering when includeSuperFields is set ---
[GitHub] groovy pull request #657: Groovy8453
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/657 Groovy8453 You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8453 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/657.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 #657 commit 344c7e996c44903e05efb43fac7359115fb93e82 Author: paulk Date: 2018-01-22T04:47:57Z GROOVY-8453: initial changes commit 3d072b6d62f6501162200a28ac42906f45259257 Author: paulk Date: 2018-01-23T09:44:30Z GROOVY-8453: @TupleConstructor ignoring inherited standard Java Beans properties ---
[GitHub] groovy pull request #659: GROOVY-8093: Final variable analysis broken within...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/659 GROOVY-8093: Final variable analysis broken within closure fields You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8093 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/659.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 #659 ---
[GitHub] groovy pull request #662: GROOVY-8477: @Immutable-related transformations sh...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/662 GROOVY-8477: @Immutable-related transformations should be more config⦠â¦urable You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8477 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/662.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 #662 commit b8bcc2d149aa80f1457a76cf3a7be2ab19adfe26 Author: paulk Date: 2018-02-13T05:06:07Z GROOVY-8477: @Immutable-related transformations should be more configurable ---
[GitHub] groovy pull request #663: GROOVY-8471: Contents of META-INF/services/org.cod...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/663 GROOVY-8471: Contents of META-INF/services/org.codehaus.groovy.source⦠â¦.Extensions conflict with Maven/Jisaw You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8471 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/663.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 #663 commit 613dd488f9c07d367ef1a3d14f2f5aba82e805be Author: paulk Date: 2018-02-14T03:16:22Z GROOVY-8471: Contents of META-INF/services/org.codehaus.groovy.source.Extensions conflict with Maven/Jisaw ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/9699e99483b8f53e4a77762225343a86ee3c4783#commitcomment-27636375 In src/main/java/org/apache/groovy/util/Maps.java: In src/main/java/org/apache/groovy/util/Maps.java on line 5802: We might want to eventually consider a method like this being exposed as part of the DGM. I guess in general we might not always want it to be a view (i.e. unmodifiable). ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/9699e99483b8f53e4a77762225343a86ee3c4783#commitcomment-27642627 In src/main/java/org/apache/groovy/util/Maps.java: In src/main/java/org/apache/groovy/util/Maps.java on line 5802: Yes, those implementations support views but we don't: ``` @Grab('org.apache.commons:commons-collections4:4.1') @Grab('com.google.guava:guava:24.0-jre') import com.google.common.collect.HashBiMap import org.apache.commons.collections4.bidimap.DualHashBidiMap import org.apache.groovy.util.Maps def pets = HashBiMap.create(dog: 1) def step = pets.inverse() pets.dog = 2 assert step[2] == 'dog' pets = new DualHashBidiMap(cat: 2) step = pets.inverseBidiMap() pets.cat = 3 assert step[3] == 'cat' pets = [goldfish: 5] step = Maps.inverse(pets) pets.goldfish = 6 assert step[5] == 'goldfish' // should be step[6] ``` ---
[GitHub] groovy pull request #664: GROOVY-7956: Provide an AST transformation which i...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/664 GROOVY-7956: Provide an AST transformation which improves named param⦠â¦eter support You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy7956 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/664.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 #664 commit 43f2c8e47b2072e2c0e42097c4462180af30efdb Author: paulk Date: 2018-02-20T00:09:59Z GROOVY-7956: Provide an AST transformation which improves named parameter support ---
[GitHub] groovy pull request #665: GROOVY-7981: Not public constructors for groovy.tr...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/665 GROOVY-7981: Not public constructors for groovy.transform.Immutable a⦠â¦nnotated class You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy7981 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/665.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 #665 commit e32ca2dc228d5d8212321c5eda81503ff6002760 Author: paulk Date: 2018-02-22T05:25:07Z GROOVY-7981: Not public constructors for groovy.transform.Immutable annotated class ---
[GitHub] groovy pull request #666: GROOVY-8480: org.codehaus.groovy.runtime.Extension...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/666 GROOVY-8480: org.codehaus.groovy.runtime.ExtensionModule should move ⦠â¦to META-INF/groovy You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8480 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/666.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 #666 commit 46b6b1164c76dd4da3e37bcc2432d6b8db815cb5 Author: paulk Date: 2018-02-23T05:14:00Z GROOVY-8480: org.codehaus.groovy.runtime.ExtensionModule should move to META-INF/groovy ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/63fc0a4036538fcf329d3a5b104dd32aa56d2d56#commitcomment-27736578 In src/install/install-jdk.sh: In src/install/install-jdk.sh on line 1: fails RAT report ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/63fc0a4036538fcf329d3a5b104dd32aa56d2d56#commitcomment-27736777 In src/install/install-jdk.sh: In src/install/install-jdk.sh on line 1: It's missing an Apache header - but I just excluded it from rat report and it's no longer copied into src zip - so should be fixed now. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/63fc0a4036538fcf329d3a5b104dd32aa56d2d56#commitcomment-27736817 In src/install/install-jdk.sh: In src/install/install-jdk.sh on line 1: Just as a side note, it would be worth writing a short summary of what you did for these extra builds and sending to dev mailing list. Probably also mention the tuning. That way we can all look out for any unexpected changed behavior. ---
[GitHub] groovy pull request #667: GROOVY-8379: Rework groovy-json FastStringUtils
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/667 GROOVY-8379: Rework groovy-json FastStringUtils You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8379 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/667.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 #667 commit f9c8ae9f71b08b230606b9bcb6e48dc1a2c26a65 Author: paulk Date: 2018-02-25T10:11:03Z GROOVY-8379: Rework groovy-json FastStringUtils ---
[GitHub] groovy pull request #672: GROOVY-7624: Collection asImmutable() methods aren...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/672 GROOVY-7624: Collection asImmutable() methods aren't immutable You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy7624 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/672.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 #672 commit 9326ebe6040bb242d68fc8a835429a846ac9edc1 Author: paulk Date: 2018-03-06T12:16:29Z GROOVY-7624: Collection asImmutable() methods aren't immutable ---
[GitHub] groovy pull request #673: GROOVY-8501: Switch internal details of @Immutable...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/673 GROOVY-8501: Switch internal details of @ImmutableBase existing const⦠â¦ructor validation You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8501 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/673.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 #673 commit 5fe29c30ba2b96badcf8bfb9a6f147b2f1f5114e Author: paulk Date: 2018-03-08T13:25:24Z GROOVY-8501: Switch internal details of @ImmutableBase existing constructor validation ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/ce256aab7653fa020ac323ef260d0c4a4cf25e44#commitcomment-28040924 I was hoping to have it out (for Apache voting) by now. I might still get that done before I hop on a plane tonight - otherwise it will happen some time during Greach. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/e154c3e560e998e158985316566c7e321579b193#commitcomment-28107242 In src/test/groovy/bugs/Groovy8439Bug.groovy: In src/test/groovy/bugs/Groovy8439Bug.groovy on line 22: It would be good to give these meaningful names if we can ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/3eb491cded846c352952cdb3a6fffed817e14741#commitcomment-28107251 In src/test/groovy/bugs/Groovy8439Bug.groovy: In src/test/groovy/bugs/Groovy8439Bug.groovy on line 50: It would be good to give these meaningful names if we can - I couldn't work out what you were trying to test with this ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/3eb491cded846c352952cdb3a6fffed817e14741#commitcomment-28107275 In src/test/groovy/bugs/Groovy8439Bug.groovy: In src/test/groovy/bugs/Groovy8439Bug.groovy on line 50: The test passed also with 2.6.0-alpha-3 so was it something that broke with your previous commit and you were trying to safeguard against that happening again? ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/3eb491cded846c352952cdb3a6fffed817e14741#commitcomment-28110657 In src/test/groovy/bugs/Groovy8439Bug.groovy: In src/test/groovy/bugs/Groovy8439Bug.groovy on line 50: We can replace the assertion with: assert ["hello,false", "hello,42", "hello,1", "hello,null", "hello,Daniel"] == Test.something([false, 42, 1G, null, "Daniel"]) and it still works, so the test seems a little puzzling to me. ---
[GitHub] groovy pull request #675: GROOVY-8514: NullPointerException in class Missing...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/675 GROOVY-8514: NullPointerException in class MissingMethodException You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8514 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/675.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 #675 commit efede2ab04d641bfc8ed8e77d15df3ae87dfc672 Author: paulk Date: 2018-03-19T12:46:07Z GROOVY-8514: NullPointerException in class MissingMethodException ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/b3e042191a7acc1c7bdfdfdc0c39fe93e2de3d94#commitcomment-28156492 If you want to hear latest status of releases etc., the Apache Groovy dev list is a good one to subscribe to. wrt asm library - last upgrade of ASM on 2_4_X still has issues, e.g.: https://issues.apache.org/jira/browse/GROOVY-8508 https://issues.apache.org/jira/browse/GROOVY-8494 Fixing that may yet require revert of ASM version. But if we manage to fix it without reverting, we can consider another upgrade of ASM. We tend not bump dependency versions in point releases without a good reason. ---
[GitHub] groovy pull request #676: Add DGM `md5`
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/676#discussion_r176448808 --- Diff: src/test/org/codehaus/groovy/runtime/DefaultGroovyMethodsTest.groovy --- @@ -310,4 +312,18 @@ class DefaultGroovyMethodsTest extends GroovyTestCase { assertTrue(DefaultGroovyMethods.implies(false, null)) assertFalse(DefaultGroovyMethods.implies(true, null)) } + +void testMd5() { +try { +Assert.assertEquals("e99a18c428cb38d5f260853678922e03", StringGroovyMethods.md5("abc123")) --- End diff -- StringGroovyMethods should be DefaultGroovyMethods or the DGM method should move? In any case, perhaps EncodingGroovyMethods might be better? ---
[GitHub] groovy pull request #675: GROOVY-8514: NullPointerException in class Missing...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/675#discussion_r176602934 --- Diff: subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyScriptEngineImpl.java --- @@ -367,6 +367,22 @@ private Object invokeImpl(Object thiz, String name, Object... args) } } +private Object invokeImplSafe(Object thiz, String name, Object... args) { +if (name == null) { +throw new NullPointerException("method name is null"); --- End diff -- I'm replicating the existing functionality, so I won't change that. ---
[GitHub] groovy pull request #675: GROOVY-8514: NullPointerException in class Missing...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/675#discussion_r176603885 --- Diff: src/main/groovy/groovy/lang/MissingMethodException.java --- @@ -48,7 +48,7 @@ public MissingMethodException(String method, Class type, Object[] arguments, boo this.method = method; this.type = type; this.isStatic = isStatic; -this.arguments = arguments; +this.arguments = arguments == null ? new Object[0] : arguments; --- End diff -- Done ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/00af138c0b0d6a9a06cf7f87d654ef7fb9505d60#commitcomment-28265903 In build.gradle: In build.gradle on line 151: It felt risky for a point release to release with a version no one would have had a chance to test against. Nothing stopping us from doing another release in a week or two. On 26 Mar. 2018 5:57 pm, "henrik242" wrote: > @paulk-asert <https://github.com/paulk-asert> Sad that 6.1 didn't make it > into .15 :( > > â > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/apache/groovy/commit/00af138c0b0d6a9a06cf7f87d654ef7fb9505d60#commitcomment-28265395>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AARF0G92VrQt9FMMJsiA7dB-XvCm9Zl-ks5tiJ9fgaJpZM4S6q1T> > . > ---
[GitHub] groovy pull request #678: GROOVY-8525: Binary compatibility issue for Groovy...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/678 GROOVY-8525: Binary compatibility issue for GroovyClassLoader between⦠⦠2.4 vs later branches You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy GROOVY-8525 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/678.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 #678 commit 6308dbfc7fa95eaca7a30bc117f4e6628d037506 Author: Paul King Date: 2018-03-30T10:59:40Z GROOVY-8525: Binary compatibility issue for GroovyClassLoader between 2.4 vs later branches ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/7e7b508c02bf35e72fca1efcb7cc0d8a4f25038a#commitcomment-28346403 In src/antlr/GroovyLexer.g4: In src/antlr/GroovyLexer.g4 on line 317: There is no doubt some merit to this approach but it seems to me a significant conceptual change to how end of String parsing is done. It should be discussed on the mailing list prior to inclusion in the code base. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/7e7b508c02bf35e72fca1efcb7cc0d8a4f25038a#commitcomment-28346795 In src/antlr/GroovyLexer.g4: In src/antlr/GroovyLexer.g4 on line 317: I don't see this as a case of it can be done so it should be done. Do we really want to do it? For me, I'd like us to have a consistent story across all Strings. We don't support a trailing slash in a slashy string for instance. `def x = /1234//` and for that matter, why not for single quoted strings? `def y = '1234''` More eyeballs might bring up other cases too. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/7e7b508c02bf35e72fca1efcb7cc0d8a4f25038a#commitcomment-28347515 In src/antlr/GroovyLexer.g4: In src/antlr/GroovyLexer.g4 on line 317: But ''' and """ can quote themselves given the current grammar, so why not the others? :-) ---
[GitHub] groovy pull request #679: GROOVY-8525: Binary compatibility issue for Groovy...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/679 GROOVY-8525: Binary compatibility issue for GroovyClassLoader between⦠⦠2.4 vs later branches (alternative to PR#678) What I haven't yet checked is whether we need to make some of the delegated method calls just throw UnsupportedOperationException in order to keep the claims like @Threadsafe. You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8525b Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/679.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 #679 commit 78dc3c8d6111ab6365f1da519bf027d634803cce Author: Paul King Date: 2018-03-30T23:36:57Z GROOVY-8525: Binary compatibility issue for GroovyClassLoader between 2.4 vs later branches ---
[GitHub] groovy pull request #679: GROOVY-8525: Binary compatibility issue for Groovy...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/679#discussion_r178421016 --- Diff: src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java --- @@ -175,6 +174,11 @@ private V compute(K key, ValueProvider valueProvider, bo return doWithReadLock(c -> c.values()); } +@Override +public Set> entrySet() { +return commonCache.entrySet(); --- End diff -- true, but I think we have to throw UnsupportedOperationException for entrySet and keySet because they return a view which might then be modified under the covers without locks? ---
[GitHub] groovy pull request #679: GROOVY-8525: Binary compatibility issue for Groovy...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/679#discussion_r178421035 --- Diff: src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java --- @@ -199,20 +208,35 @@ public int size() { return doWithReadLock(c -> c.size()); } +@Override +public boolean isEmpty() { +return commonCache.isEmpty(); +} + /** * {@inheritDoc} */ @Override -public V remove(final K key) { +public V remove(final Object key) { return doWithWriteLock(c -> c.remove(key)); } +@Override +public void putAll(Map m) { + --- End diff -- Oops, I was wondering whether to lock for the whole putAll or loop and lock per entry and then forgot to supply either! I'll do the former for now. ---
[GitHub] groovy pull request #679: GROOVY-8525: Binary compatibility issue for Groovy...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/679#discussion_r178422137 --- Diff: src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java --- @@ -175,6 +174,11 @@ private V compute(K key, ValueProvider valueProvider, bo return doWithReadLock(c -> c.values()); } +@Override +public Set> entrySet() { +return commonCache.entrySet(); --- End diff -- Inelegant but the Java collections way! ;-) Better to look inelegant rather than provide an apparently good looking but buggy implementation! In any case, I have implemented entrySet() in the same way as keys() and values() are implemented. The concern though is that if you look at ConcurrentHashMap, keySet(), entrySet() and values() are backed by views using iterators and spliterators that guarantee "weak consistency". It doesn't seem like we are making any such considerations for StampedCommonCache? I will leave that as a future exercise - we can always create such views or throw UnsupportedOperationException if we deem there is no other way to be safe. ---
[GitHub] groovy pull request #678: GROOVY-8525: Binary compatibility issue for Groovy...
Github user paulk-asert closed the pull request at: https://github.com/apache/groovy/pull/678 ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28386425 If you get a chance to check the "Serializable incompatible(!)" warnings from the checkBinaryCompatibility task that would be great. I know some of them are false positives - I did round-trip serialize/unserialize checks for ObservableMap, ObservableList etc. between 2.4 and 2.5 to confirm they are okay but they still show in the list. Otherwise you are usually fine if you generate the serialVersionUID from the 2.4 codebase and then propogate. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387182 Yes but it will break serializability within a point release! ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387216 To keep serializability compatible within 2.4 we can add serialVersionUID values generated from the 2.4 codebase. We can then move those forward onto the other branches. If there has been no changes to any fields, modifiers, inherited fields etc, then this won't be required but then it shouldn't be showing up in the discrepancy report. So it's only the cases in the report where something has changed - often we added a final modifier to a non-changing field. You can't generate the serialVersionUID from the modified class in that case. But as I said, there seems to be some cases which are generating false positives. I think where nested classes are involved. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387229 Also, I'd note that in some cases, like the ObservableList/Map/Set example which weren't serializable in the first place - contained a non-serializable value - so we don't need to try to maintain serializability compatibility in such a case. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387263 Best bet for checking is to just serialize from 2.4 using ObjectOutputStream into a dat file (binary file) and read that back in with 2.5. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387291 Bonus points if you can pin-point what is causing the false positives - we should submit a bug report/PR to japicmp to fix our cases which are failing but I haven't found a simple standalone exemplar just yet. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387349 Not all the classes probably gave errors but yep, that will probably be the easiest. The only other comment I'll make is that even for the ObservableList/Set/Map case, neither the value report by japicmp or generated by Intellij gave the right results. I had to be by what the serialize/deserialize rout-trip test gave. Perhaps I needed to clear out IntelliJ's classes directory between switching branches - not sure what was going wrong. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387373 my last reply was to your earlier comment. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387375 Let me generate you an example ... ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28387886 Please revert. That just also breaks serializable compability between 2.4.15 and 2_4_X HEAD!! Run this script on 2.4.15: ``` def obj = new GroovyRuntimeException('boom') assert obj instanceof GroovyRuntimeException assert obj.message == 'boom' def file = new File('/tmp/cc.dat') file.withObjectOutputStream{ it.writeObject(obj) } ``` Now run this script on 2_4_X HEAD or 2_5_X HEAD: ``` def file = new File('/tmp/cc.dat') file.withObjectInputStream { def newObj = it.readObject() assert newObj instanceof GroovyRuntimeException assert newObj.message == 'boom' } ``` you will see: java.io.InvalidClassException: groovy.lang.GroovyRuntimeException; local class incompatible: stream classdesc serialVersionUID = -193137033604506378, local class serialVersionUID = 3699943230572902549 ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/1bcaaeaf60078dd5a9aca5cbf1df8f45de68db60#commitcomment-28388135 Technically we only need to "fix" the broken bits but it will be easiest to revert on all branches and work from the 2.4 branch. Fixing super classes first if need be. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/f88d0122525cabf6bdf61ab051533f9983f352f1#commitcomment-28390910 In src/test/groovy/SerializableCompatibilityTest.groovy: In src/test/groovy/SerializableCompatibilityTest.groovy on line 40: This looks like it is generated on 2_4_X not 2.4.15. I think the serializable incompatibility remains - the deserialize test fails on 2.4.15. ---
[GitHub] groovy pull request #683: GROOVY-8539: Groovy fails to compile assignment op...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/683 GROOVY-8539: Groovy fails to compile assignment operators on boolean ⦠â¦array You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8539 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/683.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 #683 commit f8a0c55bb9bd69c298bcbcf763a43e6031e24b34 Author: Paul King Date: 2018-04-11T06:12:59Z GROOVY-8539: Groovy fails to compile assignment operators on boolean array ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/5443e87882f9b88169876f6d043ed54b5ae9023b#commitcomment-28569181 In src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java: In src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java on line 951: getting better (and fine for an alpha release) but there is currently no way to create a compiler configuration with a defined value - some DSLs will need a fixed value true or false regardless of system property. Also best to have try catch around Boolean.getBoolean. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/5443e87882f9b88169876f6d043ed54b5ae9023b#commitcomment-28576091 In src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java: In src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java on line 951: I think we just need SecurityException added as per safeGetSystemProperty in that file. Maybe time to have safeGetBoolean in that file to avoid dup. ---
[GitHub] groovy pull request #684: move commons-cli CliBuilder into its own subprojec...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/684 move commons-cli CliBuilder into its own subproject You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy-cli Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/684.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 #684 commit 61fec9b0291f179f5e4206eb45207d6fa44704a6 Author: Paul King Date: 2018-04-14T01:05:35Z move commons-cli CliBuilder into its own subproject ---
[GitHub] groovy pull request #684: move commons-cli CliBuilder into its own subprojec...
Github user paulk-asert closed the pull request at: https://github.com/apache/groovy/pull/684 ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/5443e87882f9b88169876f6d043ed54b5ae9023b#commitcomment-28711056 In src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java: In src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java on line 951: I added the SecurityException handling code ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/aa1ad8fe2ab2c37a0b95215e692e73bdc37297f7#commitcomment-28813835 It was me - I am not sure how your name got there. I'll have to check whether my git config is messed up. ---
[GitHub] groovy pull request #694: GROOVY-8567 Migrate Groovyc to picocli
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/694#discussion_r186015291 --- Diff: src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java --- @@ -77,18 +73,6 @@ public void compile(File[] files) throws Exception { unit.compile(); } -public static void displayHelp(final Options options) { -final HelpFormatter formatter = new HelpFormatter(); -formatter.printHelp(80, "groovyc [options] ", "options:", options, ""); -} - -public static void displayVersion() { --- End diff -- For binary compatibility we'd want to keep but deprecate this method. Ideally, you'd change implementation to point to new details. If that's not possible you can throw a DeprecationException. ---
[GitHub] groovy pull request #694: GROOVY-8567 Migrate Groovyc to picocli
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/694#discussion_r186015829 --- Diff: src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java --- @@ -77,18 +73,6 @@ public void compile(File[] files) throws Exception { unit.compile(); } -public static void displayHelp(final Options options) { --- End diff -- Not 100% sure on this one. I think we might need to keep it and mark as deprecated in 2_5_X and then remove in 2_6_X and master. That means we won't be able to remove commons cli fully just yet. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/c80d02b13005efd87eb69ca66958def9becc56e1#commitcomment-28863337 That's it! I was wondering how it got in there. I had checked all my git config from the cmd line. I don't remember ever filling in that field in Intellij. But gone now! ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/3f650cc681cf1702860a47247bfa728c4c793ef8#commitcomment-28943972 It was changed again! Weird, I've never set that field myself. ---
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/62f877abd28c62e3058a383905bb93624ef36130#commitcomment-28966636 Weird, I had to reset again. Seems okay now. I don't know how it keeps coming back. Maybe I just need to do a fresh reinstall of Intellij. ---
[GitHub] groovy pull request #708: GROOVY-6668: Static compiler doesn't coerce GStrin...
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/708#discussion_r188832656 --- Diff: src/test/groovy/bugs/Groovy6668Bug.groovy --- @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package groovy.bugs + +class Groovy6668Bug extends GroovyTestCase{ +void testGroovy6668() { +assertScript ''' +@groovy.transform.CompileStatic +class OtherThing { +OtherThing() { +Map m = [:] +def k = "foo" +m["$k"].toUpperCase() +} +} + +OtherThing --- End diff -- why not just shouldCompile then? ---
[GitHub] groovy pull request #709: GROOVY-8579: No bytecode level check is done befor...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/709 GROOVY-8579: No bytecode level check is done before producing JDK8+ b⦠â¦ytecode You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8579 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/709.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 #709 commit a237b8e11483ceef63ff5895de6d60d219cff58d Author: Paul King Date: 2018-05-17T09:00:18Z GROOVY-8579: No bytecode level check is done before producing JDK8+ bytecode ---
[GitHub] groovy pull request #715: GROOVY-8593: DocGenerator could be moved to avoid ...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/715 GROOVY-8593: DocGenerator could be moved to avoid split packages You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8593 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/715.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 #715 commit d4cf009ece729ecc4906bc7d9088e2cf581288c0 Author: Paul King Date: 2018-05-22T14:05:21Z GROOVY-8593: DocGenerator could be moved to avoid split packages ---
[GitHub] groovy pull request #716: GROOVY-8596: SqlGroovyMethods could be moved to av...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/716 GROOVY-8596: SqlGroovyMethods could be moved to avoid split packages ⦠â¦- part (1) You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8596 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/716.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 #716 commit 710027e11a985d68b49e5d7aca222d8012c60384 Author: Paul King Date: 2018-05-22T23:06:05Z GROOVY-8596: SqlGroovyMethods could be moved to avoid split packages - part (1) ---