Skip to content

Commit 9c1f913

Browse files
committed
Remove JDK21OrEarlier from Web Image
1 parent 275b0d9 commit 9c1f913

File tree

3 files changed

+1
-94
lines changed

3 files changed

+1
-94
lines changed

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/substitute/system/WebImageIOSubstitutions.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
import com.oracle.svm.core.annotate.Substitute;
5353
import com.oracle.svm.core.annotate.TargetClass;
5454
import com.oracle.svm.core.annotate.TargetElement;
55-
import com.oracle.svm.core.jdk.JDK21OrEarlier;
56-
import com.oracle.svm.core.jdk.JDKLatest;
5755
import com.oracle.svm.core.util.VMError;
5856
import com.oracle.svm.webimage.fs.WebImageNIOFileSystemProvider;
5957
import com.oracle.svm.webimage.functionintrinsics.JSFunctionIntrinsics;
@@ -175,7 +173,6 @@ private long length0() {
175173
}
176174

177175
@Substitute
178-
@TargetElement(onlyWith = JDKLatest.class)
179176
@SuppressWarnings({"static-method"})
180177
private boolean isRegularFile() {
181178
return !fd.equals(FileDescriptor.in);
@@ -414,13 +411,6 @@ public int read(ByteBuffer var1) throws IOException {
414411
}
415412

416413
@Substitute
417-
@TargetElement(name = "open", onlyWith = JDK21OrEarlier.class)
418-
public static FileChannel openJDK21(FileDescriptor fd, String path, boolean readable, boolean writable, boolean direct, Closeable parent) {
419-
throw new UnsupportedOperationException("FileChannelImpl.open");
420-
}
421-
422-
@Substitute
423-
@TargetElement(onlyWith = JDKLatest.class)
424414
public static FileChannel open(FileDescriptor fd, String path, boolean readable, boolean writable, boolean sync, boolean direct, Closeable parent) {
425415
throw new UnsupportedOperationException("FileChannelImpl.open");
426416
}

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/substitute/system/WebImageSecuritySubstitutions.java

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -25,66 +25,18 @@
2525

2626
package com.oracle.svm.webimage.substitute.system;
2727

28-
import java.security.AccessControlContext;
29-
import java.security.AccessController;
30-
import java.security.Permission;
31-
import java.security.PrivilegedAction;
32-
import java.security.PrivilegedExceptionAction;
3328
import java.util.function.BooleanSupplier;
3429

3530
import com.oracle.svm.core.annotate.Delete;
3631
import com.oracle.svm.core.annotate.Substitute;
3732
import com.oracle.svm.core.annotate.TargetClass;
38-
import com.oracle.svm.core.jdk.JDK21OrEarlier;
3933
import com.oracle.svm.webimage.substitute.WebImageUtil;
4034

4135
import sun.security.provider.NativePRNG;
4236

4337
public class WebImageSecuritySubstitutions {
4438
}
4539

46-
@TargetClass(value = AccessController.class, onlyWith = JDK21OrEarlier.class)
47-
final class Target_java_security_AccessController_Web {
48-
49-
/**
50-
* We need this substitution to avoid doing a stack walk.
51-
*/
52-
@Substitute
53-
static <T> T doPrivileged(PrivilegedAction<T> action,
54-
@SuppressWarnings("unused") AccessControlContext context, @SuppressWarnings("unused") Permission... perms) {
55-
return action.run();
56-
}
57-
58-
@Substitute
59-
static AccessControlContext getStackAccessControlContext() {
60-
return null;
61-
}
62-
63-
@Substitute
64-
@SuppressWarnings({"deprecation", "unused"}) // deprecated starting JDK 17
65-
static <T> T executePrivileged(PrivilegedExceptionAction<T> action, AccessControlContext context, Class<?> caller) throws Throwable {
66-
if (action == null) {
67-
throw new NullPointerException("Null action");
68-
}
69-
70-
if (action == null) {
71-
throw new NullPointerException("Null action");
72-
}
73-
74-
return action.run();
75-
}
76-
77-
@Substitute
78-
@SuppressWarnings({"deprecation", "unused"}) // deprecated starting JDK 17
79-
static <T> T executePrivileged(PrivilegedAction<T> action, AccessControlContext context, Class<?> caller) throws Throwable {
80-
if (action == null) {
81-
throw new NullPointerException("Null action");
82-
}
83-
84-
return action.run();
85-
}
86-
}
87-
8840
// Windows does not have a NativePRNG implementation
8941
@TargetClass(value = NativePRNG.class, onlyWith = IsUnix.class)
9042
@SuppressWarnings("all")

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/substitute/system/WebImageUnixIOSubstitutions.java

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232

3333
import com.oracle.svm.core.annotate.Substitute;
3434
import com.oracle.svm.core.annotate.TargetClass;
35-
import com.oracle.svm.core.annotate.TargetElement;
36-
import com.oracle.svm.core.jdk.JDK21OrEarlier;
37-
import com.oracle.svm.core.jdk.JDKLatest;
3835

3936
/*
4037
* Checkstyle: stop method name check
@@ -83,12 +80,6 @@ static void unlink0(long l) {
8380
throw new UnsupportedOperationException("UnixNativeDispatcher.unlink");
8481
}
8582

86-
@Substitute
87-
@TargetElement(onlyWith = JDK21OrEarlier.class)
88-
static void futimes(int fd, long times0, long times1) {
89-
throw new UnsupportedOperationException("UnixNativeDispatcher.futimes");
90-
}
91-
9283
@Substitute
9384
static void fchmod(int fd, int mode) {
9485
throw new UnsupportedOperationException("UnixNativeDispatcher.fchmod");
@@ -160,31 +151,11 @@ static int fgetxattr0(int filedes, long nameAddress, long valueAddress, int valu
160151
}
161152

162153
@Substitute
163-
@TargetElement(onlyWith = JDKLatest.class, name = "access0")
164-
static int access0JDK23(long pathAddress, int amode) {
165-
throw new UnsupportedOperationException("UnixNativeDispatcher.access0");
166-
}
167-
168-
@Substitute
169-
@TargetElement(onlyWith = JDK21OrEarlier.class)
170-
static void access0(long pathAddress, int amode) {
154+
static int access0(long pathAddress, int amode) {
171155
throw new UnsupportedOperationException("UnixNativeDispatcher.access0");
172156
}
173157

174158
@Substitute
175-
@TargetElement(onlyWith = JDK21OrEarlier.class)
176-
static boolean exists0(long pathAddress) {
177-
throw new UnsupportedOperationException("UnixNativeDispatcher.exists0");
178-
}
179-
180-
@Substitute
181-
@TargetElement(onlyWith = JDK21OrEarlier.class)
182-
static void utimes0(long pathAddress, long times0, long times1) {
183-
throw new UnsupportedOperationException("UnixNativeDispatcher.utimes0");
184-
}
185-
186-
@Substitute
187-
@TargetElement(onlyWith = JDKLatest.class)
188159
private static void utimensat0(int fd, long pathAddress, long times0, long times1, int flags) {
189160
throw new UnsupportedOperationException("UnixNativeDispatcher.utimensat0");
190161
}
@@ -219,12 +190,6 @@ static void mknod0(long pathAddress, int mode, long dev) {
219190
throw new UnsupportedOperationException("UnixNativeDispatcher.mknod0");
220191
}
221192

222-
@Substitute
223-
@TargetElement(onlyWith = JDK21OrEarlier.class)
224-
static void lutimes0(long pathAddress, long times0, long times1) {
225-
throw new UnsupportedOperationException("UnixNativeDispatcher.lutimes0");
226-
}
227-
228193
@Substitute
229194
static void lchown0(long pathAddress, int uid, int gid) {
230195
throw new UnsupportedOperationException("UnixNativeDispatcher.lchown0");

0 commit comments

Comments
 (0)