openpojo icon indicating copy to clipboard operation
openpojo copied to clipboard

NullPointerException on filtered class

Open anishakamble opened this issue 9 years ago • 1 comments

Hello,

First of all, just started using OpenPojo and it's been great so far -- thank you so much.

So the issue I'm having is this: I'm calling the validate method like so: validator.validate(packageName, new FilterClassName("^((?!com.xyz.masterdata.model.contact.relationship.ContactMechanism).)*$"), new FilterEnum());

The class is successfully being filtered out, as I can see when I println the following: PojoClassFactory.getPojoClasses(packageName, new FilterClassName("^((?!com.xyz.masterdata.model.contact.relationship.ContactMechanism).)*$"))

However, the hashCode() method of the ContactMechanism class is still throwing a NullPointerException when I run the test, which is causing the test to fail.

Why is the validator still going over the filtered class? I cannot change the hashCode() method. How do I stop the validator from throwing this exception? If I catch the exception, does this ensure that ALL the other classes in the package will be tested? Or will the validation get interrupted?

anishakamble avatar Feb 25 '16 20:02 anishakamble

Thank you for your interest in OpenPojo. The validator shouldn't see any filtered classes as they get filtered out first. Can you please attach a sample failing code?

oshoukry avatar Mar 12 '16 04:03 oshoukry