[ 
https://issues.apache.org/jira/browse/GROOVY-8571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481239#comment-16481239
 ] 

paolo di tommaso commented on GROOVY-8571:
------------------------------------------

I see, but why the above code would fail? The first time the x is declared but 
*not* assigned. Therefore it should be fine to have `x = 'foo'` in the 
following line. 

> Variable [XXX] is declared final but is reassigned false positive error
> -----------------------------------------------------------------------
>
>                 Key: GROOVY-8571
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8571
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.0-rc-2
>            Reporter: paolo di tommaso
>            Priority: Major
>
> Groovy version 2.5.0-rc-2 may report false positive final variable 
> reassignment compilation errors. 
> For example: 
> {code}
> MailerTest.groovy: -1: The variable [PORT] is declared final but is reassigned
> {code}
> The source code is available at [this 
> link|https://github.com/nextflow-io/nextflow/blob/90f8dcc5d413af06a76e8f7b3e37c5616f721024/src/test/groovy/nextflow/mail/MailerTest.groovy#L120].
>  
> To replicate the issue follow these steps 
> {code}
> git clone https://github.com/nextflow-io/nextflow.git
> cd nextflow
> CI_GROOVY_VERSION=2.5.0-rc-2 make clean compile test
> {code} 
> Curiously, the CI server build is [reporting a slight version of the same 
> issue|http://ci.groovy-lang.org/viewLog.html?buildId=49488&tab=buildResultsDiv&buildTypeId=JointBuilds_Nextflow_Groovy25xJointBuild#]
>  including sometimes the correct line number instead of -1.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to