Details
Description
Hello,
I am using Version 1.2 and I am always getting a NullPointerException while trying to add a new .class to a MappingTool object. Here is my code:
MappingTool mapTool = new MappingTool();
mapTool.addClass(BudgetCode.class);
After a lot of time trying to understand why it was failing, i decided to check the source code of Castor and I have found that the exception arises exactly at this point: MappingTool.java:259
if (_mappings.get(cls) != null)
{ return; }Basically the error is that _mappings field is not initialized (it is null), so any time it is used, it generates a NullPointerException.
I hope this information will be useful for you to solve it.
Thanks,
Carlos
Carlos, as part of Castor 1.2, we have introduced quite a few major changes (hence the major version number increase). As a result, your code needs to be changed to
I hope this makes any sense.
I do acknowledge that there's a lack of information about the MappingTool on the web site. Would you be willing to help us with getting this changed ?