You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use records with easy-random 5.0.0, but I was unable to run properly, as you can see in the following code.
public record MyRecord(Long b, String a) {
}
And the runner is
final var testing = new EasyRandom().nextObject(MyRecord.class);
And I got this error:
org.jeasy.random.ObjectCreationException: Unable to create a random instance of type class foo.bar.MyRecord
Caused by: java.lang.IllegalAccessException: Can not set final java.lang.Long field foo.bar.MyRecord.a to java.lang.Long
at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:76)
at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:80)
at java.base/jdk.internal.reflect.UnsafeQualifiedObjectFieldAccessorImpl.set(UnsafeQualifiedObjectFieldAccessorImpl.java:79)
My Java version
java version "17.0.10" 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 17.0.10+11-LTS-240)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.10+11-LTS-240, mixed mode, sharing)
Thank U
The text was updated successfully, but these errors were encountered:
I'm trying to use
records
with easy-random 5.0.0, but I was unable to run properly, as you can see in the following code.And the runner is
And I got this error:
My Java version
Thank U
The text was updated successfully, but these errors were encountered: