Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated CDI, BV, and EL. #5016

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 9 additions & 28 deletions containers/grizzly2-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<instructions>
<Import-Package>
org.glassfish.grizzly.*;version="[3.0,5.0)",
*
</Import-Package>
</instructions>
<unpackBundle>true</unpackBundle>
</configuration>
</plugin>

<plugin>
Expand Down Expand Up @@ -162,33 +171,5 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>jdk8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<configuration>
<!--
Jetty client is not compatible with JDK8, older versions need different setup
JDK HTTP client is not in JDK8 at all
Jersey Client doesn't support HTTP/2 (at least not directly)
-->
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>
1 change: 1 addition & 0 deletions containers/grizzly2-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<instructions>
<Import-Package>
jakarta.servlet.*;version="[5.0,7.0)",
org.glassfish.grizzly.*;version="[3.0,5.0)",
*
</Import-Package>
</instructions>
Expand Down
9 changes: 7 additions & 2 deletions examples/cdi-webapp/src/main/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -11,4 +11,9 @@

-->

<beans/>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all">
</beans>
9 changes: 7 additions & 2 deletions examples/cdi-webapp/src/main/webapp/WEB-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -11,4 +11,9 @@

-->

<beans/>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all">
</beans>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -11,4 +11,9 @@

-->

<beans/>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all">
</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public boolean isAlternative() {
return false;
}

@Override
// @Override - Removed in CDI 4
public boolean isNullable() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public boolean isAlternative() {
return false;
}

@Override
// @Override - Removed in CDI 4
public boolean isNullable() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018 Payara Foundation and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -823,7 +823,7 @@ public Set getInjectionPoints() {
return Collections.emptySet();
}

