Join GitHub today
"Multiple entries with same key" error in InconsistentCapitalization check #999
What version of Error Prone are you using?
Does this issue reproduce with the latest release?
AFAIK, 2.3.0 is the latest release
What did you do?
Compiled a project with ErrorProne. Unfortunately, the codebase is proprietary, but if the stacktrace isn't enough I could try coming up with a separate repro.
Probably useful to know: The class in question is an ObjectFactory class generated by JAXB. The line where the exception was reported thrown was the class declaration (
Probably directly relevant: I see two private static final QName fields, one named _DocumentObjectData_QNAME, the other named _DocumentObjectdata_QNAME (note the one-letter difference in capitalization).
What did you expect to see?
What did you see instead?
I was confused by this one too, but it actually means the problem is in your own code.
You have two fields where the case of the 'd' differs, which is confusing, so one should be renamed.
Given those names though, maybe it's autogenerated, in which case you might just have to get whatever's autogenerating it to suppress the check on the classes it's generating.
@trejkaz: This is the error message format for an unhandled exception (i.e. an error within ErrorProne), not an error report to a user of ErrorProne. ErrorProne should handle this case by reporting an error to the user, not by crashing.
For example, if I set InconsistentCapitalization to WARN, this still happens, failing the compilation.
You can work around it by fixing the error in your code, but ErrorProne should also be fixed.