Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.0-beta-5
-
None
-
JDK 1.4 and 1.5
Description
Running the attached script dies with with the following stack trace. It works if I remove "f.eachLine()" and the following closure...
Exception in thread "main" java.lang.VerifyError: (class: perry$3, method: doCal
l signature: (Ljava/lang/Object;)Ljava/lang/Object Inconsistent stack height 1
!= 0
at perry.run(perry.groovy:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[snip]
–
Cédric
http://beust.com/weblog
import java.io.File
import java.util.regex.*
dir = new File("d:/public_html/cedric/perry/endless-armada")
out = new File("d:/t/endless-armada")
for (i in 1100..1103) {
print "${i} =====\n"
n = 2
prev = true
f = new File(dir, "${i}.html")
f.eachLine { line |
newLine = ""
p = Pattern.compile("11@")
m = p.matcher(line)
if (line =~ "11@") {
if (prev)
else
{ newLine = m.replaceAll(new Integer(i + 1).toString()) } prev = ! prev
print newLine + "\n"
}
}
}
Attachments
Attachments
Issue Links
- is duplicated by
-
GROOVY-293 Exception thrown when assigning value to variable outside closure
- Closed