changeset 802:3ed3c95e5a62

Minor clean-ups - eliminate raw type warnings - typos in spec
author alanb
date Fri, 07 Nov 2008 13:12:11 +0000
parents 9417a5078188
children 1b828db8e180
files src/share/classes/java/io/File.java src/share/classes/java/io/FilePermission.java src/share/classes/java/nio/channels/AsynchronousFileChannel.java src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java src/share/classes/java/nio/channels/Channels.java src/share/classes/java/nio/channels/ServerSocketChannel.java src/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java src/share/classes/java/nio/channels/spi/SelectorProvider.java src/share/classes/java/nio/file/DirectoryStream.java src/share/classes/java/nio/file/DirectoryStreamFilters.java src/share/classes/java/nio/file/Path.java src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java src/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java src/share/classes/java/nio/file/spi/AbstractPath.java src/share/classes/java/nio/file/spi/FileSystemProvider.java src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java src/share/classes/sun/nio/ch/CompletedFuture.java src/share/classes/sun/nio/ch/Net.java src/share/classes/sun/nio/fs/AbstractWatchKey.java src/share/classes/sun/nio/fs/NativeBuffers.java src/share/classes/sun/nio/fs/Reflect.java src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java src/windows/classes/sun/nio/fs/WindowsFileSystem.java
diffstat 24 files changed, 92 insertions(+), 85 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/io/File.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/io/File.java	Fri Nov 07 13:12:11 2008 +0000
@@ -1071,13 +1071,13 @@
         if ((names == null) || (filter == null)) {
             return names;
         }
-        ArrayList v = new ArrayList();
+        List<String> v = new ArrayList<String>();
         for (int i = 0 ; i < names.length ; i++) {
             if (filter.accept(this, names[i])) {
                 v.add(names[i]);
             }
         }
-        return (String[])(v.toArray(new String[v.size()]));
+        return v.toArray(new String[v.size()]);
     }
 
     /**
--- a/src/share/classes/java/io/FilePermission.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/io/FilePermission.java	Fri Nov 07 13:12:11 2008 +0000
@@ -708,7 +708,7 @@
 implements Serializable {
 
     // Not serialized; see serialization section at end of class
-    private transient List perms;
+    private transient List<Permission> perms;
 
     /**
      * Create an empty FilePermissions object.
@@ -716,7 +716,7 @@
      */
 
     public FilePermissionCollection() {
-        perms = new ArrayList();
+        perms = new ArrayList<Permission>();
     }
 
     /**
@@ -821,7 +821,7 @@
         // Don't call out.defaultWriteObject()
 
         // Write out Vector
-        Vector permissions = new Vector(perms.size());
+        Vector<Permission> permissions = new Vector<Permission>(perms.size());
         synchronized (this) {
             permissions.addAll(perms);
         }
@@ -834,6 +834,7 @@
     /*
      * Reads in a Vector of FilePermissions and saves them in the perms field.
      */
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream in) throws IOException,
     ClassNotFoundException {
         // Don't call defaultReadObject()
@@ -842,8 +843,8 @@
         ObjectInputStream.GetField gfields = in.readFields();
 
         // Get the one we want
-        Vector permissions = (Vector)gfields.get("permissions", null);
-        perms = new ArrayList(permissions.size());
+        Vector<Permission> permissions = (Vector<Permission>)gfields.get("permissions", null);
+        perms = new ArrayList<Permission>(permissions.size());
         perms.addAll(permissions);
     }
 }
--- a/src/share/classes/java/nio/channels/AsynchronousFileChannel.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/channels/AsynchronousFileChannel.java	Fri Nov 07 13:12:11 2008 +0000
@@ -519,7 +519,7 @@
      * Acquires an exclusive lock on this channel's file.
      *
      * <p> This method initiates an operation to acquire an exclusive lock on this
