diff --git a/config/config-mp/src/main/java/io/helidon/config/mp/MpConfigImpl.java b/config/config-mp/src/main/java/io/helidon/config/mp/MpConfigImpl.java index b01d788485e..44d8854af48 100644 --- a/config/config-mp/src/main/java/io/helidon/config/mp/MpConfigImpl.java +++ b/config/config-mp/src/main/java/io/helidon/config/mp/MpConfigImpl.java @@ -335,9 +335,14 @@ private Optional findConfigValue(String propertyName) { LOGGER.log(Level.TRACE, "Found property " + propertyName + " in source " + source.getName()); } String rawValue = value; - return applyFilters(propertyName, value) - .map(it -> resolveReferences(propertyName, it)) - .map(it -> new ConfigValueImpl(propertyName, it, rawValue, source.getName(), source.getOrdinal())); + try { + return applyFilters(propertyName, value) + .map(it -> resolveReferences(propertyName, it)) + .map(it -> new ConfigValueImpl(propertyName, it, rawValue, source.getName(), source.getOrdinal())); + } catch (NoSuchElementException e) { + // Property expression does not resolve + return Optional.empty(); + } } return Optional.empty(); diff --git a/config/config-mp/src/test/java/io/helidon/config/mp/MpConfigReferenceTest.java b/config/config-mp/src/test/java/io/helidon/config/mp/MpConfigReferenceTest.java index 92cc647f893..6d7cb096542 100644 --- a/config/config-mp/src/test/java/io/helidon/config/mp/MpConfigReferenceTest.java +++ b/config/config-mp/src/test/java/io/helidon/config/mp/MpConfigReferenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021 Oracle and/or its affiliates. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package io.helidon.config.mp; import java.util.NoSuchElementException; +import java.util.Optional; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.spi.ConfigProviderResolver; @@ -66,6 +67,12 @@ void testMissingRefs() { assertThrows(NoSuchElementException.class, () -> config.getValue( "referencing4-2", String.class)); } + @Test + void testOptionalMissingRefs() { + assertThat(config.getOptionalValue("referencing4-1", String.class), is(Optional.empty())); + assertThat(config.getOptionalValue("referencing4-2", String.class), is(Optional.empty())); + } + private void test(String prefix, String value) { test(prefix, "1", value); test(prefix, "2", value + "-ref"); diff --git a/dependencies/pom.xml b/dependencies/pom.xml index b60ee8a5910..1a1a7831c6e 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -68,12 +68,12 @@ 2.13.4.20221013 2.0.1 - 2.0.0 - 3.0.0 + 2.1.0 + 4.0.1 4.0.0 - 2.0.0 - 2.0.0 - 3.0.0 + 2.0.1 + 2.1.0 + 3.1.0 3.0.0 2.0.0 2.0.1 @@ -91,7 +91,7 @@ 3.0.2 3.6.3 - 3.0.9 + 3.1.0 5.11.1.202105131744-r 5.7.0 2.8.1 @@ -103,7 +103,9 @@ 3.4.3 3.3.0 4.4.0 + 3.0.1 + 4.0 2.0 4.0 @@ -144,8 +146,8 @@ 1.32 1.4.2 2.0.4 - 4.0.SP1 - 4.0.2.Final + 5.0.SP3 + 5.1.0.Final 2.0.4 2.12.0 2.12.5 @@ -899,6 +901,17 @@ weld-spi ${version.lib.weld-api} + + org.jboss.weld + weld-lite-extension-translator + ${version.lib.weld} + + + org.jboss.weld + weld-core-impl + + + org.jboss.weld.module weld-jta diff --git a/integrations/cdi/jedis-cdi/pom.xml b/integrations/cdi/jedis-cdi/pom.xml index c38d604c1c1..3b4dff41927 100644 --- a/integrations/cdi/jedis-cdi/pom.xml +++ b/integrations/cdi/jedis-cdi/pom.xml @@ -47,6 +47,10 @@ compile + + jakarta.annotation + jakarta.annotation-api + jakarta.enterprise diff --git a/integrations/cdi/jedis-cdi/src/main/java/module-info.java b/integrations/cdi/jedis-cdi/src/main/java/module-info.java index e7b676d4c09..49f2b01cb2c 100644 --- a/integrations/cdi/jedis-cdi/src/main/java/module-info.java +++ b/integrations/cdi/jedis-cdi/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021 Oracle and/or its affiliates. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ */ @SuppressWarnings({ "requires-automatic", "requires-transitive-automatic" }) module io.helidon.integrations.jedis.cdi { + requires transitive jakarta.annotation; requires transitive java.desktop; // For java.beans requires transitive jakarta.cdi; requires jakarta.inject; diff --git a/integrations/cdi/jpa-cdi/src/main/java/module-info.java b/integrations/cdi/jpa-cdi/src/main/java/module-info.java index d4facab409d..ea11b63a913 100644 --- a/integrations/cdi/jpa-cdi/src/main/java/module-info.java +++ b/integrations/cdi/jpa-cdi/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022 Oracle and/or its affiliates. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ requires jakarta.xml.bind; requires jakarta.inject; // automatic module - requires jakarta.interceptor.api; // automatic module requires io.helidon.integrations.cdi.delegates; requires io.helidon.integrations.cdi.referencecountedcontext; diff --git a/integrations/cdi/jta-cdi/src/main/java/module-info.java b/integrations/cdi/jta-cdi/src/main/java/module-info.java index 6b586b96502..0a377ac723a 100644 --- a/integrations/cdi/jta-cdi/src/main/java/module-info.java +++ b/integrations/cdi/jta-cdi/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022 Oracle and/or its affiliates. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ requires jakarta.annotation; requires java.sql; requires java.rmi; - requires jakarta.interceptor.api; requires jakarta.inject; requires jakarta.cdi; requires narayana.jta.jakarta; diff --git a/integrations/graal/mp-native-image-extension/src/main/java/io/helidon/integrations/graal/mp/nativeimage/extension/ProxyBean.java b/integrations/graal/mp-native-image-extension/src/main/java/io/helidon/integrations/graal/mp/nativeimage/extension/ProxyBean.java index cfc9b7e835b..7f34633cdab 100644 --- a/integrations/graal/mp-native-image-extension/src/main/java/io/helidon/integrations/graal/mp/nativeimage/extension/ProxyBean.java +++ b/integrations/graal/mp-native-image-extension/src/main/java/io/helidon/integrations/graal/mp/nativeimage/extension/ProxyBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,11 +53,6 @@ public Set getInjectionPoints() { return Collections.emptySet(); } - @Override - public boolean isNullable() { - return false; - } - @Override public Object create(CreationalContext creationalContext) { throw new IllegalStateException("This bean should not be created"); diff --git a/integrations/micrometer/cdi/src/main/java/module-info.java b/integrations/micrometer/cdi/src/main/java/module-info.java index 172685a8b8f..a2065043331 100644 --- a/integrations/micrometer/cdi/src/main/java/module-info.java +++ b/integrations/micrometer/cdi/src/main/java/module-info.java @@ -35,7 +35,6 @@ requires static jakarta.activation; requires static jakarta.cdi; requires static jakarta.inject; - requires static jakarta.interceptor.api; requires io.helidon.common.http; requires io.helidon.reactive.servicecommon; diff --git a/integrations/micronaut/cdi/src/main/java/module-info.java b/integrations/micronaut/cdi/src/main/java/module-info.java index 2c366944fdd..037eb690345 100644 --- a/integrations/micronaut/cdi/src/main/java/module-info.java +++ b/integrations/micronaut/cdi/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021 Oracle and/or its affiliates. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ requires jakarta.cdi; requires jakarta.inject; - requires jakarta.interceptor.api; requires microprofile.config.api; diff --git a/integrations/micronaut/data/src/main/java/module-info.java b/integrations/micronaut/data/src/main/java/module-info.java index fb512b2ac8c..04b15efff4f 100644 --- a/integrations/micronaut/data/src/main/java/module-info.java +++ b/integrations/micronaut/data/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022 Oracle and/or its affiliates. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ requires java.sql; requires jakarta.cdi; - requires jakarta.interceptor.api; requires io.micronaut.inject; diff --git a/integrations/microstream/cdi/src/main/java/module-info.java b/integrations/microstream/cdi/src/main/java/module-info.java index 882712fccac..ea6007a0933 100644 --- a/integrations/microstream/cdi/src/main/java/module-info.java +++ b/integrations/microstream/cdi/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ requires io.helidon.integrations.microstream.cache; requires transitive jakarta.cdi; requires transitive jakarta.inject; - requires jakarta.interceptor.api; requires jakarta.annotation; requires microstream.base; requires microstream.cache; diff --git a/integrations/neo4j/metrics/src/main/java/module-info.java b/integrations/neo4j/metrics/src/main/java/module-info.java index 1a48023557b..11956dae2e5 100644 --- a/integrations/neo4j/metrics/src/main/java/module-info.java +++ b/integrations/neo4j/metrics/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ requires static jakarta.cdi; requires static jakarta.inject; - requires static jakarta.interceptor.api; requires static jakarta.annotation; exports io.helidon.integrations.neo4j.metrics; diff --git a/integrations/neo4j/neo4j/src/main/java/module-info.java b/integrations/neo4j/neo4j/src/main/java/module-info.java index dbfc30a000f..e67f704c923 100644 --- a/integrations/neo4j/neo4j/src/main/java/module-info.java +++ b/integrations/neo4j/neo4j/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ requires static jakarta.cdi; requires static jakarta.inject; - requires static jakarta.interceptor.api; requires static io.helidon.config; requires static io.helidon.config.mp; diff --git a/integrations/oci/metrics/cdi/src/main/java/module-info.java b/integrations/oci/metrics/cdi/src/main/java/module-info.java index 18b58d523a5..17f2aaadff8 100644 --- a/integrations/oci/metrics/cdi/src/main/java/module-info.java +++ b/integrations/oci/metrics/cdi/src/main/java/module-info.java @@ -25,7 +25,6 @@ requires oci.java.sdk.monitoring; - requires jakarta.interceptor.api; provides jakarta.enterprise.inject.spi.Extension with io.helidon.integrations.oci.metrics.cdi.OciMetricsCdiExtension; opens io.helidon.integrations.oci.metrics.cdi to weld.core.impl, io.helidon.microprofile.cdi; diff --git a/integrations/oci/sdk/cdi/pom.xml b/integrations/oci/sdk/cdi/pom.xml index ac886cddae2..4eb81e4655c 100644 --- a/integrations/oci/sdk/cdi/pom.xml +++ b/integrations/oci/sdk/cdi/pom.xml @@ -50,6 +50,11 @@ oci-java-sdk-common-httpclient-jersey3 runtime + + jakarta.annotation + jakarta.annotation-api + provided + jakarta.inject jakarta.inject-api diff --git a/integrations/oci/sdk/cdi/src/main/java/module-info.java b/integrations/oci/sdk/cdi/src/main/java/module-info.java index e50c77c7bca..3c2d1c2435b 100644 --- a/integrations/oci/sdk/cdi/src/main/java/module-info.java +++ b/integrations/oci/sdk/cdi/src/main/java/module-info.java @@ -29,12 +29,11 @@ requires java.logging; requires transitive jakarta.cdi; requires jakarta.inject; - requires jakarta.interceptor.api; requires jakarta.ws.rs; requires microprofile.config.api; requires oci.java.sdk.common; requires oci.java.sdk.common.httpclient; - + exports io.helidon.integrations.oci.sdk.cdi; provides jakarta.enterprise.inject.spi.Extension diff --git a/integrations/vault/cdi/src/main/java/io/helidon/integrations/vault/cdi/QualifiedBean.java b/integrations/vault/cdi/src/main/java/io/helidon/integrations/vault/cdi/QualifiedBean.java index aa5e2668f24..9f401f72b36 100644 --- a/integrations/vault/cdi/src/main/java/io/helidon/integrations/vault/cdi/QualifiedBean.java +++ b/integrations/vault/cdi/src/main/java/io/helidon/integrations/vault/cdi/QualifiedBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,11 +65,6 @@ public Set getInjectionPoints() { return Set.of(); } - @Override - public boolean isNullable() { - return false; - } - @Override public T create(CreationalContext creationalContext) { return creator.get(); diff --git a/microprofile/access-log/src/main/java/module-info.java b/microprofile/access-log/src/main/java/module-info.java index 6d224968632..a3727e11eed 100644 --- a/microprofile/access-log/src/main/java/module-info.java +++ b/microprofile/access-log/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022 Oracle and/or its affiliates. + * Copyright (c) 2019, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ requires io.helidon.microprofile.server; requires io.helidon.nima.webserver.accesslog; - requires jakarta.interceptor.api; exports io.helidon.microprofile.accesslog; diff --git a/microprofile/cdi/pom.xml b/microprofile/cdi/pom.xml index acb76caf423..5c0175c94a7 100644 --- a/microprofile/cdi/pom.xml +++ b/microprofile/cdi/pom.xml @@ -46,6 +46,10 @@ org.jboss.classfilewriter jboss-classfilewriter + + org.jboss.weld + weld-lite-extension-translator + org.eclipse.microprofile.config microprofile-config-api diff --git a/microprofile/cdi/src/main/java/io/helidon/microprofile/cdi/HelidonProxyServices.java b/microprofile/cdi/src/main/java/io/helidon/microprofile/cdi/HelidonProxyServices.java index 200fc98573f..613202b5415 100644 --- a/microprofile/cdi/src/main/java/io/helidon/microprofile/cdi/HelidonProxyServices.java +++ b/microprofile/cdi/src/main/java/io/helidon/microprofile/cdi/HelidonProxyServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Oracle and/or its affiliates. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,26 +47,11 @@ class HelidonProxyServices implements ProxyServices { this.myModule = HelidonProxyServices.class.getModule(); } - @Override - public ClassLoader getClassLoader(Class proxiedBeanType) { - return wrapCl(proxiedBeanType.getClassLoader()); - } - - @Override - public Class loadBeanClass(String className) { - return contextClassDefiningCl.doLoad(className); - } - @Override public void cleanup() { classLoaders.clear(); } - @Override - public boolean supportsClassDefining() { - return true; - } - @Override public Class defineClass(Class originalClass, String className, byte[] classBytes, int off, int len) throws ClassFormatError { diff --git a/microprofile/cors/src/main/java/module-info.java b/microprofile/cors/src/main/java/module-info.java index 973c9c269cb..190882a85bd 100644 --- a/microprofile/cors/src/main/java/module-info.java +++ b/microprofile/cors/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022 Oracle and/or its affiliates. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ requires jersey.common; requires microprofile.config.api; - requires jakarta.interceptor.api; requires jakarta.cdi; exports io.helidon.microprofile.cors; diff --git a/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FallbackHelper.java b/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FallbackHelper.java index 9944a014c65..4fc4f8a6b81 100644 --- a/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FallbackHelper.java +++ b/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FallbackHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021 Oracle and/or its affiliates. + * Copyright (c) 2018, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,9 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import jakarta.enterprise.inject.Instance; import jakarta.enterprise.inject.spi.CDI; +import jakarta.enterprise.inject.spi.Unmanaged; import jakarta.interceptor.InvocationContext; import org.eclipse.microprofile.faulttolerance.ExecutionContext; import org.eclipse.microprofile.faulttolerance.Fallback; @@ -34,6 +36,23 @@ class FallbackHelper { private final Throwable throwable; + private final ExecutionContext executionContext = new ExecutionContext() { + @Override + public Method getMethod() { + return context.getMethod(); + } + + @Override + public Object[] getParameters() { + return context.getParameters(); + } + + @Override + public Throwable getFailure() { + return throwable; + } + }; + private Class> handlerClass; private Method fallbackMethod; @@ -80,25 +99,23 @@ public Object execute() throws Exception { try { if (handlerClass != null) { // Instantiate handler using CDI - FallbackHandler handler = CDI.current().select(handlerClass).get(); - result = handler.handle( - new ExecutionContext() { - @Override - public Method getMethod() { - return context.getMethod(); - } - - @Override - public Object[] getParameters() { - return context.getParameters(); - } - - @Override - public Throwable getFailure() { - return throwable; - } - } - ); + Instance instance = CDI.current().select(handlerClass); + if (instance.isResolvable()) { + FallbackHandler handler = instance.get(); + result = handler.handle(executionContext); + } else { + // It is not required that FallbackHandler is a bean. TCKs will fail otherwise + Unmanaged> unmanaged = new Unmanaged<>(CDI.current().getBeanManager(), + (Class>) handlerClass); + Unmanaged.UnmanagedInstance> unmanagedInstance = unmanaged.newInstance(); + FallbackHandler handler = unmanagedInstance.produce().inject().postConstruct().get(); + try { + result = handler.handle(executionContext); + } finally { + // The instance exists to service a single invocation only + unmanagedInstance.preDestroy().dispose(); + } + } } else { result = fallbackMethod.invoke(context.getTarget(), context.getParameters()); } diff --git a/microprofile/fault-tolerance/src/main/java/module-info.java b/microprofile/fault-tolerance/src/main/java/module-info.java index e3c133d4929..69762c6e63f 100644 --- a/microprofile/fault-tolerance/src/main/java/module-info.java +++ b/microprofile/fault-tolerance/src/main/java/module-info.java @@ -32,7 +32,6 @@ requires jakarta.annotation; requires jakarta.inject; - requires jakarta.interceptor.api; requires io.helidon.common.context; requires io.helidon.common.configurable; diff --git a/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/FallbackBean.java b/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/FallbackBean.java index 27ae8e73272..ad560bf3b10 100644 --- a/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/FallbackBean.java +++ b/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/FallbackBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021 Oracle and/or its affiliates. + * Copyright (c) 2018, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,6 +68,13 @@ String fallbackHandler(String value) { throw new RuntimeException("Oops"); } + @Fallback(FallbackBeanHandler2.class) + String fallbackHandler2(String value) { + called.set(true); + FaultToleranceTest.printStatus("FallbackBean::fallbackHandler2()", "failure"); + throw new RuntimeException("Oops"); + } + @Dependent static class FallbackBeanHandler implements FallbackHandler { @@ -81,4 +88,17 @@ public String handle(ExecutionContext context) { return "fallbackHandler"; } } + + static class FallbackBeanHandler2 implements FallbackHandler { + + @Override + public String handle(ExecutionContext context) { + FaultToleranceTest.printStatus("FallbackBeanHandler2::handle()", "success"); + assertThat(context, is(notNullValue())); + assertThat(context.getMethod().getName(), is("fallbackHandler2")); + assertThat(context.getParameters().length, is(1)); + assertThat(context.getParameters()[0], is("someValue")); + return "fallbackHandler2"; + } + } } diff --git a/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/FallbackTest.java b/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/FallbackTest.java index c7038ce0b44..f1b0feb177f 100644 --- a/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/FallbackTest.java +++ b/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/FallbackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021 Oracle and/or its affiliates. + * Copyright (c) 2018, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,4 +61,12 @@ void testFallbackHandler() { assertThat(bean.getCalled(), is(true)); assertThat(value, is("fallbackHandler")); } + + @Test + void testFallbackHandler2() { + assertThat(bean.getCalled(), is(false)); + String value = bean.fallbackHandler2("someValue"); + assertThat(bean.getCalled(), is(true)); + assertThat(value, is("fallbackHandler2")); + } } diff --git a/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/SyntheticBean.java b/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/SyntheticBean.java index 59cb2963beb..6251c08fcc3 100644 --- a/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/SyntheticBean.java +++ b/microprofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/SyntheticBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021 Oracle and/or its affiliates. + * Copyright (c) 2019, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,9 +91,4 @@ public Set getInjectionPoints() { return emptySet(); } - @Override - public boolean isNullable() { - return false; - } - } diff --git a/microprofile/graphql/server/src/main/java/module-info.java b/microprofile/graphql/server/src/main/java/module-info.java index a14ae2044d6..175f1fc25b0 100644 --- a/microprofile/graphql/server/src/main/java/module-info.java +++ b/microprofile/graphql/server/src/main/java/module-info.java @@ -36,7 +36,6 @@ requires jakarta.json.bind; requires jakarta.annotation; requires jakarta.cdi; - requires jakarta.interceptor.api; requires org.eclipse.yasson; requires org.jboss.jandex; diff --git a/microprofile/grpc/metrics/src/main/java/module-info.java b/microprofile/grpc/metrics/src/main/java/module-info.java index c47c68133f5..290969d3f29 100644 --- a/microprofile/grpc/metrics/src/main/java/module-info.java +++ b/microprofile/grpc/metrics/src/main/java/module-info.java @@ -37,8 +37,6 @@ requires io.helidon.microprofile.servicecommon; - requires jakarta.interceptor.api; - provides io.helidon.microprofile.grpc.server.AnnotatedServiceConfigurer with io.helidon.microprofile.grpc.metrics.MetricsConfigurer; diff --git a/microprofile/health/src/main/java/module-info.java b/microprofile/health/src/main/java/module-info.java index 931673a0687..598084d5a80 100644 --- a/microprofile/health/src/main/java/module-info.java +++ b/microprofile/health/src/main/java/module-info.java @@ -43,7 +43,6 @@ requires jakarta.inject; requires jakarta.ws.rs; requires jakarta.json; - requires jakarta.interceptor.api; requires microprofile.config.api; requires transitive microprofile.health.api; requires io.helidon.config.mp; diff --git a/microprofile/jwt-auth/src/main/java/io/helidon/microprofile/jwt/auth/ClaimProducer.java b/microprofile/jwt-auth/src/main/java/io/helidon/microprofile/jwt/auth/ClaimProducer.java index cfa8720ca35..2aa9468c5ae 100644 --- a/microprofile/jwt-auth/src/main/java/io/helidon/microprofile/jwt/auth/ClaimProducer.java +++ b/microprofile/jwt-auth/src/main/java/io/helidon/microprofile/jwt/auth/ClaimProducer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022 Oracle and/or its affiliates. + * Copyright (c) 2018, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,11 +132,6 @@ public Set getInjectionPoints() { return Set.of(); } - @Override - public boolean isNullable() { - return false; - } - @Override public void destroy(Object instance, CreationalContext creationalContext) { diff --git a/microprofile/lra/jax-rs/src/main/java/module-info.java b/microprofile/lra/jax-rs/src/main/java/module-info.java index 102be0b735b..0c8d2743bf2 100644 --- a/microprofile/lra/jax-rs/src/main/java/module-info.java +++ b/microprofile/lra/jax-rs/src/main/java/module-info.java @@ -42,7 +42,6 @@ requires io.helidon.microprofile.config; requires io.helidon.microprofile.server; requires microprofile.config.api; - requires jakarta.interceptor.api; requires jersey.common; requires io.helidon.lra.coordinator.client; requires io.helidon.common.reactive; diff --git a/microprofile/messaging/core/src/main/java/module-info.java b/microprofile/messaging/core/src/main/java/module-info.java index 528c74c03a2..8b1a405fd66 100644 --- a/microprofile/messaging/core/src/main/java/module-info.java +++ b/microprofile/messaging/core/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022 Oracle and/or its affiliates. + * Copyright (c) 2018, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ requires static jakarta.cdi; requires static jakarta.inject; requires static jakarta.activation; - requires jakarta.interceptor.api; requires io.helidon.config; requires io.helidon.config.mp; requires io.helidon.microprofile.config; diff --git a/microprofile/metrics/src/main/java/module-info.java b/microprofile/metrics/src/main/java/module-info.java index fa02372592b..f527dddbe38 100644 --- a/microprofile/metrics/src/main/java/module-info.java +++ b/microprofile/metrics/src/main/java/module-info.java @@ -32,7 +32,6 @@ requires static jakarta.cdi; requires static jakarta.inject; - requires static jakarta.interceptor.api; requires static jakarta.annotation; requires static jakarta.activation; diff --git a/microprofile/openapi/src/main/java/module-info.java b/microprofile/openapi/src/main/java/module-info.java index 935e6414231..e2ae5e65ea0 100644 --- a/microprofile/openapi/src/main/java/module-info.java +++ b/microprofile/openapi/src/main/java/module-info.java @@ -36,7 +36,6 @@ requires microprofile.config.api; requires io.helidon.microprofile.server; requires io.helidon.openapi; - requires jakarta.interceptor.api; requires io.helidon.nima.openapi; requires transitive microprofile.openapi.api; diff --git a/microprofile/scheduling/src/main/java/module-info.java b/microprofile/scheduling/src/main/java/module-info.java index 3b1ee5f02e4..a5583113118 100644 --- a/microprofile/scheduling/src/main/java/module-info.java +++ b/microprofile/scheduling/src/main/java/module-info.java @@ -33,7 +33,6 @@ requires static jakarta.cdi; requires static jakarta.inject; - requires jakarta.interceptor.api; requires io.helidon.common.configurable; requires io.helidon.config; requires io.helidon.config.mp; diff --git a/microprofile/security/src/main/java/module-info.java b/microprofile/security/src/main/java/module-info.java index fd58e157911..776a6bafb42 100644 --- a/microprofile/security/src/main/java/module-info.java +++ b/microprofile/security/src/main/java/module-info.java @@ -34,7 +34,6 @@ requires transitive io.helidon.security.integration.nima; requires io.helidon.microprofile.server; requires io.helidon.microprofile.cdi; - requires jakarta.interceptor.api; exports io.helidon.microprofile.security; diff --git a/microprofile/server/src/main/java/module-info.java b/microprofile/server/src/main/java/module-info.java index 1a6367426d4..c60859dddb5 100644 --- a/microprofile/server/src/main/java/module-info.java +++ b/microprofile/server/src/main/java/module-info.java @@ -41,7 +41,6 @@ requires io.helidon.microprofile.config; requires transitive jakarta.cdi; requires transitive jakarta.ws.rs; - requires jakarta.interceptor.api; requires transitive jakarta.json; requires io.helidon.jersey.media.jsonp; diff --git a/microprofile/service-common/src/main/java/module-info.java b/microprofile/service-common/src/main/java/module-info.java index ab1f74fb67d..0cd39139468 100644 --- a/microprofile/service-common/src/main/java/module-info.java +++ b/microprofile/service-common/src/main/java/module-info.java @@ -24,7 +24,6 @@ requires jakarta.cdi; requires io.helidon.nima.servicecommon; requires microprofile.config.api; - requires jakarta.interceptor.api; requires jakarta.inject; requires io.helidon.config.mp; requires io.helidon.microprofile.server; diff --git a/microprofile/tests/tck/tck-config/src/test/tck-suite.xml b/microprofile/tests/tck/tck-config/src/test/tck-suite.xml index fc6feb8f8b0..c0b3744854f 100644 --- a/microprofile/tests/tck/tck-config/src/test/tck-suite.xml +++ b/microprofile/tests/tck/tck-config/src/test/tck-suite.xml @@ -1,7 +1,7 @@ + + diff --git a/microprofile/tests/tck/tck-fault-tolerance/src/test/tck-suite.xml b/microprofile/tests/tck/tck-fault-tolerance/src/test/tck-suite.xml index eb1ba34f09a..e08fed0f0c2 100644 --- a/microprofile/tests/tck/tck-fault-tolerance/src/test/tck-suite.xml +++ b/microprofile/tests/tck/tck-fault-tolerance/src/test/tck-suite.xml @@ -2,7 +2,7 @@ + org.eclipse.microprofile.lra.tck.TckRecoveryTests.java + diff --git a/microprofile/tracing/src/main/java/module-info.java b/microprofile/tracing/src/main/java/module-info.java index f797a2f1273..cdbdcaa3acf 100644 --- a/microprofile/tracing/src/main/java/module-info.java +++ b/microprofile/tracing/src/main/java/module-info.java @@ -39,7 +39,6 @@ requires static jakarta.cdi; requires static jakarta.inject; - requires static jakarta.interceptor.api; requires io.helidon.microprofile.server; requires transitive io.helidon.microprofile.config; diff --git a/microprofile/websocket/src/main/java/module-info.java b/microprofile/websocket/src/main/java/module-info.java index 11c696a73af..eaee841b4e6 100644 --- a/microprofile/websocket/src/main/java/module-info.java +++ b/microprofile/websocket/src/main/java/module-info.java @@ -32,7 +32,6 @@ requires java.net.http; requires jakarta.inject; - requires jakarta.interceptor.api; requires jakarta.cdi; requires transitive jakarta.websocket; diff --git a/microprofile/weld/weld-core-impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java b/microprofile/weld/weld-core-impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java index 5ec31ec06b3..15cac88caa2 100644 --- a/microprofile/weld/weld-core-impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java +++ b/microprofile/weld/weld-core-impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java @@ -98,7 +98,7 @@ * * Helidon changes are under the copyright of: * - * Copyright (c) 2020. 2022 Oracle and/or its affiliates. + * Copyright (c) 2020. 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -144,6 +144,7 @@ public class ProxyFactory implements PrivilegedAction { protected static final String INVOKE_METHOD_NAME = "invoke"; protected static final String METHOD_HANDLER_FIELD_NAME = "methodHandler"; static final String JAVA = "java"; + static final String JAKARTA = "jakarta"; static final String NO_PACKAGE = "the class package is null or empty"; static final String SIGNED = "the class is signed"; private static final Set METHOD_FILTERS; @@ -429,6 +430,8 @@ public Class getProxyClass() { } if (proxyClassName.startsWith(JAVA)) { proxyClassName = proxyClassName.replaceFirst(JAVA, WELD_PROXY_PREFIX); + } else if (proxyClassName.startsWith(JAKARTA)) { + proxyClassName = proxyClassName.replaceFirst(JAKARTA, WELD_PROXY_PREFIX); } Class proxyClass = null; Class originalClass = bean != null ? bean.getBeanClass() : proxiedBeanType;