Skip to content

Commit

Permalink
Merge pull request quarkusio#18321 from famod/provider-constr-warn
Browse files Browse the repository at this point in the history
Remove obsolete warning about @Provider and constructor injection
  • Loading branch information
geoand authored Jul 2, 2021
2 parents 1987b40 + 76d805f commit f958533
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.AnnotationValue;
import org.jboss.jandex.AnnotationValue.Kind;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
import org.jboss.jandex.FieldInfo;
import org.jboss.jandex.IndexView;
Expand Down Expand Up @@ -176,7 +175,6 @@ JaxrsProvidersToRegisterBuildItem setupProviders(BuildProducer<ReflectiveClassBu
annotatedProviders.add(i.target().asClass().name().toString());
}
checkProperConfigAccessInProvider(i);
checkProperConstructorInProvider(i);
}
contributedProviders.addAll(annotatedProviders);
Set<String> availableProviders = new HashSet<>(ServiceUtil.classNamesNamedIn(getClass().getClassLoader(),
Expand Down Expand Up @@ -362,15 +360,6 @@ private void checkProperConfigAccessInProvider(AnnotationInstance instance) {
}
}

private void checkProperConstructorInProvider(AnnotationInstance i) {
ClassInfo targetClass = i.target().asClass();
if (!targetClass.hasNoArgsConstructor()) {
LOGGER.warn(
"Classes annotated with @Provider should have a single, no-argument constructor, otherwise dependency injection won't work properly. Offending class is "
+ targetClass);
}
}

private boolean restJsonSupportNeeded(CombinedIndexBuildItem indexBuildItem, DotName mediaTypeAnnotation) {
for (AnnotationInstance annotationInstance : indexBuildItem.getIndex().getAnnotations(mediaTypeAnnotation)) {
final AnnotationValue annotationValue = annotationInstance.value();
Expand Down Expand Up @@ -657,9 +646,4 @@ public boolean noProducesDefaultsToAll() {
return noProducesDefaultsToAll;
}
}

private enum NoMediaTypesDefault {
ALL,
JSON;
}
}

0 comments on commit f958533

Please sign in to comment.