From 817b7bb7c5a691bd997ea00c844c01bd18c188df Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Fri, 22 May 2020 15:48:47 +0530 Subject: [PATCH 1/2] Jakarta namespace transition Signed-off-by: Gaurav Gupta --- pom.xml | 33 ++++++++---- .../BeanManagerInstanceCreator.java | 9 ++-- .../JsonbComponentInstanceCreatorFactory.java | 2 +- .../yasson/internal/cdi/CalledMethods.java | 4 +- .../internal/cdi/CdiDependentAdapter.java | 4 +- .../yasson/internal/cdi/CdiInjectionTest.java | 6 +-- .../yasson/internal/cdi/CdiTestService.java | 8 +-- .../eclipse/yasson/internal/cdi/Hello1.java | 4 +- .../eclipse/yasson/internal/cdi/Hello2.java | 4 +- .../yasson/internal/cdi/HelloService1.java | 8 +-- .../yasson/internal/cdi/HelloService2.java | 8 +-- .../yasson/internal/cdi/JndiBeanManager.java | 50 +++++++++---------- .../internal/cdi/MockInjectionTarget.java | 6 +-- .../eclipse/yasson/jmh/CollectionsTest.java | 4 +- .../eclipse/yasson/jmh/ScalarDataTest.java | 4 +- .../jmh/TenPropertySerializationTest.java | 2 +- 16 files changed, 85 insertions(+), 71 deletions(-) diff --git a/pom.xml b/pom.xml index 54b999197..0d250e1d7 100644 --- a/pom.xml +++ b/pom.xml @@ -34,10 +34,28 @@ UTF-8 - 2.0.0-RC1 + 2.0.0-RC2 2.0.0-RC1 + 3.0.0-M2 JDK_9 + + + + + jakarta.json + jakarta.json-api + ${jakarta.json.version} + + + org.glassfish + jakarta.json + ${jakarta.json.version} + module + compile + + + @@ -49,27 +67,24 @@ jakarta.json jakarta.json-api - ${jakarta.json.version} org.glassfish jakarta.json - ${jakarta.json.version} module - compile jakarta.enterprise jakarta.enterprise.cdi-api - 2.0.2 + ${jakarta.enterprise.cdi-api.version} true provided org.jboss.weld.se - weld-se - 2.4.3.Final + weld-se-core + 4.0.0.Alpha2 test @@ -383,8 +398,8 @@ org.eclipse.yasson;version=${project.version} org.eclipse.yasson.*;version=${project.version} - javax.enterprise.context.spi;version=!;resolution:="optional", - javax.enterprise.inject.spi;version=!;resolution:="optional", + jakarta.enterprise.context.spi;version=!;resolution:="optional", + jakarta.enterprise.inject.spi;version=!;resolution:="optional", javax.naming;resolution:="optional", java.beans;resolution:="optional", * diff --git a/src/main/java/org/eclipse/yasson/internal/components/BeanManagerInstanceCreator.java b/src/main/java/org/eclipse/yasson/internal/components/BeanManagerInstanceCreator.java index ef951d157..0c55d62a0 100644 --- a/src/main/java/org/eclipse/yasson/internal/components/BeanManagerInstanceCreator.java +++ b/src/main/java/org/eclipse/yasson/internal/components/BeanManagerInstanceCreator.java @@ -16,13 +16,12 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import jakarta.enterprise.context.spi.CreationalContext; +import jakarta.enterprise.inject.spi.AnnotatedType; +import jakarta.enterprise.inject.spi.BeanManager; +import jakarta.enterprise.inject.spi.InjectionTarget; import jakarta.json.bind.JsonbException; -import javax.enterprise.context.spi.CreationalContext; -import javax.enterprise.inject.spi.AnnotatedType; -import javax.enterprise.inject.spi.BeanManager; -import javax.enterprise.inject.spi.InjectionTarget; - import org.eclipse.yasson.internal.JsonBinding; import org.eclipse.yasson.internal.properties.MessageKeys; import org.eclipse.yasson.internal.properties.Messages; diff --git a/src/main/java/org/eclipse/yasson/internal/components/JsonbComponentInstanceCreatorFactory.java b/src/main/java/org/eclipse/yasson/internal/components/JsonbComponentInstanceCreatorFactory.java index 7dd1b4fc3..b77449db0 100644 --- a/src/main/java/org/eclipse/yasson/internal/components/JsonbComponentInstanceCreatorFactory.java +++ b/src/main/java/org/eclipse/yasson/internal/components/JsonbComponentInstanceCreatorFactory.java @@ -45,7 +45,7 @@ private JsonbComponentInstanceCreatorFactory() { * Initial context class. */ public static final String INITIAL_CONTEXT_CLASS = "javax.naming.InitialContext"; - private static final String CDI_SPI_CLASS = "javax.enterprise.inject.spi.CDI"; + private static final String CDI_SPI_CLASS = "jakarta.enterprise.inject.spi.CDI"; /** * First check a CDI provider, if available use those. diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/CalledMethods.java b/src/test/java/org/eclipse/yasson/internal/cdi/CalledMethods.java index edfdd42d4..ce7b402e7 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/CalledMethods.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/CalledMethods.java @@ -12,8 +12,8 @@ package org.eclipse.yasson.internal.cdi; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Observes; import java.util.HashMap; import java.util.Map; diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/CdiDependentAdapter.java b/src/test/java/org/eclipse/yasson/internal/cdi/CdiDependentAdapter.java index 8f8514ea0..76eb2684c 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/CdiDependentAdapter.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/CdiDependentAdapter.java @@ -12,8 +12,8 @@ package org.eclipse.yasson.internal.cdi; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import jakarta.json.bind.adapter.JsonbAdapter; /** diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/CdiInjectionTest.java b/src/test/java/org/eclipse/yasson/internal/cdi/CdiInjectionTest.java index 8ffe6b774..b17770c81 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/CdiInjectionTest.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/CdiInjectionTest.java @@ -17,9 +17,9 @@ import org.eclipse.yasson.internal.components.JsonbComponentInstanceCreatorFactory; -import javax.enterprise.inject.spi.Bean; -import javax.enterprise.inject.spi.BeanManager; -import javax.enterprise.inject.spi.CDI; +import jakarta.enterprise.inject.spi.Bean; +import jakarta.enterprise.inject.spi.BeanManager; +import jakarta.enterprise.inject.spi.CDI; import jakarta.json.bind.Jsonb; import jakarta.json.bind.JsonbBuilder; import jakarta.json.bind.JsonbConfig; diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/CdiTestService.java b/src/test/java/org/eclipse/yasson/internal/cdi/CdiTestService.java index 3e1926ce9..9a68f4e81 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/CdiTestService.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/CdiTestService.java @@ -12,10 +12,10 @@ package org.eclipse.yasson.internal.cdi; -import javax.annotation.PreDestroy; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Event; -import javax.inject.Inject; +import jakarta.annotation.PreDestroy; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Event; +import jakarta.inject.Inject; /** * CDI test service diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/Hello1.java b/src/test/java/org/eclipse/yasson/internal/cdi/Hello1.java index fab45ed25..7d769fcc8 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/Hello1.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/Hello1.java @@ -12,8 +12,8 @@ package org.eclipse.yasson.internal.cdi; -import javax.enterprise.inject.Default; -import javax.inject.Qualifier; +import jakarta.enterprise.inject.Default; +import jakarta.inject.Qualifier; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/Hello2.java b/src/test/java/org/eclipse/yasson/internal/cdi/Hello2.java index 0c318bb5c..1500197b1 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/Hello2.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/Hello2.java @@ -12,8 +12,8 @@ package org.eclipse.yasson.internal.cdi; -import javax.enterprise.inject.Default; -import javax.inject.Qualifier; +import jakarta.enterprise.inject.Default; +import jakarta.inject.Qualifier; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/HelloService1.java b/src/test/java/org/eclipse/yasson/internal/cdi/HelloService1.java index 3f6ea46fa..9631b1664 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/HelloService1.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/HelloService1.java @@ -12,10 +12,10 @@ package org.eclipse.yasson.internal.cdi; -import javax.annotation.PreDestroy; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Event; -import javax.inject.Inject; +import jakarta.annotation.PreDestroy; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Event; +import jakarta.inject.Inject; /** * @author Roman Grigoriadi diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/HelloService2.java b/src/test/java/org/eclipse/yasson/internal/cdi/HelloService2.java index 5005576d5..ab25c777f 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/HelloService2.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/HelloService2.java @@ -12,10 +12,10 @@ package org.eclipse.yasson.internal.cdi; -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.inject.Inject; +import jakarta.annotation.PreDestroy; +import jakarta.enterprise.context.Dependent; +import jakarta.enterprise.event.Event; +import jakarta.inject.Inject; /** * Dependant scoped bean, should be destroyed with its wrapper bean. diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/JndiBeanManager.java b/src/test/java/org/eclipse/yasson/internal/cdi/JndiBeanManager.java index 32716d6f4..4de1fabb6 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/JndiBeanManager.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/JndiBeanManager.java @@ -12,31 +12,31 @@ package org.eclipse.yasson.internal.cdi; -import javax.el.ELResolver; -import javax.el.ExpressionFactory; -import javax.enterprise.context.spi.Context; -import javax.enterprise.context.spi.Contextual; -import javax.enterprise.context.spi.CreationalContext; -import javax.enterprise.event.Event; -import javax.enterprise.inject.Instance; -import javax.enterprise.inject.spi.AnnotatedField; -import javax.enterprise.inject.spi.AnnotatedMember; -import javax.enterprise.inject.spi.AnnotatedMethod; -import javax.enterprise.inject.spi.AnnotatedParameter; -import javax.enterprise.inject.spi.AnnotatedType; -import javax.enterprise.inject.spi.Bean; -import javax.enterprise.inject.spi.BeanAttributes; -import javax.enterprise.inject.spi.BeanManager; -import javax.enterprise.inject.spi.Decorator; -import javax.enterprise.inject.spi.Extension; -import javax.enterprise.inject.spi.InjectionPoint; -import javax.enterprise.inject.spi.InjectionTarget; -import javax.enterprise.inject.spi.InjectionTargetFactory; -import javax.enterprise.inject.spi.InterceptionFactory; -import javax.enterprise.inject.spi.InterceptionType; -import javax.enterprise.inject.spi.Interceptor; -import javax.enterprise.inject.spi.ObserverMethod; -import javax.enterprise.inject.spi.ProducerFactory; +import jakarta.el.ELResolver; +import jakarta.el.ExpressionFactory; +import jakarta.enterprise.context.spi.Context; +import jakarta.enterprise.context.spi.Contextual; +import jakarta.enterprise.context.spi.CreationalContext; +import jakarta.enterprise.event.Event; +import jakarta.enterprise.inject.Instance; +import jakarta.enterprise.inject.spi.AnnotatedField; +import jakarta.enterprise.inject.spi.AnnotatedMember; +import jakarta.enterprise.inject.spi.AnnotatedMethod; +import jakarta.enterprise.inject.spi.AnnotatedParameter; +import jakarta.enterprise.inject.spi.AnnotatedType; +import jakarta.enterprise.inject.spi.Bean; +import jakarta.enterprise.inject.spi.BeanAttributes; +import jakarta.enterprise.inject.spi.BeanManager; +import jakarta.enterprise.inject.spi.Decorator; +import jakarta.enterprise.inject.spi.Extension; +import jakarta.enterprise.inject.spi.InjectionPoint; +import jakarta.enterprise.inject.spi.InjectionTarget; +import jakarta.enterprise.inject.spi.InjectionTargetFactory; +import jakarta.enterprise.inject.spi.InterceptionFactory; +import jakarta.enterprise.inject.spi.InterceptionType; +import jakarta.enterprise.inject.spi.Interceptor; +import jakarta.enterprise.inject.spi.ObserverMethod; +import jakarta.enterprise.inject.spi.ProducerFactory; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.List; diff --git a/src/test/java/org/eclipse/yasson/internal/cdi/MockInjectionTarget.java b/src/test/java/org/eclipse/yasson/internal/cdi/MockInjectionTarget.java index 51963f158..a006739a2 100644 --- a/src/test/java/org/eclipse/yasson/internal/cdi/MockInjectionTarget.java +++ b/src/test/java/org/eclipse/yasson/internal/cdi/MockInjectionTarget.java @@ -12,9 +12,9 @@ package org.eclipse.yasson.internal.cdi; -import javax.enterprise.context.spi.CreationalContext; -import javax.enterprise.inject.spi.InjectionPoint; -import javax.enterprise.inject.spi.InjectionTarget; +import jakarta.enterprise.context.spi.CreationalContext; +import jakarta.enterprise.inject.spi.InjectionPoint; +import jakarta.enterprise.inject.spi.InjectionTarget; import jakarta.json.bind.adapter.JsonbAdapter; import java.util.Set; diff --git a/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/CollectionsTest.java b/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/CollectionsTest.java index d37536e3e..5eb0b347e 100644 --- a/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/CollectionsTest.java +++ b/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/CollectionsTest.java @@ -4,8 +4,8 @@ import org.eclipse.yasson.jmh.model.ScalarData; import org.openjdk.jmh.annotations.*; -import javax.json.bind.Jsonb; -import javax.json.bind.JsonbBuilder; +import jakarta.json.bind.Jsonb; +import jakarta.json.bind.JsonbBuilder; import java.util.ArrayList; import java.util.HashSet; import java.util.concurrent.TimeUnit; diff --git a/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/ScalarDataTest.java b/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/ScalarDataTest.java index 12bcf4c25..2f7d68ca3 100644 --- a/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/ScalarDataTest.java +++ b/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/ScalarDataTest.java @@ -3,8 +3,8 @@ import org.eclipse.yasson.jmh.model.ScalarData; import org.openjdk.jmh.annotations.*; -import javax.json.bind.Jsonb; -import javax.json.bind.JsonbBuilder; +import jakarta.json.bind.Jsonb; +import jakarta.json.bind.JsonbBuilder; import java.util.concurrent.TimeUnit; diff --git a/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/TenPropertySerializationTest.java b/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/TenPropertySerializationTest.java index 6ba5b9b94..32ebdf741 100644 --- a/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/TenPropertySerializationTest.java +++ b/yasson-jmh/src/main/java/org/eclipse/yasson/jmh/TenPropertySerializationTest.java @@ -3,7 +3,7 @@ import org.eclipse.yasson.jmh.model.TenPropertyData; import org.openjdk.jmh.annotations.*; -import javax.json.bind.*; +import jakarta.json.bind.*; import java.util.List; import java.util.concurrent.TimeUnit; From da2260dbd845a02bbca68ff0e7912357672d04f5 Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Mon, 25 May 2020 19:15:10 +0530 Subject: [PATCH 2/2] PR review changes Signed-off-by: Gaurav Gupta --- pom.xml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 0d250e1d7..3872a987a 100644 --- a/pom.xml +++ b/pom.xml @@ -39,23 +39,6 @@ 3.0.0-M2 JDK_9 - - - - - jakarta.json - jakarta.json-api - ${jakarta.json.version} - - - org.glassfish - jakarta.json - ${jakarta.json.version} - module - compile - - - @@ -64,14 +47,10 @@ jakarta.json.bind-api ${jakarta.json.bind.version} - - jakarta.json - jakarta.json-api - org.glassfish jakarta.json - module + ${jakarta.json.version}