From e68ded6b7d585bf2dd736d16d68bd26698e4c246 Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Thu, 22 Feb 2024 11:51:17 -0600 Subject: [PATCH 01/16] Initial updates for EE 11 dependencies Signed-off-by: Scott M Stark --- api/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 4704eabb..2563c9b8 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -121,10 +121,10 @@ - 3.0.0-M1 + 3.0.0 2.0.1 - 5.0.1 - 2.2.0-M1 + 6.0.0-M2 + 2.2.0 MMMM dd, yyyy From 048b1d4335ff4704a49ba14b6ba4a15b58c7c1ed Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Thu, 22 Feb 2024 11:51:17 -0600 Subject: [PATCH 02/16] Initial updates for EE 11 dependencies Signed-off-by: Scott M Stark --- el/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/el/pom.xml b/el/pom.xml index 9e8ae043..65832237 100644 --- a/el/pom.xml +++ b/el/pom.xml @@ -31,7 +31,8 @@ - 6.0.0-M1 + 6.0.0-M2 + 17 From e7304058a84c238953298ed857aac0adb14c4aea Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Thu, 22 Feb 2024 12:44:37 -0600 Subject: [PATCH 03/16] Disable the builds with SE 11 Signed-off-by: Scott M Stark --- .github/workflows/ci-actions.yml | 17 ++++------------- el/pom.xml | 1 - 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 59cccf4d..90681e9b 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - java: [ '11', '17', '21' ] + java: [ '17', '21' ] steps: - uses: actions/checkout@v4.1.1 - name: Set up JDK ${{ matrix.java }} @@ -29,19 +29,10 @@ jobs: with: distribution: 'temurin' java-version: ${{ matrix.java }} - - if: ${{ matrix.java != '11' }} - name: "Maven install > 11" + - name: "Maven install" run: | mvn -Pstaging install -DskipTests=true -Dno-format -B -V - - if: ${{ matrix.java == '11' }} - name: "Maven install 11" - run: | - mvn -Pstaging -pl '!el' install -DskipTests=true -Dno-format -B -V - - if: ${{ matrix.java != '11' }} - name: "Maven test > 11" + - name: "Maven test" run: | mvn -Pstaging test -B - - if: ${{ matrix.java == '11' }} - name: "Maven test 11" - run: | - mvn -Pstaging -pl '!el' test -B + diff --git a/el/pom.xml b/el/pom.xml index 65832237..2b197c22 100644 --- a/el/pom.xml +++ b/el/pom.xml @@ -32,7 +32,6 @@ 6.0.0-M2 - 17 From cd7ae7a609cd66031985dc8d901745fd028005a5 Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Thu, 22 Feb 2024 14:53:24 -0600 Subject: [PATCH 04/16] Update EL to 6.0.0-RC1 Signed-off-by: Scott M Stark --- api/pom.xml | 2 +- el/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 2563c9b8..abf8b00f 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -123,7 +123,7 @@ 3.0.0 2.0.1 - 6.0.0-M2 + 6.0.0-RC1 2.2.0 MMMM dd, yyyy diff --git a/el/pom.xml b/el/pom.xml index 2b197c22..8ca7b950 100644 --- a/el/pom.xml +++ b/el/pom.xml @@ -31,7 +31,7 @@ - 6.0.0-M2 + 6.0.0-RC1 From 5cd17de4d6be378a72a692430bf394f7890575c1 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Mon, 26 Feb 2024 15:18:22 +0100 Subject: [PATCH 05/16] fix license headers and some other small things in the website --- docs/404.html | 17 ++++++------ docs/Gemfile | 1 + docs/README.md | 17 ++++++------ docs/_authors/asd.md | 19 +++++++------ docs/_authors/ladt.md | 19 +++++++------ docs/_authors/matn.md | 19 +++++++------ docs/_authors/starksm.md | 19 +++++++------ docs/_config.yml | 5 ++-- docs/_data/navigation.yml | 1 + docs/_layouts/author.html | 17 ++++++------ docs/_layouts/post.html | 17 ++++++------ docs/_posts/2021-10-25-pages-here.md | 26 +++++++++--------- docs/_posts/2021-10-25-way-to-cdi4.md | 22 +++++++-------- ...03-you-know-build-compatible-extensions.md | 22 +++++++-------- docs/_posts/2022-01-24-400-RC3-spec.md | 24 ++++++++--------- docs/about.md | 27 ++++++++----------- docs/authors.html | 17 ++++++------ docs/index.md | 19 ++++++------- 18 files changed, 142 insertions(+), 166 deletions(-) diff --git a/docs/404.html b/docs/404.html index 30362f16..30496b4c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,13 +1,12 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + permalink: /404.html layout: default --- diff --git a/docs/Gemfile b/docs/Gemfile index e2cdb8a5..b02d8630 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -5,6 +5,7 @@ # https://www.apache.org/licenses/LICENSE-2.0. # # SPDX-License-Identifier: Apache-2.0 + source "https://rubygems.org" # Hello! This is where you manage which Jekyll version is used to run. # When you want to use a different version, change it below, save the diff --git a/docs/README.md b/docs/README.md index df7e3d4c..daa22de0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -23,7 +23,7 @@ These instructions will get you a copy of the eclipse-ee4j.github.io/cdi/ websit 3. Fork the [project repository](https://github.com/eclipse-ee4j/cdi), then clone your fork. - git clone https://github.com/eclipse-ee4j/cdi + git clone https://github.com/jakartaee/cdi 4. Change into the project directory: @@ -44,17 +44,18 @@ These instructions will get you a copy of the eclipse-ee4j.github.io/cdi/ websit **For more regarding the use of Jekyll, please refer to the [Jekyll Step by Step Tutorial](https://jekyllrb.com/docs/step-by-step/01-setup/).** ## Writing a Blog Post + To write a blog: -- create an author entry in [_authors](https://github.com/eclipse-ee4j/cdi/tree/master/docs/_authors) -- create an blog entry under [_posts](https://github.com/eclipse-ee4j/cdi/tree/master/docs/_posts) - -the file name is `yyyy-mm-dd-slug.adoc` -- `tags` should be used with some care as an archive page is created for of them. Below are some basic rules to try follow: +- create an author entry in [_authors](https://github.com/jakartaee/cdi/tree/master/docs/_authors) +- create a blog entry under [_posts](https://github.com/jakartaee/cdi/tree/master/docs/_posts) + - the file name is `yyyy-mm-dd-slug.adoc` +- `tag` or `tags` should be used with some care as an archive page is created for of them. Below are some basic rules to follow: - `cdi-release` used for CDI release blogs - `announcement` used for general announcement with some impact. - `development-tips` used for blogs with tips to develop with CDI. - tags are space separated list `tags:cdi-release announcement` - tags must be in lowercase -- it's in markdown format, there is an example as shown with [2021-10-25-way-to-cdi4.md](https://github.com/eclipse-ee4j/cdi/blob/master/docs/_posts/2021-10-25-way-to-cdi4.md) - - Be aware that the `date` attribute in the asciidoc preamble defines when the article will be published. Use a present date while writing your article to test locally, then switch to the actual target date before submitting. -- send a pull request against the master branch and when it is merged it will be automatically incorporated into the pages site. +- it's in Markdown format, see [2021-10-25-way-to-cdi4.md](https://github.com/jakartaee/cdi/blob/master/docs/_posts/2021-10-25-way-to-cdi4.md) for example +- the `date` attribute in the front matter defines when the article will be published. Use a present date while writing your article to test locally, then switch to the actual target date before submitting. +- send a pull request against the `main` branch and when it is merged it will be automatically incorporated into the site. diff --git a/docs/_authors/asd.md b/docs/_authors/asd.md index b058d6c0..0de8dc9a 100644 --- a/docs/_authors/asd.md +++ b/docs/_authors/asd.md @@ -1,15 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + short_name: asd name: Antoine Sabot-Durand position: Software Engineer --- -https://github.com/antoinesd \ No newline at end of file +[https://github.com/antoinesd](https://github.com/antoinesd) diff --git a/docs/_authors/ladt.md b/docs/_authors/ladt.md index c60567c7..e8b230cb 100644 --- a/docs/_authors/ladt.md +++ b/docs/_authors/ladt.md @@ -1,15 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + short_name: ladt name: Ladislav Thon position: Software Engineer --- -https://github.com/Ladicek \ No newline at end of file +[https://github.com/Ladicek](https://github.com/Ladicek) diff --git a/docs/_authors/matn.md b/docs/_authors/matn.md index 6e2fe442..f0c09d42 100644 --- a/docs/_authors/matn.md +++ b/docs/_authors/matn.md @@ -1,15 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + short_name: matn name: Matej Novotny position: Software Engineer --- -https://github.com/manovotn \ No newline at end of file +[https://github.com/manovotn](https://github.com/manovotn) diff --git a/docs/_authors/starksm.md b/docs/_authors/starksm.md index e5149f32..19b737bc 100644 --- a/docs/_authors/starksm.md +++ b/docs/_authors/starksm.md @@ -1,15 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + short_name: starksm name: Scott M Stark position: Software Engineer --- -https://github.com/starksm64 \ No newline at end of file +[https://github.com/starksm64](https://github.com/starksm64) diff --git a/docs/_config.yml b/docs/_config.yml index 0af0941b..dddac5c3 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -5,6 +5,7 @@ # https://www.apache.org/licenses/LICENSE-2.0. # # SPDX-License-Identifier: Apache-2.0 + # Welcome to Jekyll! # # This config file is meant for settings that affect your whole blog, values @@ -28,9 +29,9 @@ title: Jakarta CDI email: cdi-dev@eclipse.org description: >- # this means to ignore newlines until "baseurl:" - This is the pages site for the Jakarta Contents and Dependency Injection API and Specifications project. + This is the site for the Jakarta Contexts and Dependency Injection API and Specification project. baseurl: "/cdi" # the subpath of your site, e.g. /blog -url: "https://eclipse-ee4j.github.io" # the base hostname & protocol for your site, e.g. http://example.com +url: "https://jakartaee.github.io" # the base hostname & protocol for your site, e.g. http://example.com #twitter_username: #github_username: diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 0cd963b7..ff28e1af 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -5,6 +5,7 @@ # https://www.apache.org/licenses/LICENSE-2.0. # # SPDX-License-Identifier: Apache-2.0 + - name: Home link: / - name: About diff --git a/docs/_layouts/author.html b/docs/_layouts/author.html index baee1b4d..ca79f7df 100644 --- a/docs/_layouts/author.html +++ b/docs/_layouts/author.html @@ -1,13 +1,12 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + layout: default ---

