src/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java

Print this page

        

@@ -63,11 +63,11 @@
         this.followLinks = followLinks;
     }
 
     // enumerates the file streams using FindFirstStream/FindNextStream APIs.
     private List<String> listUsingStreamEnumeration() throws IOException {
-        List<String> list = new ArrayList<String>();
+        List<String> list = new ArrayList<>();
         try {
             FirstStream first = FindFirstStream(file.getPathForWin32Calls());
             if (first != null) {
                 long handle = first.handle();
                 try {

@@ -112,11 +112,11 @@
         // buffer to read stream header and stream name.
         final int BUFFER_SIZE = 4096;
         NativeBuffer buffer = null;
 
         // result with names of alternative data streams
-        final List<String> list = new ArrayList<String>();
+        final List<String> list = new ArrayList<>();
 
         try {
             buffer = NativeBuffers.getNativeBuffer(BUFFER_SIZE);
             long address = buffer.address();
 

@@ -214,11 +214,11 @@
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
         // wrap with channel
         FileChannel fc = null;
         try {
-            Set<OpenOption> opts = new HashSet<OpenOption>();
+            Set<OpenOption> opts = new HashSet<>();
             opts.add(READ);
             if (!followLinks)
                 opts.add(WindowsChannelFactory.OPEN_REPARSE_POINT);
             fc = WindowsChannelFactory
                 .newFileChannel(join(file, name), null, opts, 0L);

@@ -241,11 +241,11 @@
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
         // wrap with channel
         FileChannel fc = null;
         try {
-            Set<OpenOption> opts = new HashSet<OpenOption>();
+            Set<OpenOption> opts = new HashSet<>();
             opts.add(READ);
             if (!followLinks)
                 opts.add(WindowsChannelFactory.OPEN_REPARSE_POINT);
             fc = WindowsChannelFactory
                 .newFileChannel(join(file, name), null, opts, 0L);

@@ -296,11 +296,11 @@
                                 flags);
         } catch (WindowsException x) {
             x.rethrowAsIOException(file);
         }
         try {
-            Set<OpenOption> opts = new HashSet<OpenOption>();
+            Set<OpenOption> opts = new HashSet<>();
             if (!followLinks)
                 opts.add(WindowsChannelFactory.OPEN_REPARSE_POINT);
             opts.add(CREATE);
             opts.add(WRITE);
             opts.add(StandardOpenOption.TRUNCATE_EXISTING);