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-3088

Modifiers on local variables are ignored

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.6-beta-2
  • Fix Version/s: 1.8.1
  • Component/s: ast builder
  • Labels:
    None
  • Testcase included:
    yes

Description

In Java, at least, the only modifier allowed on local variables is "final." Groovy seems to accept and ignore all modifiers, final or otherwise. For example:

class Foo {
def bar() { volatile String xxx println xxx }
}

Compiles just fine.

So there are really two issues here: (a) "final" semantics not being represented and enforced, and (b) all other modifiers not generating parse errors.

For (a), the DeclarationExpression doesn't seem to have a place to hold modifiers; perhaps it should have an isFinal field?

Issue Links

is related to

Sub-task - The sub-task of the issue GROOVY-1628 Inconsistent checking of final

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.
relates to

Sub-task - The sub-task of the issue GROOVY-1628 Inconsistent checking of final

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Paul King added a comment - 16/Jul/11 6:13 AM

now only final is permitted

Show
Paul King added a comment - 16/Jul/11 6:13 AM now only final is permitted

People

  • Assignee:
    Paul King
    Reporter:
    Martin C. Martin
Vote (0)
Watch (0)

Dates

  • Created:
    13/Oct/08 12:32 PM
    Updated:
    21/Jul/11 7:06 PM
    Resolved:
    16/Jul/11 6:13 AM
  • 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.