Clean-up of JFR support niosocketimpl-branch
authoralanb
Sat, 09 Feb 2019 07:56:19 +0000
branchniosocketimpl-branch
changeset 57168 4c38eb7c3c83
parent 57166 b3e971413a7b
child 57169 1d423d38840d
Clean-up of JFR support
src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketInputStreamInstrumentor.java
src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketOutputStreamInstrumentor.java
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketInputStreamInstrumentor.java	Fri Feb 08 18:16:53 2019 +0000
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketInputStreamInstrumentor.java	Sat Feb 09 07:56:19 2019 +0000
@@ -28,7 +28,6 @@
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.Socket;
-import java.net.SocketException;
 
 import jdk.jfr.events.SocketReadEvent;
 
@@ -73,17 +72,6 @@
         return bytesRead;
     }
 
+    // private field in java.net.Socket$SocketInputStream
     private Socket parent;
-
-    InetAddress getInetAddress() {
-        throw new RuntimeException();
-    }
-
-    int getPort() {
-        throw new RuntimeException();
-    }
-
-    int getSoTimeout() throws SocketException {
-        throw new RuntimeException();
-    }
 }
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketOutputStreamInstrumentor.java	Fri Feb 08 18:16:53 2019 +0000
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/SocketOutputStreamInstrumentor.java	Sat Feb 09 07:56:19 2019 +0000
@@ -60,7 +60,7 @@
                 event.host = remote.getHostName();
                 event.address = remote.getHostAddress();
                 event.port = parent.getPort();
-                event.bytesWritten = bytesWritten < 0 ? 0 : bytesWritten;
+                event.bytesWritten = bytesWritten;
 
                 event.commit();
                 event.reset();
@@ -68,13 +68,6 @@
         }
     }
 
+    // private field in java.net.Socket$SocketOutputStream
     private Socket parent;
-
-    InetAddress getInetAddress() {
-        throw new RuntimeException();
-    }
-
-    int getPort() {
-        throw new RuntimeException();
-    }
 }