Skip to content

Commit f42aba0

Browse files
committed
Add qualified class name to exception on writing final fields with JNI without "allowWrite".
1 parent d323c71 commit f42aba0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionSubstitutionType.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ public ReflectionSubstitutionType(ResolvedJavaType original, Member member) {
168168
private static ReflectionSubstitutionMethod createWriteMethod(ResolvedJavaMethod method, Field field, JavaKind kind) {
169169
ReflectionDataBuilder reflectionDataBuilder = (ReflectionDataBuilder) ImageSingletons.lookup(RuntimeReflectionSupport.class);
170170
if (Modifier.isFinal(field.getModifiers()) && !reflectionDataBuilder.inspectFinalFieldWritableForAnalysis(field)) {
171-
return new ThrowingMethod(method, IllegalAccessException.class, "Cannot set final field: " + field.getName() + ". " +
172-
"Enable by specifying \"allowWrite\" for this field in the reflection configuration.");
171+
return new ThrowingMethod(method, IllegalAccessException.class, "Cannot set final field: " + field.getDeclaringClass().getName() +
172+
"." + field.getName() + ". " + "Enable by specifying \"allowWrite\" for this field in the reflection configuration.");
173173
}
174174
return new ReflectiveWriteMethod(method, field, kind);
175175
}

0 commit comments

Comments
 (0)