-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b03
-
generic
-
generic
-
Not verified
Interface PrivilegedAction and PrivilegedExceptionAction has been changed to use template:
public interface PrivilegedAction<T> {
T run();
}
public interface PrivilegedExceptionAction<T> {
T run();
}
However, some of our document still use the old style codes like:
FileInputStream fis = (FileInputStream) AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public Object run() throws FileNotFoundException {
return new FileInputStream("someFile");
}
}
);
The old style codes will cause compiling unchecked conversion warnings. I think the java security sample codes should use the template style, which would help to avoid warnings and help users writing safer codes.
public interface PrivilegedAction<T> {
T run();
}
public interface PrivilegedExceptionAction<T> {
T run();
}
However, some of our document still use the old style codes like:
FileInputStream fis = (FileInputStream) AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public Object run() throws FileNotFoundException {
return new FileInputStream("someFile");
}
}
);
The old style codes will cause compiling unchecked conversion warnings. I think the java security sample codes should use the template style, which would help to avoid warnings and help users writing safer codes.
- relates to
-
JDK-6558416 Minor doc improvements for AccessController
-
- Closed
-