second part of cleanup reducing number of files touched in main line unixdomainchannels
authormichaelm
Tue, 29 Oct 2019 19:55:34 +0000
branchunixdomainchannels
changeset 58848 c3df0f8b6d93
parent 58847 692de65ab293
child 58856 b2f0339a4cad
second part of cleanup reducing number of files touched in main line
src/java.base/share/classes/module-info.java
src/java.base/share/classes/sun/nio/ch/IOStatus.java
src/java.base/share/classes/sun/nio/ch/IOUtil.java
src/java.base/share/classes/sun/nio/ch/NativeDispatcher.java
src/java.base/share/classes/sun/nio/ch/Net.java
src/java.base/share/classes/sun/nio/ch/Util.java
src/java.base/unix/classes/sun/nio/ch/DatagramDispatcher.java
src/java.base/unix/classes/sun/nio/ch/FileDispatcherImpl.java
src/java.base/unix/classes/sun/nio/ch/NativeThread.java
src/java.base/unix/classes/sun/nio/ch/SocketDispatcher.java
src/java.base/unix/native/libnio/ch/IOUtil.c
src/java.base/unix/native/libnio/ch/nio_util.h
src/java.base/windows/classes/sun/nio/ch/DatagramDispatcher.java
src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java
src/java.base/windows/classes/sun/nio/ch/NativeThread.java
src/java.base/windows/classes/sun/nio/ch/SocketDispatcher.java
src/java.base/windows/native/libnio/ch/nio_util.h
--- a/src/java.base/share/classes/module-info.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/share/classes/module-info.java	Tue Oct 29 19:55:34 2019 +0000
@@ -232,7 +232,6 @@
         jdk.jfr;
     exports sun.net to
         java.net.http,
-        jdk.net,
         jdk.naming.dns;
     exports sun.net.ext to
         jdk.net;
@@ -242,7 +241,6 @@
     exports sun.net.util to
         java.desktop,
         jdk.jconsole,
-        jdk.net,
         java.net.http;
     exports sun.net.www to
         java.net.http,
@@ -269,8 +267,7 @@
         java.sql.rowset;
     exports sun.security.action to
         java.desktop,
-        java.security.jgss,
-        jdk.net;
+        java.security.jgss;
     exports sun.security.internal.interfaces to
         jdk.crypto.cryptoki;
     exports sun.security.internal.spec to
--- a/src/java.base/share/classes/sun/nio/ch/IOStatus.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/share/classes/sun/nio/ch/IOStatus.java	Tue Oct 29 19:55:34 2019 +0000
@@ -85,7 +85,7 @@
      * Returns true if the error code is UNAVAILABLE or INTERRUPTED, the
      * error codes to indicate that an I/O operation can be retried.
      */
