< prev index next >

src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java

Print this page

        

@@ -999,12 +999,11 @@
             FileDescriptor dummy = new FileDescriptor();
             if ((!writable) || (prot == MAP_RO))
                 return Util.newMappedByteBufferR(0, 0, dummy, null, isSync);
             else
                 return Util.newMappedByteBuffer(0, 0, dummy, null, isSync);
-        }
-        else if ((!writable) || (prot == MAP_RO)) {
+        } else if ((!writable) || (prot == MAP_RO)) {
             return Util.newMappedByteBufferR((int)unmapper.cap,
                     unmapper.address + unmapper.pagePosition,
                     unmapper.fd,
                     unmapper, isSync);
         } else {

@@ -1121,17 +1120,17 @@
                 mode == ExtendedMapMode.READ_WRITE_SYNC;
     }
 
     private int toProt(MapMode mode) {
         int prot;
-        if (mode == MapMode.READ_ONLY)
+        if (mode == MapMode.READ_ONLY) {
             prot = MAP_RO;
-        else if (mode == MapMode.READ_WRITE)
+        } else if (mode == MapMode.READ_WRITE) {
             prot = MAP_RW;
-        else if (mode == MapMode.PRIVATE)
+        } else if (mode == MapMode.PRIVATE) {
             prot = MAP_PV;
-        else if (mode == ExtendedMapMode.READ_ONLY_SYNC) {
+        } else if (mode == ExtendedMapMode.READ_ONLY_SYNC) {
             prot = MAP_RO;
         } else if (mode == ExtendedMapMode.READ_WRITE_SYNC) {
             prot = MAP_RW;
         } else {
             prot = MAP_INVALID;
< prev index next >