{{ page.name }}

diff --git a/docs/_layouts/post.html b/docs/_layouts/post.html index 57938560..45dc8251 100644 --- a/docs/_layouts/post.html +++ b/docs/_layouts/post.html @@ -1,13 +1,12 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + layout: default ---

{{ page.title }}

diff --git a/docs/_posts/2021-10-25-pages-here.md b/docs/_posts/2021-10-25-pages-here.md index f5a78da9..6b601ee7 100644 --- a/docs/_posts/2021-10-25-pages-here.md +++ b/docs/_posts/2021-10-25-pages-here.md @@ -1,20 +1,18 @@ - --- -layout: post -title: "Jakarta CDI GitHub Pages" -date: 2021-10-25 22:08:50 -0500 -categories: announcement +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + +title: "Jakarta CDI GitHub Pages" +date: 2021-10-25 22:08:50 -0500 author: starksm +tag: announcement --- # CDI GitHub Pages -The GitHub pages for Jakarta CDI has arrived. See the [README.md](https://github.com/eclipse-ee4j/cdi/tree/master/docs/README.md) file for how to build the pages site locally, and how to create a blog entry. \ No newline at end of file +The GitHub pages for Jakarta CDI has arrived. See the [README.md](https://github.com/jakartaee/cdi/tree/master/docs/README.md) file for how to build the pages site locally, and how to create a blog entry. diff --git a/docs/_posts/2021-10-25-way-to-cdi4.md b/docs/_posts/2021-10-25-way-to-cdi4.md index 19e8e8a8..b5c13f8f 100644 --- a/docs/_posts/2021-10-25-way-to-cdi4.md +++ b/docs/_posts/2021-10-25-way-to-cdi4.md @@ -1,20 +1,16 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + title: "On the Way to CDI 4.0" summary: Overview of changes coming to CDI 4.0 -layout: post author: matn -tag: Release -priority: 1 -change_frequency: daily +tag: release --- As you probably know, work is well under way for projects aiming to land in Jakarta EE 10 space and CDI is no exception. In fact, the specification is close to being rounded up for its next major release hence it is the right time to summarize what is coming. diff --git a/docs/_posts/2021-12-03-you-know-build-compatible-extensions.md b/docs/_posts/2021-12-03-you-know-build-compatible-extensions.md index 32d60017..049a68cd 100644 --- a/docs/_posts/2021-12-03-you-know-build-compatible-extensions.md +++ b/docs/_posts/2021-12-03-you-know-build-compatible-extensions.md @@ -1,23 +1,19 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + title: "You already know Build Compatible Extensions" summary: Comparison of Portable Extensions and Build Compatible Extensions -layout: post author: ladt tag: development-tips -priority: 1 -change_frequency: daily --- -As you have learned from a [previous post](https://eclipse-ee4j.github.io/cdi/2021/10/25/way-to-cdi4.html), CDI Lite comes with a new extension API called _Build Compatible Extensions_. +As you have learned from a [previous post](https://jakartaee.github.io/cdi/2021/10/25/way-to-cdi4.html), CDI Lite comes with a new extension API called _Build Compatible Extensions_. In this post, you will learn more about this API by comparison with _Portable Extensions_ and my hope is that by the end, you will see that _you already know Build Compatible Extensions_. If you don't know Portable Extensions, don't worry. diff --git a/docs/_posts/2022-01-24-400-RC3-spec.md b/docs/_posts/2022-01-24-400-RC3-spec.md index 40fc16e4..26e2fc4b 100644 --- a/docs/_posts/2022-01-24-400-RC3-spec.md +++ b/docs/_posts/2022-01-24-400-RC3-spec.md @@ -1,18 +1,16 @@ - --- -layout: post -title: "Jakarta CDI 4.0 Draft Specification" -date: 2022-01-24 20:00:00 -0500 -categories: announcement +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + +title: "Jakarta CDI 4.0 Draft Specification" +date: 2022-01-24 20:00:00 -0500 author: starksm +tag: announcement --- A draft of the 4.0 CDI specification is available in the current build of the 4.0.0-RC3 API [jakarta-cdi-spec-4.0.pdf](https://ci.eclipse.org/cdi/job/CDI%20Release-JDK11/25/artifact/spec/target/generated-docs/jakarta-cdi-spec-4.0.pdf). diff --git a/docs/about.md b/docs/about.md index 40da9590..88ca331b 100644 --- a/docs/about.md +++ b/docs/about.md @@ -1,24 +1,19 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + layout: page title: About permalink: /about/ --- -This is the main Jakarta Contexts and Dependency Injection (CDI) pages site. It contains information about the latest news on Jakarta CDI. - -You can find the source code for this site in the docs directory of: -[docs](https://github.com/eclipse-ee4j/cdi/) - -You can find the source code for the Jakarta CDI API and Specification at: -[cdi](https://github.com/eclipse-ee4j/cdi/) +This is the main Jakarta Contexts and Dependency Injection (CDI) site. It contains information about the latest news on Jakarta CDI. +You can find the source code for this site in the `docs` directory: [docs](https://github.com/jakartaee/cdi/tree/main/docs) +You can find the source code for the Jakarta CDI API and Specification at: [cdi](https://github.com/jakartaee/cdi/) diff --git a/docs/authors.html b/docs/authors.html index c7531c40..68a3be69 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,13 +1,12 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + layout: default title: Authors --- diff --git a/docs/index.md b/docs/index.md index 9b95a9b3..096acbea 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,17 +1,14 @@ - --- +# Copyright (c) 2021 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + # Feel free to add content and custom Front Matter to this file. # To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults layout: home --- - - From d9f95b49c8dcccddbb4a7ed081b78b341014b847 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Mon, 26 Feb 2024 13:55:28 +0100 Subject: [PATCH 06/16] Revert incorrect change in ambiguity resolution We previously [1] changed wording in the ambiguity resolution specification from > Return an `Iterator`, that iterates over the set of contextual references > for the resulting beans and required type, as defined in <>. to > Return an `Iterator`, that iterates over the set of contextual references > for the resulting beans, as defined in <>. This was an attempt to simplify the text, but is in fact incorrect, because a contextual reference is always determined by the bean and the bean type. This commit reverts to the previous wording. [1] https://github.com/jakartaee/cdi/commit/74827d2808a4db73d1402206a8e116b5702d031a --- spec/src/main/asciidoc/core/injectionandresolution.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc index 69ec4565..ef2c5df4 100644 --- a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc +++ b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc @@ -672,7 +672,7 @@ The `iterator()` method must: * If typesafe resolution results in an unsatisfied dependency, the set of resulting beans is empty. If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains at least one alternative, the set of resulting beans contains all beans that were not eliminated during ambiguity resolution. If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains no alternative, the set of resulting beans contains all candidate beans. -* Return an `Iterator`, that iterates over the set of contextual references for the resulting beans, as defined in <>. +* Return an `Iterator`, that iterates over the set of contextual references for the resulting beans and required type, as defined in <>. The `stream()` method must: @@ -680,7 +680,7 @@ The `stream()` method must: * If typesafe resolution results in an unsatisfied dependency, the set of resulting beans is empty. If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains at least one alternative, the set of resulting beans contains all beans that were not eliminated during ambiguity resolution. If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains no alternative, the set of resulting beans contains all candidate beans. -* Return a `Stream`, that can stream over the set of contextual references for the resulting beans, as defined in <>. +* Return a `Stream`, that can stream over the set of contextual references for the resulting beans and required type, as defined in <>. The methods `isUnsatisfied()`, `isAmbiguous()` and `isResolvable()` must: From d0b981cfdf270ccb6c4580a369e24fae4c2cd000 Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Mon, 26 Feb 2024 17:03:14 -0600 Subject: [PATCH 07/16] Correct the javadoc warnings seen under JDK 17 (#775) * Correct the javadoc warnings seen under JDK 17 Fixes #719 Signed-off-by: Scott M Stark --------- Signed-off-by: Scott M Stark --- .../enterprise/context/ApplicationScoped.java | 2 +- .../enterprise/context/BeforeDestroyed.java | 12 ++++++++- .../context/BusyConversationException.java | 19 +++++++++++++ .../enterprise/context/ContextException.java | 19 +++++++++++++ .../context/ContextNotActiveException.java | 19 +++++++++++++ .../context/ConversationScoped.java | 2 +- .../jakarta/enterprise/context/Dependent.java | 2 +- .../jakarta/enterprise/context/Destroyed.java | 12 ++++++++- .../enterprise/context/Initialized.java | 12 ++++++++- .../NonexistentConversationException.java | 19 +++++++++++++ .../enterprise/context/RequestScoped.java | 2 +- .../enterprise/context/SessionScoped.java | 2 +- .../enterprise/event/NotificationOptions.java | 18 +++++++++++++ .../enterprise/event/ObserverException.java | 19 +++++++++++++ .../enterprise/inject/Alternative.java | 2 +- .../inject/AmbiguousResolutionException.java | 19 +++++++++++++ .../java/jakarta/enterprise/inject/Any.java | 2 +- .../enterprise/inject/CreationException.java | 19 +++++++++++++ .../jakarta/enterprise/inject/Default.java | 2 +- .../inject/IllegalProductException.java | 19 +++++++++++++ .../enterprise/inject/InjectionException.java | 27 ++++++++++++++++--- .../inject/ResolutionException.java | 19 +++++++++++++ .../enterprise/inject/Specializes.java | 2 +- .../enterprise/inject/TransientReference.java | 2 +- .../java/jakarta/enterprise/inject/Typed.java | 12 ++++++++- .../UnproxyableResolutionException.java | 27 ++++++++++++++++--- .../UnsatisfiedResolutionException.java | 27 ++++++++++++++++--- .../jakarta/enterprise/inject/Vetoed.java | 2 +- .../inject/literal/InjectLiteral.java | 2 +- .../inject/literal/NamedLiteral.java | 9 ++++++- .../inject/literal/QualifierLiteral.java | 2 +- .../inject/literal/SingletonLiteral.java | 2 +- .../enterprise/inject/spi/Annotated.java | 2 +- .../enterprise/inject/spi/AnnotatedType.java | 2 +- .../jakarta/enterprise/inject/spi/CDI.java | 2 ++ .../enterprise/inject/spi/CDIProvider.java | 1 + .../inject/spi/DefinitionException.java | 24 ++++++++++++++--- .../inject/spi/DeploymentException.java | 24 ++++++++++++++--- .../enterprise/inject/spi/ObserverMethod.java | 2 +- .../inject/spi/WithAnnotations.java | 6 ++++- .../enterprise/util/AnnotationLiteral.java | 3 +++ .../jakarta/enterprise/util/Nonbinding.java | 2 +- .../jakarta/enterprise/util/TypeLiteral.java | 3 +++ api/src/main/java/module-info.java | 3 +++ 44 files changed, 385 insertions(+), 44 deletions(-) diff --git a/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java b/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java index 6a07d0a1..19c47b9b 100644 --- a/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/ApplicationScoped.java @@ -91,7 +91,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements ApplicationScoped { - + /** Default ApplicationScoped literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java index 469e5c47..3e730050 100644 --- a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java +++ b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java @@ -54,19 +54,29 @@ * Supports inline instantiation of the {@link BeforeDestroyed} qualifier. */ public final static class Literal extends AnnotationLiteral implements BeforeDestroyed { - + /** Default RequestScoped literal */ public static final Literal REQUEST = of(RequestScoped.class); + /** Default ConversationScoped literal */ public static final Literal CONVERSATION = of(ConversationScoped.class); + /** Default SessionScoped literal */ public static final Literal SESSION = of(SessionScoped.class); + /** Default ApplicationScoped literal */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; + /** */ private final Class value; + /** + * Obtain the literal of the provided scope annotation + * + * @param value - the scope annotation + * @return a new Literal value for the provided scope annotation + */ public static Literal of(Class value) { return new Literal(value); } diff --git a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java index 1fcd4e74..25914b69 100644 --- a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java +++ b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java @@ -41,18 +41,37 @@ public class BusyConversationException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; + /** + * default ctor + */ public BusyConversationException() { super(); } + /** + * Create exception with given message + * + * @param message - context information + */ public BusyConversationException(String message) { super(message); } + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ public BusyConversationException(Throwable cause) { super(cause); } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ public BusyConversationException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/context/ContextException.java b/api/src/main/java/jakarta/enterprise/context/ContextException.java index 3f1be66e..1e33dbaa 100644 --- a/api/src/main/java/jakarta/enterprise/context/ContextException.java +++ b/api/src/main/java/jakarta/enterprise/context/ContextException.java @@ -26,18 +26,37 @@ public class ContextException extends RuntimeException { private static final long serialVersionUID = -3599813072560026919L; + /** + * default ctor + */ public ContextException() { super(); } + /** + * Create exception with given message and cause + * + * @param message - context information + */ public ContextException(String message) { super(message); } + /** + * Create exception with given message and cause + * + * @param cause - cause of exception + */ public ContextException(Throwable cause) { super(cause); } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ public ContextException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java index 1689c40d..f1de936f 100644 --- a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java +++ b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java @@ -32,18 +32,37 @@ public class ContextNotActiveException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; + /** + * Default ctor + */ public ContextNotActiveException() { super(); } + /** + * Create exception with given message + * + * @param message - context information + */ public ContextNotActiveException(String message) { super(message); } + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ public ContextNotActiveException(Throwable cause) { super(cause); } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ public ContextNotActiveException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java index e9c081ab..fce2cac4 100644 --- a/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/ConversationScoped.java @@ -151,7 +151,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements ConversationScoped { - + /** Default ConversationScoped literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/context/Dependent.java b/api/src/main/java/jakarta/enterprise/context/Dependent.java index f51f30dd..22147ab1 100644 --- a/api/src/main/java/jakarta/enterprise/context/Dependent.java +++ b/api/src/main/java/jakarta/enterprise/context/Dependent.java @@ -108,7 +108,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements Dependent { - + /** Default Dependent literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/context/Destroyed.java b/api/src/main/java/jakarta/enterprise/context/Destroyed.java index b78bb166..15aa7737 100644 --- a/api/src/main/java/jakarta/enterprise/context/Destroyed.java +++ b/api/src/main/java/jakarta/enterprise/context/Destroyed.java @@ -55,19 +55,29 @@ * @author Martin Kouba */ public final static class Literal extends AnnotationLiteral implements Destroyed { - + /** Default RequestScoped literal */ public static final Literal REQUEST = of(RequestScoped.class); + /** Default ConversationScoped literal */ public static final Literal CONVERSATION = of(ConversationScoped.class); + /** Default SessionScoped literal */ public static final Literal SESSION = of(SessionScoped.class); + /** Default ApplicationScoped literal */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; + /** */ private final Class value; + /** + * Obtain the literal of the provided scope annotation + * + * @param value - the scope annotation + * @return a new Literal value for the provided scope annotation + */ public static Literal of(Class value) { return new Literal(value); } diff --git a/api/src/main/java/jakarta/enterprise/context/Initialized.java b/api/src/main/java/jakarta/enterprise/context/Initialized.java index 2bcd934d..67b20500 100644 --- a/api/src/main/java/jakarta/enterprise/context/Initialized.java +++ b/api/src/main/java/jakarta/enterprise/context/Initialized.java @@ -55,19 +55,29 @@ * @author Martin Kouba */ public final static class Literal extends AnnotationLiteral implements Initialized { - + /** Default RequestScoped literal */ public static final Literal REQUEST = of(RequestScoped.class); + /** Default ConversationScoped literal */ public static final Literal CONVERSATION = of(ConversationScoped.class); + /** Default SessionScoped literal */ public static final Literal SESSION = of(SessionScoped.class); + /** Default ApplicationScoped literal */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; + /** */ private final Class value; + /** + * Obtain the literal of the provided scope annotation + * + * @param value - the scope annotation + * @return a new Literal value for the provided scope annotation + */ public static Literal of(Class value) { return new Literal(value); } diff --git a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java index db571598..2c1611a1 100644 --- a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java +++ b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java @@ -38,18 +38,37 @@ public class NonexistentConversationException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; + /** + * Default ctor + */ public NonexistentConversationException() { super(); } + /** + * Create exception with given message + * + * @param message - context information + */ public NonexistentConversationException(String message) { super(message); } + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ public NonexistentConversationException(Throwable cause) { super(cause); } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ public NonexistentConversationException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java index 644f27e3..3caf651d 100644 --- a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java @@ -95,7 +95,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements RequestScoped { - + /** Default RequestScope literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/context/SessionScoped.java b/api/src/main/java/jakarta/enterprise/context/SessionScoped.java index 64a6a33a..e2bea927 100644 --- a/api/src/main/java/jakarta/enterprise/context/SessionScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/SessionScoped.java @@ -87,7 +87,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements SessionScoped { - + /** Default SessionScoped literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java index 0b735435..0179641b 100644 --- a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java +++ b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java @@ -72,10 +72,28 @@ static Builder builder() { */ interface Builder { + /** + * Set the notification executor + * + * @param executor - {@linkplain Executor} + * @return this + */ Builder setExecutor(Executor executor); + /** + * Set an option value + * + * @param optionName - name + * @param optionValue - value + * @return this + */ Builder set(String optionName, Object optionValue); + /** + * Build the notification options + * + * @return NotificationOptions + */ NotificationOptions build(); } diff --git a/api/src/main/java/jakarta/enterprise/event/ObserverException.java b/api/src/main/java/jakarta/enterprise/event/ObserverException.java index 973ef58a..8dcfb18c 100644 --- a/api/src/main/java/jakarta/enterprise/event/ObserverException.java +++ b/api/src/main/java/jakarta/enterprise/event/ObserverException.java @@ -26,18 +26,37 @@ public class ObserverException extends RuntimeException { private static final long serialVersionUID = -801836224808304381L; + /** + * Default ctor + */ public ObserverException() { } + /** + * Create exception with given message + * + * @param message - context information + */ public ObserverException(String message) { super(message); } + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ public ObserverException(Throwable cause) { super(cause); } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ public ObserverException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Alternative.java b/api/src/main/java/jakarta/enterprise/inject/Alternative.java index 92999255..184eab06 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Alternative.java +++ b/api/src/main/java/jakarta/enterprise/inject/Alternative.java @@ -71,7 +71,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements Alternative { - + /** Default Alternative literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java index 66bac063..b37696b6 100644 --- a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java @@ -26,17 +26,36 @@ public class AmbiguousResolutionException extends ResolutionException { private static final long serialVersionUID = -2132733164534544788L; + /** + * default ctor + */ public AmbiguousResolutionException() { } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param throwable - cause of exception + */ public AmbiguousResolutionException(String message, Throwable throwable) { super(message, throwable); } + /** + * Create exception with given message + * + * @param message - context information + */ public AmbiguousResolutionException(String message) { super(message); } + /** + * Create exception with given cause + * + * @param throwable - cause of exception + */ public AmbiguousResolutionException(Throwable throwable) { super(throwable); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Any.java b/api/src/main/java/jakarta/enterprise/inject/Any.java index d4f2a907..313a7a1a 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Any.java +++ b/api/src/main/java/jakarta/enterprise/inject/Any.java @@ -83,7 +83,7 @@ * @see Event */ public static final class Literal extends AnnotationLiteral implements Any { - + /** Default Any literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/CreationException.java b/api/src/main/java/jakarta/enterprise/inject/CreationException.java index fe2a9769..10f733a6 100644 --- a/api/src/main/java/jakarta/enterprise/inject/CreationException.java +++ b/api/src/main/java/jakarta/enterprise/inject/CreationException.java @@ -26,18 +26,37 @@ public class CreationException extends InjectionException { private static final long serialVersionUID = 1002854668862145298L; + /** + * Default ctor + */ public CreationException() { } + /** + * Create exception with given message + * + * @param message - context information + */ public CreationException(String message) { super(message); } + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ public CreationException(Throwable cause) { super(cause); } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ public CreationException(String message, Throwable cause) { super(message, cause); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Default.java b/api/src/main/java/jakarta/enterprise/inject/Default.java index 73ab4904..f61f1e79 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Default.java +++ b/api/src/main/java/jakarta/enterprise/inject/Default.java @@ -99,7 +99,7 @@ * @see Event */ public static final class Literal extends AnnotationLiteral implements Default { - + /** The default Default literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java index 72176721..89c1f135 100644 --- a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java +++ b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java @@ -25,18 +25,37 @@ public class IllegalProductException extends InjectionException { private static final long serialVersionUID = -6280627846071966243L; + /** + * Default ctor + */ public IllegalProductException() { super(); } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ public IllegalProductException(String message, Throwable cause) { super(message, cause); } + /** + * Create exception with given message + * + * @param message - context information + */ public IllegalProductException(String message) { super(message); } + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ public IllegalProductException(Throwable cause) { super(cause); } diff --git a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java index 43f6d2d7..278c8289 100644 --- a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java @@ -23,19 +23,38 @@ public class InjectionException extends RuntimeException { private static final long serialVersionUID = -2132733164534544788L; + /** + * Default ctor + */ public InjectionException() { } - public InjectionException(String message, Throwable throwable) { - super(message, throwable); + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ + public InjectionException(String message, Throwable cause) { + super(message, cause); } + /** + * Create exception with given message + * + * @param message - context information + */ public InjectionException(String message) { super(message); } - public InjectionException(Throwable throwable) { - super(throwable); + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ + public InjectionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java index aa78b86c..f27e6aca 100644 --- a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java @@ -22,18 +22,37 @@ public class ResolutionException extends InjectionException { private static final long serialVersionUID = -6280627846071966243L; + /** + * Default ctor + */ public ResolutionException() { super(); } + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ public ResolutionException(String message, Throwable cause) { super(message, cause); } + /** + * Create exception with given message + * + * @param message - context information + */ public ResolutionException(String message) { super(message); } + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ public ResolutionException(Throwable cause) { super(cause); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Specializes.java b/api/src/main/java/jakarta/enterprise/inject/Specializes.java index cdadeb91..10cd24f2 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Specializes.java +++ b/api/src/main/java/jakarta/enterprise/inject/Specializes.java @@ -83,7 +83,7 @@ public static final class Literal extends AnnotationLiteral implements Specializes { private static final long serialVersionUID = 1L; - + /** Default Specializes literal */ public static final Literal INSTANCE = new Literal(); } diff --git a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java index d0c8622a..f87a2a08 100644 --- a/api/src/main/java/jakarta/enterprise/inject/TransientReference.java +++ b/api/src/main/java/jakarta/enterprise/inject/TransientReference.java @@ -62,7 +62,7 @@ public static final class Literal extends AnnotationLiteral implements TransientReference { private static final long serialVersionUID = 1L; - + /** Default TransientReference literal */ public static final Literal INSTANCE = new Literal(); } diff --git a/api/src/main/java/jakarta/enterprise/inject/Typed.java b/api/src/main/java/jakarta/enterprise/inject/Typed.java index 70a361d3..30c11a16 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Typed.java +++ b/api/src/main/java/jakarta/enterprise/inject/Typed.java @@ -69,13 +69,20 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements Typed { - + /** Default Typed literal */ public static final Literal INSTANCE = of(new Class[] {}); private static final long serialVersionUID = 1L; + /** */ private final Class[] value; + /** + * Obtain the Type literal of the provided bean classes + * + * @param value - the classes corresponding to the bean types of the bean + * @return a new Literal value for the provided classes + */ public static Literal of(Class[] value) { return new Literal(value); } @@ -84,6 +91,9 @@ private Literal(Class[] value) { this.value = value; } + /** + * @return the classes corresponding to the bean types of the bean + */ public Class[] value() { return value; } diff --git a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java index c4aebc1d..fddccf74 100644 --- a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java @@ -27,20 +27,39 @@ public class UnproxyableResolutionException extends ResolutionException { private static final long serialVersionUID = 1667539354548135465L; + /** + * Default ctor + */ public UnproxyableResolutionException() { super(); } - public UnproxyableResolutionException(String message, Throwable throwable) { - super(message, throwable); + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ + public UnproxyableResolutionException(String message, Throwable cause) { + super(message, cause); } + /** + * Create exception with given message + * + * @param message - context information + */ public UnproxyableResolutionException(String message) { super(message); } - public UnproxyableResolutionException(Throwable throwable) { - super(throwable); + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ + public UnproxyableResolutionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java index dff8d3ef..0ee43129 100644 --- a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java @@ -26,20 +26,39 @@ public class UnsatisfiedResolutionException extends ResolutionException { private static final long serialVersionUID = 5350603312442756709L; + /** + * Default ctor + */ public UnsatisfiedResolutionException() { super(); } - public UnsatisfiedResolutionException(String message, Throwable throwable) { - super(message, throwable); + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ + public UnsatisfiedResolutionException(String message, Throwable cause) { + super(message, cause); } + /** + * Create exception with given message + * + * @param message - context information + */ public UnsatisfiedResolutionException(String message) { super(message); } - public UnsatisfiedResolutionException(Throwable throwable) { - super(throwable); + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ + public UnsatisfiedResolutionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java index a039ba6a..5ad2a76c 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Vetoed.java +++ b/api/src/main/java/jakarta/enterprise/inject/Vetoed.java @@ -58,7 +58,7 @@ public static final class Literal extends AnnotationLiteral implements Vetoed { private static final long serialVersionUID = 1L; - + /** Default Vetoed literal */ public static final Literal INSTANCE = new Literal(); } diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java index 22828b95..3a94bfbe 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/InjectLiteral.java @@ -23,7 +23,7 @@ * @since 2.0 */ public final class InjectLiteral extends AnnotationLiteral implements Inject { - + /** Default Inject literal */ public static final InjectLiteral INSTANCE = new InjectLiteral(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java index 095d492b..d31a8412 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java @@ -24,13 +24,20 @@ * @since 2.0 */ public final class NamedLiteral extends AnnotationLiteral implements Named { - + /** Default NamedLiteral */ public static final Named INSTANCE = of(""); private static final long serialVersionUID = 1L; + /** */ private final String value; + /** + * Create a new NamedLiteral for the given name value + * + * @param value - name + * @return new NamedLiteral + */ public static NamedLiteral of(String value) { return new NamedLiteral(value); } diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java index 4f60f0ba..dd5f0626 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java @@ -23,7 +23,7 @@ * @since 2.0 */ public final class QualifierLiteral extends AnnotationLiteral implements Qualifier { - + /** Default QualifierLiteral instance */ public static final QualifierLiteral INSTANCE = new QualifierLiteral(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java index 14262cdd..6a3083e4 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java @@ -23,7 +23,7 @@ * @since 2.0 */ public final class SingletonLiteral extends AnnotationLiteral implements Singleton { - + /** Default SingletonLiteral instance */ public static final SingletonLiteral INSTANCE = new SingletonLiteral(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java b/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java index b9ae3f65..d6d6cd36 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/Annotated.java @@ -22,7 +22,7 @@ /** *