-    public static boolean okayToRetry(long n) {
+    static boolean okayToRetry(long n) {
         return (n == IOStatus.UNAVAILABLE) || (n == IOStatus.INTERRUPTED);
     }
 
--- a/src/java.base/share/classes/sun/nio/ch/IOUtil.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/share/classes/sun/nio/ch/IOUtil.java	Tue Oct 29 19:55:34 2019 +0000
@@ -43,14 +43,14 @@
 
     private IOUtil() { }                // No instantiation
 
-    public static int write(FileDescriptor fd, ByteBuffer src, long position,
+    static int write(FileDescriptor fd, ByteBuffer src, long position,
                      NativeDispatcher nd)
         throws IOException
     {
         return write(fd, src, position, false, -1, nd);
     }
 
-    public static int write(FileDescriptor fd, ByteBuffer src, long position,
+    static int write(FileDescriptor fd, ByteBuffer src, long position,
                      boolean directIO, int alignment, NativeDispatcher nd)
         throws IOException
     {
@@ -117,20 +117,20 @@
         return written;
     }
 
-    public static long write(FileDescriptor fd, ByteBuffer[] bufs, NativeDispatcher nd)
+    static long write(FileDescriptor fd, ByteBuffer[] bufs, NativeDispatcher nd)
         throws IOException
     {
         return write(fd, bufs, 0, bufs.length, false, -1, nd);
     }
 
-    public static long write(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
+    static long write(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
                       NativeDispatcher nd)
         throws IOException
     {
         return write(fd, bufs, offset, length, false, -1, nd);
     }
 
-    public static long write(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
+    static long write(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
                       boolean directIO, int alignment, NativeDispatcher nd)
         throws IOException
     {
@@ -216,14 +216,14 @@
         }
     }
 
-    public static int read(FileDescriptor fd, ByteBuffer dst, long position,
+    static int read(FileDescriptor fd, ByteBuffer dst, long position,
                     NativeDispatcher nd)
         throws IOException
     {
         return read(fd, dst, position, false, -1, nd);
     }
 
-    public static int read(FileDescriptor fd, ByteBuffer dst, long position,
+    static int read(FileDescriptor fd, ByteBuffer dst, long position,
                     boolean directIO, int alignment, NativeDispatcher nd)
         throws IOException
     {
@@ -280,20 +280,20 @@
         return n;
     }
 
-    public static long read(FileDescriptor fd, ByteBuffer[] bufs, NativeDispatcher nd)
+    static long read(FileDescriptor fd, ByteBuffer[] bufs, NativeDispatcher nd)
         throws IOException
     {
         return read(fd, bufs, 0, bufs.length, false, -1, nd);
     }
 
-    public static long read(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
+    static long read(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
                      NativeDispatcher nd)
         throws IOException
     {
         return read(fd, bufs, offset, length, false, -1, nd);
     }
 
-    public static long read(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
+    static long read(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
                      boolean directIO, int alignment, NativeDispatcher nd)
         throws IOException
     {
--- a/src/java.base/share/classes/sun/nio/ch/NativeDispatcher.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/share/classes/sun/nio/ch/NativeDispatcher.java	Tue Oct 29 19:55:34 2019 +0000
@@ -32,10 +32,10 @@
  * for read and write operations.
  */
 
-public abstract class NativeDispatcher
+abstract class NativeDispatcher
 {
 
-    public abstract int read(FileDescriptor fd, long address, int len)
+    abstract int read(FileDescriptor fd, long address, int len)
         throws IOException;
 
     /**
@@ -55,7 +55,7 @@
     abstract long readv(FileDescriptor fd, long address, int len)
         throws IOException;
 
-    public abstract int write(FileDescriptor fd, long address, int len)
+    abstract int write(FileDescriptor fd, long address, int len)
         throws IOException;
 
     int pwrite(FileDescriptor fd, long address, int len, long position)
@@ -67,13 +67,13 @@
     abstract long writev(FileDescriptor fd, long address, int len)
         throws IOException;
 
-    public abstract void close(FileDescriptor fd) throws IOException;
+    abstract void close(FileDescriptor fd) throws IOException;
 
     // Prepare the given fd for closing by duping it to a known internal fd
     // that's already closed.  This is necessary on some operating systems
     // (Solaris and Linux) to prevent fd recycling.
     //
-    public void preClose(FileDescriptor fd) throws IOException {
+    void preClose(FileDescriptor fd) throws IOException {
         // Do nothing by default; this is only needed on Unix
     }
 
--- a/src/java.base/share/classes/sun/nio/ch/Net.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/share/classes/sun/nio/ch/Net.java	Tue Oct 29 19:55:34 2019 +0000
@@ -55,7 +55,6 @@
 import sun.net.util.IPAddressUtil;
 import sun.security.action.GetPropertyAction;
 
-
 public class Net {
 
     private Net() { }
--- a/src/java.base/share/classes/sun/nio/ch/Util.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/share/classes/sun/nio/ch/Util.java	Tue Oct 29 19:55:34 2019 +0000
@@ -282,7 +282,7 @@
      * returning to the cache then insert it at the start so that it is
      * likely to be returned by a subsequent call to getTemporaryDirectBuffer.
      */
-    public static void offerFirstTemporaryDirectBuffer(ByteBuffer buf) {
+    static void offerFirstTemporaryDirectBuffer(ByteBuffer buf) {
         // If the buffer is too large for the cache we don't have to
         // check the cache. We'll just free it.
         if (isBufferTooLarge(buf)) {
--- a/src/java.base/unix/classes/sun/nio/ch/DatagramDispatcher.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/unix/classes/sun/nio/ch/DatagramDispatcher.java	Tue Oct 29 19:55:34 2019 +0000
@@ -39,7 +39,7 @@
         IOUtil.load();
     }
 
-    public int read(FileDescriptor fd, long address, int len) throws IOException {
+    int read(FileDescriptor fd, long address, int len) throws IOException {
         return read0(fd, address, len);
     }
 
@@ -47,7 +47,7 @@
         return readv0(fd, address, len);
     }
 
-    public int write(FileDescriptor fd, long address, int len) throws IOException {
+    int write(FileDescriptor fd, long address, int len) throws IOException {
         return write0(fd, address, len);
     }
 
@@ -55,11 +55,11 @@
         return writev0(fd, address, len);
     }
 
-    public void close(FileDescriptor fd) throws IOException {
+    void close(FileDescriptor fd) throws IOException {
         FileDispatcherImpl.close0(fd);
     }
 
-    public void preClose(FileDescriptor fd) throws IOException {
+    void preClose(FileDescriptor fd) throws IOException {
         FileDispatcherImpl.preClose0(fd);
     }
 
--- a/src/java.base/unix/classes/sun/nio/ch/FileDispatcherImpl.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/unix/classes/sun/nio/ch/FileDispatcherImpl.java	Tue Oct 29 19:55:34 2019 +0000
@@ -44,7 +44,7 @@
     FileDispatcherImpl() {
     }
 
-    public int read(FileDescriptor fd, long address, int len) throws IOException {
+    int read(FileDescriptor fd, long address, int len) throws IOException {
         return read0(fd, address, len);
     }
 
@@ -58,7 +58,7 @@
         return readv0(fd, address, len);
     }
 
-    public int write(FileDescriptor fd, long address, int len) throws IOException {
+    int write(FileDescriptor fd, long address, int len) throws IOException {
         return write0(fd, address, len);
     }
 
@@ -100,11 +100,11 @@
         release0(fd, pos, size);
     }
 
-    public void close(FileDescriptor fd) throws IOException {
+    void close(FileDescriptor fd) throws IOException {
         fdAccess.close(fd);
     }
 
-    public void preClose(FileDescriptor fd) throws IOException {
+    void preClose(FileDescriptor fd) throws IOException {
         preClose0(fd);
     }
 
--- a/src/java.base/unix/classes/sun/nio/ch/NativeThread.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/unix/classes/sun/nio/ch/NativeThread.java	Tue Oct 29 19:55:34 2019 +0000
@@ -37,19 +37,19 @@
 // always returns -1 and the signal(long) method has no effect.
 
 
-public class NativeThread {
+class NativeThread {
 
     // Returns an opaque token representing the native thread underlying the
     // invoking Java thread.  On systems that do not require signalling, this
     // method always returns -1.
     //
-    public static native long current();
+    static native long current();
 
     // Signals the given native thread so as to release it from a blocking I/O
     // operation.  On systems that do not require signalling, this method has
     // no effect.
     //
-    public static native void signal(long nt);
+    static native void signal(long nt);
 
     private static native void init();
 
--- a/src/java.base/unix/classes/sun/nio/ch/SocketDispatcher.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/unix/classes/sun/nio/ch/SocketDispatcher.java	Tue Oct 29 19:55:34 2019 +0000
@@ -33,8 +33,8 @@
  * for read and write operations.
  */
 
-public class SocketDispatcher extends NativeDispatcher {
-    public SocketDispatcher() { }
+class SocketDispatcher extends NativeDispatcher {
+    SocketDispatcher() { }
 
     /**
      * Reads up to len bytes from a socket with special handling for "connection
@@ -43,7 +43,7 @@
      * @throws sun.net.ConnectionResetException if connection reset is detected
      * @throws IOException if another I/O error occurs
      */
-    public int read(FileDescriptor fd, long address, int len) throws IOException {
+    int read(FileDescriptor fd, long address, int len) throws IOException {
         return read0(fd, address, len);
     }
 
@@ -58,7 +58,7 @@
         return readv0(fd, address, len);
     }
 
-    public int write(FileDescriptor fd, long address, int len) throws IOException {
+    int write(FileDescriptor fd, long address, int len) throws IOException {
         return FileDispatcherImpl.write0(fd, address, len);
     }
 
@@ -66,11 +66,11 @@
         return FileDispatcherImpl.writev0(fd, address, len);
     }
 
-    public void close(FileDescriptor fd) throws IOException {
+    void close(FileDescriptor fd) throws IOException {
         FileDispatcherImpl.close0(fd);
     }
 
-    public void preClose(FileDescriptor fd) throws IOException {
+    void preClose(FileDescriptor fd) throws IOException {
         FileDispatcherImpl.preClose0(fd);
     }
 
--- a/src/java.base/unix/native/libnio/ch/IOUtil.c	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/unix/native/libnio/ch/IOUtil.c	Tue Oct 29 19:55:34 2019 +0000
@@ -223,14 +223,12 @@
     }
 }
 
-JNIEXPORT jint JNICALL
-fdval(JNIEnv *env, jobject fdo)
+jint fdval(JNIEnv *env, jobject fdo)
 {
     return (*env)->GetIntField(env, fdo, fd_fdID);
 }
 
-JNIEXPORT void JNICALL
-setfdval(JNIEnv *env, jobject fdo, jint val) {
+void setfdval(JNIEnv *env, jobject fdo, jint val) {
     (*env)->SetIntField(env, fdo, fd_fdID, val);
 }
 
--- a/src/java.base/unix/native/libnio/ch/nio_util.h	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/unix/native/libnio/ch/nio_util.h	Tue Oct 29 19:55:34 2019 +0000
@@ -55,7 +55,6 @@
 /* Defined in IOUtil.c */
 
 jint fdval(JNIEnv *env, jobject fdo);
-
 void setfdval(JNIEnv *env, jobject fdo, jint value);
 
 jint convertReturnVal(JNIEnv *env, jint n, jboolean reading);
--- a/src/java.base/windows/classes/sun/nio/ch/DatagramDispatcher.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/windows/classes/sun/nio/ch/DatagramDispatcher.java	Tue Oct 29 19:55:34 2019 +0000
@@ -36,7 +36,7 @@
 class DatagramDispatcher extends NativeDispatcher {
     DatagramDispatcher() { }
 
-    public int read(FileDescriptor fd, long address, int len) throws IOException {
+    int read(FileDescriptor fd, long address, int len) throws IOException {
         return read0(fd, address, len);
     }
 
@@ -44,7 +44,7 @@
         return readv0(fd, address, len);
     }
 
-    public int write(FileDescriptor fd, long address, int len) throws IOException {
+    int write(FileDescriptor fd, long address, int len) throws IOException {
         return write0(fd, address, len);
     }
 
@@ -52,7 +52,7 @@
         return writev0(fd, address, len);
     }
 
-    public void close(FileDescriptor fd) throws IOException {
+    void close(FileDescriptor fd) throws IOException {
         SocketDispatcher.invalidateAndClose(fd);
     }
 
--- a/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Tue Oct 29 19:55:34 2019 +0000
@@ -48,7 +48,7 @@
         return true;
     }
 
-    public int read(FileDescriptor fd, long address, int len)
+    int read(FileDescriptor fd, long address, int len)
         throws IOException
     {
         return read0(fd, address, len);
@@ -64,7 +64,7 @@
         return readv0(fd, address, len);
     }
 
-    public int write(FileDescriptor fd, long address, int len) throws IOException {
+    int write(FileDescriptor fd, long address, int len) throws IOException {
         return write0(fd, address, len, fdAccess.getAppend(fd));
     }
 
@@ -104,7 +104,7 @@
         release0(fd, pos, size);
     }
 
-    public void close(FileDescriptor fd) throws IOException {
+    void close(FileDescriptor fd) throws IOException {
         fdAccess.close(fd);
     }
 
--- a/src/java.base/windows/classes/sun/nio/ch/NativeThread.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/windows/classes/sun/nio/ch/NativeThread.java	Tue Oct 29 19:55:34 2019 +0000
@@ -29,14 +29,13 @@
 // Signalling operations on native threads
 
 
-public class NativeThread {
+class NativeThread {
 
-    public static long current() {
+    static long current() {
         // return 0 to ensure that async close of blocking sockets will close
         // the underlying socket.
         return 0;
     }
 
-    public static void signal(long nt) { }
-
+    static void signal(long nt) { }
 }
--- a/src/java.base/windows/classes/sun/nio/ch/SocketDispatcher.java	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/windows/classes/sun/nio/ch/SocketDispatcher.java	Tue Oct 29 19:55:34 2019 +0000
@@ -36,13 +36,13 @@
  * for read and write operations.
  */
 
-public class SocketDispatcher extends NativeDispatcher {
+class SocketDispatcher extends NativeDispatcher {
     private static final JavaIOFileDescriptorAccess fdAccess =
             SharedSecrets.getJavaIOFileDescriptorAccess();
 
-    public SocketDispatcher() { }
+    SocketDispatcher() { }
 
-    public int read(FileDescriptor fd, long address, int len) throws IOException {
+    int read(FileDescriptor fd, long address, int len) throws IOException {
         return read0(fd, address, len);
     }
 
@@ -50,7 +50,7 @@
         return readv0(fd, address, len);
     }
 
-    public int write(FileDescriptor fd, long address, int len) throws IOException {
+    int write(FileDescriptor fd, long address, int len) throws IOException {
         return write0(fd, address, len);
     }
 
@@ -58,11 +58,11 @@
         return writev0(fd, address, len);
     }
 
-    public void preClose(FileDescriptor fd) throws IOException {
+    void preClose(FileDescriptor fd) throws IOException {
         throw new UnsupportedOperationException();
     }
 
-    public void close(FileDescriptor fd) throws IOException {
+    void close(FileDescriptor fd) throws IOException {
         invalidateAndClose(fd);
     }
 
--- a/src/java.base/windows/native/libnio/ch/nio_util.h	Tue Oct 29 19:23:09 2019 +0000
+++ b/src/java.base/windows/native/libnio/ch/nio_util.h	Tue Oct 29 19:55:34 2019 +0000
@@ -35,16 +35,13 @@
  */
 #define MAX_BUFFER_SIZE             ((128*1024)-1)
 
-JNIEXPORT jint JNICALL
-fdval(JNIEnv *env, jobject fdo);
-JNIEXPORT void JNICALL
-setfdval(JNIEnv *env, jobject fdo, jint val);
+jint fdval(JNIEnv *env, jobject fdo);
+void setfdval(JNIEnv *env, jobject fdo, jint val);
 jlong handleval(JNIEnv *env, jobject fdo);
 jint convertReturnVal(JNIEnv *env, jint n, jboolean r);
 jlong convertLongReturnVal(JNIEnv *env, jlong n, jboolean r);
 jboolean purgeOutstandingICMP(JNIEnv *env, jclass clazz, jint fd);
-JNIEXPORT jint JNICALL
-handleSocketError(JNIEnv *env, int errorValue);
+jint handleSocketError(JNIEnv *env, int errorValue);
 
 #ifdef _WIN64