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.
The old code seemed dangerous: If new constant pool entry types get added in future Java versions,
resolve
andvalidate
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.