Skip to content

Commit

Permalink
8318601: Remove javadoc text about restricted methods
Browse files Browse the repository at this point in the history
Reviewed-by: alanb
  • Loading branch information
mcimadamore committed Oct 20, 2023
1 parent 4010642 commit 9144287
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 40 deletions.
4 changes: 0 additions & 4 deletions src/java.base/share/classes/java/lang/ModuleLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,6 @@ public Controller addOpens(Module source, String pn, Module target) {
* Enables native access for a module in the layer if the caller's module
* has native access.
*
* <p> This method is <a href="foreign/package-summary.html#restricted"><em>restricted</em></a>.
* 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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
*}
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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.
Expand Down
12 changes: 0 additions & 12 deletions src/java.base/share/classes/java/lang/foreign/Linker.java
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,6 @@ static Linker nativeLinker() {
* {@snippet lang=java :
* linker.downcallHandle(function).bindTo(symbol);
* }
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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.
Expand Down Expand Up @@ -575,10 +571,6 @@ static Linker nativeLinker() {
* {@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}.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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.
Expand Down Expand Up @@ -612,10 +604,6 @@ static Linker nativeLinker() {
* 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.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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.
Expand Down
12 changes: 0 additions & 12 deletions src/java.base/share/classes/java/lang/foreign/MemorySegment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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
Expand Down Expand Up @@ -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()}.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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,
Expand Down Expand Up @@ -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}.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ static SymbolLookup loaderLookup() {
* 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}.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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.
Expand Down Expand Up @@ -245,10 +241,6 @@ static SymbolLookup libraryLookup(String name, Arena arena) {
* 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}.
* <p>
* This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
* 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.
Expand Down

1 comment on commit 9144287

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.