Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 143466 - Language change: Variable declarations
Language change: Variable declarations
Product: javafx
Classification: Unclassified
Component: Editor
All All
: P1 (vote)
: 6.x
Assigned To: David Strupl
: 144394 (view as bug list)
Depends on:
Blocks: 130138
  Show dependency treegraph
Reported: 2008-08-11 14:04 UTC by David Strupl
Modified: 2008-09-19 10:06 UTC (History)
0 users

See Also:
Issue Type: TASK


Note You need to log in before you can comment on or make changes to this bug.
Description David Strupl 2008-08-11 14:04:34 UTC
The keywords "var" and "def" are used for declaring variables everywhere; the keywords "attribute" and "static" are
going away.  Variables declared inside a class are what used to be called attributes; variables defined at script level
are what used to be called statics; variables inside code blocks are local variables.  "Def" can be used wherever "var"
can, and it is an error to subsequently assign a value to a variable defined with "def".  Defs may be bound (which means
they are not truly constant.)  Status: var and def are valid anywhere, no warning yet for using "attribute" instead of
var, warning for using "static".  Static attributes should be turned into top-level vars or defs.
Comment 1 David Strupl 2008-08-19 09:07:03 UTC
The code completion must be updated to suggest proper keywords.
Comment 2 David Strupl 2008-08-19 14:19:28 UTC
*** Issue 144394 has been marked as a duplicate of this issue. ***
Comment 3 David Strupl 2008-09-08 13:10:52 UTC
After this revision
we should suggest var and def. The rest will be tracked as bugs.
Comment 4 Alexandr Scherbatiy 2008-09-19 10:06:43 UTC
verified in

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo