--- a/jdk/src/share/classes/sun/misc/ExtensionDependency.java Mon Mar 10 14:32:51 2008 -0700
+++ b/jdk/src/share/classes/sun/misc/ExtensionDependency.java Mon Mar 10 15:07:09 2008 -0700
@@ -284,10 +284,9 @@
// Load the jar file ...
Manifest man;
try {
- man = (Manifest) AccessController.doPrivileged
- (
- new PrivilegedExceptionAction() {
- public Object run()
+ man = AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Manifest>() {
+ public Manifest run()
throws IOException, FileNotFoundException {
if (!file.exists())
throw new FileNotFoundException(file.getName());
@@ -391,9 +390,9 @@
final String extName = extensionName;
final String[] fileExt = {".jar", ".zip"};
- return (File) AccessController.doPrivileged
- (new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<File>() {
+ public File run() {
try {
File fExtension;
File[] dirs = getExtDirs();
@@ -460,7 +459,7 @@
* @return the list of files installed in all the directories
*/
private static File[] getExtFiles(File[] dirs) throws IOException {
- Vector urls = new Vector();
+ Vector<File> urls = new Vector<File>();
for (int i = 0; i < dirs.length; i++) {
String[] files = dirs[i].list(new JarFilter());
if (files != null) {
@@ -484,16 +483,15 @@
* </p>
*/
private File[] getInstalledExtensions() throws IOException {
- return (File[]) AccessController.doPrivileged
- (
- new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<File[]>() {
+ public File[] run() {
try {
return getExtFiles(getExtDirs());
} catch(IOException e) {
debug("Cannot get list of installed extensions");
debugException(e);
- return new URL[0];
+ return new File[0];
}
}
});