dsl-json icon indicating copy to clipboard operation
dsl-json copied to clipboard

Incorrect condition in Analysis for verification of custom converter

Open master-bytes-krafter opened this issue 6 years ago • 5 comments

Hello, i found an issue in Analysis.java for custom converter existence verification

else if (jsonReaderField == null && jsonReaderMethod == null || jsonWriterField == null && jsonWriterMethod == null)

Should be else if ((jsonReaderField == null || jsonReaderMethod == null) && (jsonWriterField == null || jsonWriterMethod == null)) { Otherwise it evaluates wrong.

Can i make/submit a PR so that it can be merged (and hopefully released) quickly (it blocks our build right now, we need to make a workaround) :) Regards

master-bytes-krafter avatar Jul 17 '19 18:07 master-bytes-krafter

Hi,

yes you can make PR. Just please include a test which fails with the current code but works with your fix.

zapov avatar Jul 18 '19 02:07 zapov

Hello, sorry for the delay, will be working on it soon

master-bytes-krafter avatar Sep 21 '19 15:09 master-bytes-krafter

Before i create the PR, can you confirm that for a converter READ AND WRITE are mandatory or it may only provide READ OR WRITE, if it is the former then the error message is misleading, if it is the later then i will create the PR

master-bytes-krafter avatar Sep 21 '19 18:09 master-bytes-krafter

It must have both. But I didn't bother separating checks and pointing out which one is currently missing, so thus the or in the message. If you want to make a better error message, or split the check, sure

zapov avatar Sep 21 '19 18:09 zapov

Ok if it must have both it changes everything ;) a more explicit error message will suffice

master-bytes-krafter avatar Sep 21 '19 18:09 master-bytes-krafter

v1.10 released which has better error messages for this case

zapov avatar Jan 07 '23 08:01 zapov