Skip to content

Commit

Permalink
Merge pull request #32792 from rsvoboda/deprecations
Browse files Browse the repository at this point in the history
Deprecations cleanup - Jandex, OpenTelemetry, SRye reactive messaging
  • Loading branch information
gsmet authored Apr 25, 2023
2 parents 8ec6b03 + 63d6a0a commit 128b467
Show file tree
Hide file tree
Showing 34 changed files with 54 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ static ResultHandle arrayValue(AnnotationValue value, BytecodeCreator valueMetho

static String componentType(MethodInfo method) {
ArrayType arrayType = method.returnType().asArrayType();
return arrayType.component().name().toString();
return arrayType.constituent().name().toString();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private void addReflectiveHierarchy(CombinedIndexBuildItem combinedIndexBuildIte
}
} else if (type instanceof ArrayType) {
visits.addLast(() -> addReflectiveHierarchy(combinedIndexBuildItem, reflectiveHierarchyBuildItem, source,
type.asArrayType().component(),
type.asArrayType().constituent(),
processedReflectiveHierarchies,
unindexedClasses, finalFieldsWritable, reflectiveClass, visits));
} else if (type instanceof ParameterizedType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private void registerType(BuildProducer<ReflectiveHierarchyBuildItem> reflective
ClassLoader classLoader, Set<DotName> processedReflectiveHierarchies, boolean methods,
ReflectiveHierarchyBuildItem.Builder builder, Type type) {
if (type.kind().equals(Kind.ARRAY)) {
type = type.asArrayType().component();
type = type.asArrayType().constituent();
}
if (type.kind() != Kind.PRIMITIVE && !processedReflectiveHierarchies.contains(type.name())) {
registerClassDependencies(reflectiveClassHierarchy, classLoader, processedReflectiveHierarchies,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private static void toSignature(StringBuilder sb, Type type, Function<String, St
for (int i = 0; i < arrayType.dimensions(); i++) {
sb.append('[');
}
toSignature(sb, arrayType.component(), typeArgMapper, erased);
toSignature(sb, arrayType.constituent(), typeArgMapper, erased);
break;
case CLASS:
sb.append('L').append(type.asClassType().name().toString('/')).append(';');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private static boolean containsTypeParameters(List<Type> typeArgumentsFromSupert
private static boolean containsTypeParameters(Type type) {
switch (type.kind()) {
case ARRAY:
return containsTypeParameters(type.asArrayType().component());
return containsTypeParameters(type.asArrayType().constituent());
case PARAMETERIZED_TYPE:
ParameterizedType parameterizedType = type.asParameterizedType();
if (parameterizedType.owner() != null
Expand All @@ -259,7 +259,7 @@ private static Type mapGenerics(Type type, Map<String, Type> mapping) {
switch (type.kind()) {
case ARRAY:
ArrayType arrayType = type.asArrayType();
return ArrayType.create(mapGenerics(arrayType.component(), mapping), arrayType.dimensions());
return ArrayType.create(mapGenerics(arrayType.constituent(), mapping), arrayType.dimensions());
case CLASS:
return type;
case PARAMETERIZED_TYPE:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/kafka.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Alternatively, your application can inject a `Multi` in your bean and subscribe
[source, java]
----
import io.smallrye.mutiny.Multi;
import io.smallrye.reactive.messaging.annotations.Channel;
import org.eclipse.microprofile.reactive.messaging.Channel;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/opentelemetry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ The instrumentation documented in this section has been tested with Quarkus and

=== CDI

Annotating a method in any CDI aware bean with the `io.opentelemetry.extension.annotations.WithSpan`
Annotating a method in any CDI aware bean with the `io.opentelemetry.instrumentation.annotations.WithSpan`
annotation will create a new Span and establish any required relationships with the current Trace context.

Method parameters can be annotated with the `io.opentelemetry.extension.annotations.SpanAttribute` annotation to
Method parameters can be annotated with the `io.opentelemetry.instrumentation.annotations.SpanAttribute` annotation to
indicate which method parameters should be part of the Trace.

Example:
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/resteasy-reactive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ import org.jboss.resteasy.reactive.RestStreamElementType;
import io.smallrye.mutiny.Multi;
import io.smallrye.reactive.messaging.annotations.Channel;
import org.eclipse.microprofile.reactive.messaging.Channel;
@Path("escoffier")
public class Endpoint {
Expand Down Expand Up @@ -995,7 +995,7 @@ import org.jboss.resteasy.reactive.RestStreamElementType;
import io.smallrye.mutiny.Multi;
import io.smallrye.reactive.messaging.annotations.Channel;
import org.eclipse.microprofile.reactive.messaging.Channel;
@Path("escoffier")
public class Endpoint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static String createSimpleName(Type type) {
case PARAMETERIZED_TYPE:
return createSimple(type.asParameterizedType());
case ARRAY:
Type component = type.asArrayType().component();
Type component = type.asArrayType().constituent();
if (component.kind() == Kind.CLASS) {
return createSimple(type.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ private static void collectEmbeddedTypes(Set<DotName> embeddedTypes, Type indexT
}
break;
case ARRAY:
collectEmbeddedTypes(embeddedTypes, indexType.asArrayType().component());
collectEmbeddedTypes(embeddedTypes, indexType.asArrayType().constituent());
break;
default:
// do nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private static void collectModelClassesRecursively(Index index, Type type, Set<D
collectModelClassesRecursively(index, type.name(), classes);
break;
case ARRAY:
collectModelClassesRecursively(index, type.asArrayType().component(), classes);
collectModelClassesRecursively(index, type.asArrayType().constituent(), classes);
break;
case TYPE_VARIABLE:
for (Type bound : type.asTypeVariable().bounds()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ private static DotName getClassName(Type type) {
case PARAMETERIZED_TYPE:
return type.name();
case ARRAY:
return getClassName(type.asArrayType().component());
return getClassName(type.asArrayType().constituent());
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.extension.annotations.WithSpan;
import io.opentelemetry.instrumentation.annotations.WithSpan;
import io.opentelemetry.sdk.trace.data.SpanData;
import io.quarkus.grpc.GrpcClient;
import io.quarkus.grpc.GrpcService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2535,7 +2535,7 @@ private ResultHandle addQueryParam(MethodInfo jandexMethod, BytecodeCreator meth
ResultHandle paramArray;
String componentType = null;
if (type.kind() == Type.Kind.ARRAY) {
componentType = type.asArrayType().component().name().toString();
componentType = type.asArrayType().constituent().name().toString();
paramArray = notNullParam.checkCast(queryParamHandle, Object[].class);
} else if (isCollection(type, index)) {
if (type.kind() == PARAMETERIZED_TYPE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ private static boolean isString(Type type) {
}

private static boolean isStringArray(Type returnType) {
return returnType.kind() == Type.Kind.ARRAY && returnType.asArrayType().component().name().equals(STRING);
return returnType.kind() == Type.Kind.ARRAY && returnType.asArrayType().constituent().name().equals(STRING);
}

private static boolean isComputedParamContext(Type type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ private static boolean isComputed(PermissionKey permissionKey, MethodInfo constr

private static boolean secondParamIsNotStringArr(MethodInfo constructor) {
return constructor.parametersCount() < 2 || constructor.parameterType(1).kind() != Type.Kind.ARRAY
|| !constructor.parameterType(1).asArrayType().component().name().equals(STRING);
|| !constructor.parameterType(1).asArrayType().constituent().name().equals(STRING);
}

private static boolean isStringPermission(PermissionKey permissionKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;

import org.eclipse.microprofile.reactive.messaging.Channel;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;

import io.smallrye.reactive.messaging.annotations.Channel;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.ext.web.Router;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import org.eclipse.microprofile.reactive.messaging.Channel;
import org.eclipse.microprofile.reactive.messaging.Emitter;
import org.eclipse.microprofile.reactive.messaging.Incoming;
import org.eclipse.microprofile.reactive.messaging.Message;
import org.eclipse.microprofile.reactive.messaging.Outgoing;
Expand All @@ -26,8 +28,6 @@
import org.reactivestreams.Publisher;

import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.reactive.messaging.annotations.Channel;
import io.smallrye.reactive.messaging.annotations.Emitter;

@SuppressWarnings("unused")
public class ProcessorSignatureTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import org.eclipse.microprofile.reactive.messaging.Channel;
import org.eclipse.microprofile.reactive.messaging.Emitter;
import org.eclipse.microprofile.reactive.messaging.Incoming;
import org.eclipse.microprofile.reactive.messaging.Message;
import org.junit.jupiter.api.Test;
Expand All @@ -21,8 +23,6 @@
import org.reactivestreams.Subscription;

import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.reactive.messaging.annotations.Channel;
import io.smallrye.reactive.messaging.annotations.Emitter;

@SuppressWarnings("unused")
public class SubscriberSignatureTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import org.eclipse.microprofile.reactive.messaging.Channel;
import org.eclipse.microprofile.reactive.messaging.Emitter;
import org.eclipse.microprofile.reactive.messaging.Incoming;
import org.eclipse.microprofile.reactive.messaging.Message;
import org.eclipse.microprofile.reactive.messaging.Outgoing;
Expand All @@ -23,8 +25,6 @@
import org.reactivestreams.Publisher;

import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.reactive.messaging.annotations.Channel;
import io.smallrye.reactive.messaging.annotations.Emitter;

@SuppressWarnings("unused")
public class TransformerSignatureTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ protected Type verifyQueryResultType(Type t, IndexView index) {
return t;
}
if (t.kind() == Type.Kind.ARRAY) {
return verifyQueryResultType(t.asArrayType().component(), index);
return verifyQueryResultType(t.asArrayType().constituent(), index);
} else if (t.kind() == Type.Kind.PARAMETERIZED_TYPE) {
final List<Type> types = t.asParameterizedType().arguments();
if (types.size() == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static boolean validateConstructor(IndexView index, String permissionCla
}

private static boolean isStringArray(Type type) {
return type.kind() == Type.Kind.ARRAY && isString(type.asArrayType().component());
return type.kind() == Type.Kind.ARRAY && isString(type.asArrayType().constituent());
}

private static boolean isString(Type type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static String defaultValueStaticFieldName(MethodInfo annotationMember) {
private static boolean returnsClassOrClassArray(MethodInfo annotationMember) {
boolean returnsClass = DotNames.CLASS.equals(annotationMember.returnType().name());
boolean returnsClassArray = annotationMember.returnType().kind() == Type.Kind.ARRAY
&& DotNames.CLASS.equals(annotationMember.returnType().asArrayType().component().name());
&& DotNames.CLASS.equals(annotationMember.returnType().asArrayType().constituent().name());
return returnsClass || returnsClassArray;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private static String componentType(MethodInfo method) {

private static DotName componentTypeName(MethodInfo method) {
ArrayType arrayType = method.returnType().asArrayType();
return arrayType.component().name();
return arrayType.constituent().name();
}

private static String generateAnnotationLiteralClassName(DotName annotationName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ boolean matchesNoBoxing(Type requiredType, Type beanType) {
if (ARRAY.equals(requiredType.kind())) {
if (ARRAY.equals(beanType.kind())) {
// Array types are considered to match only if their element types are identical
return matchesNoBoxing(requiredType.asArrayType().component(), beanType.asArrayType().component());
return matchesNoBoxing(requiredType.asArrayType().constituent(), beanType.asArrayType().constituent());
}
} else if (CLASS.equals(requiredType.kind())) {
if (CLASS.equals(beanType.kind())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private static Type resolveType(Type type, ClassInfo beanClass, BeanDeployment b
return ParameterizedType.create(parameterizedType.name(), typeParams, parameterizedType.owner());
} else if (type.kind() == org.jboss.jandex.Type.Kind.ARRAY) {
ArrayType arrayType = type.asArrayType();
Type component = arrayType.component();
Type component = arrayType.constituent();
if (component.kind() == org.jboss.jandex.Type.Kind.TYPE_VARIABLE
|| component.kind() == org.jboss.jandex.Type.Kind.PARAMETERIZED_TYPE) {
component = resolveType(component, beanClass, beanDeployment, resolvedTypeVariables);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private static void getTypeHandle(AssignableResultHandle variable, BytecodeCreat
arrayHandle = doLoadClass(creator, array.name().toString(), tccl);
} else {
// E.g. List<String>[] -> new GenericArrayTypeImpl(new ParameterizedTypeImpl(List.class, String.class))
Type componentType = type.asArrayType().component();
Type componentType = type.asArrayType().constituent();
AssignableResultHandle componentTypeHandle = creator.createVariable(Object.class);
getTypeHandle(componentTypeHandle, creator, componentType, tccl, cache, typeVariables);
arrayHandle = creator.newInstance(
Expand Down Expand Up @@ -349,9 +349,9 @@ static Type getProviderType(ClassInfo classInfo) {
}

static Type getArrayElementType(ArrayType array) {
Type elementType = array.component();
Type elementType = array.constituent();
while (elementType.kind() == Kind.ARRAY) {
elementType = elementType.asArrayType().component();
elementType = elementType.asArrayType().constituent();
}
return elementType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ArrayTypeImpl extends TypeImpl<org.jboss.jandex.ArrayType> implements Arra
public Type componentType() {
int dimensions = jandexType.dimensions();
org.jboss.jandex.Type componentType = dimensions == 1
? jandexType.component()
: org.jboss.jandex.ArrayType.create(jandexType.component(), dimensions - 1);
? jandexType.constituent()
: org.jboss.jandex.ArrayType.create(jandexType.constituent(), dimensions - 1);
return fromJandexType(jandexIndex, annotationOverlays, componentType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ private ParameterizedType parameterizedType(DotName genericTypeName, Type... typ

@Override
public WildcardType wildcardWithUpperBound(Type upperBound) {
org.jboss.jandex.WildcardType jandexType = org.jboss.jandex.WildcardType.create(((TypeImpl<?>) upperBound).jandexType,
true);
org.jboss.jandex.WildcardType jandexType = org.jboss.jandex.WildcardType
.createUpperBound(((TypeImpl<?>) upperBound).jandexType);
return new WildcardTypeImpl(jandexIndex, annotationOverlays, jandexType);
}

@Override
public WildcardType wildcardWithLowerBound(Type lowerBound) {
org.jboss.jandex.WildcardType jandexType = org.jboss.jandex.WildcardType.create(((TypeImpl<?>) lowerBound).jandexType,
false);
org.jboss.jandex.WildcardType jandexType = org.jboss.jandex.WildcardType
.createLowerBound(((TypeImpl<?>) lowerBound).jandexType);
return new WildcardTypeImpl(jandexIndex, annotationOverlays, jandexType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private void implementResolve(ClassCreator valueResolver, ClassInfo declaringCla
// Last param is varargs
Type varargsParam = params.get(lastIdx).type;
ResultHandle componentType = tryCatch
.loadClass(varargsParam.asArrayType().component().name().toString());
.loadClass(varargsParam.asArrayType().constituent().name().toString());
ResultHandle varargsResults = tryCatch.invokeVirtualMethod(
Descriptors.EVALUATED_PARAMS_GET_VARARGS_RESULTS,
evaluatedParamsHandle, tryCatch.load(evaluated.size()), componentType);
Expand Down Expand Up @@ -579,7 +579,7 @@ public void addMethod(MethodInfo method, String matchName, List<String> matchNam
// Last param is varargs
Type varargsParam = params.get(lastIdx).type;
ResultHandle componentType = tryCatch
.loadClass(varargsParam.asArrayType().component().name().toString());
.loadClass(varargsParam.asArrayType().constituent().name().toString());
ResultHandle varargsResults = tryCatch.invokeVirtualMethod(
Descriptors.EVALUATED_PARAMS_GET_VARARGS_RESULTS,
whenEvaluatedParams, tryCatch.load(evaluated.size()), componentType);
Expand Down
Loading

0 comments on commit 128b467

Please sign in to comment.