For format version mismatches, report version number in a human friendly way#330
For format version mismatches, report version number in a human friendly way#330somechris wants to merge 1 commit intojacoco:masterfrom somechris:format_version
Conversation
|
IMO this relates to #319 |
|
@somechris I didn't get why "6" or "7" is more user-friendly and less misleading than any other numbers like "1006" and "1007"? In both cases remediation action is unknown, when user receives such internal version format number, which is IMO root of the problem. |
The error message Incompatible version 1007 was confusing, as it: * Showed a hex string without a hex string marker, * Showed an alienatingly high number, as it still contained the padding, * Did not gave hints about what actually failed, why it failed, and how to get around it. We now report incompatible versions like Failed to read version 6 data (This JaCoCo build can only read/write version 7 data). To read the version 6 data, use the same JaCoCo version that got used for writing it. Also, we give JaCoCo users a chance to reliably identify version- mismatch exceptions by providing a separate exception class for them. Issue #319
|
Thanks for the pointer. You're right, they are definitely related. |
|
@somechris In a separate PR #219 I fixed the error message and created a specialized IOException. Though the decission that we write version numbers as hex strings and started with version 0x1001 I decided not to hide this fact in the error message. But version numbers are now properly written as hex literals (0x1007). Thankf for your support! |
Version numbers have been reported as hex string, but without any hex
string marker. So effectively when seeing a mismatch reported around
version '1006', it came down to version '0x1006', which is version
4102 in decimal. Those high format version numbers and mismatch in hex
vs. decimal was confusing.
Hence, we now get rid of the byte-marker 0x1000, and report the format
version as plain decimal.
Thereby, nice low format versions get reported. And the confusion
between (markerless) hex and decimal is gone.
What is 0x1007 format version on-disk, is now reported as version 7.
What is 0x1006 format version on-disk, is now reported as version 6.