[foreign-preview] RFR: 8280527: Move jdk.incubator.foreign to java.lang.foreign [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Jan 26 15:27:09 UTC 2022


On Wed, 26 Jan 2022 14:57:00 GMT, Julia Boes <jboes 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.
>
> Julia Boes has updated the pull request incrementally with one additional commit since the last revision:
> 
>   address PR comments

Looks good. Minor (optional) nit in test helper routine.

test/jdk/java/foreign/NativeTestHelper.java line 110:

> 108:     }
> 109: 
> 110:     public static NativeSymbol findNativeOrThrow(Class<?> clazz, String name) {

note: if this was an _instance_ method, then I think you could get rid of the `clazz` parameter, and just use `this` ?

-------------

Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/633


More information about the panama-dev mailing list