The changes in ConverterPrimitiveTypes made with #242 breaks our software. Before these changes, opencsv used it's own ConvertUtilsBean but now it uses the BeanUtilsBean.getInstance().getConvertUtils() instance and re-registered the converters with throwException=true. That causes issues in our application because we need to have the "global" ConvertUtilsBean with throwException=false so that the default values are used.
Maybe opencsv could create and use it's own singleton of ConvertUtilsBean so that it does not interfere with others using BeanUtilsBean.getInstance() ?
Unfortunately I can't change that part of our software because that's also kind of a library.
I'm new to SourceForge but I could create a PR if that helps?
Hello Setfan - go ahead and send a PR if you have some sample code (and hopefully test) and I will do my best to look at it this weekend.
Right now I am thinking of changing the ConverterPrimitiveTypes code that is doing the register from :
to
}
This way nothing is registered if something is already registered. I am a little concerned because for giggles I changed the throwException in the original code from true to false and none of the existing tests broke. This is why I have no problems changing the code like I did above. But if you have tests that show somehow that if you did set the converter beforehand that is the one that will be used it would be a big help... but I won't hold up the changes if it is not there.
The above mentioned fix has been merged in for both the read and write converters and will go out in the next release.
I am reverting this back to open and rolling back my changes and will reopen #242 as well. I need to create a test that shows what is happening with the converters being overwritten and then find a way to determine if a custom converter has been registered and not re-register all converters like is currently being done.