Skip to content

Commit

Permalink
Explicitly log UnsupportedClassVersionError's when creating the defin…
Browse files Browse the repository at this point in the history
…itions via reflection.

Signed-off-by: James R. Perkins <jperkins@redhat.com>
  • Loading branch information
jamezp committed Feb 21, 2024
1 parent 424108d commit 35e84c3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ private void readFields(ClassDescription c, Class classObject) {
fld.setAccessible(true);
Object v = fld.get(null);
fid.setConstantValue(MemberDescription.valueToString(v));
}
catch (Throwable e) {
} catch (UnsupportedClassVersionError e) {
System.err.printf("Constant value for field %s in type %s cannot be resolved.%n",
fld, fqname);
e.printStackTrace(System.err);
} catch (Throwable e) {
// catch error or exception that may be thrown during static class initialization
if (debug) {
System.err.println("Error during reading field value " + fld.toString());
Expand Down

0 comments on commit 35e84c3

Please sign in to comment.