FULL PRODUCT VERSION :
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Attempting to assign a value to "this" produces an error message that refers "to final variable this". However, "this" is a Java keyword (??15.8.3) and not a variable at all. In particular, it does not fit the description of any of the seven kinds of variables specified in ??4.12.3 of the spec.
The error message should be changed to refer to "keyword this" instead of "final variable this".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile any code that attempts to assign a value to "this".
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would expect to see an error message something like:
Test.java:4: error: cannot assign a value to keyword this
this = null;
^
ACTUAL -
Received a poorly worded error message.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Test.java:4: error: cannot assign a value to final variable this
this = null;
^
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Test
{
void test() {
this = null;
}
}
---------- END SOURCE ----------
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Attempting to assign a value to "this" produces an error message that refers "to final variable this". However, "this" is a Java keyword (??15.8.3) and not a variable at all. In particular, it does not fit the description of any of the seven kinds of variables specified in ??4.12.3 of the spec.
The error message should be changed to refer to "keyword this" instead of "final variable this".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile any code that attempts to assign a value to "this".
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would expect to see an error message something like:
Test.java:4: error: cannot assign a value to keyword this
this = null;
^
ACTUAL -
Received a poorly worded error message.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Test.java:4: error: cannot assign a value to final variable this
this = null;
^
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Test
{
void test() {
this = null;
}
}
---------- END SOURCE ----------