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

final modifier ignored in scripts

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.0-JSR-6
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    JSR-6, JDK1.5, Windows XP

Description

The simple script:

println "Hello World"
final foo = "Foo is final"
println foo
foo = "Yet foo has changed"
println foo

outputs:
Hello World
Foo is final
Yet foo has changed

groovy should error when the final variable foo is re-assigned

Issue Links

duplicates

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

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Andres Almiray added a comment - 27/Nov/07 12:13 AM

I'm not sure if this is a bug or not as 'foo' is a variable in the Binding so the final modifier is not applied. But if the final keyword is used with a class property then it will work as expected.

If final should work at script level, should static and access modifiers too?

Show
Andres Almiray added a comment - 27/Nov/07 12:13 AM I'm not sure if this is a bug or not as 'foo' is a variable in the Binding so the final modifier is not applied. But if the final keyword is used with a class property then it will work as expected. If final should work at script level, should static and access modifiers too?
Hide
Permalink
Paul King added a comment - 14/Apr/08 7:52 PM

closing dup

Show
Paul King added a comment - 14/Apr/08 7:52 PM closing dup

People

  • Assignee:
    Unassigned
    Reporter:
    Alasdair MacLeod
Vote (1)
Watch (0)

Dates

  • Created:
    11/Jul/06 2:16 PM
    Updated:
    17/Apr/08 7:27 AM
    Resolved:
    14/Apr/08 7:52 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.