Skip to content

Commit

Permalink
Merge pull request #33907 from mkouba/arc-deprecated-proxyunwrapper
Browse files Browse the repository at this point in the history
ArC: remove deprecated classes and methods
  • Loading branch information
mkouba authored Jun 9, 2023
2 parents f1e6683 + 22620b6 commit a7dc8ea
Show file tree
Hide file tree
Showing 26 changed files with 15 additions and 419 deletions.

This file was deleted.

2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/cdi-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ public class Processor {
<1> The injected instance is an _immutable list_ of the contextual references of the _disambiguated_ beans.
<2> For this injection point the required type is `Service` and no additional qualifiers are declared.

TIP: The list is sorted by priority as defined by `io.quarkus.arc.InjectableBean#getPriority()`. Higher priority goes first. In general, the `@jakarta.annotation.Priority` and `@io.quarkus.arc.Priority` annotations can be used to assign the priority to a class bean, producer method or producer field.
TIP: The list is sorted by priority as defined by `io.quarkus.arc.InjectableBean#getPriority()`. Higher priority goes first. In general, the `@jakarta.annotation.Priority` annotation can be used to assign the priority to a class bean, producer method or producer field.

If an injection point declares no other qualifier than `@All` then `@Any` is used, i.e. the behavior is equivalent to `@Inject @Any Instance<Service>`.

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import jakarta.enterprise.inject.AmbiguousResolutionException;
import jakarta.enterprise.inject.UnsatisfiedResolutionException;

import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
Expand Down Expand Up @@ -60,7 +59,6 @@
import io.quarkus.arc.processor.ReflectionRegistration;
import io.quarkus.arc.processor.ResourceOutput;
import io.quarkus.arc.processor.StereotypeInfo;
import io.quarkus.arc.processor.StereotypeRegistrar;
import io.quarkus.arc.runtime.AdditionalBean;
import io.quarkus.arc.runtime.ArcRecorder;
import io.quarkus.arc.runtime.BeanContainer;
Expand Down Expand Up @@ -150,25 +148,6 @@ AdditionalBeanBuildItem quarkusApplication(CombinedIndexBuildItem combinedIndex)
.build();
}

@BuildStep
StereotypeRegistrarBuildItem convertLegacyAdditionalStereotypes(List<AdditionalStereotypeBuildItem> buildItems) {
return new StereotypeRegistrarBuildItem(new StereotypeRegistrar() {
@Override
public Set<DotName> getAdditionalStereotypes() {
Set<DotName> result = new HashSet<>();
for (AdditionalStereotypeBuildItem buildItem : buildItems) {
result.addAll(buildItem.getStereotypes()
.values()
.stream()
.flatMap(Collection::stream)
.map(AnnotationInstance::name)
.collect(Collectors.toSet()));
}
return result;
}
});
}