* Represents a Java program element that can be annotated. - *

+ *

* * @see java.lang.reflect.AnnotatedElement * diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java index 8f5a4a52..ab17b40d 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/AnnotatedType.java @@ -64,7 +64,7 @@ public interface AnnotatedType extends Annotated { /** *

* Get the {@linkplain AnnotatedField fields} of the type. - *

+ *

* * @return the fields, or an empty set if none are defined */ diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java index 10e6d909..25c4966f 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java @@ -42,7 +42,9 @@ public abstract class CDI implements Instance { private static final Object lock = new Object(); private static volatile boolean providerSetManually = false; + /** The set of discovered CDIProviders */ protected static volatile Set discoveredProviders = null; + /** {@link CDIProvider} set by user or retrieved by serviceloader */ protected static volatile CDIProvider configuredProvider = null; /** diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java index 9a7c0732..4811fc51 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDIProvider.java @@ -22,6 +22,7 @@ */ public interface CDIProvider extends Prioritized { + /** The default value for {@linkplain #getPriority()} */ public static final int DEFAULT_CDI_PROVIDER_PRIORITY = 0; /** diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java index 0172e053..7c0a1237 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java @@ -41,16 +41,32 @@ public class DefinitionException extends RuntimeException { private static final long serialVersionUID = -2699170549782567339L; - public DefinitionException(String message, Throwable t) { - super(message, t); + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ + public DefinitionException(String message, Throwable cause) { + super(message, cause); } + /** + * Create exception with given message + * + * @param message - context information + */ public DefinitionException(String message) { super(message); } - public DefinitionException(Throwable t) { - super(t); + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ + public DefinitionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java index 50627b26..1d0804ae 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java @@ -41,16 +41,32 @@ public class DeploymentException extends RuntimeException { private static final long serialVersionUID = 2604707587772339984L; - public DeploymentException(String message, Throwable t) { - super(message, t); + /** + * Create exception with given message and cause + * + * @param message - context information + * @param cause - cause of exception + */ + public DeploymentException(String message, Throwable cause) { + super(message, cause); } + /** + * Create exception with given message + * + * @param message - context information + */ public DeploymentException(String message) { super(message); } - public DeploymentException(Throwable t) { - super(t); + /** + * Create exception with given cause + * + * @param cause - cause of exception + */ + public DeploymentException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java index 5f3e754e..fd812983 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java @@ -40,7 +40,7 @@ * @param the event type */ public interface ObserverMethod extends Prioritized { - + /** The default observer notification priority */ public static final int DEFAULT_PRIORITY = jakarta.interceptor.Interceptor.Priority.APPLICATION + 500; /** diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java b/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java index 86211672..968cb254 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java @@ -44,7 +44,11 @@ @Retention(RUNTIME) @Target(PARAMETER) public @interface WithAnnotations { - + /** + * Event annotation types to observe + * + * @return Event annotation types to observe + */ Class[] value(); } diff --git a/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java b/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java index 00ab36ef..4ff7fe80 100644 --- a/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java +++ b/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java @@ -71,6 +71,9 @@ public abstract class AnnotationLiteral implements Annotat private transient Method[] members; private transient Integer cachedHashCode; + /** + * Default ctor + */ protected AnnotationLiteral() { } diff --git a/api/src/main/java/jakarta/enterprise/util/Nonbinding.java b/api/src/main/java/jakarta/enterprise/util/Nonbinding.java index 9f54c1b4..8ef816d6 100644 --- a/api/src/main/java/jakarta/enterprise/util/Nonbinding.java +++ b/api/src/main/java/jakarta/enterprise/util/Nonbinding.java @@ -56,7 +56,7 @@ * @since 2.0 */ public static final class Literal extends AnnotationLiteral implements Nonbinding { - + /** Default Nonbinding literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java b/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java index 451a6d3f..d5f13bd0 100644 --- a/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java +++ b/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java @@ -52,6 +52,9 @@ public abstract class TypeLiteral implements Serializable { private transient Type actualType; + /** + * Default ctor + */ protected TypeLiteral() { } diff --git a/api/src/main/java/module-info.java b/api/src/main/java/module-info.java index 5154dab2..218571c9 100644 --- a/api/src/main/java/module-info.java +++ b/api/src/main/java/module-info.java @@ -11,6 +11,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/** + * The CDI exported package, dependency information and services + */ module jakarta.cdi { exports jakarta.decorator; exports jakarta.enterprise.context; From 58f20d758fb1e31d53ca26b1b43bff4637417859 Mon Sep 17 00:00:00 2001 From: Eclipse CDI Bot Date: Mon, 26 Feb 2024 23:12:11 +0000 Subject: [PATCH 08/16] [maven-release-plugin] prepare release 4.1.0.Beta2 --- api/pom.xml | 4 ++-- el/pom.xml | 2 +- ide-config/pom.xml | 2 +- lang-model/pom.xml | 2 +- pom.xml | 4 ++-- spec/pom.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 4704eabb..37184a08 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -18,7 +18,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0-SNAPSHOT + 4.1.0.Beta2 jakarta.enterprise.cdi-api @@ -214,7 +214,7 @@ scm:git:git@github.com:cdi-spec/cdi.git scm:git:git@github.com:cdi-spec/cdi.git scm:git:git@github.com:cdi-spec/cdi.git - HEAD + 4.1.0.Beta2 diff --git a/el/pom.xml b/el/pom.xml index 9e8ae043..6262b070 100644 --- a/el/pom.xml +++ b/el/pom.xml @@ -13,7 +13,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0-SNAPSHOT + 4.1.0.Beta2 jakarta.enterprise.cdi-el-api diff --git a/ide-config/pom.xml b/ide-config/pom.xml index 46e0e720..15dbd332 100644 --- a/ide-config/pom.xml +++ b/ide-config/pom.xml @@ -14,7 +14,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0-SNAPSHOT + 4.1.0.Beta2 cdi-ide-config diff --git a/lang-model/pom.xml b/lang-model/pom.xml index c81d517b..3d41183a 100644 --- a/lang-model/pom.xml +++ b/lang-model/pom.xml @@ -13,7 +13,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0-SNAPSHOT + 4.1.0.Beta2 jakarta.enterprise.lang-model diff --git a/pom.xml b/pom.xml index b65003a7..49c2853e 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent pom - 4.1.0-SNAPSHOT + 4.1.0.Beta2 Parent module for CDI Specification @@ -35,7 +35,7 @@ scm:git:git://github.com/eclipse-ee4j/cdi.git scm:git:git@github.com:eclipse-ee4j/cdi.git https://github.com/eclipse-ee4j/cdi - HEAD + 4.1.0.Beta2 diff --git a/spec/pom.xml b/spec/pom.xml index 0548b5c2..38296158 100644 --- a/spec/pom.xml +++ b/spec/pom.xml @@ -13,7 +13,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0-SNAPSHOT + 4.1.0.Beta2 jakarta.enterprise.cdi-spec-doc From 486281d839d073ee69c8e2a0b453bd288fe65f76 Mon Sep 17 00:00:00 2001 From: Eclipse CDI Bot Date: Mon, 26 Feb 2024 23:12:12 +0000 Subject: [PATCH 09/16] [maven-release-plugin] prepare for next development iteration --- api/pom.xml | 4 ++-- el/pom.xml | 2 +- ide-config/pom.xml | 2 +- lang-model/pom.xml | 2 +- pom.xml | 4 ++-- spec/pom.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 37184a08..4704eabb 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -18,7 +18,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0.Beta2 + 4.1.0-SNAPSHOT jakarta.enterprise.cdi-api @@ -214,7 +214,7 @@ scm:git:git@github.com:cdi-spec/cdi.git scm:git:git@github.com:cdi-spec/cdi.git scm:git:git@github.com:cdi-spec/cdi.git - 4.1.0.Beta2 + HEAD diff --git a/el/pom.xml b/el/pom.xml index 6262b070..9e8ae043 100644 --- a/el/pom.xml +++ b/el/pom.xml @@ -13,7 +13,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0.Beta2 + 4.1.0-SNAPSHOT jakarta.enterprise.cdi-el-api diff --git a/ide-config/pom.xml b/ide-config/pom.xml index 15dbd332..46e0e720 100644 --- a/ide-config/pom.xml +++ b/ide-config/pom.xml @@ -14,7 +14,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0.Beta2 + 4.1.0-SNAPSHOT cdi-ide-config diff --git a/lang-model/pom.xml b/lang-model/pom.xml index 3d41183a..c81d517b 100644 --- a/lang-model/pom.xml +++ b/lang-model/pom.xml @@ -13,7 +13,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0.Beta2 + 4.1.0-SNAPSHOT jakarta.enterprise.lang-model diff --git a/pom.xml b/pom.xml index 49c2853e..b65003a7 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent pom - 4.1.0.Beta2 + 4.1.0-SNAPSHOT Parent module for CDI Specification @@ -35,7 +35,7 @@ scm:git:git://github.com/eclipse-ee4j/cdi.git scm:git:git@github.com:eclipse-ee4j/cdi.git https://github.com/eclipse-ee4j/cdi - 4.1.0.Beta2 + HEAD diff --git a/spec/pom.xml b/spec/pom.xml index 38296158..0548b5c2 100644 --- a/spec/pom.xml +++ b/spec/pom.xml @@ -13,7 +13,7 @@ jakarta.enterprise jakarta.enterprise.cdi-parent - 4.1.0.Beta2 + 4.1.0-SNAPSHOT jakarta.enterprise.cdi-spec-doc From 22a5148200260cb760be4711193d531bee0583a8 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Mon, 26 Feb 2024 17:19:55 +0100 Subject: [PATCH 10/16] add blog post about what's new in CDI 4.1 --- docs/_posts/2024-02-27-whats-new-in-cdi41.md | 127 +++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 docs/_posts/2024-02-27-whats-new-in-cdi41.md diff --git a/docs/_posts/2024-02-27-whats-new-in-cdi41.md b/docs/_posts/2024-02-27-whats-new-in-cdi41.md new file mode 100644 index 00000000..df91b552 --- /dev/null +++ b/docs/_posts/2024-02-27-whats-new-in-cdi41.md @@ -0,0 +1,127 @@ +--- +# Copyright (c) 2024 Red Hat, Inc. and others +# +# This program and the accompanying materials are made available under the +# Apache Software License 2.0 which is available at: +# https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: Apache-2.0 + +title: "What's new in CDI 4.1?" +author: ladt +tag: development-tips +--- + +If you're following the activity on the [CDI repository](https://github.com/jakartaee/cdi/), or in Jakarta EE in general, you might have noticed that the CDI 4.1 release is coming soon. +In this short post, we'll take a look at what's new in the wonderful world of CDI. + +## Method Invokers + +The most important (or at least the biggest) addition to CDI is _method invokers_. +It is not terribly interesting for application developers, but it should be very useful for people who build CDI-based frameworks. + +A method invoker is, unsurprisingly, an object that allows invoking a method indirectly. +It implements the `jakarta.enterprise.invoke.Invoker` interface, which is very simple: + +```java +interface Invoker { + R invoke(T instance, Object[] arguments) throws Exception; +} +``` + +CDI extensions can create an invoker for methods (including `static` methods) declared on managed beans. +For example, let's say the application contains this bean: + +```java +@Dependent +public class MyService { + public String hello(String name) { + return "Hello " + name + "!"; + } +} +``` + +A hypothetical CDI-based framework can decide that it might need to invoke the method at runtime. +During deployment, the CDI extension provided by the framework would use + +- `ProcessManagedBean.createInvoker()`, if using a Portable Extension +- `InvokerFactory.createInvoker()`, if using a Build Compatible Extension + +to obtain an `InvokerBuilder`. Calling `build()` on it will produce + +- an `Invoker` directly, if using a Portable Extension +- an `InvokerInfo` that materializes as an `Invoker` at application runtime, if using a Build Compatible Extension + +The `Invoker` then needs to be stored somewhere until the framework actually needs it. +When the time comes to invoke the method, the framework takes the `Invoker`, obtains an instance of `MyService` and all the parameter values, and calls + +```java +invoker.invoke(myService, new Object[] { "world" }) +``` + +The return value is `"Hello world!"`, as expected. + +### Lookups + +It is fairly common that some of the parameters the method accepts are CDI beans. +It is possible to configure the `InvokerBuilder` to resolve and instantiate a correct value for such parameter automatically. +In fact, this is possible also for the instance on which the method should be invoked. +The `InvokerBuilder` has methods `withInstanceLookup()` and `withArgumentLookup()` to configure that. + +Returning back to the example above, if the CDI extension called `withInstanceLookup()` before calling `InvokerBuilder.build()`, it wouldn't have to obtain the instance of `MyService` manually. +The invoker would do it automatically. +The invocation would just use `null` as the instance value: + +```java +invoker.invoke(null, new Object[] { "world" }) +``` + +The result is still the same: `"Hello world!"`. + +## Other Improvements + +There's a couple of quality of life improvements in this release, too. + +Interceptors can now access the interceptor binding annotations from `InvocationContext`, using methods `getInterceptorBinding()` and `getInteceptorBindings()`. +This is technically a change in the Interceptors specification, but is most useful for CDI programmers, so we mention it here as well. + +Producer methods and fields can now declare a `@Priority` directly (or obtain a priority from a stereotype); they no longer have to rely on the priority value of their declaring bean. +When both the producer and its declaring bean have a priority, the producer's priority wins. + +The newly added methods `BeanContainer.isMatchingBean()` and `isMatchingEvent()` provide programmatic access to the typesafe resolution and observer resolution rules. +This is useful for frameworks that want to perform the same matching as CDI, but don't want to reimplement the rules themselves. + +The newly added method `BeanContainer.getContexts()` returns context objects of all registered contexts for given scope, regardless of whether they are active or inactive. +This is useful for authors of Build Compatible Extensions, who don't provide a context object to the container directly. +Instead, they provide a _class_ of the context object, and they need to use this method to gain access to the context object which the CDI container creates internally. + +## Deprecations + +CDI 4.1 prepares for removing a dependency on Unified EL from the core CDI API (`cdi-api.jar`). +This dependency is very narrow and really only useful for application server authors, but it's still there. + +Specifically, there are 2 methods on the `BeanManager` interface that use EL types in their signatures: + +- `getELResolver()`, which returns `ELResolver` +- `wrapExpressionFactory()`, which accepts and returns `ExpressionFactory` + +These 2 methods are deprecated in CDI 4.1 and shall be removed in CDI 5.0. + +The suggested replacement is the `ELAwareBeanManager` interface, which extends `BeanManager` and contains the same 2 methods, but exists outside of the core CDI API, in a supplemental CDI EL API artifact (`cdi-el-api.jar`). + +As mentioned above, these methods are mainly used by application servers, so this shouldn't really affect CDI users. +Also, CDI users don't have to consume the new supplemental artifact; compiling against the existing CDI API is fine. + +## CDI EE Specification Moved + +This is more of a curiosity from user perspective, but relatively important change internally. + +The _CDI in Jakarta EE_ part of the CDI specification, or _CDI EE_ for short, was moved from the CDI specification to the Jakarta EE Platform specification. +Together with that, the corresponding part of the CDI TCK (the `web` module, basically) was moved to the Jakarta EE Platform TCK. + +This doesn't affect CDI users, but is important for CDI implementations. + +## Conclusion + +CDI 4.1 is not a huge release, but it contains improvements useful for both application developers and framework authors. +If you have any questions, the friendly mailing list `cdi-dev@eclipse.org` is a great place to ask! From 85c0160c5d5465ddbebfab4d7b60b597bf0223d0 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 20 Feb 2024 11:28:50 +0100 Subject: [PATCH 11/16] Allow relaxing invoker lookup rules for asynchronous methods --- spec/src/main/asciidoc/core/invokers.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/src/main/asciidoc/core/invokers.asciidoc b/spec/src/main/asciidoc/core/invokers.asciidoc index b8566a71..2a003f3c 100644 --- a/spec/src/main/asciidoc/core/invokers.asciidoc +++ b/spec/src/main/asciidoc/core/invokers.asciidoc @@ -215,6 +215,19 @@ Implementations are permitted to remember the identified beans and not repeat th All instances of `@Dependent` looked up beans obtained during `Invoker.invoke()` are destroyed before the `invoke()` method returns or throws. The order in which the instances of `@Dependent` looked up beans are destroyed is not specified. +This specification recognizes the existence of _asynchronous_ methods, where the action represented by the method does not always finish when the method returns; the _completion_ of the action is asynchronous to the method call. +For target methods that are considered asynchronous by the CDI container, the requirement to destroy instances of `@Dependent` looked up beans is relaxed: the instances of `@Dependent` looked up beans need not be destroyed before `Invoker.invoke()` returns. +It is recommended that the instances of `@Dependent` looked up beans are destroyed after the asynchronous action completes and before the completion is propagated to the caller of `Invoker.invoke()`; if an asynchronous target method completes synchronously or throws synchronously, it is recommended that the instances of `@Dependent` looked up beans are destroyed before `invoke()` returns or rethrows the exception. + +[CAUTION] +==== +The rules for recognizing asynchronous methods are not specified. +Applications which use invokers to call asynchronous methods are therefore not portable. +Future versions of this specification may define an API to give greater control over the invocation of asynchronous methods. + +Implementations that support asynchronous methods are encouraged to document the rules they follow. +==== + The order in which instances of looked up beans are obtained during `Invoker.invoke()` in not specified. If an exception is thrown when creating an instance of a looked up bean during `Invoker.invoke()`, the exception is rethrown. From 7d8ad7732de1b5eb404370d7f58799099b915873 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 27 Feb 2024 09:47:00 +0100 Subject: [PATCH 12/16] review javadoc improvements in the CDI API --- .../enterprise/context/BeforeDestroyed.java | 16 ++++++------- .../context/BusyConversationException.java | 16 ++++++------- .../enterprise/context/ContextException.java | 16 ++++++------- .../context/ContextNotActiveException.java | 16 ++++++------- .../jakarta/enterprise/context/Destroyed.java | 12 +++++----- .../enterprise/context/Initialized.java | 12 +++++----- .../NonexistentConversationException.java | 16 ++++++------- .../enterprise/context/RequestScoped.java | 2 +- .../enterprise/event/NotificationOptions.java | 6 ++--- .../enterprise/event/ObserverException.java | 16 ++++++------- .../inject/AmbiguousResolutionException.java | 24 +++++++++---------- .../enterprise/inject/CreationException.java | 16 ++++++------- .../inject/IllegalProductException.java | 16 ++++++------- .../enterprise/inject/InjectionException.java | 16 ++++++------- .../inject/ResolutionException.java | 16 ++++++------- .../java/jakarta/enterprise/inject/Typed.java | 10 ++++---- .../UnproxyableResolutionException.java | 16 ++++++------- .../UnsatisfiedResolutionException.java | 16 ++++++------- .../inject/literal/NamedLiteral.java | 6 ++--- .../inject/literal/QualifierLiteral.java | 2 +- .../inject/literal/SingletonLiteral.java | 2 +- .../jakarta/enterprise/inject/spi/CDI.java | 2 +- .../inject/spi/DefinitionException.java | 14 +++++------ .../inject/spi/DeploymentException.java | 14 +++++------ .../enterprise/inject/spi/ObserverMethod.java | 2 +- .../inject/spi/WithAnnotations.java | 5 ++-- .../enterprise/util/AnnotationLiteral.java | 2 +- .../jakarta/enterprise/util/TypeLiteral.java | 2 +- api/src/main/java/module-info.java | 2 +- 29 files changed, 156 insertions(+), 155 deletions(-) diff --git a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java index 3e730050..36614d6a 100644 --- a/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java +++ b/api/src/main/java/jakarta/enterprise/context/BeforeDestroyed.java @@ -54,28 +54,28 @@ * Supports inline instantiation of the {@link BeforeDestroyed} qualifier. */ public final static class Literal extends AnnotationLiteral implements BeforeDestroyed { - /** Default RequestScoped literal */ + /** Default BeforeDestroyed literal for the RequestScoped scope */ public static final Literal REQUEST = of(RequestScoped.class); - /** Default ConversationScoped literal */ + /** Default BeforeDestroyed literal for the ConversationScoped scope */ public static final Literal CONVERSATION = of(ConversationScoped.class); - /** Default SessionScoped literal */ + /** Default BeforeDestroyed literal for the SessionScoped scope */ public static final Literal SESSION = of(SessionScoped.class); - /** Default ApplicationScoped literal */ + /** Default BeforeDestroyed literal for the ApplicationScoped scope */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; - /** */ + /** The scope annotation */ private final Class value; /** - * Obtain the literal of the provided scope annotation + * Obtain the literal for the provided scope annotation * - * @param value - the scope annotation - * @return a new Literal value for the provided scope annotation + * @param value the scope annotation + * @return a new literal value for the provided scope annotation */ public static Literal of(Class value) { return new Literal(value); diff --git a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java index 25914b69..eafa12df 100644 --- a/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java +++ b/api/src/main/java/jakarta/enterprise/context/BusyConversationException.java @@ -42,35 +42,35 @@ public class BusyConversationException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; /** - * default ctor + * Creates the exception with no detail message or cause. */ public BusyConversationException() { super(); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public BusyConversationException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public BusyConversationException(Throwable cause) { super(cause); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public BusyConversationException(String message, Throwable cause) { super(message, cause); diff --git a/api/src/main/java/jakarta/enterprise/context/ContextException.java b/api/src/main/java/jakarta/enterprise/context/ContextException.java index 1e33dbaa..cd921ad5 100644 --- a/api/src/main/java/jakarta/enterprise/context/ContextException.java +++ b/api/src/main/java/jakarta/enterprise/context/ContextException.java @@ -27,35 +27,35 @@ public class ContextException extends RuntimeException { private static final long serialVersionUID = -3599813072560026919L; /** - * default ctor + * Creates the exception with no detail message or cause. */ public ContextException() { super(); } /** - * Create exception with given message and cause + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public ContextException(String message) { super(message); } /** - * Create exception with given message and cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public ContextException(Throwable cause) { super(cause); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public ContextException(String message, Throwable cause) { super(message, cause); diff --git a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java index f1de936f..9ae4e5b1 100644 --- a/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java +++ b/api/src/main/java/jakarta/enterprise/context/ContextNotActiveException.java @@ -33,35 +33,35 @@ public class ContextNotActiveException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public ContextNotActiveException() { super(); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public ContextNotActiveException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public ContextNotActiveException(Throwable cause) { super(cause); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public ContextNotActiveException(String message, Throwable cause) { super(message, cause); diff --git a/api/src/main/java/jakarta/enterprise/context/Destroyed.java b/api/src/main/java/jakarta/enterprise/context/Destroyed.java index 15aa7737..28e52844 100644 --- a/api/src/main/java/jakarta/enterprise/context/Destroyed.java +++ b/api/src/main/java/jakarta/enterprise/context/Destroyed.java @@ -55,27 +55,27 @@ * @author Martin Kouba */ public final static class Literal extends AnnotationLiteral implements Destroyed { - /** Default RequestScoped literal */ + /** Default Destroyed literal for the RequestScoped scope */ public static final Literal REQUEST = of(RequestScoped.class); - /** Default ConversationScoped literal */ + /** Default Destroyed literal for the ConversationScoped scope */ public static final Literal CONVERSATION = of(ConversationScoped.class); - /** Default SessionScoped literal */ + /** Default Destroyed literal for the SessionScoped scope */ public static final Literal SESSION = of(SessionScoped.class); - /** Default ApplicationScoped literal */ + /** Default Destroyed literal for the ApplicationScoped scope */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; - /** */ + /** The scope annotation */ private final Class value; /** * Obtain the literal of the provided scope annotation * - * @param value - the scope annotation + * @param value the scope annotation * @return a new Literal value for the provided scope annotation */ public static Literal of(Class value) { diff --git a/api/src/main/java/jakarta/enterprise/context/Initialized.java b/api/src/main/java/jakarta/enterprise/context/Initialized.java index 67b20500..7f78d3e7 100644 --- a/api/src/main/java/jakarta/enterprise/context/Initialized.java +++ b/api/src/main/java/jakarta/enterprise/context/Initialized.java @@ -55,27 +55,27 @@ * @author Martin Kouba */ public final static class Literal extends AnnotationLiteral implements Initialized { - /** Default RequestScoped literal */ + /** Default Initialized literal for the RequestScoped scope */ public static final Literal REQUEST = of(RequestScoped.class); - /** Default ConversationScoped literal */ + /** Default Initialized literal for the ConversationScoped scope */ public static final Literal CONVERSATION = of(ConversationScoped.class); - /** Default SessionScoped literal */ + /** Default Initialized literal for the SessionScoped scope */ public static final Literal SESSION = of(SessionScoped.class); - /** Default ApplicationScoped literal */ + /** Default Initialized literal for the ApplicationScoped scope */ public static final Literal APPLICATION = of(ApplicationScoped.class); private static final long serialVersionUID = 1L; - /** */ + /** The scope annotation */ private final Class value; /** * Obtain the literal of the provided scope annotation * - * @param value - the scope annotation + * @param value the scope annotation * @return a new Literal value for the provided scope annotation */ public static Literal of(Class value) { diff --git a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java index 2c1611a1..e7d12ce9 100644 --- a/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java +++ b/api/src/main/java/jakarta/enterprise/context/NonexistentConversationException.java @@ -39,35 +39,35 @@ public class NonexistentConversationException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public NonexistentConversationException() { super(); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public NonexistentConversationException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public NonexistentConversationException(Throwable cause) { super(cause); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public NonexistentConversationException(String message, Throwable cause) { super(message, cause); diff --git a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java index 3caf651d..38505418 100644 --- a/api/src/main/java/jakarta/enterprise/context/RequestScoped.java +++ b/api/src/main/java/jakarta/enterprise/context/RequestScoped.java @@ -95,7 +95,7 @@ * @since 2.0 */ public final static class Literal extends AnnotationLiteral implements RequestScoped { - /** Default RequestScope literal */ + /** Default RequestScoped literal */ public static final Literal INSTANCE = new Literal(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java index 0179641b..60b735e8 100644 --- a/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java +++ b/api/src/main/java/jakarta/enterprise/event/NotificationOptions.java @@ -75,7 +75,7 @@ interface Builder { /** * Set the notification executor * - * @param executor - {@linkplain Executor} + * @param executor the {@linkplain Executor} * @return this */ Builder setExecutor(Executor executor); @@ -83,8 +83,8 @@ interface Builder { /** * Set an option value * - * @param optionName - name - * @param optionValue - value + * @param optionName option name + * @param optionValue option value * @return this */ Builder set(String optionName, Object optionValue); diff --git a/api/src/main/java/jakarta/enterprise/event/ObserverException.java b/api/src/main/java/jakarta/enterprise/event/ObserverException.java index 8dcfb18c..36c575fe 100644 --- a/api/src/main/java/jakarta/enterprise/event/ObserverException.java +++ b/api/src/main/java/jakarta/enterprise/event/ObserverException.java @@ -27,35 +27,35 @@ public class ObserverException extends RuntimeException { private static final long serialVersionUID = -801836224808304381L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public ObserverException() { } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public ObserverException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public ObserverException(Throwable cause) { super(cause); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public ObserverException(String message, Throwable cause) { super(message, cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java index b37696b6..5add09f3 100644 --- a/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/AmbiguousResolutionException.java @@ -27,37 +27,37 @@ public class AmbiguousResolutionException extends ResolutionException { private static final long serialVersionUID = -2132733164534544788L; /** - * default ctor + * Creates the exception with no detail message or cause. */ public AmbiguousResolutionException() { } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param throwable - cause of exception + * @param message the detail message + * @param cause the cause */ - public AmbiguousResolutionException(String message, Throwable throwable) { - super(message, throwable); + public AmbiguousResolutionException(String message, Throwable cause) { + super(message, cause); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public AmbiguousResolutionException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param throwable - cause of exception + * @param cause the cause */ - public AmbiguousResolutionException(Throwable throwable) { - super(throwable); + public AmbiguousResolutionException(Throwable cause) { + super(cause); } } diff --git a/api/src/main/java/jakarta/enterprise/inject/CreationException.java b/api/src/main/java/jakarta/enterprise/inject/CreationException.java index 10f733a6..b20edcfe 100644 --- a/api/src/main/java/jakarta/enterprise/inject/CreationException.java +++ b/api/src/main/java/jakarta/enterprise/inject/CreationException.java @@ -27,35 +27,35 @@ public class CreationException extends InjectionException { private static final long serialVersionUID = 1002854668862145298L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public CreationException() { } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public CreationException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public CreationException(Throwable cause) { super(cause); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public CreationException(String message, Throwable cause) { super(message, cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java index 89c1f135..56223681 100644 --- a/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java +++ b/api/src/main/java/jakarta/enterprise/inject/IllegalProductException.java @@ -26,35 +26,35 @@ public class IllegalProductException extends InjectionException { private static final long serialVersionUID = -6280627846071966243L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public IllegalProductException() { super(); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public IllegalProductException(String message, Throwable cause) { super(message, cause); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public IllegalProductException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public IllegalProductException(Throwable cause) { super(cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java index 278c8289..cf453358 100644 --- a/api/src/main/java/jakarta/enterprise/inject/InjectionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/InjectionException.java @@ -24,34 +24,34 @@ public class InjectionException extends RuntimeException { private static final long serialVersionUID = -2132733164534544788L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public InjectionException() { } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public InjectionException(String message, Throwable cause) { super(message, cause); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public InjectionException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public InjectionException(Throwable cause) { super(cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java index f27e6aca..8bc7312e 100644 --- a/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/ResolutionException.java @@ -23,35 +23,35 @@ public class ResolutionException extends InjectionException { private static final long serialVersionUID = -6280627846071966243L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public ResolutionException() { super(); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public ResolutionException(String message, Throwable cause) { super(message, cause); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public ResolutionException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public ResolutionException(Throwable cause) { super(cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/Typed.java b/api/src/main/java/jakarta/enterprise/inject/Typed.java index 30c11a16..f1386222 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Typed.java +++ b/api/src/main/java/jakarta/enterprise/inject/Typed.java @@ -54,8 +54,8 @@ public @interface Typed { /** *

- * Selects the bean types of the bean. Every class must correspond to a type in the unrestricted set of bean types of a - * bean. + * Selects the bean types of the bean. Every class must correspond to a type in the unrestricted set of bean types + * of a bean. *

* * @return the classes corresponding to the bean types of the bean @@ -74,13 +74,13 @@ public final static class Literal extends AnnotationLiteral implements Ty private static final long serialVersionUID = 1L; - /** */ + /** The classes corresponding to the bean types of the bean */ private final Class[] value; /** - * Obtain the Type literal of the provided bean classes + * Obtain the Typed literal for the provided bean types * - * @param value - the classes corresponding to the bean types of the bean + * @param value the classes corresponding to the bean types of the bean * @return a new Literal value for the provided classes */ public static Literal of(Class[] value) { diff --git a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java index fddccf74..0020620a 100644 --- a/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/UnproxyableResolutionException.java @@ -28,35 +28,35 @@ public class UnproxyableResolutionException extends ResolutionException { private static final long serialVersionUID = 1667539354548135465L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public UnproxyableResolutionException() { super(); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public UnproxyableResolutionException(String message, Throwable cause) { super(message, cause); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public UnproxyableResolutionException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public UnproxyableResolutionException(Throwable cause) { super(cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java index 0ee43129..5f5be316 100644 --- a/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/UnsatisfiedResolutionException.java @@ -27,35 +27,35 @@ public class UnsatisfiedResolutionException extends ResolutionException { private static final long serialVersionUID = 5350603312442756709L; /** - * Default ctor + * Creates the exception with no detail message or cause. */ public UnsatisfiedResolutionException() { super(); } /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public UnsatisfiedResolutionException(String message, Throwable cause) { super(message, cause); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public UnsatisfiedResolutionException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public UnsatisfiedResolutionException(Throwable cause) { super(cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java index d31a8412..2d355ab6 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/NamedLiteral.java @@ -24,18 +24,18 @@ * @since 2.0 */ public final class NamedLiteral extends AnnotationLiteral implements Named { - /** Default NamedLiteral */ + /** Default Named literal */ public static final Named INSTANCE = of(""); private static final long serialVersionUID = 1L; - /** */ + /** The name */ private final String value; /** * Create a new NamedLiteral for the given name value * - * @param value - name + * @param value the name * @return new NamedLiteral */ public static NamedLiteral of(String value) { diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java index dd5f0626..7b43962f 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/QualifierLiteral.java @@ -23,7 +23,7 @@ * @since 2.0 */ public final class QualifierLiteral extends AnnotationLiteral implements Qualifier { - /** Default QualifierLiteral instance */ + /** Default Qualifier literal */ public static final QualifierLiteral INSTANCE = new QualifierLiteral(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java b/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java index 6a3083e4..e188ddd6 100644 --- a/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java +++ b/api/src/main/java/jakarta/enterprise/inject/literal/SingletonLiteral.java @@ -23,7 +23,7 @@ * @since 2.0 */ public final class SingletonLiteral extends AnnotationLiteral implements Singleton { - /** Default SingletonLiteral instance */ + /** Default Singleton literal */ public static final SingletonLiteral INSTANCE = new SingletonLiteral(); private static final long serialVersionUID = 1L; diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java index 25c4966f..ffa9a486 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java @@ -44,7 +44,7 @@ public abstract class CDI implements Instance { private static volatile boolean providerSetManually = false; /** The set of discovered CDIProviders */ protected static volatile Set discoveredProviders = null; - /** {@link CDIProvider} set by user or retrieved by serviceloader */ + /** {@link CDIProvider} set by user or retrieved by service loader */ protected static volatile CDIProvider configuredProvider = null; /** diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java index 7c0a1237..455db37c 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/DefinitionException.java @@ -42,28 +42,28 @@ public class DefinitionException extends RuntimeException { private static final long serialVersionUID = -2699170549782567339L; /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public DefinitionException(String message, Throwable cause) { super(message, cause); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public DefinitionException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public DefinitionException(Throwable cause) { super(cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java index 1d0804ae..0970d517 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/DeploymentException.java @@ -42,28 +42,28 @@ public class DeploymentException extends RuntimeException { private static final long serialVersionUID = 2604707587772339984L; /** - * Create exception with given message and cause + * Creates the exception with given detail message and cause. * - * @param message - context information - * @param cause - cause of exception + * @param message the detail message + * @param cause the cause */ public DeploymentException(String message, Throwable cause) { super(message, cause); } /** - * Create exception with given message + * Creates the exception with given detail message. * - * @param message - context information + * @param message the detail message */ public DeploymentException(String message) { super(message); } /** - * Create exception with given cause + * Creates the exception with given cause. * - * @param cause - cause of exception + * @param cause the cause */ public DeploymentException(Throwable cause) { super(cause); diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java index fd812983..f224dfb5 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java @@ -40,7 +40,7 @@ * @param the event type */ public interface ObserverMethod extends Prioritized { - /** The default observer notification priority */ + /** The default observer priority */ public static final int DEFAULT_PRIORITY = jakarta.interceptor.Interceptor.Priority.APPLICATION + 500; /** diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java b/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java index 968cb254..9f223ba7 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/WithAnnotations.java @@ -45,9 +45,10 @@ @Target(PARAMETER) public @interface WithAnnotations { /** - * Event annotation types to observe + * The annotation types that must be present on the {@link AnnotatedType} + * for the {@code ProcessAnnotatedType} observer to be notified. * - * @return Event annotation types to observe + * @return required annotation types */ Class[] value(); diff --git a/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java b/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java index 4ff7fe80..2baab50b 100644 --- a/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java +++ b/api/src/main/java/jakarta/enterprise/util/AnnotationLiteral.java @@ -72,7 +72,7 @@ public abstract class AnnotationLiteral implements Annotat private transient Integer cachedHashCode; /** - * Default ctor + * The literal constructor, only for subclasses. */ protected AnnotationLiteral() { } diff --git a/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java b/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java index d5f13bd0..56af037b 100644 --- a/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java +++ b/api/src/main/java/jakarta/enterprise/util/TypeLiteral.java @@ -53,7 +53,7 @@ public abstract class TypeLiteral implements Serializable { private transient Type actualType; /** - * Default ctor + * The literal constructor, only for subclasses. */ protected TypeLiteral() { } diff --git a/api/src/main/java/module-info.java b/api/src/main/java/module-info.java index 218571c9..b4f3fdd7 100644 --- a/api/src/main/java/module-info.java +++ b/api/src/main/java/module-info.java @@ -12,7 +12,7 @@ * limitations under the License. */ /** - * The CDI exported package, dependency information and services + * The {@code jakarta.cdi} module; defines the CDI API exported packages, dependencies and services. */ module jakarta.cdi { exports jakarta.decorator; From 0dd76aa7ea9ea63512e0263953fc4069547ba90e Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 27 Feb 2024 09:47:16 +0100 Subject: [PATCH 13/16] fix javadoc warnings in CDI EL API --- .../jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java | 4 ++-- el/src/main/java/module-info.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java b/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java index de7ef49c..bdfa1319 100644 --- a/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java +++ b/el/src/main/java/jakarta/enterprise/inject/spi/el/ELAwareBeanManager.java @@ -19,8 +19,8 @@ import jakarta.enterprise.inject.spi.BeanManager; /** - * A {@link BeanManager} that allows integrators to obtain Unified EL objects - * that are integrated with the CDI container as described in the CDI specification. + * A {@link BeanManager} that allows integrators to obtain Unified EL objects that are + * integrated with the CDI container as described in the Jakarta EE Platform specification. * * @since 4.1 */ diff --git a/el/src/main/java/module-info.java b/el/src/main/java/module-info.java index 41499c6d..d6669a0c 100644 --- a/el/src/main/java/module-info.java +++ b/el/src/main/java/module-info.java @@ -11,6 +11,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/** + * The {@code jakarta.cdi.el} module; defines the CDI EL API exported packages and dependencies. + */ module jakarta.cdi.el { exports jakarta.enterprise.inject.spi.el; From 4856e190a2fe8358cd5d670ca6a8b6dbae9adcac Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 27 Feb 2024 09:56:52 +0100 Subject: [PATCH 14/16] fix javadoc warnings in CDI Language Model API --- .../model/declarations/DeclarationInfo.java | 22 +++++++++++++++ .../lang/model/types/PrimitiveType.java | 27 +++++++++++++++++++ .../enterprise/lang/model/types/Type.java | 22 +++++++++------ lang-model/src/main/java/module-info.java | 3 +++ 4 files changed, 66 insertions(+), 8 deletions(-) diff --git a/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/DeclarationInfo.java b/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/DeclarationInfo.java index 554fde1e..c837de98 100644 --- a/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/DeclarationInfo.java +++ b/lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/DeclarationInfo.java @@ -26,6 +26,7 @@ *
  • {@linkplain FieldInfo fields}
  • *
  • {@linkplain MethodInfo methods}, including constructors
  • *
  • {@linkplain ParameterInfo method parameters}, including constructor parameters
  • + *
  • {@linkplain RecordComponentInfo record components}
  • * * * @since 4.0 @@ -51,12 +52,33 @@ default Type asType() { throw new IllegalStateException("Not a type"); } + /** + * The declaration kind: package, class, method, parameter, field, record component. + */ enum Kind { + /** + * Package + */ PACKAGE, + /** + * Class, interface, enum, annotation, or record + */ CLASS, + /** + * Method or constructor + */ METHOD, + /** + * Method parameter or constructor parameter + */ PARAMETER, + /** + * Field + */ FIELD, + /** + * Record component + */ RECORD_COMPONENT, } diff --git a/lang-model/src/main/java/jakarta/enterprise/lang/model/types/PrimitiveType.java b/lang-model/src/main/java/jakarta/enterprise/lang/model/types/PrimitiveType.java index 21d4c80e..ee9265f4 100644 --- a/lang-model/src/main/java/jakarta/enterprise/lang/model/types/PrimitiveType.java +++ b/lang-model/src/main/java/jakarta/enterprise/lang/model/types/PrimitiveType.java @@ -30,14 +30,41 @@ * @since 4.0 */ public interface PrimitiveType extends Type { + /** + * The primitive type kind: boolean, byte, short, int, long, float, double, char + */ enum PrimitiveKind { + /** + * The {@code boolean} primitive type + */ BOOLEAN, + /** + * The {@code byte} primitive type + */ BYTE, + /** + * The {@code short} primitive type + */ SHORT, + /** + * The {@code int} primitive type + */ INT, + /** + * The {@code long} primitive type + */ LONG, + /** + * The {@code float} primitive type + */ FLOAT, + /** + * The {@code double} primitive type + */ DOUBLE, + /** + * The {@code char} primitive type + */ CHAR, } diff --git a/lang-model/src/main/java/jakarta/enterprise/lang/model/types/Type.java b/lang-model/src/main/java/jakarta/enterprise/lang/model/types/Type.java index 0ed1e5f4..48f21a64 100644 --- a/lang-model/src/main/java/jakarta/enterprise/lang/model/types/Type.java +++ b/lang-model/src/main/java/jakarta/enterprise/lang/model/types/Type.java @@ -68,22 +68,28 @@ default Type asType() { return this; } + /** + * The type kind: void, primitive, class, array, parameterized type, type variable, wildcard type + */ enum Kind { - /** E.g. when method returns {@code void}. */ + /** The void pseudo-type, e.g. when method returns {@code void}. */ VOID, - /** E.g. when method returns {@code int}. */ + /** A primitive type, e.g. when method returns {@code int}. */ PRIMITIVE, - /** E.g. when method returns {@code String}. */ + /** A class type, e.g. when method returns {@code String}. */ CLASS, - /** E.g. when method returns {@code int[]} or {@code String[][]}. */ + /** An array type, e.g. when method returns {@code int[]} or {@code String[][]}. */ ARRAY, - /** E.g. when method returns {@code List}. */ + /** A parameterized type, e.g. when method returns {@code List}. */ PARAMETERIZED_TYPE, - /** E.g. when method returns {@code T} and {@code T} is a type parameter of the declaring class. */ + /** + * A type variable, e.g. when method returns {@code T} and {@code T} is a type parameter + * of the declaring class. + */ TYPE_VARIABLE, /** - * E.g. when method returns {@code List}. The kind of such type is {@code PARAMETERIZED_TYPE}, - * but the first (and only) type argument is a {@code WILDCARD_TYPE}. + * A wildcard type, e.g. when method returns {@code List}. The kind of such type + * is {@code PARAMETERIZED_TYPE}, but the first (and only) type argument is a {@code WILDCARD_TYPE}. */ WILDCARD_TYPE, } diff --git a/lang-model/src/main/java/module-info.java b/lang-model/src/main/java/module-info.java index 85f75901..aab96e73 100644 --- a/lang-model/src/main/java/module-info.java +++ b/lang-model/src/main/java/module-info.java @@ -11,6 +11,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/** + * The {@code jakarta.cdi.lang.model} module; defines the CDI Language Model API exported packages + */ module jakarta.cdi.lang.model { exports jakarta.enterprise.lang.model; exports jakarta.enterprise.lang.model.declarations; From d5745630ba878a85cee74653799f57021a1c5d57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 05:53:46 +0000 Subject: [PATCH 15/16] Bump actions/setup-java from 4.0.0 to 4.1.0 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v4.0.0...v4.1.0) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/ci-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 59cccf4d..d8201ce9 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v4.1.1 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v4.0.0 + uses: actions/setup-java@v4.1.0 with: distribution: 'temurin' java-version: ${{ matrix.java }} From 961f04c949641663825194f9e59e20c9a40ee763 Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Thu, 29 Feb 2024 12:52:09 -0600 Subject: [PATCH 16/16] Add the 6.0.0 EL version Signed-off-by: Scott M Stark --- api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pom.xml b/api/pom.xml index abf8b00f..56004ea6 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -123,7 +123,7 @@ 3.0.0 2.0.1 - 6.0.0-RC1 + 6.0.0 2.2.0 MMMM dd, yyyy