fix: correct imports

This commit is contained in:
exaucae 2023-02-27 13:44:33 +00:00
parent c61004285c
commit b74bbc518c
3 changed files with 15 additions and 9 deletions

View File

@ -1,9 +1,14 @@
package com.baeldung.java.panama.core;
import java.lang.foreign.*;
import java.lang.invoke.MethodHandle;
import static java.lang.foreign.ValueLayout.ADDRESS;
import static java.lang.foreign.ValueLayout.JAVA_INT;
import static java.lang.foreign.ValueLayout.*;
import java.lang.foreign.FunctionDescriptor;
import java.lang.foreign.Linker;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.MemorySession;
import java.lang.foreign.SymbolLookup;
import java.lang.invoke.MethodHandle;
public class Greetings {
@ -26,7 +31,6 @@ public class Greetings {
if (methodHandle == null) {
throw new NoSuchMethodError("Method Handle was not found");
}
;
try (MemorySession memorySession = MemorySession.openConfined()) {
MemorySegment greetingSegment = memorySession.allocateUtf8String(greeting);

View File

@ -2,8 +2,8 @@ package com.baeldung.java.panama.core;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.MemorySession;
import java.lang.foreign.ValueLayout;
import java.lang.foreign.SegmentAllocator;
import java.lang.foreign.ValueLayout;
public class MemoryAllocation {

View File

@ -1,15 +1,17 @@
package com.baeldung.java.panama.core;
import static java.lang.foreign.MemoryLayout.sequenceLayout;
import static java.lang.foreign.MemoryLayout.structLayout;
import static java.lang.foreign.ValueLayout.JAVA_DOUBLE;
import static java.lang.foreign.ValueLayout.JAVA_FLOAT;
import static java.lang.foreign.ValueLayout.PathElement;
import java.lang.foreign.GroupLayout;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.MemorySession;
import java.lang.foreign.SequenceLayout;
import java.lang.invoke.VarHandle;
import static java.lang.foreign.MemoryLayout.sequenceLayout;
import static java.lang.foreign.MemoryLayout.structLayout;
import static java.lang.foreign.ValueLayout.*;
public class MemoryLayout {
public static void main(String[] args) {