Skip to content

Commit

Permalink
fix: enhance logging when ConstantPoolParser throws exception.
Browse files Browse the repository at this point in the history
Issue 1150.
  • Loading branch information
autonomousapps committed Apr 3, 2024
1 parent a4630ea commit bebeecc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal object ConstantPoolParser {
val num: Int = buf.char.code

while (ix < num) {
when (buf.get()) {
when (val b = buf.get()) {
CONSTANT_UTF8 -> stringConstants[ix] = decodeString(buf)
CONSTANT_CLASS, CONSTANT_STRING, CONSTANT_METHOD_TYPE -> classes.add(buf.char.code)
CONSTANT_FIELDREF, CONSTANT_METHODREF, CONSTANT_INTERFACEMETHODREF, CONSTANT_NAME_AND_TYPE, CONSTANT_INVOKE_DYNAMIC -> {
Expand All @@ -80,7 +80,7 @@ internal object ConstantPoolParser {
buf.get()
buf.char
}
else -> throw RuntimeException("Unknown constant pool type")
else -> throw RuntimeException("Unknown constant pool type: byte '$b' at pos '$ix'")
}
ix++
}
Expand Down

0 comments on commit bebeecc

Please sign in to comment.