-
Bug
-
Resolution: Fixed
-
P4
-
1.0.2, 1.1
-
1.1fcs
-
sparc
-
solaris_2.5
-
Not verified
Name: laC46010 Date: 10/14/96
The section "8.3.1.4 volatile Fields" of The Java Language Specification requires:
"A compile-time error occurs if a final variable is also declared volatile. "
However compilers (both 1.0.2 and 1.1) don't report anything:
> javac -d . clss09001.java
> ja11 -verify javasoft.sqe.tests.lang.clss090.clss09001.clss09001
Passed.
>
--------------------------clss09001.java------------------------------
// Ident: %Z%%M% %I% %E%
// Copyright %G% Sun Microsystems, Inc. All Rights Reserved
package javasoft.sqe.tests.lang.clss090.clss09001;
import java.io.PrintStream;
class clss09001 {
volatile final int var = 9001;
public static void main(String argv[])
{
System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
}
public static int run(String argv[],PrintStream out) {
clss09001 x = new clss09001();
if (x.var == 9001) {
out.println("Passed.");
return(0/*STATUS_PASS*/);
} else {
out.println("Failed.");
return(2/*STATUS_FAILED*/);
}
}
}
-----------------------------------------------------------------
======================================================================