[ https://issues.apache.org/jira/browse/GROOVY-9661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Sun resolved GROOVY-9661. -------------------------------- Fix Version/s: 3.0.6 4.0.0-alpha-1 Assignee: Paul King Resolution: Fixed The proposed PR is merged. Thanks! > Since Groovy 3 ArrayExpression#sizeExpression can suddenly return null > ---------------------------------------------------------------------- > > Key: GROOVY-9661 > URL: https://issues.apache.org/jira/browse/GROOVY-9661 > Project: Groovy > Issue Type: Bug > Affects Versions: 3.0.5 > Reporter: Björn Kautler > Assignee: Paul King > Priority: Major > Fix For: 4.0.0-alpha-1, 3.0.6 > > Time Spent: 0.5h > Remaining Estimate: 0h > > Before Groovy 3, {{ArrayExpression#sizeExpression}} never was {{null}}, > because you could only write {{new Object[0][1]}}, but {{new Object[] \{ 1, 2 > }}} was not valid syntax. > Now with Groovy 3 both syntaxes are valid. > In the former case you get for {{expressions}} an empty list and for > {{sizeExpression}} a list with the two size expressions. > In the latter case you get for {{expressions}} a list with the two member > expressions and for {{sizeExpression}} you get {{null}}. > This is somewhat unexpected and inconsistent. > Some code (Spock currently does unless > [https://github.com/spockframework/spock/pull/1203/files] gets merged) might > assume {{sizeExpression}} is always non-{{null}} as it always was. > I asked Paul and he said this should probably be fixed on Groovy side to also > provide an empty list here, so here is the according issue. :) -- This message was sent by Atlassian Jira (v8.3.4#803005)