21 lines
568 B
Plaintext
21 lines
568 B
Plaintext
As of Java 5, "assert" is a keyword. By default, using the word as an identifier generates a compilation error, and backward compatibility must be activated with "-source=1.4" to compile such pieces of code. Eventually this backward compatibility mode will be dropped.
|
|
|
|
|
|
The following code snippet illustrates this rule:
|
|
|
|
----
|
|
public void doSomething(){
|
|
int assert = 4; // Non-Compliant
|
|
...
|
|
}
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|