We're updating the issue view to help you get more done. 

NPE using a custom annotation on a non-indexed class

Description

I have a custom annotation in my main project using play framework v1.5, that's not coming from an external dependency (jar). Using this annotation on a non-indexed class results in a NPE while building the SessionFactory:

java.lang.NullPointerException at org.hibernate.search.util.impl.ReflectionHelper.isSearchAnnotation(ReflectionHelper.java:181)

Looking at the code in the debugger shows, that annotation.annotationType().getPackage() returns null for my custom annotation (at this time). A behavior that's documented in the getPackage() method, so it's valid, although I can't reproduce it with a stand-alone test-case w/out using the play-framework with all its classloading magic
Nonetheless I think a null-check should be added in ReflectionHelper#isSearchAnnotation(...) to avoid this.

Environment

None

Status

Assignee

Sebastian Beigel

Reporter

Sebastian Beigel

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Fix versions

Priority

Major