[foreign-preview] RFR: 8280527: Move jdk.incubator.foreign to java.lang.foreign
Jorn Vernee
jvernee at openjdk.java.net
Mon Jan 24 20:01:24 UTC 2022
On Mon, 24 Jan 2022 19:49:34 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> To prepare for preview, this change removes the jdk.incubator.foreign module and moves the public classes to java.base/java.lang.foreign, implementation classes to java.base/jdk.internal.foreign respectively.
>>
>> While here, `SystemLookup` is replaced with the method `ClassLoader::findNative` and the methods in `MemoryHandles` are moved to `MethodHandles`. The `@PreviewFeature(feature=PreviewFeature.Feature.FOREIGN)` annotation and the `--enable-preview` flag are added were needed.
>
> src/java.base/share/classes/jdk/internal/access/foreign/MemoryAddressProxy.java line 98:
>
>> 96: private static IndexOutOfBoundsException overflowException(long min, long max) {
>> 97: return new IndexOutOfBoundsException(String.format("Overflow occurred during offset computation ; offset exceeded range { %d .. %d }", min, max));
>> 98: }
>
> I don't see these methods back after the move, only the ones from MemorySegmentProxy. Were they not needed anymore?
Ah, looks like they were unused before as well :)
> test/jdk/java/foreign/TestMemoryHandleAsUnsigned.java line 1:
>
>> 1: /*
>
> Why was this file deleted?
Looking closer, it seems that the `asUnsigned` combinator was removed altogether?
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/633
More information about the panama-dev
mailing list