Skip to content
Permalink
Browse files
avoid NPE on xml ctors
  • Loading branch information
mbenson committed Oct 16, 2018
1 parent e243ee9 commit e5e22d3e650e4960657e4fdbdd10f61691b8a9a0
Showing 1 changed file with 5 additions and 4 deletions.
@@ -166,10 +166,11 @@ private Set<Signature> constructors(Class<?> t, List<ConstructorType> ctors) {
final Constructor<?> dc = Reflection.getDeclaredConstructor(t, parameterTypes);
Exceptions.raiseIf(dc == null, ValidationException::new, "Unknown %s constructor %s", t, result);

final ForConstructor<?> metaCtor = new Meta.ForConstructor<>(dc);
constraints(metaCtor, ctor.getReturnValue().getConstraint());
containerElements(metaCtor, ctor.getReturnValue().getContainerElementType());

Optional.of(ctor).map(ConstructorType::getReturnValue).ifPresent(rv -> {
final ForConstructor<?> metaCtor = new Meta.ForConstructor<>(dc);
constraints(metaCtor, rv.getConstraint());
containerElements(metaCtor, rv.getContainerElementType());
});
final Parameter[] params = dc.getParameters();

IntStream.range(0, parameterTypes.length).forEach(n -> {

0 comments on commit e5e22d3

Please sign in to comment.