Skip to content

Commit

Permalink
Merge pull request quarkusio#44767 from mkouba/arc-remove-deprecated-02
Browse files Browse the repository at this point in the history
ArC: remove some deprecated stuff marked for removal
  • Loading branch information
gsmet authored Nov 27, 2024
2 parents e5ab20f + 45ab249 commit a36e483
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 134 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package io.quarkus.arc.deployment.devui;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import jakarta.enterprise.inject.spi.InterceptionType;

import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.MethodInfo;

import io.quarkus.arc.deployment.CompletedApplicationClassPredicateBuildItem;
import io.quarkus.arc.processor.InterceptorInfo;
Expand All @@ -21,18 +18,18 @@ public static DevInterceptorInfo from(InterceptorInfo interceptor, CompletedAppl
for (AnnotationInstance binding : interceptor.getBindings()) {
bindings.add(Name.from(binding));
}
Map<InterceptionType, MethodInfo> intercepts = new HashMap<>();
Set<InterceptionType> intercepts = new HashSet<>();
if (interceptor.intercepts(InterceptionType.AROUND_INVOKE)) {
intercepts.put(InterceptionType.AROUND_INVOKE, interceptor.getAroundInvoke());
intercepts.add(InterceptionType.AROUND_INVOKE);
}
if (interceptor.intercepts(InterceptionType.AROUND_CONSTRUCT)) {
intercepts.put(InterceptionType.AROUND_CONSTRUCT, interceptor.getAroundConstruct());
intercepts.add(InterceptionType.AROUND_CONSTRUCT);
}
if (interceptor.intercepts(InterceptionType.POST_CONSTRUCT)) {
intercepts.put(InterceptionType.POST_CONSTRUCT, interceptor.getPostConstruct());
intercepts.add(InterceptionType.POST_CONSTRUCT);
}
if (interceptor.intercepts(InterceptionType.PRE_DESTROY)) {
intercepts.put(InterceptionType.PRE_DESTROY, interceptor.getPreDestroy());
intercepts.add(InterceptionType.PRE_DESTROY);
}
return new DevInterceptorInfo(interceptor.getIdentifier(), Name.from(interceptor.getBeanClass()), bindings,
interceptor.getPriority(), intercepts,
Expand All @@ -43,11 +40,11 @@ public static DevInterceptorInfo from(InterceptorInfo interceptor, CompletedAppl
private final Name interceptorClass;
private final Set<Name> bindings;
private final int priority;
private final Map<InterceptionType, MethodInfo> intercepts;
private final Set<InterceptionType> intercepts;
private final boolean isApplicationBean;

DevInterceptorInfo(String id, Name interceptorClass, Set<Name> bindings, int priority,
Map<InterceptionType, MethodInfo> intercepts, boolean isApplicationBean) {
Set<InterceptionType> intercepts, boolean isApplicationBean) {
this.id = id;
this.interceptorClass = interceptorClass;
this.bindings = bindings;
Expand All @@ -72,7 +69,7 @@ public int getPriority() {
return priority;
}

public Map<InterceptionType, MethodInfo> getIntercepts() {
public Set<InterceptionType> getIntercepts() {
return intercepts;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ export class QwcArcInterceptors extends LitElement {
font-size: 85%;
}
.method {
color: var(--lumo-primary-text-color);
}
.annotation {
color: var(--lumo-contrast-50pct);
}
Expand Down Expand Up @@ -92,20 +88,11 @@ export class QwcArcInterceptors extends LitElement {
}

_typeRenderer(bean){
let i = JSON.stringify(bean.intercepts);

const typeTemplates = [];
for (const [key, value] of Object.entries(bean.intercepts)) {
typeTemplates.push(html`<code class="annotation">${this._printIntercepterType(key)}</code>`);
}

bean.intercepts.forEach((interceptionType) => typeTemplates.push(html`<code class="annotation">${this._printIntercepterType(interceptionType)}</code>`));
return html`
<vaadin-vertical-layout>
${typeTemplates}
<div>
<code>${bean.interceptorClass.simpleName}</code>
<code class="method">#${bean.methodName}()</code>
</div>
</vaadin-vertical-layout>`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,6 @@ public boolean isAlternative() {
return alternative;
}

/**
* @deprecated use {@link #getPriority()}
*/
@Deprecated(forRemoval = true)
public Integer getAlternativePriority() {
return alternative ? priority : null;
}

public Integer getPriority() {
return priority;
}
Expand Down Expand Up @@ -1218,15 +1210,6 @@ Builder disposer(DisposerInfo disposer) {
return this;
}

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

Builder alternative(boolean value) {
this.alternative = value;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ public final class DotNames {
public static final DotName INTERCEPTION_PROXY = create(InterceptionProxy.class);
public static final DotName BINDINGS_SOURCE = create(BindingsSource.class);

/**
* @deprecated use {@link KotlinUtils}; this constant will be removed at some time after Quarkus 3.6
*/
@Deprecated(forRemoval = true, since = "3.0")
public static final DotName KOTLIN_METADATA_ANNOTATION = create("kotlin.Metadata");

public static final DotName BOOLEAN = create(Boolean.class);
public static final DotName BYTE = create(Byte.class);
public static final DotName CHARACTER = create(Character.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,42 +233,6 @@ public List<MethodInfo> getPreDestroys() {
return preDestroys;
}

/**
*
* @deprecated Use {@link #getAroundInvokes()} instead
*/
@Deprecated(since = "3.1", forRemoval = true)
public MethodInfo getAroundInvoke() {
return aroundInvokes.get(aroundInvokes.size() - 1);
}

/**
*
* @deprecated Use {@link #getAroundConstructs()} instead
*/
@Deprecated(since = "3.1", forRemoval = true)
public MethodInfo getAroundConstruct() {
return aroundConstructs.get(aroundConstructs.size() - 1);
}

/**
*
* @deprecated Use {@link #getPostConstructs()} instead
*/
@Deprecated(since = "3.1", forRemoval = true)
public MethodInfo getPostConstruct() {
return postConstructs.get(postConstructs.size() - 1);
}

/**
*
* @deprecated Use {@link #getPreDestroys()} instead
*/
@Deprecated(since = "3.1", forRemoval = true)
public MethodInfo getPreDestroy() {
return preDestroys.get(preDestroys.size() - 1);
}

public boolean intercepts(InterceptionType interceptionType) {
if (isSynthetic()) {
return interceptionType == this.interceptionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ public static Builder builder() {
private ArcInitConfig(Builder builder) {
this.currentContextFactory = builder.currentContextFactory;
this.strictCompatibility = builder.strictCompatibility;
this.optimizeContexts = builder.optimizeContexts;
}

private final boolean strictCompatibility;
private final CurrentContextFactory currentContextFactory;
private final boolean optimizeContexts;

public boolean isStrictCompatibility() {
return strictCompatibility;
Expand All @@ -39,26 +37,14 @@ public CurrentContextFactory getCurrentContextFactory() {
return currentContextFactory;
}

/**
*
* @return {@code true} if optimized contexts should be used, {@code false} otherwise
* @deprecated This method was never used and will be removed at some point after Quarkus 3.10
*/
@Deprecated(since = "3.7", forRemoval = true)
public boolean isOptimizeContexts() {
return optimizeContexts;
}

public static class Builder {
private boolean strictCompatibility;
private CurrentContextFactory currentContextFactory;
private boolean optimizeContexts;

private Builder() {
// init all values with their defaults
this.strictCompatibility = false;
this.currentContextFactory = null;
this.optimizeContexts = false;
}

public Builder setStrictCompatibility(boolean strictCompatibility) {
Expand All @@ -71,19 +57,6 @@ public Builder setCurrentContextFactory(CurrentContextFactory currentContextFact
return this;
}

/**
* The value was actually never used.
*
* @param value
* @return this
* @deprecated This value was never used; this method will be removed at some point after Quarkus 3.10
*/
@Deprecated(since = "3.7", forRemoval = true)
public Builder setOptimizeContexts(boolean value) {
optimizeContexts = value;
return this;
}

public ArcInitConfig build() {
return new ArcInitConfig(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ public void writeResource(Resource resource) throws IOException {
// Now we are ready to initialize Arc
ArcInitConfig.Builder initConfigBuilder = ArcInitConfig.builder();
initConfigBuilder.setStrictCompatibility(strictCompatibility);
initConfigBuilder.setOptimizeContexts(optimizeContexts);
Arc.initialize(initConfigBuilder.build());

} catch (Throwable e) {
Expand Down

0 comments on commit a36e483

Please sign in to comment.