groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain Stalder <astal...@span.ch>
Subject Groovy 2.5 SNAPSHOT and final local variables
Date Sun, 05 Mar 2017 13:16:04 GMT
Not sure if this is the right/best place to report this, but I got this 
with the current head of the master branch of 
https://github.com/apache/groovy.git (ec3179a455):

--
final File file = new File('whatever')
final List<String> lines
try {
   lines = file.readLines()
} catch (IOException e) {
   return null
}
--

=>

1 compilation error:

The variable [lines] may be uninitialized
. At [2:20]  at line: 2, column: 20

--
final File file = new File('whatever')
final List<String> lines
try {
   lines = file.readLines()
} catch (IOException e) {
   lines = null
}
--

=>

1 compilation error:

The variable [lines] is declared final but is reassigned
. At [6:3]  at line: 6, column: 3



Mime
View raw message