staktrace / cafebabe

A java class file parser
40 stars 12 forks source link

List up all constant pool entry types #8

Closed schubart closed 2 years ago

schubart commented 2 years ago

The old code seemed dangerous: If new constant pool entry types get added in future Java versions, resolve and validate would silently return success for the new types without doing anything.

The new code will result in compilation errors when adding to the ConstantPoolEntry enum. This forces the developer to think about whether any resolution or validation is needed for he new variants, which is good.

schubart commented 2 years ago

Also factored out some duplication in resolve.