@Override
// @Override - Removed in CDI 4
public boolean isNullable() {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -123,7 +123,7 @@ public Set<InjectionPoint> getInjectionPoints() {
return Collections.emptySet();
}

@Override
// @Override - Removed in CDI 4
public boolean isNullable() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public static <T> BindingBeanPair registerSupplier(RuntimeType runtimeType, Supp

Class<Supplier<T>> supplierClass = (Class<Supplier<T>>) binding.getSupplierClass();
AnnotatedType<Supplier<T>> annotatedType = beanManager.createAnnotatedType(supplierClass);
InjectionTarget<Supplier<T>> injectionTarget = beanManager.createInjectionTarget(annotatedType);
final InjectionTargetFactory<Supplier<T>> injectionTargetFactory = beanManager.getInjectionTargetFactory(annotatedType);
final InjectionTarget<Supplier<T>> injectionTarget = injectionTargetFactory.createInjectionTarget(null);

SupplierClassBean<T> supplierBean = new SupplierClassBean<>(runtimeType, binding);
InjectionTarget<Supplier<T>> jit = getJerseyInjectionTarget(supplierClass, injectionTarget, supplierBean, resolvers);
Expand Down Expand Up @@ -218,7 +219,8 @@ private static <T> ConstructorInjectionPoint<T> createConstructorInjectionPoint(

final Class<Supplier<T>> bindingClass = (Class<Supplier<T>>) binding.getSupplierClass();
final AnnotatedType<Supplier<T>> annotatedType = beanManager.createAnnotatedType(bindingClass);
final InjectionTarget<Supplier<T>> injectionTarget = beanManager.createInjectionTarget(annotatedType);
final InjectionTargetFactory<Supplier<T>> injectionTargetFactory = beanManager.getInjectionTargetFactory(annotatedType);
final InjectionTarget<Supplier<T>> injectionTarget = injectionTargetFactory.createInjectionTarget(null);

final CachedConstructorAnalyzer<Supplier<T>> analyzer =
new CachedConstructorAnalyzer<>(bindingClass, InjectionUtils.getInjectAnnotations(resolvers));
Expand All @@ -239,7 +241,8 @@ private static <T> ConstructorInjectionPoint<T> createConstructorInjectionPoint(

final Class<T> bindingClass = binding.getImplementationType();
final AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(bindingClass);
final InjectionTarget<T> injectionTarget = beanManager.createInjectionTarget(annotatedType);
final InjectionTargetFactory<T> injectionTargetFactory = beanManager.getInjectionTargetFactory(annotatedType);
final InjectionTarget<T> injectionTarget = injectionTargetFactory.createInjectionTarget(null);

final CachedConstructorAnalyzer<T> analyzer =
new CachedConstructorAnalyzer<>(bindingClass, InjectionUtils.getInjectAnnotations(resolvers));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -142,7 +142,7 @@ public boolean isAlternative() {
return false;
}

@Override
// @Override - Removed in CDI 4
public boolean isNullable() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public RequestScopeBean(BeanManager beanManager) {
this.injectionTarget = injectionTargetFactory.createInjectionTarget(null);
}

@Override
// @Override - Removed in CDI 4
public boolean isNullable() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public RequestScopeBean(BeanManager beanManager) {
this.injectionTarget = injectionTargetFactory.createInjectionTarget(null);
}

@Override
// @Override - Removed in CDI 4
public boolean isNullable() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ public static <T> void registerSupplier(SupplierInstanceBinding<T> binding, Afte
public static <T> void registerSupplier(SupplierClassBinding<T> binding, AfterBeanDiscovery abd,
Collection<InjectionResolver> resolvers, BeanManager beanManager) {

Class<Supplier<T>> supplierClass = (Class<Supplier<T>>) binding.getSupplierClass();
AnnotatedType<Supplier<T>> annotatedType = beanManager.createAnnotatedType(supplierClass);
InjectionTarget<Supplier<T>> injectionTarget = beanManager.createInjectionTarget(annotatedType);
final Class<Supplier<T>> supplierClass = (Class<Supplier<T>>) binding.getSupplierClass();
final AnnotatedType<Supplier<T>> annotatedType = beanManager.createAnnotatedType(supplierClass);
final InjectionTargetFactory<Supplier<T>> injectionTargetFactory = beanManager.getInjectionTargetFactory(annotatedType);
final InjectionTarget<Supplier<T>> injectionTarget = injectionTargetFactory.createInjectionTarget(null);

SupplierClassBean<T> supplierBean = new SupplierClassBean<>(binding);
InjectionTarget<Supplier<T>> jit = getJerseyInjectionTarget(supplierClass, injectionTarget, supplierBean, resolvers);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -133,7 +133,7 @@ public boolean isAlternative() {
return false;
}

@Override
// @Override - Removed in CDI 4
public boolean isNullable() {
return false;
}
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2157,8 +2157,8 @@
<surefire.version>3.0.0-M5</surefire.version>

<!-- Jakartified, eligible for CQ -->
<weld.version>4.0.2.Final</weld.version>
<validation.impl.version>7.0.1.Final</validation.impl.version>
<weld.version>5.0.0.CR2</weld.version>
<validation.impl.version>8.0.0.Alpha1</validation.impl.version>
<!-- END of Jakartified, eligible for CQ -->
<xerces.version>2.11.0</xerces.version>

Expand All @@ -2168,7 +2168,7 @@
<!-- do not need CQs (below this line till the end of version properties)-->
<gf.impl.version>7.0.0-M2</gf.impl.version>
<!-- Jakartified -->
<cdi.api.version>3.0.0</cdi.api.version>
<cdi.api.version>4.0.0</cdi.api.version>
<ejb.version>4.0.0</ejb.version>
<grizzly2.version>4.0.0-M1</grizzly2.version>
<grizzly.npn.version>2.0.0</grizzly.npn.version>
Expand All @@ -2182,8 +2182,8 @@
<istack.commons.runtime.version>4.0.0</istack.commons.runtime.version>
<jakarta.activation-api.version>2.1.0</jakarta.activation-api.version>
<jakarta.activation.version>2.0.1</jakarta.activation.version>
<jakarta.el.version>4.0.0</jakarta.el.version>
<jakarta.el.impl.version>4.0.2</jakarta.el.impl.version>
<jakarta.el.version>5.0.0</jakarta.el.version>
<jakarta.el.impl.version>5.0.0-M1</jakarta.el.impl.version>
<jakarta.annotation.osgi.version>jakarta.annotation.*;version="[2.0,3)"</jakarta.annotation.osgi.version>
<jakarta.annotation.version>2.1.0</jakarta.annotation.version>
<jakarta.inject.version>2.0.1</jakarta.inject.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,7 +17,11 @@

-->

<beans>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all">
<interceptors>
<class>org.glassfish.jersey.tests.e2e.inject.cdi.se.SecurityInterceptor</class>
</interceptors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,4 +17,9 @@

-->

<beans/>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all">
</beans>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,4 +17,9 @@

-->

<beans/>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all">
</beans>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,4 +17,9 @@

-->

<beans/>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all">
</beans>