src/java.base/share/classes/java/io/BufferedInputStream.java
changeset 52220 9c260a6b6471
parent 47216 71c04702a3d5
child 54971 4285b4d13471
--- a/src/java.base/share/classes/java/io/BufferedInputStream.java	Mon Oct 22 14:41:51 2018 -0700
+++ b/src/java.base/share/classes/java/io/BufferedInputStream.java	Mon Oct 22 17:00:04 2018 -0700
@@ -238,7 +238,7 @@
                     nsz = marklimit;
                 byte[] nbuf = new byte[nsz];
                 System.arraycopy(buffer, 0, nbuf, 0, pos);
-                if (!U.compareAndSetObject(this, BUF_OFFSET, buffer, nbuf)) {
+                if (!U.compareAndSetReference(this, BUF_OFFSET, buffer, nbuf)) {
                     // Can't replace buf if there was an async close.
                     // Note: This would need to be changed if fill()
                     // is ever made accessible to multiple threads.
@@ -482,7 +482,7 @@
     public void close() throws IOException {
         byte[] buffer;
         while ( (buffer = buf) != null) {
-            if (U.compareAndSetObject(this, BUF_OFFSET, buffer, null)) {
+            if (U.compareAndSetReference(this, BUF_OFFSET, buffer, null)) {
                 InputStream input = in;
                 in = null;
                 if (input != null)