From 91442878b7b7b2e131621958de4942f30bbf3537 Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Fri, 20 Oct 2023 14:29:17 +0000 Subject: [PATCH] 8318601: Remove javadoc text about restricted methods Reviewed-by: alanb --- .../share/classes/java/lang/ModuleLayer.java | 4 ---- .../classes/java/lang/foreign/AddressLayout.java | 4 ---- .../share/classes/java/lang/foreign/Linker.java | 12 ------------ .../classes/java/lang/foreign/MemorySegment.java | 12 ------------ .../classes/java/lang/foreign/SymbolLookup.java | 8 -------- 5 files changed, 40 deletions(-) diff --git a/src/java.base/share/classes/java/lang/ModuleLayer.java b/src/java.base/share/classes/java/lang/ModuleLayer.java index b038c1efa27..814cdeb7e6d 100644 --- a/src/java.base/share/classes/java/lang/ModuleLayer.java +++ b/src/java.base/share/classes/java/lang/ModuleLayer.java @@ -305,10 +305,6 @@ public final class ModuleLayer { * Enables native access for a module in the layer if the caller's module * has native access. * - *

This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. - * * @param target * The module to update * diff --git a/src/java.base/share/classes/java/lang/foreign/AddressLayout.java b/src/java.base/share/classes/java/lang/foreign/AddressLayout.java index 6c93f4b64ed..3e2e3dc2bc9 100644 --- a/src/java.base/share/classes/java/lang/foreign/AddressLayout.java +++ b/src/java.base/share/classes/java/lang/foreign/AddressLayout.java @@ -98,10 +98,6 @@ public sealed interface AddressLayout extends ValueLayout permits ValueLayouts.O * AddressLayout unboundedLayout = addressLayout.withTargetLayout( * MemoryLayout.sequenceLayout(Long.MAX_VALUE, ValueLayout.JAVA_BYTE)); *} - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @param layout the target layout. * @return an address layout with same characteristics as this layout, but with the provided target layout. diff --git a/src/java.base/share/classes/java/lang/foreign/Linker.java b/src/java.base/share/classes/java/lang/foreign/Linker.java index 747e2b9270d..738ff19a517 100644 --- a/src/java.base/share/classes/java/lang/foreign/Linker.java +++ b/src/java.base/share/classes/java/lang/foreign/Linker.java @@ -519,10 +519,6 @@ public sealed interface Linker permits AbstractLinker { * {@snippet lang=java : * linker.downcallHandle(function).bindTo(symbol); * } - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @param address the native memory segment whose {@linkplain MemorySegment#address() base address} is the * address of the target foreign function. @@ -575,10 +571,6 @@ public sealed interface Linker permits AbstractLinker { * {@link MemorySegment#copy(MemorySegment, long, MemorySegment, long, long)} methods may be thrown. * The returned method handle will additionally throw {@link NullPointerException} if any argument * passed to it is {@code null}. - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @param function the function descriptor of the target foreign function. * @param options the linker options associated with this linkage request. @@ -612,10 +604,6 @@ public sealed interface Linker permits AbstractLinker { * try/catch block to catch any unexpected exceptions. This can be done using the * {@link java.lang.invoke.MethodHandles#catchException(MethodHandle, Class, MethodHandle)} method handle combinator, * and handle exceptions as desired in the corresponding catch block. - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @param target the target method handle. * @param function the upcall stub function descriptor. diff --git a/src/java.base/share/classes/java/lang/foreign/MemorySegment.java b/src/java.base/share/classes/java/lang/foreign/MemorySegment.java index 724286ce693..6dca1b699e7 100644 --- a/src/java.base/share/classes/java/lang/foreign/MemorySegment.java +++ b/src/java.base/share/classes/java/lang/foreign/MemorySegment.java @@ -587,10 +587,6 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl { /** * Returns a new memory segment that has the same address and scope as this segment, but with the provided size. - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @param newSize the size of the returned segment. * @return a new memory segment that has the same address and scope as this segment, but the new @@ -620,10 +616,6 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl { * } * That is, the cleanup action receives a segment that is associated with the global scope, * and is accessible from any thread. The size of the segment accepted by the cleanup action is {@link #byteSize()}. - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @apiNote The cleanup action (if present) should take care not to leak the received segment to external * clients which might access the segment after its backing region of memory is no longer available. Furthermore, @@ -659,10 +651,6 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl { * } * That is, the cleanup action receives a segment that is associated with the global scope, * and is accessible from any thread. The size of the segment accepted by the cleanup action is {@code newSize}. - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @apiNote The cleanup action (if present) should take care not to leak the received segment to external * clients which might access the segment after its backing region of memory is no longer available. Furthermore, diff --git a/src/java.base/share/classes/java/lang/foreign/SymbolLookup.java b/src/java.base/share/classes/java/lang/foreign/SymbolLookup.java index 632543c9957..efab47a40f2 100644 --- a/src/java.base/share/classes/java/lang/foreign/SymbolLookup.java +++ b/src/java.base/share/classes/java/lang/foreign/SymbolLookup.java @@ -211,10 +211,6 @@ public interface SymbolLookup { * For instance, if the provided arena is a confined arena, the library * associated with the returned lookup will be unloaded when the provided confined arena is * {@linkplain Arena#close() closed}. - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @implNote The process of resolving a library name is OS-specific. For instance, in a POSIX-compliant OS, * the library name is resolved according to the specification of the {@code dlopen} function for that OS. @@ -245,10 +241,6 @@ public interface SymbolLookup { * For instance, if the provided arena is a confined arena, the library * associated with the returned lookup will be unloaded when the provided confined arena is * {@linkplain Arena#close() closed}. - *

- * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. * * @implNote On Linux, the functionalities provided by this factory method and the returned symbol lookup are * implemented using the {@code dlopen}, {@code dlsym} and {@code dlclose} functions.