Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.8.2
-
None
-
None
Description
The schema validator reports false negatives for any incompatible change to an enum type. I found this bug when invoking the SchemaValidatorBuilder.mutualReadStrategy() method via Confluent's Schema Registry.
This bug can be traced to the Symbol.hasErrors() method. When it is invoked with a Symbol.EnumAdjustAction object, it always (and therefore incorrectly) returns false. This is a problem because these objects can definitely have errors—masquerading along side adjustments.
The root cause of this bug has to do with objects of the Symbol.EnumAdjustAction class being assigned a Kind.EXPLICIT_ACTION kind. This kind informs the Symbol.hasErrors() method to always return false without checking if there are any errors hiding inside the object's adjustments.
As best I understand, there are a few possible solutions:
- Fix the Symbol.hasErrors() method so it checks the objects adjustments.
- Fix the Symbol.EnumAdjustAction class so its objects have a different kind.
- Fix both 1 and 2.
I'm not 100% familiar with the intention of the Symbol class. However, if given a little guidance on the preferred solution, I'm happy to submit a pull request to fix the bug.