jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-484

parser error with static initializer

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0-JSR-5
  • Component/s: parser
  • Labels:
    None

Description

static_init:
class A {
static foo
static bar
static { foo = "FOO" bar = "BAR" }
}

$ groovyc static_init
>>> a serious error occurred: found unexpected token during REDUCE [804]
>>> stacktrace:
found unexpected token during REDUCE [804]
at org.codehaus.groovy.syntax.parser.Parser.expression(Parser.java:3009)
at org.codehaus.groovy.syntax.parser.Parser.propertyDeclaration(Parser.java:1125)
at org.codehaus.groovy.syntax.parser.Parser.typeBodyStatement(Parser.java:955)
at org.codehaus.groovy.syntax.parser.Parser.typeBody(Parser.java:804)
at org.codehaus.groovy.syntax.parser.Parser.classDeclaration(Parser.java:644)
at org.codehaus.groovy.syntax.parser.Parser.topLevelStatement(Parser.java:506)
at org.codehaus.groovy.syntax.parser.Parser.module(Parser.java:299)
at org.codehaus.groovy.syntax.parser.Parser.parse(Parser.java:103)
at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:288)
at org.codehaus.groovy.control.CompilationUnit$3.call(CompilationUnit.java:528)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:872)
at org.codehaus.groovy.control.CompilationUnit.parse(CompilationUnit.java:513)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:475)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:452)
at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:72)
at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:211)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

Issue Links

is depended upon by

Task - A task that needs to be done. GROOVY-753 complete parser

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Chris Poirier added a comment - 19/May/04 3:43 PM

For some reason, the "static {" isn't being handled by the code that is supposed to handle it.... I'll look into it and get it fixed.

Show
Chris Poirier added a comment - 19/May/04 3:43 PM For some reason, the "static {" isn't being handled by the code that is supposed to handle it.... I'll look into it and get it fixed.
Hide
Permalink
blackdrag blackdrag added a comment - 26/Jan/06 6:24 PM

now fixed. Any static initializer block is executed after the initlialization of static variables

Show
blackdrag blackdrag added a comment - 26/Jan/06 6:24 PM now fixed. Any static initializer block is executed after the initlialization of static variables

People

  • Assignee:
    blackdrag blackdrag
    Reporter:
    Michael Ivey
Vote (1)
Watch (1)

Dates

  • Created:
    18/May/04 4:06 PM
    Updated:
    26/Jan/06 6:24 PM
    Resolved:
    26/Jan/06 6:24 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.