oracle/graal · error · IllegalArgumentException
Unsupported kind:
Error message
Unsupported kind:
What it means
Error "Unsupported kind: " thrown in oracle/graal.
Source
Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java:1067
if (!(arrayType.isArray() && arrayType.getComponentType().isPrimitive())) {
throw new IllegalArgumentException("Source should be a primitive array, got " + arrayType);
}
Value value = objectConstant.getValue();
long byteLength = value.getBufferSize();
int bytesToRead = kind.getByteCount();
if (offset < 0 || (long) offset + bytesToRead > byteLength) {
throw new IllegalArgumentException("Invalid input range: " + offset + ".." + (offset + bytesToRead) + " for buffer size " + byteLength);
}
return switch (kind) {
case Boolean -> JavaConstant.forBoolean(value.readBufferByte(offset) != 0);
case Byte -> JavaConstant.forByte(value.readBufferByte(offset));
case Short -> JavaConstant.forShort(value.readBufferShort(ByteOrder.nativeOrder(), offset));
case Char -> JavaConstant.forChar((char) value.readBufferShort(ByteOrder.nativeOrder(), offset));
case Int -> JavaConstant.forInt(value.readBufferInt(ByteOrder.nativeOrder(), offset));
case Long -> JavaConstant.forLong(value.readBufferLong(ByteOrder.nativeOrder(), offset));
case Float -> JavaConstant.forFloat(value.readBufferFloat(ByteOrder.nativeOrder(), offset));
case Double -> JavaConstant.forDouble(value.readBufferDouble(ByteOrder.nativeOrder(), offset));
default -> throw new IllegalArgumentException("Unsupported kind: " + kind);
};
}
@Override
public JavaConstant createHostProxy(Object hostTarget, ResolvedJavaType guestType) {
Objects.requireNonNull(hostTarget);
if (!(Objects.requireNonNull(guestType) instanceof EspressoExternalResolvedInstanceType espressoGuestType) || !espressoGuestType.isInterface()) {
throw new IllegalArgumentException("Invalid guest type");
}
Value hostProxy = hostProxies.createHostProxy(hostTarget, espressoGuestType);
return new EspressoExternalObjectConstant(this, hostProxy);
}
@Override
public Throwable unwrapHostProxyException(JavaConstant guestWrapper) {
Objects.requireNonNull(guestWrapper);
if (!(guestWrapper instanceof EspressoExternalObjectConstant espressoWrapper)) {
return null;View on GitHub (pinned to a66e9ccd1d)
Solutions
- Fix the condition reported by the error: Unsupported kind:
- Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.
Example fix
Validate inputs and environment so that the failing condition does not occur: Unsupported kind:
When it happens
Trigger: Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java:1067 when the library encounters an invalid state.
Common situations: Occurs when a caller violates the contract guarded by this check: Unsupported kind:
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/cf19445d1b7989d7.
Report an issue: GitHub.