[jira] [Closed] (GROOVY-8780) Add `sha256` DGM
[ https://issues.apache.org/jira/browse/GROOVY-8780?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Sun closed GROOVY-8780. -- Resolution: Fixed Fixed by https://github.com/apache/groovy/commit/6a6e1f0ff9c810fc4fac977c67bdb789b7a486bf > Add `sha256` DGM > > > Key: GROOVY-8780 > URL: https://issues.apache.org/jira/browse/GROOVY-8780 > Project: Groovy > Issue Type: Improvement >Reporter: Daniel Sun >Assignee: Daniel Sun >Priority: Minor > Fix For: 3.0.0-alpha-4, 2.5.3 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-8780) Add `sha256` DGM
[ https://issues.apache.org/jira/browse/GROOVY-8780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607919#comment-16607919 ] ASF GitHub Bot commented on GROOVY-8780: Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/793 > Add `sha256` DGM > > > Key: GROOVY-8780 > URL: https://issues.apache.org/jira/browse/GROOVY-8780 > Project: Groovy > Issue Type: Improvement >Reporter: Daniel Sun >Assignee: Daniel Sun >Priority: Minor > Fix For: 3.0.0-alpha-4, 2.5.3 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-8780) Add `sha256` DGM
[ https://issues.apache.org/jira/browse/GROOVY-8780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607911#comment-16607911 ] ASF GitHub Bot commented on GROOVY-8780: Github user danielsun1106 commented on a diff in the pull request: https://github.com/apache/groovy/pull/793#discussion_r216121282 --- Diff: src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java --- @@ -389,6 +390,26 @@ public static String md5(byte[] self) throws NoSuchAlgorithmException { return digest(self, MD5); } +/** + * Calculate SHA-256 of the CharSequence instance + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 + */ +public static String sha256(CharSequence self) throws NoSuchAlgorithmException { +return digest(self, SHA_256); +} + +/** + * Calculate SHA-256 of the byte array + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 --- End diff -- OK. I'll fix it. Thanks ;-) > Add `sha256` DGM > > > Key: GROOVY-8780 > URL: https://issues.apache.org/jira/browse/GROOVY-8780 > Project: Groovy > Issue Type: Improvement >Reporter: Daniel Sun >Assignee: Daniel Sun >Priority: Minor > Fix For: 3.0.0-alpha-4, 2.5.3 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #793: GROOVY-8780: Add `sha256` DGM
Github user danielsun1106 commented on a diff in the pull request: https://github.com/apache/groovy/pull/793#discussion_r216121282 --- Diff: src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java --- @@ -389,6 +390,26 @@ public static String md5(byte[] self) throws NoSuchAlgorithmException { return digest(self, MD5); } +/** + * Calculate SHA-256 of the CharSequence instance + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 + */ +public static String sha256(CharSequence self) throws NoSuchAlgorithmException { +return digest(self, SHA_256); +} + +/** + * Calculate SHA-256 of the byte array + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 --- End diff -- OK. I'll fix it. Thanks ;-) ---
[GitHub] groovy pull request #793: GROOVY-8780: Add `sha256` DGM
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/793#discussion_r216121209 --- Diff: src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java --- @@ -389,6 +390,26 @@ public static String md5(byte[] self) throws NoSuchAlgorithmException { return digest(self, MD5); } +/** + * Calculate SHA-256 of the CharSequence instance + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 --- End diff -- 2.5.3? ---
[jira] [Commented] (GROOVY-8780) Add `sha256` DGM
[ https://issues.apache.org/jira/browse/GROOVY-8780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607909#comment-16607909 ] ASF GitHub Bot commented on GROOVY-8780: Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/793#discussion_r216121214 --- Diff: src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java --- @@ -389,6 +390,26 @@ public static String md5(byte[] self) throws NoSuchAlgorithmException { return digest(self, MD5); } +/** + * Calculate SHA-256 of the CharSequence instance + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 + */ +public static String sha256(CharSequence self) throws NoSuchAlgorithmException { +return digest(self, SHA_256); +} + +/** + * Calculate SHA-256 of the byte array + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 --- End diff -- ditto > Add `sha256` DGM > > > Key: GROOVY-8780 > URL: https://issues.apache.org/jira/browse/GROOVY-8780 > Project: Groovy > Issue Type: Improvement >Reporter: Daniel Sun >Assignee: Daniel Sun >Priority: Minor > Fix For: 3.0.0-alpha-4, 2.5.3 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #793: GROOVY-8780: Add `sha256` DGM
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/793#discussion_r216121214 --- Diff: src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java --- @@ -389,6 +390,26 @@ public static String md5(byte[] self) throws NoSuchAlgorithmException { return digest(self, MD5); } +/** + * Calculate SHA-256 of the CharSequence instance + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 + */ +public static String sha256(CharSequence self) throws NoSuchAlgorithmException { +return digest(self, SHA_256); +} + +/** + * Calculate SHA-256 of the byte array + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 --- End diff -- ditto ---
[jira] [Commented] (GROOVY-8780) Add `sha256` DGM
[ https://issues.apache.org/jira/browse/GROOVY-8780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607908#comment-16607908 ] ASF GitHub Bot commented on GROOVY-8780: Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/793#discussion_r216121209 --- Diff: src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java --- @@ -389,6 +390,26 @@ public static String md5(byte[] self) throws NoSuchAlgorithmException { return digest(self, MD5); } +/** + * Calculate SHA-256 of the CharSequence instance + * @return SHA-256 value + * @throws NoSuchAlgorithmException if SHA-256 algorithm not found + * @since 2.5.0 --- End diff -- 2.5.3? > Add `sha256` DGM > > > Key: GROOVY-8780 > URL: https://issues.apache.org/jira/browse/GROOVY-8780 > Project: Groovy > Issue Type: Improvement >Reporter: Daniel Sun >Assignee: Daniel Sun >Priority: Minor > Fix For: 3.0.0-alpha-4, 2.5.3 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-8780) Add `sha256` DGM
[ https://issues.apache.org/jira/browse/GROOVY-8780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607902#comment-16607902 ] ASF GitHub Bot commented on GROOVY-8780: GitHub user danielsun1106 opened a pull request: https://github.com/apache/groovy/pull/793 GROOVY-8780: Add `sha256` DGM You can merge this pull request into a Git repository by running: $ git pull https://github.com/danielsun1106/groovy more-digest Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/793.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 #793 commit c6a8a1ecbd82a83aeffb8502afed19ba5dcfc0cf Author: danielsun1106 Date: 2018-09-08T04:15:43Z GROOVY-8780: Add `sha256` DGM > Add `sha256` DGM > > > Key: GROOVY-8780 > URL: https://issues.apache.org/jira/browse/GROOVY-8780 > Project: Groovy > Issue Type: Improvement >Reporter: Daniel Sun >Assignee: Daniel Sun >Priority: Minor > Fix For: 3.0.0-alpha-4, 2.5.3 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #793: GROOVY-8780: Add `sha256` DGM
GitHub user danielsun1106 opened a pull request: https://github.com/apache/groovy/pull/793 GROOVY-8780: Add `sha256` DGM You can merge this pull request into a Git repository by running: $ git pull https://github.com/danielsun1106/groovy more-digest Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/793.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 #793 commit c6a8a1ecbd82a83aeffb8502afed19ba5dcfc0cf Author: danielsun1106 Date: 2018-09-08T04:15:43Z GROOVY-8780: Add `sha256` DGM ---
[jira] [Created] (GROOVY-8780) Add `sha256` DGM
Daniel Sun created GROOVY-8780: -- Summary: Add `sha256` DGM Key: GROOVY-8780 URL: https://issues.apache.org/jira/browse/GROOVY-8780 Project: Groovy Issue Type: Improvement Reporter: Daniel Sun Assignee: Daniel Sun Fix For: 3.0.0-alpha-4, 2.5.3 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-8778) Cast short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607876#comment-16607876 ] ASF GitHub Bot commented on GROOVY-8778: Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/792#discussion_r216118264 --- Diff: subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java --- @@ -2337,14 +2337,11 @@ public Expression visitPathElement(PathElementContext ctx) { this.visitNamedPropertyArgs(ctx.namedPropertyArgs()); Expression right; -if (mapEntryExpressionList.size() == 1) { -MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0); - -if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) { -right = mapEntryExpression.getKeyExpression(); -} else { -right = mapEntryExpression; -} +if (mapEntryExpressionList.size() == 0) { +// expecting list of MapEntryExpressions later so use SpreadMap to smuggle empty MapExpression to later stages +right = new SpreadMapExpression(configureAST(new MapExpression(), ctx.namedPropertyArgs())); --- End diff -- Yes, you are right - if we ever do support getAt(Map) more generally, we would need to process that differently, so best it is correct to start with. > Cast short-hand breaks for empty map > > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Bug >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #792: GROOVY-8778: Cast short-hand breaks for empty map
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/792#discussion_r216118264 --- Diff: subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java --- @@ -2337,14 +2337,11 @@ public Expression visitPathElement(PathElementContext ctx) { this.visitNamedPropertyArgs(ctx.namedPropertyArgs()); Expression right; -if (mapEntryExpressionList.size() == 1) { -MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0); - -if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) { -right = mapEntryExpression.getKeyExpression(); -} else { -right = mapEntryExpression; -} +if (mapEntryExpressionList.size() == 0) { +// expecting list of MapEntryExpressions later so use SpreadMap to smuggle empty MapExpression to later stages +right = new SpreadMapExpression(configureAST(new MapExpression(), ctx.namedPropertyArgs())); --- End diff -- Yes, you are right - if we ever do support getAt(Map) more generally, we would need to process that differently, so best it is correct to start with. ---
[jira] [Commented] (GROOVY-8778) Cast short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607856#comment-16607856 ] ASF GitHub Bot commented on GROOVY-8778: Github user danielsun1106 commented on a diff in the pull request: https://github.com/apache/groovy/pull/792#discussion_r216116090 --- Diff: subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java --- @@ -2337,14 +2337,11 @@ public Expression visitPathElement(PathElementContext ctx) { this.visitNamedPropertyArgs(ctx.namedPropertyArgs()); Expression right; -if (mapEntryExpressionList.size() == 1) { -MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0); - -if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) { -right = mapEntryExpression.getKeyExpression(); -} else { -right = mapEntryExpression; -} +if (mapEntryExpressionList.size() == 0) { +// expecting list of MapEntryExpressions later so use SpreadMap to smuggle empty MapExpression to later stages +right = new SpreadMapExpression(configureAST(new MapExpression(), ctx.namedPropertyArgs())); --- End diff -- The implementation of parser should not decouple with back end(i.e. not rely on the implementation of back end). If the implementation of resolve visitor changes in the future, the expression is not thrown away, the node position is missing. > Cast short-hand breaks for empty map > > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Bug >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #792: GROOVY-8778: Cast short-hand breaks for empty map
Github user danielsun1106 commented on a diff in the pull request: https://github.com/apache/groovy/pull/792#discussion_r216116090 --- Diff: subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java --- @@ -2337,14 +2337,11 @@ public Expression visitPathElement(PathElementContext ctx) { this.visitNamedPropertyArgs(ctx.namedPropertyArgs()); Expression right; -if (mapEntryExpressionList.size() == 1) { -MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0); - -if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) { -right = mapEntryExpression.getKeyExpression(); -} else { -right = mapEntryExpression; -} +if (mapEntryExpressionList.size() == 0) { +// expecting list of MapEntryExpressions later so use SpreadMap to smuggle empty MapExpression to later stages +right = new SpreadMapExpression(configureAST(new MapExpression(), ctx.namedPropertyArgs())); --- End diff -- The implementation of parser should not decouple with back end(i.e. not rely on the implementation of back end). If the implementation of resolve visitor changes in the future, the expression is not thrown away, the node position is missing. ---
[GitHub] groovy pull request #792: GROOVY-8778: Cast short-hand breaks for empty map
Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/792#discussion_r216115626 --- Diff: subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java --- @@ -2337,14 +2337,11 @@ public Expression visitPathElement(PathElementContext ctx) { this.visitNamedPropertyArgs(ctx.namedPropertyArgs()); Expression right; -if (mapEntryExpressionList.size() == 1) { -MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0); - -if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) { -right = mapEntryExpression.getKeyExpression(); -} else { -right = mapEntryExpression; -} +if (mapEntryExpressionList.size() == 0) { +// expecting list of MapEntryExpressions later so use SpreadMap to smuggle empty MapExpression to later stages +right = new SpreadMapExpression(configureAST(new MapExpression(), ctx.namedPropertyArgs())); --- End diff -- I had that originally but we throw that expression away in resolve visitor. ---
[jira] [Commented] (GROOVY-8778) Cast short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607840#comment-16607840 ] ASF GitHub Bot commented on GROOVY-8778: Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/792#discussion_r216115626 --- Diff: subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java --- @@ -2337,14 +2337,11 @@ public Expression visitPathElement(PathElementContext ctx) { this.visitNamedPropertyArgs(ctx.namedPropertyArgs()); Expression right; -if (mapEntryExpressionList.size() == 1) { -MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0); - -if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) { -right = mapEntryExpression.getKeyExpression(); -} else { -right = mapEntryExpression; -} +if (mapEntryExpressionList.size() == 0) { +// expecting list of MapEntryExpressions later so use SpreadMap to smuggle empty MapExpression to later stages +right = new SpreadMapExpression(configureAST(new MapExpression(), ctx.namedPropertyArgs())); --- End diff -- I had that originally but we throw that expression away in resolve visitor. > Cast short-hand breaks for empty map > > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Bug >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-8778) Cast short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607812#comment-16607812 ] ASF GitHub Bot commented on GROOVY-8778: Github user danielsun1106 commented on a diff in the pull request: https://github.com/apache/groovy/pull/792#discussion_r216113948 --- Diff: subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java --- @@ -2337,14 +2337,11 @@ public Expression visitPathElement(PathElementContext ctx) { this.visitNamedPropertyArgs(ctx.namedPropertyArgs()); Expression right; -if (mapEntryExpressionList.size() == 1) { -MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0); - -if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) { -right = mapEntryExpression.getKeyExpression(); -} else { -right = mapEntryExpression; -} +if (mapEntryExpressionList.size() == 0) { +// expecting list of MapEntryExpressions later so use SpreadMap to smuggle empty MapExpression to later stages +right = new SpreadMapExpression(configureAST(new MapExpression(), ctx.namedPropertyArgs())); --- End diff -- It's better to `configureAST` the instance of `SpreadMapExpression` too, or its node position will be missing. > Cast short-hand breaks for empty map > > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Bug >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #792: GROOVY-8778: Cast short-hand breaks for empty map
Github user danielsun1106 commented on a diff in the pull request: https://github.com/apache/groovy/pull/792#discussion_r216113948 --- Diff: subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java --- @@ -2337,14 +2337,11 @@ public Expression visitPathElement(PathElementContext ctx) { this.visitNamedPropertyArgs(ctx.namedPropertyArgs()); Expression right; -if (mapEntryExpressionList.size() == 1) { -MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0); - -if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) { -right = mapEntryExpression.getKeyExpression(); -} else { -right = mapEntryExpression; -} +if (mapEntryExpressionList.size() == 0) { +// expecting list of MapEntryExpressions later so use SpreadMap to smuggle empty MapExpression to later stages +right = new SpreadMapExpression(configureAST(new MapExpression(), ctx.namedPropertyArgs())); --- End diff -- It's better to `configureAST` the instance of `SpreadMapExpression` too, or its node position will be missing. ---
[jira] [Commented] (GROOVY-8778) Cast short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607810#comment-16607810 ] ASF GitHub Bot commented on GROOVY-8778: GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/792 GROOVY-8778: Cast short-hand breaks for empty map You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8778 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/792.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 #792 commit 921fbda4568592691fcda60919a90f93caf39135 Author: Paul King Date: 2018-09-08T00:22:37Z GROOVY-8778: Cast short-hand breaks for empty map > Cast short-hand breaks for empty map > > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Bug >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #792: GROOVY-8778: Cast short-hand breaks for empty map
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/792 GROOVY-8778: Cast short-hand breaks for empty map You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8778 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/792.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 #792 commit 921fbda4568592691fcda60919a90f93caf39135 Author: Paul King Date: 2018-09-08T00:22:37Z GROOVY-8778: Cast short-hand breaks for empty map ---
[jira] [Updated] (GROOVY-8778) Cast short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King updated GROOVY-8778: -- Summary: Cast short-hand breaks for empty map (was: Constructor short-hand breaks for empty map) > Cast short-hand breaks for empty map > > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Bug >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-8778) Constructor short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King updated GROOVY-8778: -- Issue Type: Bug (was: Dependency upgrade) > Constructor short-hand breaks for empty map > --- > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Bug >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-8777) @MapConstructor with @CompileStatic: Creating inner class instance => IncompatibleClassChangeError ... does not implement the requested interface java.util.Map
[ https://issues.apache.org/jira/browse/GROOVY-8777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King updated GROOVY-8777: -- Summary: @MapConstructor with @CompileStatic: Creating inner class instance => IncompatibleClassChangeError ... does not implement the requested interface java.util.Map (was: @MapConstructor: Creating inner class instance => IncompatibleClassChangeError ... does not implement the requested interface java.util.Map) > @MapConstructor with @CompileStatic: Creating inner class instance => > IncompatibleClassChangeError ... does not implement the requested interface > java.util.Map > --- > > Key: GROOVY-8777 > URL: https://issues.apache.org/jira/browse/GROOVY-8777 > Project: Groovy > Issue Type: Bug > Components: Compiler >Affects Versions: 2.5.2 >Reporter: mgroovy >Priority: Minor > > {code:java} > import groovy.transform.CompileStatic > import groovy.transform.MapConstructor > @CompileStatic // static bug only > class GroovyMapConstructorCheck { > @MapConstructor(noArg = true) > class Goo { > final int x0 > @Override > public String toString() { > return "Goo(|$x0|)" > } > } > void go() { > println new Goo(x0:123) > } > } > final check = new GroovyMapConstructorCheck() > check.go() > {code} > throws > {quote} > java.lang.IncompatibleClassChangeError: Class GroovyMapConstructorCheck does > not implement the requested interface java.util.Map > at GroovyMapConstructorCheck$Goo.(VerifyError - Bad type on > operand stack 2 v1.groovy) > at GroovyMapConstructorCheck.go(VerifyError - Bad type on operand stack > 2 v1.groovy:18) > at GroovyMapConstructorCheck$go.call(Unknown Source) > at VerifyError_-_Bad_type_on_operand_stack_2_v1.run(VerifyError - Bad > type on operand stack 2 v1.groovy:23) > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-7165) Static Compilation: private static field accessed from a Closure produces a runtime error
[ https://issues.apache.org/jira/browse/GROOVY-7165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607793#comment-16607793 ] Daniel Sun commented on GROOVY-7165: We should forbidden accessing `private` members from other classes. {code:java} class Base { private static final String CONST = 'const' } class C extends Base { static main(args) { println Base.CONST // I expect some error here println CONST // throws MissingPropertyException } } {code} > Static Compilation: private static field accessed from a Closure produces a > runtime error > - > > Key: GROOVY-7165 > URL: https://issues.apache.org/jira/browse/GROOVY-7165 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.3.7 >Reporter: Neil Galarneau >Priority: Major > > The following code compiles cleanly but throws an exception at runtime. > This code doesn't have a stack trace. The code I simplified this from, did > have a stack trace. > If I remove 'private' from staticfield, then it works: > {code} > @CompileStatic > class TestPrivateStaticFieldInClosure extends BaseBug > { > public static void main(String[] args) > { > (new TestPrivateStaticFieldInClosure()).show() > } > } > @CompileStatic > class BaseBug > { > private static ArrayList staticfield = new ArrayList<>() > void show() > { > List, String>> runners = new ArrayList<>() > runners.add(new Called()) > List cmds = ["hello"] > runners.each { cmds.addAll(it.apply(staticfield)) } > println cmds.size() > } > class Called implements Function, String> > { > @Override > String apply(List strings) { > "groovin" > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-7165) Static Compilation: private static field accessed from a Closure produces a runtime error
[ https://issues.apache.org/jira/browse/GROOVY-7165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607518#comment-16607518 ] Eric Milles commented on GROOVY-7165: - I have seen the same with static final fields. Strangely, the implicit-this case fails but the class expression qualifier works just fine. So it is not that Groovy says no to accessing private members. It just is failing to resolve to super types for private static fields. {code:groovy} class Base { private static final String CONST = 'const' } class C extends Base { static main(args) { println Base.CONST // works println CONST // throws MissingPropertyException } } {code} > Static Compilation: private static field accessed from a Closure produces a > runtime error > - > > Key: GROOVY-7165 > URL: https://issues.apache.org/jira/browse/GROOVY-7165 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.3.7 >Reporter: Neil Galarneau >Priority: Major > > The following code compiles cleanly but throws an exception at runtime. > This code doesn't have a stack trace. The code I simplified this from, did > have a stack trace. > If I remove 'private' from staticfield, then it works: > {code} > @CompileStatic > class TestPrivateStaticFieldInClosure extends BaseBug > { > public static void main(String[] args) > { > (new TestPrivateStaticFieldInClosure()).show() > } > } > @CompileStatic > class BaseBug > { > private static ArrayList staticfield = new ArrayList<>() > void show() > { > List, String>> runners = new ArrayList<>() > runners.add(new Called()) > List cmds = ["hello"] > runners.each { cmds.addAll(it.apply(staticfield)) } > println cmds.size() > } > class Called implements Function, String> > { > @Override > String apply(List strings) { > "groovin" > } > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-8602) Safe index doesn't work with map arguments
[ https://issues.apache.org/jira/browse/GROOVY-8602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16607400#comment-16607400 ] Daniil Ovchinnikov commented on GROOVY-8602: Sounds fair to me. > Safe index doesn't work with map arguments > -- > > Key: GROOVY-8602 > URL: https://issues.apache.org/jira/browse/GROOVY-8602 > Project: Groovy > Issue Type: Bug >Affects Versions: 3.0.0-alpha-2 >Reporter: Daniil Ovchinnikov >Priority: Minor > > {{a[b:2]}} works. > {{a?[b:2]}} produces {{Unexpected input: ''; Expecting ':' @ ...}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-8779) Groovy 2.5.2 triggers a bug in IntelliJ IDEA
[ https://issues.apache.org/jira/browse/GROOVY-8779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henrik updated GROOVY-8779: --- Description: I have a Java 10.0.2 / Groovy 2.5.1 project in IntelliJ IDEA 2018.2.3. If I upgrade it to 2.5.2, it is not able to build the project anymore. It fails with: {code:java} Error:Groovyc: While compiling shared-test-helpers: BUG! exception in phase 'class generation' in source unit '/Users/me/myproject/shared/test-helpers/src/main/java/me/shared/test/helpers/pages/PageSnapshot.groovy' Bytecode version [10] is not supported by the compiler at org.codehaus.groovy.classgen.asm.WriterController.chooseBytecodeVersion(WriterController.java:169) at org.codehaus.groovy.classgen.asm.WriterController.init(WriterController.java:98) at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:210) at org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:850) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:631) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:609) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:586) at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62) at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:118) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:91) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:160) at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.lambda$runGroovyc$0(InProcessGroovyc.java:89) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844){code} was: I have a Java/Groovy project in IntelliJ IDEA 2018.2.3 with Groovy 2.5.1. If I upgrade it to 2.5.2, it is not able to build the project anymore. It fails with: {code:java} Error:Groovyc: While compiling shared-test-helpers: BUG! exception in phase 'class generation' in source unit '/Users/me/myproject/shared/test-helpers/src/main/java/me/shared/test/helpers/pages/PageSnapshot.groovy' Bytecode version [10] is not supported by the compiler at org.codehaus.groovy.classgen.asm.WriterController.chooseBytecodeVersion(WriterController.java:169) at org.codehaus.groovy.classgen.asm.WriterController.init(WriterController.java:98) at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:210) at org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:850) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:631) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:609) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:586) at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62) at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:118) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:91) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
[jira] [Created] (GROOVY-8779) Groovy 2.5.2 triggers a bug in IntelliJ IDEA
Henrik created GROOVY-8779: -- Summary: Groovy 2.5.2 triggers a bug in IntelliJ IDEA Key: GROOVY-8779 URL: https://issues.apache.org/jira/browse/GROOVY-8779 Project: Groovy Issue Type: Bug Affects Versions: 2.5.2 Environment: Mac OSX High SIerra Reporter: Henrik I have a Java/Groovy project in IntelliJ IDEA 2018.2.3 with Groovy 2.5.1. If I upgrade it to 2.5.2, it is not able to build the project anymore. It fails with: {code:java} Error:Groovyc: While compiling shared-test-helpers: BUG! exception in phase 'class generation' in source unit '/Users/me/myproject/shared/test-helpers/src/main/java/me/shared/test/helpers/pages/PageSnapshot.groovy' Bytecode version [10] is not supported by the compiler at org.codehaus.groovy.classgen.asm.WriterController.chooseBytecodeVersion(WriterController.java:169) at org.codehaus.groovy.classgen.asm.WriterController.init(WriterController.java:98) at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:210) at org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:850) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:631) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:609) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:586) at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62) at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:118) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:91) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:160) at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.lambda$runGroovyc$0(InProcessGroovyc.java:89) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844){code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #:
Github user PascalSchumacher commented on the pull request: https://github.com/apache/groovy/commit/a7ebe87b8cb4ff7ce220a13af96788118d316006#commitcomment-30427718 In subprojects/groovy-test-junit5/build.gradle: In subprojects/groovy-test-junit5/build.gradle on line 28: Great! Thanks! ---
[jira] [Updated] (GROOVY-8778) Constructor short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King updated GROOVY-8778: -- Labels: breaking (was: ) > Constructor short-hand breaks for empty map > --- > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Dependency upgrade >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-8778) Constructor short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King updated GROOVY-8778: -- Description: We support: {code} println Date[time:0] def map = [time:0] println Date[*:map] map = [:] println Date[*:map] {code} but not: {code} println Date[:] {code} This is a breaking change since we currently support printing an empty map without brackets but would require them after this change: {code} println [:] {code} would need to be: {code} println([:]) {code} But we require the brackets for lists (empty and non-empty) and non-empty maps already. was: We support: {code} println Date[time:0] def map = [time:0] println Date[*:map] map = [:] println Date[*:map] {code} but not: {code} println Date[:] {code} This is a breaking change since we currently support printing an empty map without brackets but would require them after this change: {code} println [:] {code} would need to be: {code} println [:] {code} But we require the brackets for lists (empty and non-empty) and non-empty maps already. > Constructor short-hand breaks for empty map > --- > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Dependency upgrade >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-8778) Constructor short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King updated GROOVY-8778: -- Affects Version/s: 3.0.0-alpha-3 > Constructor short-hand breaks for empty map > --- > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Dependency upgrade >Affects Versions: 3.0.0-alpha-3 >Reporter: Paul King >Assignee: Paul King >Priority: Major > Labels: breaking > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println([:]) > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-8778) Constructor short-hand breaks for empty map
[ https://issues.apache.org/jira/browse/GROOVY-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King updated GROOVY-8778: -- Description: We support: {code} println Date[time:0] def map = [time:0] println Date[*:map] map = [:] println Date[*:map] {code} but not: {code} println Date[:] {code} This is a breaking change since we currently support printing an empty map without brackets but would require them after this change: {code} println [:] {code} would need to be: {code} println [:] {code} But we require the brackets for lists (empty and non-empty) and non-empty maps already. was: We support: {code} println Date[time:0] def map = [time:0] println Date[*:map] map = [:] println Date[*:map] {code} but not: {code} println Date[:] {code} > Constructor short-hand breaks for empty map > --- > > Key: GROOVY-8778 > URL: https://issues.apache.org/jira/browse/GROOVY-8778 > Project: Groovy > Issue Type: Dependency upgrade >Reporter: Paul King >Assignee: Paul King >Priority: Major > > We support: > {code} > println Date[time:0] > def map = [time:0] > println Date[*:map] > map = [:] > println Date[*:map] > {code} > but not: > {code} > println Date[:] > {code} > This is a breaking change since we currently support printing an empty map > without brackets but would require them after this change: > {code} > println [:] > {code} > would need to be: > {code} > println [:] > {code} > But we require the brackets for lists (empty and non-empty) and non-empty > maps already. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (GROOVY-8778) Constructor short-hand breaks for empty map
Paul King created GROOVY-8778: - Summary: Constructor short-hand breaks for empty map Key: GROOVY-8778 URL: https://issues.apache.org/jira/browse/GROOVY-8778 Project: Groovy Issue Type: Dependency upgrade Reporter: Paul King Assignee: Paul King We support: {code} println Date[time:0] def map = [time:0] println Date[*:map] map = [:] println Date[*:map] {code} but not: {code} println Date[:] {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #:
Github user paulk-asert commented on the pull request: https://github.com/apache/groovy/commit/a7ebe87b8cb4ff7ce220a13af96788118d316006#commitcomment-30427238 In subprojects/groovy-test-junit5/build.gradle: In subprojects/groovy-test-junit5/build.gradle on line 28: Thanks Pascal, great to hear from you. Yes, when I checked previously the platform dependency hadn't made it to maven central but it's there now. I'll fix. ---