Skip to content

Commit

Permalink
WIP to be squashed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladicek committed Apr 3, 2024
1 parent b0f42de commit 53e5d4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.eclipse.microprofile.config.ConfigProvider;

import io.quarkus.arc.BeanCreator;
import io.quarkus.arc.impl.InjectionPointProvider;
import io.quarkus.arc.impl.CreationalContextImpl;
import io.smallrye.config.inject.ConfigProducerUtil;

public class ConfigBeanCreator implements BeanCreator<Object> {
Expand All @@ -27,7 +27,7 @@ public Object create(CreationalContext<Object> creationalContext, Map<String, Ob
throw new IllegalStateException("Cannot load required type: " + requiredType);
}

InjectionPoint injectionPoint = InjectionPointProvider.get();
InjectionPoint injectionPoint = (InjectionPoint) CreationalContextImpl.getExtra(creationalContext);
if (injectionPoint == null) {
throw new IllegalStateException("No current injection point found");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.jboss.logging.Logger;

import io.quarkus.arc.Arc;
import io.quarkus.arc.impl.InjectionPointProvider;
import io.quarkus.runtime.ExecutionMode;
import io.quarkus.runtime.annotations.StaticInitSafe;
import io.smallrye.config.SmallRyeConfig;
Expand All @@ -37,7 +36,8 @@ public class ConfigStaticInitCheckInterceptor {

@AroundInvoke
Object aroundInvoke(InvocationContext context) throws Exception {
recordConfigValue(null, configValues);
InjectionPoint injectionPoint = (InjectionPoint) context.getParameters()[0];
recordConfigValue(injectionPoint, configValues);
return context.proceed();
}

Expand All @@ -46,9 +46,6 @@ static void recordConfigValue(InjectionPoint injectionPoint, ConfigStaticInitVal
// No-op for any other execution mode
return;
}
if (injectionPoint == null) {
injectionPoint = InjectionPointProvider.get();
}
if (injectionPoint == null) {
throw new IllegalStateException("No current injection point found");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

import io.quarkus.arc.Arc;
import io.quarkus.arc.BeanCreator;
import io.quarkus.arc.impl.InjectionPointProvider;
import io.quarkus.arc.impl.CreationalContextImpl;
import io.smallrye.jwt.auth.cdi.RawClaimTypeProducer;

public class RawOptionalClaimCreator implements BeanCreator<Optional<?>> {

@Override
public Optional<?> create(CreationalContext<Optional<?>> creationalContext, Map<String, Object> params) {
InjectionPoint injectionPoint = InjectionPointProvider.get();
InjectionPoint injectionPoint = (InjectionPoint) CreationalContextImpl.getExtra(creationalContext);
if (injectionPoint == null) {
throw new IllegalStateException("No current injection point found");
}
Expand Down

0 comments on commit 53e5d4e

Please sign in to comment.