-     * channel's file. The method returns an {@code Future} representing the
+     * channel's file. The method returns a {@code Future} representing the
      * pending result of the operation. Its {@link Future#get() get} method
      * returns the {@link FileLock} on successful completion.
      *
@@ -529,7 +529,7 @@
      *     ch.{@link #lock(long,long,boolean,Object,CompletionHandler) lock}(0L, Long.MAX_VALUE, false, null, null)
      * </pre>
      *
-     * @return  an {@code Future} object representing the pending result
+     * @return  A {@code Future} object representing the pending result
      *
      * @throws  OverlappingFileLockException
      *          If a lock is already held by this Java virtual machine, or there
@@ -630,7 +630,7 @@
      *
      * <p> This method initiates the reading of a sequence of bytes from this
      * channel into the given buffer, starting at the given file position. This
-     * method returns an {@code Future} representing the pending result of the
+     * method returns a {@code Future} representing the pending result of the
      * operation. The Future's {@link Future#get() get} method returns the
      * number of bytes read or {@code -1} if the given position is greater than
      * or equal to the file's size at the time that the read is attempted.
@@ -651,7 +651,7 @@
      * @param   handler
      *          The handler for consuming the result; can be {@code null}
      *
-     * @return  an {@code Future} object representing the pending result
+     * @return  A {@code Future} object representing the pending result
      *
      * @throws  IllegalArgumentException
      *          If the position is negative or the buffer is read-only
@@ -672,7 +672,7 @@
      *
      * <p> This method initiates the reading of a sequence of bytes from this
      * channel into the given buffer, starting at the given file position. This
-     * method returns an {@code Future} representing the pending result of the
+     * method returns a {@code Future} representing the pending result of the
      * operation. The Future's {@link Future#get() get} method returns the
      * number of bytes read or {@code -1} if the given position is greater
      * than or equal to the file's size at the time that the read is attempted.
@@ -687,7 +687,7 @@
      *          The file position at which the transfer is to begin;
      *          must be non-negative
      *
-     * @return  an {@code Future} object representing the pending result
+     * @return  A {@code Future} object representing the pending result
      *
      * @throws  IllegalArgumentException
      *          If the position is negative or the buffer is read-only
@@ -704,7 +704,7 @@
      *
      * <p> This method initiates the writing of a sequence of bytes to this channel
      * from the given buffer, starting at the given file position. The method
-     * returns an {@code Future} representing the pending result of the write
+     * returns a {@code Future} representing the pending result of the write
      * operation. The Future's {@link Future#get() get} method returns the
      * number of bytes written.
      *
@@ -726,7 +726,7 @@
      * @param   handler
      *          The handler for consuming the result; can be {@code null}
      *
-     * @return  an {@code Future} object representing the pending result
+     * @return  A {@code Future} object representing the pending result
      *
      * @throws  IllegalArgumentException
      *          If the position is negative
@@ -747,7 +747,7 @@
      *
      * <p> This method initiates the writing of a sequence of bytes to this channel
      * from the given buffer, starting at the given file position. The method
-     * returns an {@code Future} representing the pending result of the write
+     * returns a {@code Future} representing the pending result of the write
      * operation. The Future's {@link Future#get() get} method returns the
      * number of bytes written.
      *
@@ -761,7 +761,7 @@
      *          The file position at which the transfer is to begin;
      *          must be non-negative
      *
-     * @return  an {@code Future} object representing the pending result
+     * @return  A {@code Future} object representing the pending result
      *
      * @throws  IllegalArgumentException
      *          If the position is negative
--- a/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java	Fri Nov 07 13:12:11 2008 +0000
@@ -288,7 +288,7 @@
      *
      * <p> This method is equivalent to invoking {@link
      * #accept(Object,CompletionHandler)} with the {@code attachment}
-     * and handler parameters set to {@code null}.
+     * and {@code handler} parameters set to {@code null}.
      *
      * @return  an <tt>Future</tt> object representing the pending result
      *
--- a/src/share/classes/java/nio/channels/Channels.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/channels/Channels.java	Fri Nov 07 13:12:11 2008 +0000
@@ -38,7 +38,6 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.UnsupportedCharsetException;
 import java.nio.channels.spi.AbstractInterruptibleChannel;
-import java.util.concurrent.Future;
 import java.util.concurrent.ExecutionException;
 import sun.nio.ch.ChannelInputStream;
 import sun.nio.cs.StreamDecoder;
--- a/src/share/classes/java/nio/channels/ServerSocketChannel.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/channels/ServerSocketChannel.java	Fri Nov 07 13:12:11 2008 +0000
@@ -34,7 +34,7 @@
 /**
  * A selectable channel for stream-oriented listening sockets.
  *
- * <p> A server-socket channel is created by invoking the {@link #open() open}
+ * <p> {@note revised} A server-socket channel is created by invoking the {@link #open() open}
  * method of this class.  It is not possible to create a channel for an arbitrary,
  * pre-existing {@link ServerSocket}. A newly-created server-socket channel is
  * open but not yet bound.  An attempt to invoke the {@link #accept() accept}
@@ -68,6 +68,7 @@
  * @author Mark Reinhold
  * @author JSR-51 Expert Group
  * @since 1.4
+ * @updated 1.7
  */
 
 public abstract class ServerSocketChannel
@@ -122,6 +123,7 @@
     // -- ServerSocket-specific operations --
 
     /**
+     * {@note new}
      * Binds the channel's socket to a local address and configures the socket
      * to listen for connections.
      *
@@ -154,6 +156,7 @@
     }
 
     /**
+     * {@note new}
      * Binds the channel's socket to a local address and configures the socket to
      * listen for connections.
      *
--- a/src/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java	Fri Nov 07 13:12:11 2008 +0000
@@ -80,8 +80,8 @@
         if (cn == null)
             return false;
         try {
-            Class c = Class.forName(cn, true,
-                                    ClassLoader.getSystemClassLoader());
+            Class<?> c = Class.forName(cn, true,
+                                       ClassLoader.getSystemClassLoader());
             provider = (AsynchronousChannelProvider)c.newInstance();
             return true;
         } catch (ClassNotFoundException x) {
--- a/src/share/classes/java/nio/channels/spi/SelectorProvider.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/channels/spi/SelectorProvider.java	Fri Nov 07 13:12:11 2008 +0000
@@ -89,8 +89,8 @@
         if (cn == null)
             return false;
         try {
-            Class c = Class.forName(cn, true,
-                                    ClassLoader.getSystemClassLoader());
+            Class<?> c = Class.forName(cn, true,
+                                       ClassLoader.getSystemClassLoader());
             provider = (SelectorProvider)c.newInstance();
             return true;
         } catch (ClassNotFoundException x) {
@@ -188,6 +188,7 @@
         throws IOException;
 
     /**
+     * {@note new}
      * Opens a datagram channel.
      *
      * @param   family
--- a/src/share/classes/java/nio/file/DirectoryStream.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/file/DirectoryStream.java	Fri Nov 07 13:12:11 2008 +0000
@@ -87,14 +87,14 @@
  * freeze the directory while iterating, so it may (or may not) reflect updates
  * to the directory that occur after the {@code DirectoryStream} is created.
  *
- * @param   <T>     The type of file reference
+ * @param   <T>     The type of element returned by the iterator
  *
  * @since 1.7
  *
  * @see Path#newDirectoryStream
  */
 
-public interface DirectoryStream<T extends FileRef>
+public interface DirectoryStream<T>
     extends Closeable, Iterable<T>
 {
     /**
@@ -108,11 +108,11 @@
      * create filters for a number of common usages and also methods to combine
      * filters.
      *
-     * @param   <T>     The type of file reference
+     * @param   <T>     The type of the directory entry
      *
      * @since 1.7
      */
-    public static interface Filter<T extends FileRef> {
+    public static interface Filter<T> {
         /**
          * Decides if the given directory entry should be accept or filtered.
          *
--- a/src/share/classes/java/nio/file/DirectoryStreamFilters.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/file/DirectoryStreamFilters.java	Fri Nov 07 13:12:11 2008 +0000
@@ -132,7 +132,7 @@
      *
      * @return  The resulting filter
      */
-    public static <T extends FileRef> DirectoryStream.Filter<T>
+    public static <T> DirectoryStream.Filter<T>
         allOf(final Iterable<? extends DirectoryStream.Filter<? super T>> filters)
     {
         if (filters == null)
@@ -166,7 +166,7 @@
      *
      * @return  The resulting filter
      */
-    public static <T extends FileRef> DirectoryStream.Filter<T>
+    public static <T> DirectoryStream.Filter<T>
         anyOf(final Iterable<? extends DirectoryStream.Filter<? super T>> filters)
     {
         if (filters == null)
@@ -195,7 +195,7 @@
      *
      * @return  The resulting filter that is the complement of the given filter
      */
-    public static <T extends FileRef> DirectoryStream.Filter<T>
+    public static <T> DirectoryStream.Filter<T>
         complementOf(final DirectoryStream.Filter<T> filter)
     {
         if (filter == null)
--- a/src/share/classes/java/nio/file/Path.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/file/Path.java	Fri Nov 07 13:12:11 2008 +0000
@@ -968,18 +968,19 @@
      * Suppose we want to iterate over the files in a directory that are
      * larger than 8K.
      * <pre>
-     *     Path dir = ...
-     *     DirectoryStream&lt;Path&gt; stream = dir.newDirectoryStream(new DirectoryStream.Filter&lt;Path&gt;() {
+     *     DirectoryStream.Filter&lt;Path&gt; filter = new DirectoryStream.Filter&lt;Path&gt;() {
      *         public boolean accept(Path file) {
      *             try {
      *                 long size = Attributes.readBasicFileAttributes(file, false).size();
      *                 return (size > 8192L);
      *             } catch (IOException e) {
      *                 // failed to get size
+     *                 return false;
      *             }
-     *             return false;
      *         }
-     *     });
+     *     };
+     *     Path dir = ...
+     *     DirectoryStream&lt;Path&gt; stream = dir.newDirectoryStream(filter);
      * </pre>
      * @param   filter
      *          The directory stream filter
--- a/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java	Fri Nov 07 13:12:11 2008 +0000
@@ -65,7 +65,7 @@
  *         .readAttributes();
  *     System.out.format("%s %s%n",
  *         atts.owner().getName(),
- *         PosixFilePermission.toString(attrs.permissions()));
+ *         PosixFilePermissions.toString(attrs.permissions()));
  * </pre>
  *
  * <h4> Dynamic Access </h4>
--- a/src/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java	Fri Nov 07 13:12:11 2008 +0000
@@ -92,7 +92,7 @@
      * @return  A user principal.
      *
      * @throws  UserPrincipalNotFoundException
-     *          The principal does not exist, or it exists but it not a group
+     *          The principal does not exist or is not a group
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
--- a/src/share/classes/java/nio/file/spi/AbstractPath.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/file/spi/AbstractPath.java	Fri Nov 07 13:12:11 2008 +0000
@@ -252,7 +252,7 @@
     }
 
     @Override
-    public final WatchKey register(WatchService watcher, WatchEvent.Kind... events)
+    public final WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events)
         throws IOException
     {
         return register(watcher, events, NO_MODIFIERS);
--- a/src/share/classes/java/nio/file/spi/FileSystemProvider.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/java/nio/file/spi/FileSystemProvider.java	Fri Nov 07 13:12:11 2008 +0000
@@ -364,7 +364,7 @@
      *          If the set contains an invalid combination of options
      * @throws  UnsupportedOperationException
      *          If this provider that does not support creating file channels,
-     *          or an unsupported open option is specified
+     *          or an unsupported open option or file attribute is specified
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -412,7 +412,8 @@
      *          If the set contains an invalid combination of options
      * @throws  UnsupportedOperationException
      *          If this provider that does not support creating asynchronous file
-     *          channels, or an unsupported open option is specified
+     *          channels, or an unsupported open option or file attribute is
+     *          specified
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
--- a/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java	Fri Nov 07 13:12:11 2008 +0000
@@ -235,10 +235,10 @@
             CompletedFuture<V,A> result;
             if (isScatteringRead) {
                 Long value = (shutdown) ? Long.valueOf(-1L) : Long.valueOf(0L);
-                result = CompletedFuture.withResult(this, value, attachment);
+                result = (CompletedFuture<V,A>)CompletedFuture.withResult(this, value, attachment);
             } else {
                 int value = (shutdown) ? -1 : 0;
-                result = CompletedFuture.withResult(this, value, attachment);
+                result = (CompletedFuture<V,A>)CompletedFuture.withResult(this, value, attachment);
             }
             Invoker.invoke(handler, result);
             return result;
@@ -334,9 +334,9 @@
         if (!hasDataToWrite) {
             CompletedFuture<V,A> result;
             if (isGatheringWrite) {
-                result = CompletedFuture.withResult(this, 0L, attachment);
+                result = (CompletedFuture<V,A>)CompletedFuture.withResult(this, 0L, attachment);
             } else {
-                result = CompletedFuture.withResult(this, 0, attachment);
+                result = (CompletedFuture<V,A>)CompletedFuture.withResult(this, 0, attachment);
             }
             Invoker.invoke(handler, result);
             return result;
--- a/src/share/classes/sun/nio/ch/CompletedFuture.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/sun/nio/ch/CompletedFuture.java	Fri Nov 07 13:12:11 2008 +0000
@@ -53,10 +53,10 @@
 
     @SuppressWarnings("unchecked")
     static <V,A> CompletedFuture<V,A> withResult(AsynchronousChannel channel,
-                                                 Object result,
+                                                 V result,
                                                  A attachment)
     {
-        return new CompletedFuture(channel, result, null, attachment);
+        return new CompletedFuture<V,A>(channel, result, null, attachment);
     }
 
     @SuppressWarnings("unchecked")
--- a/src/share/classes/sun/nio/ch/Net.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/sun/nio/ch/Net.java	Fri Nov 07 13:12:11 2008 +0000
@@ -207,7 +207,7 @@
     // -- Socket options
 
     static void setSocketOption(FileDescriptor fd, ProtocolFamily family,
-                                SocketOption name, Object value)
+                                SocketOption<?> name, Object value)
         throws IOException
     {
         if (value == null)
@@ -262,7 +262,7 @@
     }
 
     static Object getSocketOption(FileDescriptor fd, ProtocolFamily family,
-                                  SocketOption name)
+                                  SocketOption<?> name)
         throws IOException
     {
         Class<?> type = name.type();
--- a/src/share/classes/sun/nio/fs/AbstractWatchKey.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/sun/nio/fs/AbstractWatchKey.java	Fri Nov 07 13:12:11 2008 +0000
@@ -101,7 +101,7 @@
                         isRepeat = context.equals(prev.context());
                     }
                     if (isRepeat) {
-                        ((Event)prev).increment();
+                        ((Event<?>)prev).increment();
                         return;
                     }
                 }
--- a/src/share/classes/sun/nio/fs/NativeBuffers.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/sun/nio/fs/NativeBuffers.java	Fri Nov 07 13:12:11 2008 +0000
@@ -37,18 +37,8 @@
     private static final Unsafe unsafe = Unsafe.getUnsafe();
 
     private static final int TEMP_BUF_POOL_SIZE = 3;
-    private static ThreadLocal<NativeBuffer>[] buffers;
-
-    @SuppressWarnings("unchecked")
-    static ThreadLocal<NativeBuffer>[] createThreadLocalArray() {
-        return new ThreadLocal[TEMP_BUF_POOL_SIZE];
-    }
-
-    static {
-        buffers = createThreadLocalArray();
-        for (int i=0; i<TEMP_BUF_POOL_SIZE; i++)
-            buffers[i] = new ThreadLocal<NativeBuffer>();
-    }
+    private static ThreadLocal<NativeBuffer[]> threadLocal =
+        new ThreadLocal<NativeBuffer[]>();
 
     /**
      * Allocates a native buffer, of at least the given size, from the heap.
@@ -65,11 +55,14 @@
      */
     static NativeBuffer getNativeBufferFromCache(int size) {
         // return from cache if possible
-        for (int i=0; i<TEMP_BUF_POOL_SIZE; i++) {
-            NativeBuffer buffer = buffers[i].get();
-            if (buffer != null && buffer.size() >= size) {
-                buffers[i].set(null);
-                return buffer;
+        NativeBuffer[] buffers = threadLocal.get();
+        if (buffers != null) {
+            for (int i=0; i<TEMP_BUF_POOL_SIZE; i++) {
+                NativeBuffer buffer = buffers[i];
+                if (buffer != null && buffer.size() >= size) {
+                    buffers[i] = null;
+                    return buffer;
+                }
             }
         }
         return null;
@@ -95,19 +88,27 @@
      * then the buffer goes into the cache; otherwise the memory is deallocated.
      */
     static void releaseNativeBuffer(NativeBuffer buffer) {
+        // create cache if it doesn't exist
+        NativeBuffer[] buffers = threadLocal.get();
+        if (buffers == null) {
+            buffers = new NativeBuffer[TEMP_BUF_POOL_SIZE];
+            buffers[0] = buffer;
+            threadLocal.set(buffers);
+            return;
+        }
         // Put it in an empty slot if such exists
         for (int i=0; i<TEMP_BUF_POOL_SIZE; i++) {
-            if (buffers[i].get() == null) {
-                buffers[i].set(buffer);
+            if (buffers[i] == null) {
+                buffers[i] = buffer;
                 return;
             }
         }
         // Otherwise replace a smaller one in the cache if such exists
         for (int i=0; i<TEMP_BUF_POOL_SIZE; i++) {
-            NativeBuffer inCache = buffers[i].get();
-            if (inCache.size() < buffer.size()) {
-                inCache.cleaner().clean();
-                buffers[i].set(buffer);
+            NativeBuffer existing = buffers[i];
+            if (existing.size() < buffer.size()) {
+                existing.cleaner().clean();
+                buffers[i] = buffer;
                 return;
             }
         }
--- a/src/share/classes/sun/nio/fs/Reflect.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/share/classes/sun/nio/fs/Reflect.java	Fri Nov 07 13:12:11 2008 +0000
@@ -50,7 +50,7 @@
      */
     static Field lookupField(String className, String fieldName) {
         try {
-            Class cl = Class.forName(className);
+            Class<?> cl = Class.forName(className);
             Field f = cl.getDeclaredField(fieldName);
             setAccessible(f);
             return f;
--- a/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java	Fri Nov 07 13:12:11 2008 +0000
@@ -502,10 +502,10 @@
 
             // result type is Long or Integer
             if (isScatteringRead) {
-                result = CompletedFuture
+                result = (CompletedFuture<V,A>)CompletedFuture
                     .withResult(this, Long.valueOf(n), attachment);
             } else {
-                result = CompletedFuture
+                result = (CompletedFuture<V,A>)CompletedFuture
                     .withResult(this, Integer.valueOf(n), attachment);
             }
         } catch (Throwable x) {
@@ -646,10 +646,10 @@
             // data available
             enableWriting();
             if (isGatheringWrite) {
-                result = CompletedFuture
+                result = (CompletedFuture<V,A>)CompletedFuture
                     .withResult(this, Long.valueOf(n), attachment);
             } else {
-                result = CompletedFuture
+                result = (CompletedFuture<V,A>)CompletedFuture
                     .withResult(this, Integer.valueOf(n), attachment);
             }
         } catch (Throwable x) {
--- a/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java	Fri Nov 07 13:12:11 2008 +0000
@@ -159,6 +159,13 @@
     public void setOwner(UserPrincipal obj)
         throws IOException
     {
+        if (obj == null)
+            throw new NullPointerException("'owner' is null");
+        if (!(obj instanceof WindowsUserPrincipals.User))
+            throw new ProviderMismatchException();
+        WindowsUserPrincipals.User owner = (WindowsUserPrincipals.User)obj;
+
+        // permission check
         checkAccess(file, false, true);
 
         // SetFileSecurity does not follow links so when following links we
@@ -166,10 +173,6 @@
         String path = followLinks ? WindowsLinkSupport.getFinalPath(file) :
                                     file.getPathForWin32Calls();
 
-        if (!(obj instanceof WindowsUserPrincipals.User))
-            throw new ProviderMismatchException();
-        WindowsUserPrincipals.User owner = (WindowsUserPrincipals.User)obj;
-
         // ConvertStringSidToSid allocates memory for SID so must invoke
         // LocalFree to free it when we are done
         long pOwner = 0L;
--- a/src/windows/classes/sun/nio/fs/WindowsFileSystem.java	Thu Nov 06 20:59:33 2008 +0000
+++ b/src/windows/classes/sun/nio/fs/WindowsFileSystem.java	Fri Nov 07 13:12:11 2008 +0000
@@ -35,9 +35,6 @@
 import java.security.PrivilegedAction;
 import sun.security.action.GetPropertyAction;
 
-import static sun.nio.fs.WindowsNativeDispatcher.*;
-import static sun.nio.fs.WindowsConstants.*;
-
 class WindowsFileSystem
     extends FileSystem
 {
@@ -231,7 +228,7 @@
 
     // supported views
     private static final Set<String> supportedFileAttributeViews = Collections
-        .unmodifiableSet(new HashSet(Arrays.asList("basic", "dos", "acl", "owner", "xattr")));
+        .unmodifiableSet(new HashSet<String>(Arrays.asList("basic", "dos", "acl", "owner", "xattr")));
 
     @Override
     public Set<String> supportedFileAttributeViews() {