8193822: Remove unused newDirectByteBuffer and truncate methods from buffer classes
authorbpb
Wed, 08 Aug 2018 09:25:10 -0700
changeset 51336 d8cd1a8ae50f
parent 51335 3965b3332610
child 51337 0bcb90968b3c
8193822: Remove unused newDirectByteBuffer and truncate methods from buffer classes Reviewed-by: alanb, psandoz
src/java.base/share/classes/java/nio/Buffer.java
src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java
--- a/src/java.base/share/classes/java/nio/Buffer.java	Wed Aug 08 15:31:07 2018 +0200
+++ b/src/java.base/share/classes/java/nio/Buffer.java	Wed Aug 08 09:25:10 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -717,14 +717,6 @@
                 public JavaNioAccess.BufferPool getDirectBufferPool() {
                     return Bits.BUFFER_POOL;
                 }
-                @Override
-                public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) {
-                    return new DirectByteBuffer(addr, cap, ob);
-                }
-                @Override
-                public void truncate(Buffer buf) {
-                    buf.truncate();
-                }
             });
     }
 
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java	Wed Aug 08 15:31:07 2018 +0200
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java	Wed Aug 08 09:25:10 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,18 +39,4 @@
         long getMemoryUsed();
     }
     BufferPool getDirectBufferPool();
-
-    /**
-     * Constructs a direct ByteBuffer referring to the block of memory starting
-     * at the given memory address and extending {@code cap} bytes.
-     * The {@code ob} parameter is an arbitrary object that is attached
-     * to the resulting buffer.
-     */
-    ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob);
-
-    /**
-     * Truncates a buffer by changing its capacity to 0.
-     */
-    void truncate(Buffer buf);
-
 }