// PHASE 1 - build BeanProcessor
@BuildStep
public ContextRegistrationPhaseBuildItem initialize(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ public RegisteredComponentsBuildItem(BeanDeployment beanDeployment) {
this.beanResolver = beanDeployment.getBeanResolver();
}

/**
* @return the registered beans
*
* @deprecated in favor of {@link #getBeans()}
*/
@Deprecated(forRemoval = true)
public Collection<BeanInfo> geBeans() {
return beans;
}

/**
* @return the registered beans
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import io.quarkus.arc.impl.ComputingCache;
import io.quarkus.gizmo.BytecodeCreator;
import io.quarkus.gizmo.ClassOutput;
import io.quarkus.gizmo.FieldDescriptor;
import io.quarkus.gizmo.MethodDescriptor;
import io.quarkus.gizmo.ResultHandle;
Expand Down Expand Up @@ -57,17 +56,6 @@ ComputingCache<CacheKey, AnnotationLiteralClassInfo> getCache() {
return cache;
}

/**
* @deprecated annotation literal sharing is now always enabled, this method is superseded
* by {@link #create(BytecodeCreator, ClassInfo, AnnotationInstance)} and will be removed
* at some time after Quarkus 3.0
*/
@Deprecated
public ResultHandle process(BytecodeCreator bytecode, ClassOutput classOutput, ClassInfo annotationClass,
AnnotationInstance annotationInstance, String targetPackage) {
return create(bytecode, annotationClass, annotationInstance);
}

/**
* Generates a bytecode sequence to create an instance of given annotation type, such that
* the annotation members have the same values as the given annotation instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,6 @@ public THIS targetPackageName(String name) {
return self();
}

/**
* @deprecated use {@link #alternative(boolean)} and {@link #priority(int)};
* this method will be removed at some time after Quarkus 3.6
*/
@Deprecated(forRemoval = true, since = "3.0")
public THIS alternativePriority(int value) {
this.alternative = true;
this.priority = value;
return self();
}

public THIS alternative(boolean alternative) {
this.alternative = alternative;
return self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,6 @@ private Map<DotName, StereotypeInfo> findStereotypes(Map<DotName, ClassInfo> int
isNamed = true;
} else if (DotNames.PRIORITY.equals(annotation.name())) {
alternativePriority = annotation.value().asInt();
} else if (DotNames.ARC_PRIORITY.equals(annotation.name()) && alternativePriority == null) {
alternativePriority = annotation.value().asInt();
} else {
final ScopeInfo scope = getScope(annotation.name(), customContexts);
if (scope != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import jakarta.annotation.Priority;

import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
import org.jboss.jandex.IndexView;
Expand Down Expand Up @@ -586,26 +585,6 @@ public Builder setAdditionalBeanDefiningAnnotations(
return this;
}

/**
* @deprecated use {@link #addStereotypeRegistrar(StereotypeRegistrar)};
* this method will be removed at some time after Quarkus 3.0
*/
@Deprecated
public Builder setAdditionalStereotypes(Map<DotName, Collection<AnnotationInstance>> additionalStereotypes) {
Objects.requireNonNull(additionalStereotypes);
this.stereotypeRegistrars.add(new StereotypeRegistrar() {
@Override
public Set<DotName> getAdditionalStereotypes() {
return additionalStereotypes.values()
.stream()
.flatMap(Collection::stream)
.map(AnnotationInstance::name)
.collect(Collectors.toSet());
}
});
return this;
}

public Builder addQualifierRegistrar(QualifierRegistrar qualifierRegistrar) {
this.qualifierRegistrars.add(qualifierRegistrar);
return this;
Expand All @@ -626,15 +605,6 @@ public Builder setOutput(ResourceOutput output) {
return this;
}

/**
* @deprecated annotation literal sharing is now always enabled, this method doesn't do anything
* and will be removed at some time after Quarkus 3.0
*/
@Deprecated
public Builder setSharedAnnotationLiterals(boolean sharedAnnotationLiterals) {
return this;
}

public Builder setReflectionRegistration(ReflectionRegistration reflectionRegistration) {
this.reflectionRegistration = reflectionRegistration;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ static BeanInfo createProducerMethod(Set<Type> beanTypes, MethodInfo producerMet
priority = annotation.value().asInt();
continue;
}
if (priority == null && DotNames.ARC_PRIORITY.equals(annotationName)) {
priority = annotation.value().asInt();
continue;
}
if (DotNames.DEFAULT_BEAN.equals(annotationName)) {
isDefaultBean = true;
continue;
Expand Down Expand Up @@ -245,10 +241,6 @@ static BeanInfo createProducerField(FieldInfo producerField, BeanInfo declaringB
priority = annotation.value().asInt();
continue;
}
if (priority == null && DotNames.ARC_PRIORITY.equals(annotationName)) {
priority = annotation.value().asInt();
continue;
}
ScopeInfo scopeAnnotation = beanDeployment.getScope(annotationName);
if (scopeAnnotation != null) {
scopes.add(scopeAnnotation);
Expand Down Expand Up @@ -1253,10 +1245,6 @@ void processAnnotation(AnnotationInstance annotation,
priority = annotation.value().asInt();
return;
}
if (priority == null && DotNames.ARC_PRIORITY.equals(annotationName)) {
priority = annotation.value().asInt();
return;
}
StereotypeInfo stereotype = beanDeployment.getStereotype(annotationName);
if (stereotype != null) {
stereotypes.add(stereotype);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ static DecoratorInfo createDecorator(ClassInfo decoratorClass, BeanDeployment be
if (annotation.name().equals(DotNames.PRIORITY)) {
priority = annotation.value().asInt();
}
if (priority == null && annotation.name().equals(DotNames.ARC_PRIORITY)) {
priority = annotation.value().asInt();
}
ScopeInfo scopeAnnotation = beanDeployment.getScope(annotation.name());
if (scopeAnnotation != null && !BuiltinScope.DEPENDENT.is(scopeAnnotation)) {
throw new DefinitionException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public final class DotNames {
public static final DotName AROUND_INVOKE = create(AroundInvoke.class);
public static final DotName AROUND_CONSTRUCT = create(AroundConstruct.class);
public static final DotName PRIORITY = create(Priority.class);
public static final DotName ARC_PRIORITY = create(io.quarkus.arc.Priority.class);
public static final DotName DEFAULT = create(Default.class);
public static final DotName ANY = create(Any.class);
public static final DotName BEAN = create(Bean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ static InterceptorInfo createInterceptor(ClassInfo interceptorClass, BeanDeploym
if (annotation.name().equals(DotNames.PRIORITY)) {
priority = annotation.value().asInt();
}
if (priority == null && annotation.name().equals(DotNames.ARC_PRIORITY)) {
priority = annotation.value().asInt();
}

// rudimentary, but good enough for now (should also look at inherited annotations and stereotypes)
ScopeInfo scope = beanDeployment.getScope(annotation.name());
if (scope != null && !BuiltinScope.DEPENDENT.is(scope)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ public class StereotypeInfo {
// used to differentiate between standard stereotype and one that was added through StereotypeRegistrarBuildItem
private final boolean isAdditionalStereotype;

/**
*
* @deprecated This constructor will be removed at some time after Quarkus 3.0
*/
@Deprecated
public StereotypeInfo(ScopeInfo defaultScope, List<AnnotationInstance> interceptorBindings, boolean alternative,
Integer alternativePriority, boolean isNamed, boolean isAdditionalBeanDefiningAnnotation,
boolean isAdditionalStereotype,
ClassInfo target, boolean isInherited, List<AnnotationInstance> parentStereotypes) {
this(defaultScope, interceptorBindings, alternative, alternativePriority, isNamed, isAdditionalStereotype, target,
isInherited, parentStereotypes);
}

public StereotypeInfo(ScopeInfo defaultScope, List<AnnotationInstance> interceptorBindings, boolean alternative,
Integer alternativePriority, boolean isNamed, boolean isAdditionalStereotype, ClassInfo target, boolean isInherited,
List<AnnotationInstance> parentStereotypes) {
Expand All @@ -49,7 +36,7 @@ public StereotypeInfo(ScopeInfo defaultScope, List<AnnotationInstance> intercept
public StereotypeInfo(ScopeInfo defaultScope, List<AnnotationInstance> interceptorBindings, boolean alternative,
Integer alternativePriority, boolean isNamed, ClassInfo target, boolean isInherited,
List<AnnotationInstance> parentStereotype) {
this(defaultScope, interceptorBindings, alternative, alternativePriority, isNamed, false, false, target, isInherited,
this(defaultScope, interceptorBindings, alternative, alternativePriority, isNamed, false, target, isInherited,
parentStereotype);
}

Expand Down Expand Up @@ -85,24 +72,6 @@ public DotName getName() {
return target.name();
}

/**
*
* @deprecated This method will be removed at some time after Quarkus 3.0
*/
@Deprecated
public boolean isAdditionalBeanDefiningAnnotation() {
return false;
}

/**
* @deprecated use {@link #isAdditionalStereotype()};
* this method will be removed at some time after Quarkus 3.0
*/
@Deprecated
public boolean isAdditionalStereotypeBuildItem() {
return isAdditionalStereotype;
}

public boolean isAdditionalStereotype() {
return isAdditionalStereotype;
}
Expand Down
Loading

0 comments on commit a7dc8ea

Please sign in to comment.