HHH-18505 fix npe occurring while processing module descriptor
Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
5d45d19005
commit
f99bdd4b8d
|
@ -367,7 +367,7 @@ public class HibernateProcessor extends AbstractProcessor {
|
|||
try {
|
||||
if ( !included( element )
|
||||
|| hasAnnotation( element, Constants.EXCLUDE )
|
||||
|| hasAnnotation( context.getElementUtils().getPackageOf(element), Constants.EXCLUDE ) ) {
|
||||
|| hasPackageAnnotation( element, Constants.EXCLUDE ) ) {
|
||||
// skip it completely
|
||||
}
|
||||
else if ( isEntityOrEmbeddable( element ) ) {
|
||||
|
@ -420,6 +420,11 @@ public class HibernateProcessor extends AbstractProcessor {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean hasPackageAnnotation(Element element, String annotation) {
|
||||
final PackageElement pack = context.getElementUtils().getPackageOf( element ); // null for module descriptor
|
||||
return pack != null && hasAnnotation( pack, annotation );
|
||||
}
|
||||
|
||||
private void createMetaModelClasses() {
|
||||
|
||||
for ( Metamodel aux : context.getMetaAuxiliaries() ) {
|
||||
|
|
Loading…
Reference in New Issue