diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index a07e1142d250..214076d28290 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,5 +5,5 @@ contact_links: url: https://github.com/apache/netbeans/discussions/ about: Ask a question or request support for using Apache NetBeans. - name: Mailing lists - url: https://netbeans.apache.org/community/mailing-lists.html + url: https://netbeans.apache.org/community/mailing-lists about: Subscribe to the users, dev or announce mailing lists for Apache NetBeans. diff --git a/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml b/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml index 39d09225a53d..11e1c5c44eef 100644 --- a/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml @@ -27,8 +27,8 @@ body: Latest releases are always available from https://netbeans.apache.org/download/ multiple: false options: - - "Apache NetBeans 20" -# - "Apache NetBeans 21 release candidate" + - "Apache NetBeans 21" + - "Apache NetBeans 22 release candidate" - "Apache NetBeans latest daily build" validations: required: true @@ -73,13 +73,12 @@ body: multiple: false options: - "No / Don't know" + - "Apache NetBeans 21" + - "Apache NetBeans 20" - "Apache NetBeans 19" - "Apache NetBeans 18" - "Apache NetBeans 17" - - "Apache NetBeans 16" - - "Apache NetBeans 15" - - "Apache NetBeans 14" - - "Apache NetBeans 13 or earlier" + - "Apache NetBeans 16 or earlier" validations: required: true - type: input diff --git a/.github/actions/delete-artifact b/.github/actions/delete-artifact deleted file mode 160000 index 54ab544f12cd..000000000000 --- a/.github/actions/delete-artifact +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 54ab544f12cdb7b71613a16a2b5a37a9ade990af diff --git a/.github/release.yml b/.github/release.yml index 91e1ce8ce946..559e27ee99b5 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -104,7 +104,7 @@ changelog: labels: - 'VSCode Extension' - - title: 'Maintanance' + - title: 'Maintenance' labels: - 'Code cleanup' - 'Upgrade Library' diff --git a/.github/scripts/BinariesListUpdates.java b/.github/scripts/BinariesListUpdates.java new file mode 100644 index 000000000000..6a64515f5ee3 --- /dev/null +++ b/.github/scripts/BinariesListUpdates.java @@ -0,0 +1,143 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.concurrent.Semaphore; +import java.util.concurrent.atomic.LongAdder; +import java.util.stream.Stream; +import org.apache.maven.search.api.SearchRequest; +import org.apache.maven.search.backend.smo.SmoSearchBackend; +import org.apache.maven.search.backend.smo.SmoSearchBackendFactory; +import org.apache.maven.artifact.versioning.ComparableVersion; + +import static java.util.FormatProcessor.FMT; +import static org.apache.maven.search.api.MAVEN.ARTIFACT_ID; +import static org.apache.maven.search.api.MAVEN.CLASSIFIER; +import static org.apache.maven.search.api.MAVEN.GROUP_ID; +import static org.apache.maven.search.api.MAVEN.VERSION; +import static org.apache.maven.search.api.request.BooleanQuery.and; +import static org.apache.maven.search.api.request.FieldQuery.fieldQuery; + +/** + * Scans for binaries-list files and checks if newer versions of the declared dependencies exist. + * + *
org.apache.maven.indexer:search-backend-smo
must be in classpath. + * + * @author mbien + */ +public class BinariesListUpdates { + + private static final LongAdder updates = new LongAdder(); + private static final LongAdder checks = new LongAdder(); + private static final LongAdder skips = new LongAdder(); + + // java --enable-preview --source 22 --class-path "lib/*" BinariesListUpdates.java /path/to/netbeans/project + public static void main(String[] args) throws IOException, InterruptedException { + + if (args.length != 1 || Files.notExists(Path.of(args[0]).resolve("README.md"))) { + throw new IllegalArgumentException("path to netbeans folder expected"); + } + + Path path = Path.of(args[0]); + try (Stream dependencyFiles = Files.find(path, 10, (p, a) -> p.getFileName().toString().equals("binaries-list")); + SmoSearchBackend backend = SmoSearchBackendFactory.createDefault()) { + dependencyFiles.sorted().forEach(p -> { + try { + checkDependencies(p, backend); + } catch (IOException | InterruptedException ex) { + throw new RuntimeException(ex); + } + }); + } + + System.out.println(STR."checked \{checks.sum()} dependencies, found \{updates.sum()} updates, skipped \{skips.sum()}." ); + } + + private static void checkDependencies(Path path, SmoSearchBackend backend) throws IOException, InterruptedException { + System.out.println(path); + try (Stream lines = Files.lines(path).parallel()) { + + // 321C614F85F1DEA6BB08C1817C60D53B7F3552FD org.fusesource.jansi:jansi:2.4.0 + lines.filter(l -> !l.startsWith("#")) + .filter(l -> l.length() > 40 && l.charAt(40) == ' ') + .map(l -> l.substring(40+1)) + .forEach(l -> { + + String[] comp = l.split("\\:"); + if (comp.length == 3 || comp.length == 4) { + String gid = comp[0].strip(); + String aid = comp[1].strip(); + String version = comp[2].strip(); + String classifier = comp.length == 4 ? comp[3].strip() : null; + try { + String gac; + String latest; + if (classifier == null) { + latest = queryLatestVersion(backend, gid, aid); + gac = String.join(":", gid, aid); + } else { + latest = queryLatestVersion(backend, gid, aid, classifier.split("@")[0]); + gac = String.join(":", gid, aid, classifier); + } + if (latest != null && !version.equals(latest)) { + System.out.println(FMT." %-50s\{gac} \{version} -> \{latest}"); + updates.increment(); + } + } catch (IOException | InterruptedException ex) { + throw new RuntimeException(ex); + } + } else { + System.out.println(" skip: '"+l+"'"); + skips.increment(); + } + checks.increment(); + }); + } + System.out.println(); + } + + private static String queryLatestVersion(SmoSearchBackend backend, String gid, String aid) throws IOException, InterruptedException { + return queryLatestVersion(backend, new SearchRequest(and(fieldQuery(GROUP_ID, gid), fieldQuery(ARTIFACT_ID, aid)))); + } + + private static String queryLatestVersion(SmoSearchBackend backend, String gid, String aid, String classifier) throws IOException, InterruptedException { + return queryLatestVersion(backend, new SearchRequest(and(fieldQuery(GROUP_ID, gid), fieldQuery(ARTIFACT_ID, aid), fieldQuery(CLASSIFIER, classifier)))); + } + + // reduce concurrency level if needed + private final static Semaphore requests = new Semaphore(4); + + private static String queryLatestVersion(SmoSearchBackend backend, SearchRequest request) throws IOException, InterruptedException { + requests.acquire(); + try { + return backend.search(request).getPage().stream() + .map(r -> r.getValue(VERSION)) + .filter(v -> !v.contains("alpha") && !v.contains("beta")) + .filter(v -> !v.contains("M") && !v.contains("m") && !v.contains("B") && !v.contains("b") && !v.contains("ea")) + .limit(5) + .max((v1, v2) -> new ComparableVersion(v1).compareTo(new ComparableVersion(v2))) + .orElse(null); + } finally { + requests.release(); + } + } + +} diff --git a/.github/workflows/dependency-checks.yml b/.github/workflows/dependency-checks.yml new file mode 100644 index 000000000000..034aca8b53c7 --- /dev/null +++ b/.github/workflows/dependency-checks.yml @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: NetBeans Dependency Checks + +on: +# pull_request: + # Allows you to run this workflow manually from the Actions tab in GitHub UI + workflow_dispatch: + +# cancel other workflow run in the same head-base group if it exists +concurrency: + group: dep-checker-${{ github.head_ref || github.run_id }}-${{ github.base_ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + + base-build: + name: Check Dependencies + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + + - name: Checkout ${{ github.ref }} ( ${{ github.sha }} ) + uses: actions/checkout@v4 + with: + persist-credentials: false + submodules: false + show-progress: false + + - name: Check Dependencies + run: | + mvn -q dependency:copy -Dartifact=org.apache.maven.indexer:search-backend-smo:7.1.1 -DoutputDirectory=./lib + mvn -q dependency:copy -Dartifact=org.apache.maven.indexer:search-api:7.1.1 -DoutputDirectory=./lib + mvn -q dependency:copy -Dartifact=com.google.code.gson:gson:2.10.1 -DoutputDirectory=./lib + mvn -q dependency:copy -Dartifact=org.apache.maven:maven-artifact:3.9.6 -DoutputDirectory=./lib + echo "
" >> $GITHUB_STEP_SUMMARY
+          $JAVA_HOME_21_X64/bin/java --enable-preview --source 21 -cp "lib/*" .github/scripts/BinariesListUpdates.java ./ | tee -a $GITHUB_STEP_SUMMARY
+          echo "
" >> $GITHUB_STEP_SUMMARY + rm -Rf lib diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5856777d1c5c..b4943feb75cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,11 +50,25 @@ env: # what to build and test, see nbbuild/cluster.properties CLUSTER_CONFIG: 'full' + + # default java distribution used by the setup-java action + # see https://github.com/actions/setup-java#supported-distributions + DEFAULT_JAVA_DISTRIBUTION: 'zulu' + + # labels are mapped to env vars for pipeline customization. If this is not a PR, (almost) everything will run, but with a reduced matrix. + # note: env vars don't work in the job's 'if' field but do work within jobs ( https://github.com/actions/runner/issues/1189 ), the whole expression must be duplicated + + # labels for special commands: + # 'ci:all-tests' enables everything + # 'ci:no-build' disables the build job (and test jobs too) + # 'ci:dev-build' produces an artifact containing a runnable NetBeans zip distribution - # flags for conditional, long running steps or jobs configurable with labels. If this is not a PR, everything will run. # 'Java' label test_java: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} + # 'JavaFX' label + test_javafx: ${{ contains(github.event.pull_request.labels.*.name, 'JavaFX') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} + # 'JavaDoc' or 'API Change' labels test_javadoc: ${{ contains(github.event.pull_request.labels.*.name, 'JavaDoc') || contains(github.event.pull_request.labels.*.name, 'API Change') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} @@ -73,11 +87,9 @@ env: # 'Platform' label test_platform: ${{ contains(github.event.pull_request.labels.*.name, 'Platform') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} - # 'tests' label for building all tests - test_tests: ${{ contains(github.event.pull_request.labels.*.name, 'tests') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} - # 'LSP' label for enabling Language Server Protocol tests - test_lsp: ${{ contains(github.event.pull_request.labels.*.name, 'LSP') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} + # 'Gradle' or 'Maven' will activate lsp tests too due to test dependencies on project API (ProjectViewTest, LspBrokenReferencesImplTest, ...) + test_lsp: ${{ contains(github.event.pull_request.labels.*.name, 'LSP') || contains(github.event.pull_request.labels.*.name, 'Gradle') || contains(github.event.pull_request.labels.*.name, 'Maven') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} # 'GraalVM' label for tests requirering GraalVM test_graalvm: ${{ contains(github.event.pull_request.labels.*.name, 'GraalVM') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} @@ -85,17 +97,20 @@ env: # 'VSCode Extension' label for building and testing the VSCode Extension test_vscode_extension: ${{ contains(github.event.pull_request.labels.*.name, 'VSCode Extension') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} - # 'Ant', 'Gradle', 'Maven' and 'MX' labels trigger build-tools job - # see job condition (env vars don't work for job conditions https://github.com/actions/runner/issues/1189 ) + # 'Ant', 'Gradle', 'Maven' and 'MX' labels trigger the build-tools job + test_build_tools: ${{ contains(github.event.pull_request.labels.*.name, 'Ant') || contains(github.event.pull_request.labels.*.name, 'Gradle') || contains(github.event.pull_request.labels.*.name, 'Maven') || contains(github.event.pull_request.labels.*.name, 'MX') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} - # special commands: - # 'ci:all-tests' enables everything - # 'ci:no-build' disables the build job (and test jobs too) - # 'ci:dev-build' produces an artifact containing a runnable NetBeans zip distribution - - # default java distribution used by the setup-java action - # see https://github.com/actions/setup-java#supported-distributions - default_java_distribution: 'zulu' + # 'git', 'subversion' and 'mercurial' labels trigger the versioning job + test_versioning: ${{ contains(github.event.pull_request.labels.*.name, 'git') || contains(github.event.pull_request.labels.*.name, 'subversion') || contains(github.event.pull_request.labels.*.name, 'mercurial') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} + + # 'Java EE/Jakarta EE', 'Micronaut' and 'enterprise' labels trigger the enterprise job + test_enterprise: ${{ contains(github.event.pull_request.labels.*.name, 'Java EE/Jakarta EE') || contains(github.event.pull_request.labels.*.name, 'Micronaut') || contains(github.event.pull_request.labels.*.name, 'enterprise') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} + + # 'JavaScript', 'TypeScript', 'HTML', 'CSS', 'CSL' and 'web' labels the trigger web job + test_web: ${{ contains(github.event.pull_request.labels.*.name, 'JavaScript') || contains(github.event.pull_request.labels.*.name, 'TypeScript') || contains(github.event.pull_request.labels.*.name, 'HTML') || contains(github.event.pull_request.labels.*.name, 'CSS') || contains(github.event.pull_request.labels.*.name, 'CSL') || contains(github.event.pull_request.labels.*.name, 'web') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} + + # 'tests' label activates an extra step which builds all tests + test_tests: ${{ contains(github.event.pull_request.labels.*.name, 'tests') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} jobs: @@ -106,18 +121,20 @@ jobs: name: Build Clusters on JDK ${{ matrix.java }} if: contains(github.event.pull_request.labels.*.name, 'ci:no-build') == false runs-on: ubuntu-latest - timeout-minutes: 60 + timeout-minutes: 40 strategy: matrix: - java: [ '11', '21' ] + java: [ '17', '21', '22' ] + exclude: + - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} fail-fast: false steps: - + - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Checkout ${{ github.ref }} ( ${{ github.sha }} ) uses: actions/checkout@v4 @@ -127,7 +144,7 @@ jobs: show-progress: false - name: Caching dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.hgexternalcache key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }} @@ -137,28 +154,30 @@ jobs: run: ant $OPTS -quiet -Dcluster.config=$CLUSTER_CONFIG build-nozip - name: Prepare Artifact - if: ${{ matrix.java == '11' }} + if: ${{ matrix.java == '17' }} run: tar -I 'zstd -9 -T0' -cf /tmp/build.tar.zst --exclude ".git" . - name: Upload Workspace - if: ${{ (matrix.java == '11') && success() }} - uses: actions/upload-artifact@v3 + if: ${{ (matrix.java == '17') && success() }} + uses: actions/upload-artifact@v4 with: name: build path: /tmp/build.tar.zst + compression-level: 0 retention-days: 2 if-no-files-found: error - name: Create Dev Build - if: ${{ matrix.java == '11' && contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success() }} + if: ${{ matrix.java == '17' && contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success() }} run: ant $OPTS -quiet -Dcluster.config=$CLUSTER_CONFIG zip-cluster-config - name: Upload Dev Build - if: ${{ matrix.java == '11' && contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success() }} - uses: actions/upload-artifact@v3 + if: ${{ matrix.java == '17' && contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success() }} + uses: actions/upload-artifact@v4 with: name: dev-build path: nbbuild/NetBeans-*.zip + compression-level: 0 retention-days: 7 if-no-files-found: error @@ -176,13 +195,13 @@ jobs: submodules: false show-progress: false - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - distribution: ${{ env.default_java_distribution }} - java-version: 11 + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} + java-version: 17 - name: Caching dependencies - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ~/.hgexternalcache key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }} @@ -199,26 +218,26 @@ jobs: run: ant $OPTS commit-validation -Dnbjavac.class.path=java/libs.javacapi/external/*.jar # secondary jobs - linux-commit-validation: + commit-validation: name: CV on ${{ matrix.os }}/JDK ${{ matrix.java }} needs: base-build runs-on: ${{ matrix.os }} - timeout-minutes: 60 + timeout-minutes: 40 strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - java: [ 11 ] + java: [ 17 ] include: - os: ubuntu-latest - java: 21 + java: 22 fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb if: contains(matrix.os, 'ubuntu') && success() @@ -227,7 +246,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -244,14 +263,12 @@ jobs: if: contains(matrix.os, 'macos') && success() run: ant $OPTS -f platform/masterfs.macosx test - # fails on 17+ + - name: Commit Validation tests + run: .github/retry.sh ant $OPTS -Dcluster.config=$CLUSTER_CONFIG commit-validation + - name: platform/core.network - if: matrix.java == 11 && success() run: ant $OPTS -f platform/core.network test - - name: Commit Validation tests - run: ant $OPTS -Dcluster.config=$CLUSTER_CONFIG commit-validation - - name: Create Test Summary uses: test-summary/action@v2 if: failure() @@ -264,21 +281,28 @@ jobs: paperwork: name: Check Paperwork on Linux/JDK ${{ matrix.java }} needs: base-build - if: always() + if: ${{ !cancelled() }} runs-on: ubuntu-latest timeout-minutes: 60 env: ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json strategy: matrix: - java: [ '11' ] + java: [ '17' ] steps: + - name: Check PR labels + if: ${{ github.event_name == 'pull_request' && join(github.event.pull_request.labels.*.name) == '' }} + run: | + echo "::error::PRs must be labeled, see: https://cwiki.apache.org/confluence/display/NETBEANS/PRs+and+You+-+A+reviewer+Guide" + exit 1 + - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + if: ${{ !cancelled() }} + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Checkout ${{ github.ref }} ( ${{ github.sha }} ) if: ${{ !cancelled() }} @@ -308,7 +332,7 @@ jobs: - name: Download Build if: ${{ needs.base-build.result == 'success' && !cancelled() }} - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -330,23 +354,29 @@ jobs: build-system-test: - name: Build-System Test on Linux/JDK ${{ matrix.java }} + name: Build-System / Misc Tests on Linux/JDK ${{ matrix.java }} needs: base-build runs-on: ubuntu-latest - timeout-minutes: 60 + timeout-minutes: 100 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} + + - name: Setup Xvfb + run: | + echo "DISPLAY=:99.0" >> $GITHUB_ENV + Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -355,44 +385,54 @@ jobs: - name: Test Netbeans Build System run: ant $OPTS -Dcluster.config=$CLUSTER_CONFIG localtest + + - name: harness/o.n.insane + run: ant $OPTS -f harness/o.n.insane test - - name: Build all Tests - # runs only in PRs if requested, nowhere else (~18 min) - if: env.test_tests == 'true' && github.event_name == 'pull_request' && success() - run: ant -quiet -Dcluster.config=$CLUSTER_CONFIG test -Dtest.includes=NoTestsJustBuild + - name: harness/apisupport.harness + run: ant $OPTS -f harness/apisupport.harness test + - name: harness/harness/nbjunit + run: ant $OPTS -f harness/nbjunit test - build-nbms: - name: Build NBMs and Javadoc on JDK ${{ matrix.java }} - needs: base-build - runs-on: ubuntu-latest - timeout-minutes: 60 - strategy: - matrix: - java: [ '11' ] - steps: + - name: harness/jellytools.platform + run: ant $OPTS -f harness/jellytools.platform test -Dtest.config=stable - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + - name: ergonomics/ide.ergonomics + run: ant $OPTS -f ergonomics/ide.ergonomics test -Dtest.config=commit - - name: Download Build - uses: actions/download-artifact@v3 - with: - name: build + - name: nb/deadlock.detector + run: ant $OPTS -f nb/deadlock.detector test - - name: Extract - run: tar --zstd -xf build.tar.zst + - name: nb/ide.branding + run: ant $OPTS -f nb/ide.branding test + - name: nb/o.n.upgrader + run: ant $OPTS -f nb/o.n.upgrader test + +# - name: nb/updatecenters +# run: ant $OPTS -f nb/updatecenters test + + # 5-6 min - name: Build nbms run: ant $OPTS build-nbms + # 13-14 min - name: Build javadoc if: env.test_javadoc == 'true' && success() run: ant $OPTS build-javadoc + # runs only in PRs if requested; ~18 min + - name: Build all Tests + if: env.test_tests == 'true' && github.event_name == 'pull_request' && success() + run: ant -quiet -Dcluster.config=$CLUSTER_CONFIG test -Dtest.includes=NoTestsJustBuild + + - name: Create Test Summary + uses: test-summary/action@v2 + if: failure() + with: + paths: "./*/*/build/test/*/results/TEST-*.xml" + build-from-src-zip: name: Build ${{ matrix.config }} from src.zip on JDK ${{ matrix.java }} @@ -403,18 +443,19 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] config: [ 'platform', 'release' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -422,7 +463,7 @@ jobs: run: tar --zstd -xf build.tar.zst - name: Restoring Cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ~/.hgexternalcache key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }} @@ -444,7 +485,7 @@ jobs: # extra round for VSCodeExt which is built with 'release' config - name: Set up node if: ${{ (matrix.config == 'release') && success() }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 @@ -462,14 +503,15 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -477,7 +519,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -508,21 +550,6 @@ jobs: - name: ide/core.ide run: ant $OPTS -f ide/core.ide test - - name: ide/csl.api - run: ant $OPTS -f ide/csl.api test - - - name: ide/csl.types - run: ant $OPTS -f ide/csl.types test - - - name: ide/css.editor - run: ant $OPTS -f ide/css.editor test - - - name: ide/css.lib - run: ant $OPTS -f ide/css.lib test - - - name: ide/css.model - run: ant $OPTS -f ide/css.model test - - name: ide/db run: .github/retry.sh ant $OPTS -f ide/db test @@ -592,27 +619,6 @@ jobs: - name: ide/gsf.testrunner.ui run: ant $OPTS -f ide/gsf.testrunner.ui test - - name: ide/html - run: .github/retry.sh ant $OPTS -f ide/html test - - - name: ide/html.custom - run: ant $OPTS -f ide/html.custom test - - - name: ide/html.editor - run: ant $OPTS -f ide/html.editor test - - - name: ide/html.editor - run: ant $OPTS -f ide/html.editor.lib test - - - name: ide/html.lexer - run: ant $OPTS -f ide/html.lexer test - - - name: ide/html.parser - run: ant $OPTS -f ide/html.parser test - - - name: ide/html.validation - run: ant $OPTS -f ide/html.validation test - - name: ide/httpserver run: ant $OPTS -f ide/httpserver test @@ -658,9 +664,6 @@ jobs: - name: ide/libs.freemarker run: ant $OPTS -f ide/libs.freemarker test - - name: ide/libs.git - run: ant $OPTS -f ide/libs.git test - - name: ide/libs.graalsdk run: ant $OPTS -f ide/libs.graalsdk test @@ -670,11 +673,8 @@ jobs: - name: ide/libs.truffleapi run: ant $OPTS -f ide/libs.truffleapi test - - name: ide/lsp.client - run: ant $OPTS -f ide/lsp.client test - - name: ide/notifications - run: ant $OPTS -f ide/notifications test + run: .github/retry.sh ant $OPTS -f ide/notifications test - name: ide/o.openidex.util run: ant $OPTS -f ide/o.openidex.util test @@ -739,15 +739,6 @@ jobs: - name: ide/utilities run: ant $OPTS -f ide/utilities test - - name: ide/versioning.masterfs - run: ant $OPTS -f ide/versioning.masterfs test - - - name: ide/versioning.ui - run: ant $OPTS -f ide/versioning.ui test - - - name: ide/versioning.util - run: ant $OPTS -f ide/versioning.util test - - name: ide/web.common run: ant $OPTS -f ide/web.common test @@ -810,23 +801,25 @@ jobs: build-tools: - name: Build Tools on Linux/JDK ${{ matrix.java }} (some on 17) + name: Build-Tools on Linux/JDK ${{ matrix.java }} # label triggers: Ant, Gradle, Maven, MX if: ${{ contains(github.event.pull_request.labels.*.name, 'Ant') || contains(github.event.pull_request.labels.*.name, 'Gradle') || contains(github.event.pull_request.labels.*.name, 'Maven') || contains(github.event.pull_request.labels.*.name, 'MX') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest - timeout-minutes: 60 + timeout-minutes: 50 strategy: matrix: - java: [ '11', '17', '21' ] + java: [ '17', '21', '22' ] + exclude: + - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -834,7 +827,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -898,28 +891,25 @@ jobs: # - name: java/ant.grammar # run: ant $OPTS -f java/ant.grammar test - - name: Set up JDK 17 for JDK 21 incompatible tests - if: ${{ matrix.java == '21' }} - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: ${{ env.default_java_distribution }} - - # TODO fix JDK 21 incompatibilites + # TODO next are JDK 21+ incompatibe steps - name: java/java.mx.project - continue-on-error: ${{ github.event_name != 'pull_request' }} + if: ${{ matrix.java == '17' }} run: .github/retry.sh ant $OPTS -f java/java.mx.project test - name: java/gradle.java + if: ${{ matrix.java == '17' }} run: .github/retry.sh ant $OPTS -f java/gradle.java test - name: extide/gradle + if: ${{ matrix.java == '17' }} run: ant $OPTS -f extide/gradle test - name: java/gradle.dependencies + if: ${{ matrix.java == '17' }} run: ant $OPTS -f java/gradle.dependencies test - name: extide/o.apache.tools.ant.module + if: ${{ matrix.java == '17' }} run: ant $OPTS -f extide/o.apache.tools.ant.module test - name: Create Test Summary @@ -938,14 +928,15 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -953,7 +944,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -984,9 +975,6 @@ jobs: - name: platform/api.search run: ant $OPTS -f platform/api.search test - - name: platform/api.templates - run: ant $OPTS -f platform/api.templates test - - name: platform/api.visual run: ant $OPTS -f platform/api.visual test @@ -1053,9 +1041,6 @@ jobs: - name: platform/keyring.impl run: ant $OPTS -f platform/keyring.impl test - - name: platform/libs.javafx - run: ant $OPTS -f platform/libs.javafx test - - name: platform/libs.junit4 run: ant $OPTS -f platform/libs.junit4 test @@ -1075,14 +1060,14 @@ jobs: run: ant $OPTS -f platform/o.n.swing.tabcontrol test - name: Set up JDK 8 for incompatibe tests - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} # TODO fix JDK 11 incompatibilities - name: platform/lib.uihandler - run: ant $OPTS -f platform/lib.uihandler test + run: .github/retry.sh ant $OPTS -f platform/lib.uihandler test - name: platform/openide.text run: .github/retry.sh ant $OPTS -f platform/openide.text test @@ -1119,20 +1104,15 @@ jobs: timeout-minutes: 90 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: ${{ env.default_java_distribution }} - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1140,7 +1120,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -1231,86 +1211,31 @@ jobs: - name: platform/spi.quicksearch run: ant $OPTS -f platform/spi.quicksearch test - - name: platform/templates - run: ant $OPTS -f platform/templates test - - name: platform/templatesui run: ant $OPTS -f platform/templatesui test - name: platform/uihandler - run: ant $OPTS -f platform/uihandler test + run: .github/retry.sh ant $OPTS -f platform/uihandler test - name: platform/o.n.bootstrap run: ant $OPTS -f platform/o.n.bootstrap test - - name: Create Test Summary - uses: test-summary/action@v2 - if: failure() + - name: Set up JDK 11 for platform/templates + uses: actions/setup-java@v4 with: - paths: "./*/*/build/test/*/results/TEST-*.xml" - - - harness-modules-test: - name: Harness, NB and Ergonomics on Linux/JDK ${{ matrix.java }} - # equals env.test_platform == 'true' - if: ${{ contains(github.event.pull_request.labels.*.name, 'Platform') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} - needs: base-build - runs-on: ubuntu-latest - timeout-minutes: 60 - strategy: - matrix: - java: [ '11' ] - steps: - - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} - - - name: Setup Xvfb - run: | - echo "DISPLAY=:99.0" >> $GITHUB_ENV - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - - - name: Download Build - uses: actions/download-artifact@v3 - with: - name: build - - - name: Extract - run: tar --zstd -xf build.tar.zst - - - name: harness/o.n.insane - run: ant $OPTS -f harness/o.n.insane test - - - name: harness/apisupport.harness - run: ant $OPTS -f harness/apisupport.harness test - - - name: harness/harness/nbjunit - run: ant $OPTS -f harness/nbjunit test - - - name: harness/jellytools.platform - run: ant $OPTS -f harness/jellytools.platform test -Dtest.config=stable - - - name: ergonomics/ide.ergonomics - run: ant $OPTS -f ergonomics/ide.ergonomics test -Dtest.config=commit - - - name: nb/deadlock.detector - run: ant $OPTS -f nb/deadlock.detector test + java-version: 11 + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - - name: nb/ide.branding - run: ant $OPTS -f nb/ide.branding test + # TODO tests rely on javax.script.ScriptEngine / js which locks this to JDK 11 + - name: platform/templates + run: ant $OPTS -f platform/templates test - - name: nb/o.n.upgrader - run: ant $OPTS -f nb/o.n.upgrader test + - name: platform/api.templates + run: ant $OPTS -f platform/api.templates test -# - name: nb/updatecenters -# run: ant $OPTS -f nb/updatecenters test + - name: platform/openide.loaders TemplatesMimeTypeTest + run: ant $OPTS -f platform/openide.loaders test -Dtest.config.default.includes=**/TemplatesMimeTypeTest.class -Dtest.config.default.excludes="" - - name: nb/welcome - run: ant $OPTS -f nb/welcome test - - name: Create Test Summary uses: test-summary/action@v2 if: failure() @@ -1320,19 +1245,22 @@ jobs: java-modules-test: name: Java Modules on Linux/JDK ${{ matrix.java }} + # equals env.test_java == 'true' + if: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest timeout-minutes: 100 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1340,7 +1268,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -1363,15 +1291,12 @@ jobs: run: ant $OPTS -f java/editor.htmlui test - name: java.completion - if: env.test_java == 'true' && success() run: ant $OPTS -f java/java.completion test - name: java.editor.base - if: env.test_java == 'true' && success() run: ant $OPTS -f java/java.editor.base test - name: java.editor - if: env.test_java == 'true' && success() run: .github/retry.sh ant $OPTS -f java/java.editor test-unit - name: java.freeform @@ -1414,7 +1339,6 @@ jobs: # run: ant $OPTS -f java/java.source.ant test - name: java.source.base - if: env.test_java == 'true' && success() run: ant $OPTS -f java/java.source.base test - name: java.source.compat8 @@ -1424,7 +1348,6 @@ jobs: run: ant $OPTS -f java/java.source.queriesimpl test - name: java.sourceui - if: env.test_java == 'true' && success() run: ant $OPTS -f java/java.sourceui test - name: java.testrunner @@ -1439,8 +1362,8 @@ jobs: # - name: jellytools.java # run: ant $OPTS -f java/jellytools.java test -# - name: jshell.support -# run: ant $OPTS -f java/jshell.support test + - name: jshell.support + run: ant $OPTS -f java/jshell.support test - name: junit run: ant $OPTS -f java/junit test-unit @@ -1466,9 +1389,6 @@ jobs: - name: spellchecker.bindings.java run: ant $OPTS -f java/spellchecker.bindings.java test - - name: spring.beans - run: ant $OPTS -f java/spring.beans test - - name: testng run: ant $OPTS -f java/testng test @@ -1488,15 +1408,12 @@ jobs: run: ant $OPTS -f java/java.lexer test - name: refactoring.java - if: env.test_java == 'true' && success() run: ant $OPTS -f java/refactoring.java test-unit - name: form - if: env.test_java == 'true' && success() run: ant $OPTS -f java/form test-unit - name: javadoc - if: env.test_javadoc == 'true' && success() run: ant $OPTS -f java/javadoc test - name: Create Test Summary @@ -1506,6 +1423,7 @@ jobs: paths: "./*/*/build/test/*/results/TEST-*.xml" + # TODO merge this job into other jobs once tests are fixed apisupport-modules-test: name: APISupport Modules on Linux/JDK ${{ matrix.java }} needs: base-build @@ -1514,13 +1432,14 @@ jobs: strategy: matrix: java: [ '8' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1528,7 +1447,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -1566,16 +1485,18 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17', '22' ] config: [ 'batch1', 'batch2' ] + exclude: + - java: ${{ github.event_name == 'pull_request' && 'nothing' || '22' }} fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1583,7 +1504,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -1617,15 +1538,17 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '11', '21' ] + java: [ '17', '21', '22' ] + exclude: + - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1633,7 +1556,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -1650,7 +1573,7 @@ jobs: run: ant $OPTS -f java/debugger.jpda.js test - name: debugger.jpda.projects - run: ant $OPTS -f java/debugger.jpda.projects test + run: .github/retry.sh ant $OPTS -f java/debugger.jpda.projects test - name: debugger.jpda.projectsui run: ant $OPTS -f java/debugger.jpda.projectsui test @@ -1670,19 +1593,22 @@ jobs: profiler-test: name: Profiler on Linux/JDK ${{ matrix.java }} + # equals env.test_java == 'true' + if: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest timeout-minutes: 60 strategy: matrix: java: [ '11' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1690,7 +1616,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -1700,6 +1626,7 @@ jobs: - name: profiler run: ant $OPTS -f profiler/profiler test-unit + # TODO OQL requires js script engine which locks this to JDK 11 - name: profiler.oql run: ant $OPTS -f profiler/profiler.oql test @@ -1711,20 +1638,23 @@ jobs: webcommon-test: - name: Webcommon Modules on Linux/JDK ${{ matrix.java }} + name: Web Modules on Linux/JDK ${{ matrix.java }} + # equals env.test_web == 'true' + if: ${{ contains(github.event.pull_request.labels.*.name, 'JavaScript') || contains(github.event.pull_request.labels.*.name, 'TypeScript') || contains(github.event.pull_request.labels.*.name, 'HTML') || contains(github.event.pull_request.labels.*.name, 'CSS') || contains(github.event.pull_request.labels.*.name, 'CSL') || contains(github.event.pull_request.labels.*.name, 'web') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1732,15 +1662,48 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build - name: Extract run: tar --zstd -xf build.tar.zst - - name: webcommon/api.knockout - run: ant $OPTS -f webcommon/api.knockout test + - name: ide/csl.api + run: ant $OPTS -f ide/csl.api test + + - name: ide/csl.types + run: ant $OPTS -f ide/csl.types test + + - name: ide/css.editor + run: ant $OPTS -f ide/css.editor test + + - name: ide/css.lib + run: ant $OPTS -f ide/css.lib test + + - name: ide/css.model + run: ant $OPTS -f ide/css.model test + + - name: ide/html + run: .github/retry.sh ant $OPTS -f ide/html test + + - name: ide/html.custom + run: ant $OPTS -f ide/html.custom test + + - name: ide/html.editor + run: ant $OPTS -f ide/html.editor test + + - name: ide/html.editor + run: ant $OPTS -f ide/html.editor.lib test + + - name: ide/html.lexer + run: ant $OPTS -f ide/html.lexer test + + - name: ide/html.parser + run: ant $OPTS -f ide/html.parser test + + - name: ide/html.validation + run: ant $OPTS -f ide/html.validation test # - name: webcommon/cordova # run: ant $OPTS -f webcommon/cordova test @@ -1839,6 +1802,16 @@ jobs: - name: webcommon/web.inspect run: ant $OPTS -f webcommon/web.inspect test + - name: Set up JDK 11 for webcommon/api.knockout + uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} + + # TODO: requires js script engine + - name: webcommon/api.knockout + run: ant $OPTS -f webcommon/api.knockout test + - name: Create Test Summary uses: test-summary/action@v2 if: failure() @@ -1848,19 +1821,22 @@ jobs: javafx-test: name: JavaFX on Linux/JDK ${{ matrix.java }} + # equals env.test_javafx == 'true' + if: ${{ contains(github.event.pull_request.labels.*.name, 'JavaFX') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1868,13 +1844,16 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build - name: Extract run: tar --zstd -xf build.tar.zst + - name: platform/libs.javafx + run: ant $OPTS -f platform/libs.javafx test + - name: javafx2.editor run: ant $OPTS -f javafx/javafx2.editor test -Dtest.config=stable @@ -1898,13 +1877,14 @@ jobs: strategy: matrix: java: [ '8' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1912,7 +1892,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -1953,14 +1933,15 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -1968,7 +1949,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -1992,20 +1973,23 @@ jobs: enterprise-test: - name: Enterprise on Linux/JDK ${{ matrix.java }} (some on 8 and 17) + name: Enterprise on Linux/JDK ${{ matrix.java }} (some on 8) + # equals env.test_enterprise == 'true' + if: ${{ contains(github.event.pull_request.labels.*.name, 'Java EE/Jakarta EE') || contains(github.event.pull_request.labels.*.name, 'Micronaut') || contains(github.event.pull_request.labels.*.name, 'enterprise') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -2013,13 +1997,16 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build - name: Extract run: tar --zstd -xf build.tar.zst + - name: micronaut + run: .github/retry.sh ant $OPTS -f enterprise/micronaut test + - name: api.web.webmodule run: ant $OPTS -f enterprise/api.web.webmodule test @@ -2035,6 +2022,7 @@ jobs: - name: glassfish.common run: ant $OPTS -f enterprise/glassfish.common test +# TODO failing tests commented out # Fails # - name: glassfish.javaee # run: ant $OPTS -f enterprise/glassfish.javaee test @@ -2123,6 +2111,9 @@ jobs: - name: spring.webmvc run: ant $OPTS -f enterprise/spring.webmvc test + - name: spring.beans + run: ant $OPTS -f java/spring.beans test + - name: tomcat5 run: ant $OPTS -f enterprise/tomcat5 test @@ -2168,10 +2159,6 @@ jobs: # - name: web.project # run: ant $OPTS -f enterprise/web.project test -# Fails -# - name: web.struts -# run: ant $OPTS -f enterprise/web.struts test - - name: websvc.clientapi run: ant $OPTS -f enterprise/websvc.clientapi test @@ -2219,10 +2206,10 @@ jobs: run: ant $OPTS -f enterprise/websvc.wsstackapi test - name: Set up JDK 8 for incompatible tests - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: websvc.editor.hints run: ant $OPTS -f enterprise/websvc.editor.hints test @@ -2230,15 +2217,6 @@ jobs: - name: j2ee.dd.webservice run: ant $OPTS -f enterprise/j2ee.dd.webservice test - - name: Set up JDK 17 for tests that are not compatible with JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: ${{ env.default_java_distribution }} - - - name: micronaut - run: .github/retry.sh ant $OPTS -f enterprise/micronaut test - - name: Create Test Summary uses: test-summary/action@v2 if: failure() @@ -2248,19 +2226,22 @@ jobs: versioning-test: name: Versioning Modules on Linux/JDK ${{ matrix.java }} + # equals env.test_versioning == 'true' + if: ${{ contains(github.event.pull_request.labels.*.name, 'git') || contains(github.event.pull_request.labels.*.name, 'subversion') || contains(github.event.pull_request.labels.*.name, 'mercurial') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -2268,7 +2249,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -2278,6 +2259,21 @@ jobs: - name: Setup Env run: echo "GIT_TEST_REPO=$HOME/git_test_repo" >> $GITHUB_ENV + - name: ide/git + run: .github/retry.sh ant $OPTS -f ide/git test-unit + + - name: ide/libs.git + run: .github/retry.sh ant $OPTS -f ide/libs.git test + + - name: ide/versioning.masterfs + run: ant $OPTS -f ide/versioning.masterfs test + + - name: ide/versioning.ui + run: ant $OPTS -f ide/versioning.ui test + + - name: ide/versioning.util + run: ant $OPTS -f ide/versioning.util test + - name: ide/versioning.core run: ant $OPTS -f ide/versioning.core test-unit @@ -2313,12 +2309,15 @@ jobs: mysql-db-test: name: DB Tests with MySQL on Linux/JDK ${{ matrix.java }} + # equals env.test_enterprise == 'true' + if: ${{ contains(github.event.pull_request.labels.*.name, 'Java EE/Jakarta EE') || contains(github.event.pull_request.labels.*.name, 'Micronaut') || contains(github.event.pull_request.labels.*.name, 'enterprise') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false services: mysql: @@ -2332,10 +2331,10 @@ jobs: steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -2343,7 +2342,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -2370,6 +2369,8 @@ jobs: php: name: PHP on ${{ matrix.os }}/JDK ${{ matrix.java }} + # equals env.test_php == 'true' + if: ${{ contains(github.event.pull_request.labels.*.name, 'PHP') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ${{ matrix.os }} timeout-minutes: 120 @@ -2377,23 +2378,39 @@ jobs: DISPLAY: ":99.0" strategy: matrix: - java: [ '11' ] + java: [ '17' ] os: [ 'windows-latest', 'ubuntu-latest' ] + exclude: + - os: ${{ github.event_name == 'pull_request' && 'nothing' || 'windows-latest' }} fail-fast: false + defaults: + run: + # hack: shorten paths to stay below 32k char process arg limit of windows (symptom: junit jvm spawn failures) + # note 'a' is apparently a mount point, we shouldn't go below that + # note actions don't care about the defaults here, its just for 'run:', they will keep using the long path which is fine + working-directory: ${{ contains(matrix.os, 'windows') && 'D:\\a\\ws' || github.workspace }} + shell: bash + steps: + - name: Symlink short paths for windows + if: contains(matrix.os, 'windows') + run: mklink /d D:\\a\\ws ${{ github.workspace }} + working-directory: ${{ github.workspace }} + shell: cmd + - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} # linux specific setup - name: Setup PHP if: contains(matrix.os, 'ubuntu') uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '8.3' tools: pecl extensions: xdebug ini-values: xdebug.mode=debug @@ -2404,7 +2421,7 @@ jobs: # - - - - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -2460,11 +2477,9 @@ jobs: # longest step (~40min) - name: php.editor - if: env.test_php == 'true' && success() run: ant $OPTS -Dtest.config=stable -f php/php.editor test - name: php.editor (unreliable tests) - if: env.test_php == 'true' && success() run: .github/retry.sh ant $OPTS -Dtest.config=unreliable -f php/php.editor test - name: php.latte @@ -2513,20 +2528,21 @@ jobs: lsp-test: name: LSP tests on Linux/JDK ${{ matrix.java }} # equals env.test_lsp == 'true' - if: ${{ contains(github.event.pull_request.labels.*.name, 'LSP') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} + if: ${{ contains(github.event.pull_request.labels.*.name, 'LSP') || contains(github.event.pull_request.labels.*.name, 'Gradle') || contains(github.event.pull_request.labels.*.name, 'Maven') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build runs-on: ubuntu-latest timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Setup Xvfb run: | @@ -2534,13 +2550,16 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build - name: Extract run: tar --zstd -xf build.tar.zst + - name: ide/lsp.client + run: ant $OPTS -f ide/lsp.client test + - name: java/java.lsp.server run: .github/retry.sh ant $OPTS -f java/java.lsp.server test @@ -2560,6 +2579,8 @@ jobs: timeout-minutes: 60 strategy: matrix: + # TODO uses GraalVM 17 / 22.3.1 which is the last known release which offers all required language extensions + # GraalVM based on JDK 21+ doesn't support the 'gu' tool anymore - extensions are now regular application dependencies graal: [ '22.3.1' ] fail-fast: false @@ -2570,21 +2591,21 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build - name: Extract run: tar --zstd -xf build.tar.zst - - name: Setup GraalVM + - name: Setup GraalVM ${{ matrix.graal }} run: | - URL=https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${{ matrix.graal }}/graalvm-ce-java11-linux-amd64-${{ matrix.graal }}.tar.gz + URL=https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${{ matrix.graal }}/graalvm-ce-java17-linux-amd64-${{ matrix.graal }}.tar.gz curl -L $URL | tar -xz - GRAALVM=`pwd`/graalvm-ce-java11-${{ matrix.graal }} + GRAALVM=`pwd`/graalvm-ce-java17-${{ matrix.graal }} echo "JAVA_HOME=$GRAALVM" >> $GITHUB_ENV - - name: Setup GraalVM Languages + - name: Setup GraalVM Languages (python, R, ruby and js) run: $JAVA_HOME/bin/gu install --no-progress python R ruby js - name: platform/core.network @@ -2624,17 +2645,18 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '11' ] + java: [ '17' ] + fail-fast: false steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: ${{ env.default_java_distribution }} + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} - name: Set up node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 @@ -2644,7 +2666,7 @@ jobs: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Download Build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build @@ -2667,15 +2689,13 @@ jobs: name: Cleanup Workflow Artifacts needs: - base-build - - linux-commit-validation + - commit-validation - paperwork - build-system-test - - build-nbms - build-from-src-zip - ide-modules-test - platform-modules-test1 - platform-modules-test2 - - harness-modules-test - java-modules-test - java-hints-test - java-debugger-test @@ -2702,22 +2722,15 @@ jobs: timeout-minutes: 60 steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - submodules: true - show-progress: false - - name: Delete Workspace Artifact - uses: ./.github/actions/delete-artifact/ + uses: geekyeggo/delete-artifact@v5 with: name: build - failOnError: true + useGlob: false - name: Delete Dev Build Artifact - uses: ./.github/actions/delete-artifact/ + uses: geekyeggo/delete-artifact@v5 if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && cancelled() }} with: name: dev-build - failOnError: true + useGlob: false diff --git a/.github/workflows/native-binary-build-dlight.nativeexecution.yml b/.github/workflows/native-binary-build-dlight.nativeexecution.yml index 19b89facf035..2afaa8726c0a 100644 --- a/.github/workflows/native-binary-build-dlight.nativeexecution.yml +++ b/.github/workflows/native-binary-build-dlight.nativeexecution.yml @@ -94,7 +94,7 @@ jobs: ls -l -R ${SOURCES} - name: Upload native sources - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: nativeexecution-external-sources path: ide/dlight.nativeexecution/build/sources/ @@ -110,7 +110,7 @@ jobs: steps: - name: Download sources - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: nativeexecution-external-sources @@ -126,7 +126,7 @@ jobs: working-directory: ide/dlight.nativeexecution/tools - name: Upload artifact Linux 64 bit - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Linux-x86_64 path: ide/dlight.nativeexecution/tools/buildall/ @@ -144,7 +144,7 @@ jobs: # steps: # # - name: Download sources -# uses: actions/download-artifact@v3 +# uses: actions/download-artifact@v4 # with: # name: nativeexecution-external-sources # @@ -158,7 +158,7 @@ jobs: # shell: bash # working-directory: ide/dlight.nativeexecution/tools # - name: Upload artifact Windows 64 bit -# uses: actions/upload-artifact@v3 +# uses: actions/upload-artifact@v4 # with: # name: Windows-x86_64 # path: ide/dlight.nativeexecution/tools/buildall/ @@ -174,7 +174,7 @@ jobs: steps: - name: Download sources - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: nativeexecution-external-sources @@ -188,7 +188,7 @@ jobs: working-directory: ide/dlight.nativeexecution/tools - name: Upload artifact macOS x86_64 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: MacOSX-x86_64 path: ide/dlight.nativeexecution/tools/buildall/ @@ -203,7 +203,7 @@ jobs: steps: - name: Download sources - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: nativeexecution-external-sources @@ -217,7 +217,7 @@ jobs: working-directory: ide/dlight.nativeexecution/tools - name: Upload artifact macOS arm64 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: MacOSX-arm_64 path: ide/dlight.nativeexecution/tools/buildall/ @@ -238,7 +238,7 @@ jobs: run: mkdir -p myfiles/ - name: Download artifacts from predecessor jobs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: myfiles/ @@ -267,7 +267,7 @@ jobs: echo "" >> "$BUILDINFO" - name: Upload bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: nativeexecution-external-binaries path: myfiles/ diff --git a/.github/workflows/native-binary-build-launcher.yml b/.github/workflows/native-binary-build-launcher.yml index 2b4ea7b96eb9..c0bd965708dc 100644 --- a/.github/workflows/native-binary-build-launcher.yml +++ b/.github/workflows/native-binary-build-launcher.yml @@ -86,7 +86,7 @@ jobs: ls -l -R ${SOURCES} - name: Upload native sources - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: launcher-external-sources path: nbbuild/build/native/launcher/sources/ @@ -105,7 +105,7 @@ jobs: run: sudo apt install mingw-w64 mingw-w64-tools - name: Download sources - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: launcher-external-sources @@ -119,7 +119,7 @@ jobs: working-directory: platform/o.n.bootstrap/launcher/windows/ - name: Upload bootstrap artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: launcher-bootstrap-bin path: platform/o.n.bootstrap/launcher/windows/build/ @@ -135,7 +135,7 @@ jobs: working-directory: harness/apisupport.harness/windows-launcher-src - name: Upload harness artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: launcher-harness-bin path: harness/apisupport.harness/windows-launcher-src/build/ @@ -151,7 +151,7 @@ jobs: working-directory: nb/ide.launcher/windows - name: Upload IDE artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: launcher-ide-bin path: nb/ide.launcher/windows/build/ @@ -171,7 +171,7 @@ jobs: run: mkdir -p myfiles/ - name: Download artifacts from predecessor jobs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: myfiles/ @@ -203,7 +203,7 @@ jobs: echo "" >> "$BUILDINFO" - name: Upload bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: launcher-external-binaries path: myfiles/ diff --git a/.github/workflows/native-binary-build-lib.profiler.yml b/.github/workflows/native-binary-build-lib.profiler.yml index d81bdf591ebc..e17a41ace275 100644 --- a/.github/workflows/native-binary-build-lib.profiler.yml +++ b/.github/workflows/native-binary-build-lib.profiler.yml @@ -93,7 +93,7 @@ jobs: show-progress: false - name: Caching dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.hgexternalcache key: profiler-${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }} @@ -118,7 +118,7 @@ jobs: cp NOTICE ${SOURCES}/NOTICE ls -l -R ${SOURCES} - name: Upload native sources - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: profiler-external-sources-ASF path: profiler/lib.profiler/build/sources/ @@ -134,7 +134,7 @@ jobs: steps: - name: Download sources - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: profiler-external-sources-ASF @@ -171,13 +171,13 @@ jobs: # Upload interim build artifacts to GitHub # - name: Upload artifact Linux 64 bit - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: linux-amd64 path: profiler/lib.profiler/release/lib/deployed/jdk16/linux-amd64/ if-no-files-found: error - name: Upload artifact Linux 32 bit - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: linux path: profiler/lib.profiler/release/lib/deployed/jdk16/linux/ @@ -195,7 +195,7 @@ jobs: steps: - name: Download sources - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: profiler-external-sources-ASF @@ -246,13 +246,13 @@ jobs: # Upload interim build artifacts to GitHub # - name: Upload artifact Windows 64 bit - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: windows-amd64 path: profiler/lib.profiler/release/lib/deployed/jdk16/windows-amd64/ if-no-files-found: error - name: Upload artifact Windows 32 bit - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: windows path: profiler/lib.profiler/release/lib/deployed/jdk16/windows/ @@ -268,7 +268,7 @@ jobs: steps: - name: Download sources - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: profiler-external-sources-ASF @@ -292,7 +292,7 @@ jobs: # Upload interim build artifacts to GitHub # - name: Upload artifact MacOS 64 bit - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: mac path: profiler/lib.profiler/release/lib/deployed/jdk16/mac/ @@ -313,7 +313,7 @@ jobs: run: mkdir -p myfiles/lib/deployed/jdk16 - name: Download artifacts from predecessor jobs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: myfiles/lib/deployed/jdk16 @@ -343,7 +343,7 @@ jobs: - name: Upload bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: profiler-external-binaries-ASF path: myfiles/ diff --git a/.gitignore b/.gitignore index 6750ca4b18bd..6045e2589e5a 100644 --- a/.gitignore +++ b/.gitignore @@ -110,7 +110,11 @@ derby.log /java/languages.antlr/external/*.g4 /java/languages.antlr/external/LexerAdaptor.java +/ide/go.lang/src/org/antlr/parser/golang/Go*.java /ide/languages.hcl/src/org/netbeans/modules/languages/hcl/grammar/*.java +/java/languages.antlr/src/org/antlr/parser/*/ANTLR*.java + +/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/Json*.java # idea .idea diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 44927a9118c1..000000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule ".github/actions/delete-artifact"] - path = .github/actions/delete-artifact - url = https://github.com/GeekyEggo/delete-artifact diff --git a/NOTICE b/NOTICE index 9de85ba63c18..f7bb1161fb49 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache NetBeans -Copyright 2017-2023 The Apache Software Foundation +Copyright 2017-2024 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/README.md b/README.md index 6c4ac6d2a18c..fa5e7e01a5cd 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ Apache NetBeans is an open source development environment, tooling platform, and ### Requirements * Git - * Ant 1.9.9 or above - * JDK 11 or above (to build and run NetBeans) + * Ant + * JDK 17 or above (to build and run NetBeans) #### Notes: @@ -98,11 +98,11 @@ $ ant tryme ### Download * [Developer builds](https://ci-builds.apache.org/job/Netbeans/job/netbeans-linux/lastSuccessfulBuild/artifact/nbbuild/) on Jenkins (NetBeans-dev-xxx.zip). - * [Latest release](https://netbeans.apache.org/download/index.html) (convenience binary of released source artifacts). + * [Latest release](https://netbeans.apache.org/download) (convenience binary of released source artifacts). ### Reporting Bugs - * [How to report bugs](https://netbeans.apache.org/participate/report-issue.html) + * [How to report bugs](https://netbeans.apache.org/participate/report-issue) ### Log, Config and Cache Locations diff --git a/apisupport/apisupport.ant/manifest.mf b/apisupport/apisupport.ant/manifest.mf index 1cdd588ff816..99bf9f2919ce 100644 --- a/apisupport/apisupport.ant/manifest.mf +++ b/apisupport/apisupport.ant/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.apisupport.ant OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/project/Bundle.properties -OpenIDE-Module-Specification-Version: 2.95 +OpenIDE-Module-Specification-Version: 2.97 AutoUpdate-Show-In-Client: false OpenIDE-Module-Layer: org/netbeans/modules/apisupport/project/resources/layer.xml diff --git a/apisupport/apisupport.ant/nbproject/org-netbeans-modules-apisupport-ant.sig b/apisupport/apisupport.ant/nbproject/org-netbeans-modules-apisupport-ant.sig index 5ba598ef8d9e..7bd68b6b63de 100644 --- a/apisupport/apisupport.ant/nbproject/org-netbeans-modules-apisupport-ant.sig +++ b/apisupport/apisupport.ant/nbproject/org-netbeans-modules-apisupport-ant.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.94 +#Version 2.95 CLSS public java.lang.Object cons public init() diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ApisupportAntUtils.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ApisupportAntUtils.java index 9b917ca87655..ae65249c7ac3 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ApisupportAntUtils.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ApisupportAntUtils.java @@ -186,7 +186,7 @@ public static LocalizedBundleInfo findLocalizedBundleInfo(FileObject sourceDir, } if (!bundleFOs.isEmpty()) { Collections.reverse(bundleFOs); - return LocalizedBundleInfo.load(bundleFOs.toArray(new FileObject[bundleFOs.size()])); + return LocalizedBundleInfo.load(bundleFOs.toArray(new FileObject[0])); } } } catch (IOException e) { @@ -264,7 +264,7 @@ public static LocalizedBundleInfo findLocalizedBundleInfoFromJAR(File binaryProj addBundlesFromJar(main, bundleISs, locBundleResource); if (!bundleISs.isEmpty()) { Collections.reverse(bundleISs); - return LocalizedBundleInfo.load(bundleISs.toArray(new InputStream[bundleISs.size()])); + return LocalizedBundleInfo.load(bundleISs.toArray(new InputStream[0])); } } finally { for (InputStream bundleIS : bundleISs) { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/Evaluator.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/Evaluator.java index ca6e5e1fb9d5..cf46e134d353 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/Evaluator.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/Evaluator.java @@ -353,7 +353,7 @@ private PropertyEvaluator createEvaluator(ModuleList ml) { String codeNameBase = project.getCodeNameBase(); PropertyEvaluator suiteEval = null; if (type == NbModuleType.SUITE_COMPONENT) { - suiteEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + suiteEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); } if (type == NbModuleType.SUITE_COMPONENT) { @@ -368,9 +368,9 @@ private PropertyEvaluator createEvaluator(ModuleList ml) { providers.add(project.getHelper().getPropertyProvider("nbproject/platform.properties")); // NOI18N } if (type == NbModuleType.SUITE_COMPONENT || type == NbModuleType.STANDALONE) { - PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); providers.add(new ApisupportAntUtils.UserPropertiesFileProvider(baseEval, dir)); - baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); providers.add(new DestDirProvider(baseEval)); } if (type == NbModuleType.NETBEANS_ORG) { @@ -380,7 +380,7 @@ private PropertyEvaluator createEvaluator(ModuleList ml) { providers.add(PropertyUtils.propertiesFilePropertyProvider(new File(nbbuild, "site.build.properties"))); // NOI18N providers.add(PropertyUtils.propertiesFilePropertyProvider(new File(System.getProperty("user.home"), ".nbbuild.properties"))); // NOI18N } - PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); providers.add(new NbJdkProvider(baseEval)); providers.add(privateProperties); providers.add(projectProperties); @@ -445,7 +445,7 @@ private PropertyEvaluator createEvaluator(ModuleList ml) { } } - baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); Map testsCPs = computeTestingClassPaths(ml, baseEval, testTypes); testTypes.addAll(testsCPs.keySet()); @@ -463,7 +463,7 @@ private PropertyEvaluator createEvaluator(ModuleList ml) { providers.add(PropertyUtils.fixedPropertyProvider(buildDefaults)); } // skip a bunch of properties irrelevant here - NBM stuff, etc. - return PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + return PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); } private static final RequestProcessor RP = new RequestProcessor(Evaluator.class.getName()); diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java index 5f4a8e3497af..f30dc95ecbca 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java @@ -689,9 +689,13 @@ public Map getExtraCompilationUnits() { /** Get the Java source level used for this module. Default is 1.4. */ public String getJavacSource() { - String javacSource = evaluator().getProperty(SingleModuleProperties.JAVAC_SOURCE); - assert javacSource != null; - return javacSource; + String sourceLevel = evaluator().getProperty(SingleModuleProperties.JAVAC_RELEASE); + if (sourceLevel != null && !sourceLevel.isEmpty()) { + return sourceLevel; + } + sourceLevel = evaluator().getProperty(SingleModuleProperties.JAVAC_SOURCE); + assert sourceLevel != null; + return sourceLevel; } private ClassPath[] boot, source, compile; diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProviderImpl.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProviderImpl.java index a3fc9cbbe0dc..d03b7a94284c 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProviderImpl.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProviderImpl.java @@ -214,7 +214,7 @@ class NbModuleProviderImpl implements NbModuleProvider { } XMLFileSystem xfs = new XMLFileSystem(); try { - xfs.setXmlUrls(otherLayerURLs.toArray(new URL[otherLayerURLs.size()])); + xfs.setXmlUrls(otherLayerURLs.toArray(new URL[0])); } catch (PropertyVetoException ex) { assert false : ex; } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ProjectXMLManager.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ProjectXMLManager.java index f64feaf8f53d..5f2bd0e87d45 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ProjectXMLManager.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ProjectXMLManager.java @@ -816,7 +816,7 @@ public String[] getFriends() { public String[] getBinaryOrigins() { Set origins = new LinkedHashSet(getClassPathExtensions().values()); origins.remove(null); - return origins.toArray(new String[origins.size()]); + return origins.toArray(new String[0]); } /** @@ -981,7 +981,7 @@ public static ManifestManager.PackageExport[] findPublicPackages(final Element c if (ppEl != null) { pps.addAll(findAllPackages(ppEl)); } - return pps.isEmpty() ? ManifestManager.EMPTY_EXPORTED_PACKAGES : pps.toArray(new ManifestManager.PackageExport[pps.size()]); + return pps.isEmpty() ? ManifestManager.EMPTY_EXPORTED_PACKAGES : pps.toArray(new ManifestManager.PackageExport[0]); } /** Utility method for finding friend. */ @@ -994,7 +994,7 @@ public static String[] findFriends(final Element confData) { friends.add(XMLUtil.findText(friendEl)); } } - return friends.toArray(new String[friends.size()]); + return friends.toArray(new String[0]); } return null; } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl.java index 2130fdfc488f..e86f4a8ea0d7 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl.java @@ -604,7 +604,7 @@ public ClassPath[] getProjectClassPaths(String type) { paths.add(ClassPathSupport.createClassPath(new FileObject[] {root})); } } - return paths.toArray(new ClassPath[paths.size()]); + return paths.toArray(new ClassPath[0]); } private static final class FilteredClassPathImplementation implements ClassPathImplementation, PropertyChangeListener { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/GlobalJavadocForBinaryImpl.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/GlobalJavadocForBinaryImpl.java index 7e480382b6bb..f09635912b80 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/GlobalJavadocForBinaryImpl.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/GlobalJavadocForBinaryImpl.java @@ -179,7 +179,7 @@ private Result findByDashedCNB(final String cnbdashes, final URL[] roots, boolea } return new JavadocForBinaryQuery.Result() { public @Override URL[] getRoots() { - return candidates.toArray(new URL[candidates.size()]); + return candidates.toArray(new URL[0]); } public @Override void addChangeListener(ChangeListener l) {} public @Override void removeChangeListener(ChangeListener l) {} diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/GlobalSourceForBinaryImpl.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/GlobalSourceForBinaryImpl.java index 3f4b442ecece..6504abdcd50f 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/GlobalSourceForBinaryImpl.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/GlobalSourceForBinaryImpl.java @@ -188,7 +188,7 @@ public FileObject[] getRoots() { } catch (IOException ex) { throw new AssertionError(ex); } - return candidates.toArray(new FileObject[candidates.size()]); + return candidates.toArray(new FileObject[0]); } protected abstract String resolveRelativePath(URL sourceRoot) throws IOException; diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/JavadocForBinaryImpl.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/JavadocForBinaryImpl.java index 3640d9016430..41d81691b124 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/JavadocForBinaryImpl.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/JavadocForBinaryImpl.java @@ -93,7 +93,7 @@ public JavadocForBinaryQuery.Result findJavadoc(URL binaryRoot) { } } } - return new R(candidates.toArray(new URL[candidates.size()])); + return new R(candidates.toArray(new URL[0])); } catch (MalformedURLException e) { throw new AssertionError(e); } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ModuleProjectClassPathExtender.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ModuleProjectClassPathExtender.java index ddab2d53779f..c5575ad91947 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ModuleProjectClassPathExtender.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ModuleProjectClassPathExtender.java @@ -69,7 +69,7 @@ protected SourceGroup[] getExtensibleSourceGroups() { sgs.add(g); } } - return sgs.toArray(new SourceGroup[sgs.size()]); + return sgs.toArray(new SourceGroup[0]); } protected String[] getExtensibleClassPathTypes(SourceGroup sourceGroup) { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/SuiteProject.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/SuiteProject.java index 73e310ea9492..437ede85d230 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/SuiteProject.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/SuiteProject.java @@ -188,9 +188,9 @@ private PropertyEvaluator createEvaluator() { List providers = new ArrayList(); providers.add(helper.getPropertyProvider("nbproject/private/platform-private.properties")); // NOI18N providers.add(helper.getPropertyProvider("nbproject/platform.properties")); // NOI18N - PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); providers.add(new ApisupportAntUtils.UserPropertiesFileProvider(baseEval, dir)); - baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); providers.add(new DestDirProvider(baseEval)); providers.add(helper.getPropertyProvider(AntProjectHelper.PRIVATE_PROPERTIES_PATH)); providers.add(helper.getPropertyProvider(AntProjectHelper.PROJECT_PROPERTIES_PATH)); @@ -205,7 +205,7 @@ private PropertyEvaluator createEvaluator() { fixedProps.put("dist.dir", "dist"); // NOI18N fixedProps.put("test.user.dir", "${suite.build.dir}/testuserdir"); // NOI18N providers.add(PropertyUtils.fixedPropertyProvider(fixedProps)); - return PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()])); + return PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0])); } private final class Info implements ProjectInformation, AntProjectListener { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ActionFilterNode.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ActionFilterNode.java index 9c7dcfa6e983..b8c4bb886f07 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ActionFilterNode.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ActionFilterNode.java @@ -127,7 +127,7 @@ private Action[] initActions() { } } } - actionCache = result.toArray(new Action[result.size()]); + actionCache = result.toArray(new Action[0]); } return actionCache; } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/LibrariesNode.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/LibrariesNode.java index ac3fdcc8c497..28c76e8f4f88 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/LibrariesNode.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/LibrariesNode.java @@ -270,7 +270,7 @@ protected Node[] createNodes(Object key) { nodes.add(createLibraryPackageViewNode(jar)); } } - return nodes.toArray(new Node[nodes.size()]); + return nodes.toArray(new Node[0]); } private Node createLibraryPackageViewNode(FileObject jfo) { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ModuleActions.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ModuleActions.java index ae6f8ce80b82..c98e3cfa21a0 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ModuleActions.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ModuleActions.java @@ -149,7 +149,7 @@ public void refresh() { supportedActionsSet.add(ActionProvider.COMMAND_MOVE); supportedActionsSet.add(ActionProvider.COMMAND_COPY); supportedActionsSet.add(ActionProvider.COMMAND_DELETE); - supportedActions = supportedActionsSet.toArray(new String[supportedActionsSet.size()]); + supportedActions = supportedActionsSet.toArray(new String[0]); } public String[] getSupportedActions() { @@ -362,7 +362,7 @@ TestSources findTestSourcesForSources(Lookup context) { if (testFOs.isEmpty()) { return null; } - return new TestSources(testFOs.toArray(new FileObject[testFOs.size()]), testType, testSrcDir, null); + return new TestSources(testFOs.toArray(new FileObject[0]), testType, testSrcDir, null); } } } @@ -407,7 +407,7 @@ TestSources findTestSourcesForFiles(Lookup context) { } } } - return testFiles.isEmpty() ? null : new TestSources(testFiles.toArray(new FileObject[testFiles.size()]), testType, testRoot, null); + return testFiles.isEmpty() ? null : new TestSources(testFiles.toArray(new FileObject[0]), testType, testRoot, null); } @Messages("MSG_no_source=No source to operate on.") @@ -441,11 +441,7 @@ public void invokeAction(final String command, final Lookup context) throws Ille doRun(); } finally { if (task != null) { - task.addTaskListener(new TaskListener() { - @Override public void taskFinished(Task _) { - listener.finished(task.result() == 0); - } - }); + task.addTaskListener((Task t) -> listener.finished(task.result() == 0)); } else { listener.finished(false); } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/PlatformNode.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/PlatformNode.java index 62b1278739e8..822e64d1d4f2 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/PlatformNode.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/PlatformNode.java @@ -300,7 +300,7 @@ private static URL[] getJavadocRoots(JavaPlatform platform) { ClassPath.Entry e = it.next(); result.addAll(Arrays.asList(JavadocForBinaryQuery.findJavadoc(e.getURL()).getRoots())); } - return result.toArray(new URL[result.size()]); + return result.toArray(new URL[0]); } } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java index 7b64df719852..8b2c180ef042 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java @@ -312,7 +312,7 @@ public String[] getSupportedActions() { ActionProvider.COMMAND_MOVE, ActionProvider.COMMAND_DELETE )); - return actions.toArray(new String[actions.size()]); + return actions.toArray(new String[0]); } public boolean isActionEnabled(String command, Lookup context) throws IllegalArgumentException { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteOperations.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteOperations.java index 306b9af0a2fc..443c2e72d011 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteOperations.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteOperations.java @@ -167,7 +167,7 @@ public Void call () throws Exception { } }); - OpenProjects.getDefault().open(toOpen.toArray(new Project[toOpen.size()]), false); + OpenProjects.getDefault().open(toOpen.toArray(new Project[0]), false); } boolean isRename = original.getProjectDirectory().getParent().equals( suite.getProjectDirectory().getParent()); diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/UnitTestLibrariesNode.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/UnitTestLibrariesNode.java index afd2a60e77d3..9c47d9559c80 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/UnitTestLibrariesNode.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/UnitTestLibrariesNode.java @@ -142,7 +142,7 @@ private Image getIcon(boolean opened) { actions.add(new AddJUnit4Action(testType, project)); } actions.add(new AddUnitTestDependencyAction(testType, project)); - return actions.toArray(new Action[actions.size()]); + return actions.toArray(new Action[0]); } @Messages("HINT_missing_junit4=Incomplete test libraries. Use context menu to resolve.") @@ -326,7 +326,7 @@ private static final class ProjectDependencyNode extends AbstractNode { result.add(new EditTestDependencyAction(dep, testType, project)); // Remove dependency result.add(LibrariesChildren.REMOVE_DEPENDENCY_ACTION); - actions = result.toArray(new Action[result.size()]); + actions = result.toArray(new Action[0]); } return actions; } @@ -379,7 +379,7 @@ private static final class LibraryDependencyNode extends FilterNode { } } result.add(LibrariesChildren.REMOVE_DEPENDENCY_ACTION); - actions = result.toArray(new Action[result.size()]); + actions = result.toArray(new Action[0]); } return actions; } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerLibraries.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerLibraries.java index 29ed32aea3e7..78eac7ac07a8 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerLibraries.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerLibraries.java @@ -827,7 +827,7 @@ private void addJarButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN- newPaths.add (path); } - filePaths = newPaths.toArray (new String [newPaths.size ()]); + filePaths = newPaths.toArray (new String [0]); final DefaultListModel model = getProperties().getWrappedJarsListModel(); int[] newSelection = ClassPathUiSupport.addJarFiles(model,emListComp.getSelectedIndices(), filePaths, base, diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerSources.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerSources.java index 3975dd6c2452..5eee85a0c127 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerSources.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerSources.java @@ -32,6 +32,9 @@ import org.openide.util.Exceptions; import org.openide.util.NbBundle; +import static org.netbeans.modules.apisupport.project.ui.customizer.SingleModuleProperties.JAVAC_RELEASE; +import static org.netbeans.modules.apisupport.project.ui.customizer.SingleModuleProperties.JAVAC_SOURCE; + /** * Represents Sources panel in Netbeans Module customizer. * @@ -51,7 +54,7 @@ public void actionPerformed(ActionEvent e) { if (srcLevelValueBeingUpdated) { return; } - final String oldLevel = getProperty(SingleModuleProperties.JAVAC_SOURCE); + final String oldLevel = getProperty(getJavacLanguageLevelKey()); final String newLevel = (String) srcLevelValue.getSelectedItem(); SpecificationVersion jdk5 = new SpecificationVersion("1.5"); // NOI18N if (new SpecificationVersion(oldLevel).compareTo(jdk5) < 0 && new SpecificationVersion(newLevel).compareTo(jdk5) >= 0) { @@ -80,6 +83,7 @@ public void run() { }); } + @Override protected void refresh() { if (getProperties().getSuiteDirectoryPath() == null) { moduleSuite.setVisible(false); @@ -95,16 +99,20 @@ protected void refresh() { for (String level : levels) { srcLevelValue.addItem(level); } - srcLevelValue.setSelectedItem(getProperty(SingleModuleProperties.JAVAC_SOURCE)); + srcLevelValue.setSelectedItem(getProperty(getJavacLanguageLevelKey())); } finally { srcLevelValueBeingUpdated = false; } ApisupportAntUIUtils.setText(prjFolderValue, getProperties().getProjectDirectory()); } + @Override public void store() { - setProperty(SingleModuleProperties.JAVAC_SOURCE, - (String) srcLevelValue.getSelectedItem()); + setProperty(getJavacLanguageLevelKey(), (String) srcLevelValue.getSelectedItem()); + } + + private String getJavacLanguageLevelKey() { + return containsProperty(JAVAC_RELEASE) ? JAVAC_RELEASE : JAVAC_SOURCE; } /** This method is called from within the constructor to diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/NbPropertyPanel.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/NbPropertyPanel.java index 0ffaad473519..7b7dc612c9cb 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/NbPropertyPanel.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/NbPropertyPanel.java @@ -65,6 +65,11 @@ String getProperty(String key) { return props.getProperty(key); } + boolean containsProperty(String key) { + String prop = props.getProperty(key); + return prop != null && !prop.isEmpty(); + } + void setProperty(String key, String property) { props.setProperty(key, property); } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java index 5067387380ab..ed721ec071d0 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java @@ -110,6 +110,7 @@ public final class SingleModuleProperties extends ModuleProperties { public static final String IS_AUTOLOAD = "is.autoload"; // NOI18N public static final String IS_EAGER = "is.eager"; // NOI18N public static final String JAVAC_SOURCE = "javac.source"; // NOI18N + public static final String JAVAC_RELEASE = "javac.release"; // NOI18N public static final String JAVADOC_TITLE = "javadoc.title"; // NOI18N public static final String LICENSE_FILE = "license.file"; // NOI18N public static final String NBM_HOMEPAGE = "nbm.homepage"; // NOI18N @@ -754,7 +755,7 @@ String[] getAvailableFriends() { set.add(dep.getModuleEntry().getCodeNameBase()); } } // else standalone module - leave empty (see the UI spec) - return set.toArray(new String[set.size()]); + return set.toArray(new String[0]); } FriendListModel getFriendListModel() { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteCustomizerLibraries.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteCustomizerLibraries.java index f59a75caecab..dbe7f77c6a23 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteCustomizerLibraries.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteCustomizerLibraries.java @@ -430,7 +430,7 @@ public void store() { } if (oldPlaf) { - getProperties().setEnabledClusters(enabledClusters.toArray(new String[enabledClusters.size()])); + getProperties().setEnabledClusters(enabledClusters.toArray(new String[0])); } else { for (ClusterNode e : libChildren.extraNodes()) { clusterPath.add(e.getClusterInfo()); @@ -447,7 +447,7 @@ public void store() { } getProperties().setClusterPath(clusterPath); } - getProperties().setDisabledModules(disabledModules.toArray(new String[disabledModules.size()])); + getProperties().setDisabledModules(disabledModules.toArray(new String[0])); } /** This method is called from within the constructor to diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteProperties.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteProperties.java index 04693f92c3f2..f60e1711eda8 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteProperties.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteProperties.java @@ -268,7 +268,7 @@ public static String[] getArrayProperty(PropertyEvaluator evaluator, String p) { disabledClusters.add(entry.getClusterDirectory().getName()); } disabledClusters.removeAll(Arrays.asList(enabledClusters)); - separated = disabledClusters.toArray(new String[disabledClusters.size()]); + separated = disabledClusters.toArray(new String[0]); for (int i = 0; i < separated.length - 1; i++) { separated[i] = separated[i] + ','; } diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteUtils.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteUtils.java index c7fd6dec083a..041ba006bbf4 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteUtils.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteUtils.java @@ -105,7 +105,7 @@ public NbModuleProject[] run() throws Exception { } } } - return result.toArray(new NbModuleProject[result.size()]); + return result.toArray(new NbModuleProject[0]); } }); } catch (MutexException e) { @@ -431,7 +431,7 @@ public static String[] getAntProperty(final Collection pieces) { String piece = it.next() + (it.hasNext() ? ":" : ""); // NOI18N l.add(piece); } - return l.toArray(new String[l.size()]); + return l.toArray(new String[0]); } /** diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/platform/PlatformComponentFactory.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/platform/PlatformComponentFactory.java index db69ba7339ac..892e4c6db8c9 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/platform/PlatformComponentFactory.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/platform/PlatformComponentFactory.java @@ -184,7 +184,7 @@ private static NbPlatform[] getSortedPlatforms(NbPlatform extra) { if (extra != null) { _platforms.add(extra); } - NbPlatform[] platforms = _platforms.toArray(new NbPlatform[_platforms.size()]); + NbPlatform[] platforms = _platforms.toArray(new NbPlatform[0]); Arrays.sort(platforms, new Comparator() { public int compare(NbPlatform p1, NbPlatform p2) { int res = Collator.getInstance().compare(p1.getLabel(), p2.getLabel()); diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/AbstractBinaryEntry.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/AbstractBinaryEntry.java index 6e36950aa639..cfcdb2761ffb 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/AbstractBinaryEntry.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/AbstractBinaryEntry.java @@ -78,7 +78,7 @@ abstract class AbstractBinaryEntry extends AbstractEntry { deps.add(codename.substring(0, slash)); } } - runDependencies = deps.toArray(new String[deps.size()]); + runDependencies = deps.toArray(new String[0]); } public String getNetBeansOrgPath() { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/AbstractEntryWithSources.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/AbstractEntryWithSources.java index b6283f2f6df1..c5f0a85b6704 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/AbstractEntryWithSources.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/AbstractEntryWithSources.java @@ -129,7 +129,7 @@ public String[] getRunDependencies() { String cnb = XMLUtil.findText(cnbEl); deps.add(cnb); } - return deps.toArray(new String[deps.size()]); + return deps.toArray(new String[0]); } public String getSpecificationVersion() { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/LocalizedBundleInfo.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/LocalizedBundleInfo.java index dcd710726178..9421fa5b4a75 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/LocalizedBundleInfo.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/LocalizedBundleInfo.java @@ -268,7 +268,7 @@ private static String[] splitBySentence(String text) { sentences.add(text.substring(start, end)); start = end; } - return sentences.toArray(new String[sentences.size()]); + return sentences.toArray(new String[0]); } public void addPropertyChangeListener(PropertyChangeListener pchl) { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java index 5eb092b6589c..b3c6e05f4468 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java @@ -250,7 +250,7 @@ public static URL[] getSourceRootsForExternalModule(File binaryRootF) { roots.addAll(Arrays.asList(bce.getSourceRoots())); } } - return roots.toArray(new URL[roots.size()]); + return roots.toArray(new URL[0]); } public static URL[] getJavadocRootsForExternalModule(File binaryRootF) { @@ -263,7 +263,7 @@ public static URL[] getJavadocRootsForExternalModule(File binaryRootF) { roots.addAll(Arrays.asList(bce.getJavadocRoots())); } } - return roots.toArray(new URL[roots.size()]); + return roots.toArray(new URL[0]); } private static void registerEntry(ModuleEntry entry, Set files) { @@ -648,7 +648,7 @@ private static String[] scanDirForFiles(File dir) { if (files == null) { List l = new ArrayList(250); doScanDirForFiles(dir, l, ""); - files = l.toArray(new String[l.size()]); + files = l.toArray(new String[0]); } return files; } @@ -678,7 +678,7 @@ public static ModuleList findOrCreateModuleListFromSuite( lists.add(findOrCreateModuleListFromSuiteWithoutBinaries(root, nbdestdir, eval)); lists.addAll(findOrCreateModuleListsFromClusterPath(clup, nbdestdir)); // XXX should this also omit excluded modules? or should that be done only in e.g. LayerUtils.getPlatformJarsForSuiteComponentProject? - return merge(lists.toArray(new ModuleList[lists.size()]), root); + return merge(lists.toArray(new ModuleList[0]), root); } else { return merge(new ModuleList[]{ findOrCreateModuleListFromSuiteWithoutBinaries(root, nbdestdir, eval), @@ -776,7 +776,7 @@ private static PropertyEvaluator parseSuiteProperties(File root) throws IOExcept List providers = new ArrayList(); providers.add(loadPropertiesFile(new File(root, "nbproject" + File.separatorChar + "private" + File.separatorChar + "platform-private.properties"))); // NOI18N providers.add(loadPropertiesFile(new File(root, "nbproject" + File.separatorChar + "platform.properties"))); // NOI18N - PropertyEvaluator eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[providers.size()])); + PropertyEvaluator eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[0])); String buildS = eval.getProperty("user.properties.file"); // NOI18N if (buildS != null) { providers.add(loadPropertiesFile(PropertyUtils.resolveFile(root, buildS))); @@ -786,9 +786,9 @@ private static PropertyEvaluator parseSuiteProperties(File root) throws IOExcept } providers.add(loadPropertiesFile(new File(root, "nbproject" + File.separatorChar + "private" + File.separatorChar + "private.properties"))); // NOI18N providers.add(loadPropertiesFile(new File(root, "nbproject" + File.separatorChar + "project.properties"))); // NOI18N - eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[providers.size()])); + eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[0])); providers.add(new DestDirProvider(eval)); - return PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[providers.size()])); + return PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[0])); } static File[] findModulesInSuite(File root) throws IOException { @@ -1071,7 +1071,7 @@ static PropertyEvaluator parseProperties(File basedir, File root, NbModuleType t if (type == NbModuleType.SUITE_COMPONENT) { providers.add(loadPropertiesFile(new File(basedir, "nbproject" + File.separatorChar + "private" + File.separatorChar + "suite-private.properties"))); // NOI18N providers.add(loadPropertiesFile(new File(basedir, "nbproject" + File.separatorChar + "suite.properties"))); // NOI18N - PropertyEvaluator eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[providers.size()])); + PropertyEvaluator eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[0])); String suiteS = eval.getProperty("suite.dir"); // NOI18N if (suiteS != null) { File suite = PropertyUtils.resolveFile(basedir, suiteS); @@ -1083,14 +1083,14 @@ static PropertyEvaluator parseProperties(File basedir, File root, NbModuleType t providers.add(loadPropertiesFile(new File(basedir, "nbproject" + File.separatorChar + "platform.properties"))); // NOI18N } if (type != NbModuleType.NETBEANS_ORG) { - PropertyEvaluator eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[providers.size()])); + PropertyEvaluator eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[0])); String buildS = eval.getProperty("user.properties.file"); // NOI18N if (buildS != null) { providers.add(loadPropertiesFile(PropertyUtils.resolveFile(basedir, buildS))); } else { providers.add(PropertyUtils.globalPropertyProvider()); } - eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[providers.size()])); + eval = PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[0])); providers.add(new DestDirProvider(eval)); } // private.properties & project.properties. @@ -1112,7 +1112,7 @@ static PropertyEvaluator parseProperties(File basedir, File root, NbModuleType t } providers.add(PropertyUtils.fixedPropertyProvider(defaults)); defaults.put("cluster", findClusterLocation(basedir, root, type)); - return PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[providers.size()])); + return PropertyUtils.sequentialPropertyEvaluator(predefsProvider, providers.toArray(new PropertyProvider[0])); } private static PropertyProvider loadPropertiesFile(File f) throws IOException { diff --git a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/PlatformLayersCacheManager.java b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/PlatformLayersCacheManager.java index eb3aaf46c6e3..a5a648df9da2 100644 --- a/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/PlatformLayersCacheManager.java +++ b/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/PlatformLayersCacheManager.java @@ -454,7 +454,7 @@ public boolean accept(File dir, String name) { }))); } } - return allJars.toArray(new File[allJars.size()]); + return allJars.toArray(new File[0]); } private static PLFSCache fillCache(File clusterDir) throws IOException { diff --git a/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/layers/LayerUtilsTest.java b/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/layers/LayerUtilsTest.java index ef8b3c6f3754..ac08b16304db 100644 --- a/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/layers/LayerUtilsTest.java +++ b/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/layers/LayerUtilsTest.java @@ -141,7 +141,7 @@ public boolean accept(File dir, String name) { } })); System.out.println("Loading external cache from " + cacheDir + ", " + files.size() + " files"); - Collections.sort(files, new Comparator() { + files.sort(new Comparator() { public int compare(File f1, File f2) { return - f1.getName().compareTo(f2.getName()); } diff --git a/apisupport/apisupport.installer.maven/manifest.mf b/apisupport/apisupport.installer.maven/manifest.mf index a70ce45f6d7d..dfcb4a450122 100644 --- a/apisupport/apisupport.installer.maven/manifest.mf +++ b/apisupport/apisupport.installer.maven/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.apisupport.installer.maven OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/installer/maven/Bundle.properties -OpenIDE-Module-Specification-Version: 1.45 +OpenIDE-Module-Specification-Version: 1.47 diff --git a/apisupport/apisupport.installer.maven/src/org/netbeans/modules/apisupport/installer/maven/actions/BuildInstallersAction.java b/apisupport/apisupport.installer.maven/src/org/netbeans/modules/apisupport/installer/maven/actions/BuildInstallersAction.java index 0773a5ef7d7f..f9562769ebbf 100644 --- a/apisupport/apisupport.installer.maven/src/org/netbeans/modules/apisupport/installer/maven/actions/BuildInstallersAction.java +++ b/apisupport/apisupport.installer.maven/src/org/netbeans/modules/apisupport/installer/maven/actions/BuildInstallersAction.java @@ -26,6 +26,7 @@ import java.io.OutputStream; import java.net.MalformedURLException; import java.net.URL; +import java.nio.file.Files; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -171,7 +172,7 @@ void actionPerformed(ActionEvent e) { URL url = new URL(licenseResource); is = url.openStream(); if (is != null) { - licenseFile = File.createTempFile("license", ".txt"); + licenseFile = Files.createTempFile("license", ".txt").toFile(); licenseFile.getParentFile().mkdirs(); licenseFile.deleteOnExit(); diff --git a/apisupport/apisupport.installer/manifest.mf b/apisupport/apisupport.installer/manifest.mf index 54e65dd7e24e..fa3cdcddb112 100644 --- a/apisupport/apisupport.installer/manifest.mf +++ b/apisupport/apisupport.installer/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.apisupport.installer OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/installer/Bundle.properties -OpenIDE-Module-Specification-Version: 1.46 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/apisupport/apisupport.installer/nbproject/org-netbeans-modules-apisupport-installer.sig b/apisupport/apisupport.installer/nbproject/org-netbeans-modules-apisupport-installer.sig index 6e3abb570d76..3b88d253cd70 100644 --- a/apisupport/apisupport.installer/nbproject/org-netbeans-modules-apisupport-installer.sig +++ b/apisupport/apisupport.installer/nbproject/org-netbeans-modules-apisupport-installer.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.45 +#Version 1.46 CLSS public abstract java.awt.Component cons protected init() diff --git a/apisupport/apisupport.installer/src/org/netbeans/modules/apisupport/installer/actions/BuildInstallersAction.java b/apisupport/apisupport.installer/src/org/netbeans/modules/apisupport/installer/actions/BuildInstallersAction.java index c5265e64cf87..f707ceec5633 100644 --- a/apisupport/apisupport.installer/src/org/netbeans/modules/apisupport/installer/actions/BuildInstallersAction.java +++ b/apisupport/apisupport.installer/src/org/netbeans/modules/apisupport/installer/actions/BuildInstallersAction.java @@ -26,6 +26,7 @@ import java.io.OutputStream; import java.net.MalformedURLException; import java.net.URL; +import java.nio.file.Files; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -175,7 +176,7 @@ public ContextBuildInstaller(Lookup actionContext) { URL url = new URL(licenseResource); is = url.openStream(); if (is != null) { - licenseFile = File.createTempFile("license", ".txt"); + licenseFile = Files.createTempFile("license", ".txt").toFile(); licenseFile.getParentFile().mkdirs(); licenseFile.deleteOnExit(); diff --git a/apisupport/apisupport.installer/src/org/netbeans/modules/apisupport/installer/ui/LicenseComboBoxModel.java b/apisupport/apisupport.installer/src/org/netbeans/modules/apisupport/installer/ui/LicenseComboBoxModel.java index 8a61647fce2d..c41896f1598d 100644 --- a/apisupport/apisupport.installer/src/org/netbeans/modules/apisupport/installer/ui/LicenseComboBoxModel.java +++ b/apisupport/apisupport.installer/src/org/netbeans/modules/apisupport/installer/ui/LicenseComboBoxModel.java @@ -134,7 +134,7 @@ public void removeListDataListener(ListDataListener listener) { private void fireContentsChanged(int index) { final ListDataListener[] clone; synchronized (listeners) { - clone = listeners.toArray(new ListDataListener[listeners.size()]); + clone = listeners.toArray(new ListDataListener[0]); } final ListDataEvent event = new ListDataEvent( diff --git a/apisupport/apisupport.kit/manifest.mf b/apisupport/apisupport.kit/manifest.mf index 921f413ca62c..71f90de6eb74 100644 --- a/apisupport/apisupport.kit/manifest.mf +++ b/apisupport/apisupport.kit/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.apisupport.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.53 +OpenIDE-Module-Specification-Version: 1.55 OpenIDE-Module-Provides: org.netbeans.modules.apisupport.kit diff --git a/apisupport/apisupport.project/manifest.mf b/apisupport/apisupport.project/manifest.mf index f4b1331529cd..8249b93cd79c 100644 --- a/apisupport/apisupport.project/manifest.mf +++ b/apisupport/apisupport.project/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/project/api/Bu OpenIDE-Module-Requires: javax.script.ScriptEngine.freemarker OpenIDE-Module-Layer: org/netbeans/modules/apisupport/project/ui/resources/layer.xml AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.99 +OpenIDE-Module-Specification-Version: 1.101 diff --git a/apisupport/apisupport.project/nbproject/org-netbeans-modules-apisupport-project.sig b/apisupport/apisupport.project/nbproject/org-netbeans-modules-apisupport-project.sig index dd0440164a1f..ab345079e7c1 100644 --- a/apisupport/apisupport.project/nbproject/org-netbeans-modules-apisupport-project.sig +++ b/apisupport/apisupport.project/nbproject/org-netbeans-modules-apisupport-project.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.98 +#Version 1.99 CLSS public abstract java.awt.Component cons protected init() diff --git a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/api/LayerHandle.java b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/api/LayerHandle.java index 8fe936ab718e..3b81d871e913 100644 --- a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/api/LayerHandle.java +++ b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/api/LayerHandle.java @@ -263,7 +263,7 @@ private void configure() { Logger.getLogger(DualLayers.class.getName()).log(Level.INFO, "could not load " + generated, x); } } - setDelegates(layers.toArray(new FileSystem[layers.size()])); + setDelegates(layers.toArray(new FileSystem[0])); } public @Override void fileDataCreated(FileEvent fe) { configure(); diff --git a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/api/ManifestManager.java b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/api/ManifestManager.java index d2d7997cf82e..a0a41952a911 100644 --- a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/api/ManifestManager.java +++ b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/api/ManifestManager.java @@ -191,7 +191,7 @@ public static ManifestManager getInstanceFromJAR(File jar, boolean withGenerated ManifestManager mm2 = getInstanceFromJAR(ext); List toks = new ArrayList(Arrays.asList(mm.provTokens)); toks.addAll(Arrays.asList(mm2.provTokens)); - mm.provTokens = toks.toArray(new String[toks.size()]); + mm.provTokens = toks.toArray(new String[0]); } } } @@ -553,7 +553,7 @@ private static PackageExport[] parseExportedPackages(final String exportsS) { if (exports.isEmpty()) { throw new IllegalArgumentException("Illegal OpenIDE-Module-Public-Packages: " + exportsS); // NOI18N } - exportedPackages = exports.toArray(new PackageExport[exports.size()]); + exportedPackages = exports.toArray(new PackageExport[0]); } return exportedPackages; } @@ -574,7 +574,7 @@ private static String[] parseFriends(final String friends) { if (set.isEmpty()) { throw new IllegalArgumentException("Empty OpenIDE-Module-Friends: " + friends); // NOI18N } - return set.toArray(new String[set.size()]); + return set.toArray(new String[0]); } public String getCodeNameBase() { @@ -605,7 +605,7 @@ public String[] getProvidedTokens() { } else { List ret = new ArrayList(arr); ret.add(implied); - return ret.toArray(new String[ret.size()]); + return ret.toArray(new String[0]); } } diff --git a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/BadgingSupport.java b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/BadgingSupport.java index 747354d2e519..01ed998180cc 100644 --- a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/BadgingSupport.java +++ b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/BadgingSupport.java @@ -451,7 +451,7 @@ private static ClassPath classpathForFile(FileObject fo) { LOG.log(Level.WARNING, "could not find locale variants of {0}", jar); } LOG.log(Level.FINE, "from {0} getting {1}", new Object[] {layer, roots}); - return ClassPathSupport.createClassPath(roots.toArray(new URL[roots.size()])); + return ClassPathSupport.createClassPath(roots.toArray(new URL[0])); } Project p; try { diff --git a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/LayerUtils.java b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/LayerUtils.java index ba5a96a03ae0..5f98965534ab 100644 --- a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/LayerUtils.java +++ b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/LayerUtils.java @@ -85,7 +85,7 @@ public static ClassPath findResourceCP(Project project) { if (roots.isEmpty()) { LOG.log(Level.WARNING, "no resource path for {0}", project); } - return ClassPathSupport.createClassPath(roots.toArray(new FileObject[roots.size()])); + return ClassPathSupport.createClassPath(roots.toArray(new FileObject[0])); } /** @@ -140,7 +140,7 @@ static URL[] currentify(URL u, String suffix, ClassPath cp) { } } if (!urls.isEmpty()) { - return urls.toArray(new URL[urls.size()]); + return urls.toArray(new URL[0]); } } return new URL[] {u}; diff --git a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/WritableXMLFileSystem.java b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/WritableXMLFileSystem.java index 48a54c05cf35..549d8311502c 100644 --- a/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/WritableXMLFileSystem.java +++ b/apisupport/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/WritableXMLFileSystem.java @@ -261,7 +261,7 @@ public String[] children(String f) { } } //System.err.println("children <" + f + ">: " + kids); - return kids.toArray(new String[kids.size()]); + return kids.toArray(new String[0]); } /** retrieve byte contents of a named resource */ diff --git a/apisupport/apisupport.refactoring/manifest.mf b/apisupport/apisupport.refactoring/manifest.mf index c4f40309da5f..cf88272d9dec 100644 --- a/apisupport/apisupport.refactoring/manifest.mf +++ b/apisupport/apisupport.refactoring/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.apisupport.refactoring OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/refactoring/Bundle.properties -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.62 diff --git a/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/DataObjectRegistrationHinter.java b/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/DataObjectRegistrationHinter.java index c1dffe849655..3f135b6225ef 100644 --- a/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/DataObjectRegistrationHinter.java +++ b/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/DataObjectRegistrationHinter.java @@ -167,7 +167,7 @@ public ChangeInfo implement() throws Exception { } if (!fixes.isEmpty()) { - ctx.addHint(Severity.WARNING, ctx.standardAnnotationDescription(), fixes.toArray(new Fix[fixes.size()])); + ctx.addHint(Severity.WARNING, ctx.standardAnnotationDescription(), fixes.toArray(new Fix[0])); } } diff --git a/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/UseNbBundleMessages.java b/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/UseNbBundleMessages.java index 0856eaf04e2c..0102cfb5a659 100644 --- a/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/UseNbBundleMessages.java +++ b/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/UseNbBundleMessages.java @@ -263,7 +263,7 @@ public UseMessagesFix(CompilationInfo compilationInfo, TreePath treePath, boolea Tree enclosing = findEnclosingElement(wc, treePath); Tree modifiers; Tree nueModifiers; - ExpressionTree[] linesA = lines.toArray(new ExpressionTree[lines.size()]); + ExpressionTree[] linesA = lines.toArray(new ExpressionTree[0]); switch (enclosing.getKind()) { case METHOD: modifiers = wc.resolveRewriteTarget(((MethodTree) enclosing).getModifiers()); diff --git a/apisupport/apisupport.wizards/manifest.mf b/apisupport/apisupport.wizards/manifest.mf index 6be8da6766c4..f95f8229d96c 100644 --- a/apisupport/apisupport.wizards/manifest.mf +++ b/apisupport/apisupport.wizards/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.apisupport.wizards OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/project/ui/wizard/common/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/apisupport/project/ui/wizard/common/layer.xml -OpenIDE-Module-Specification-Version: 1.43 +OpenIDE-Module-Specification-Version: 1.45 diff --git a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/CreatedModifiedFiles.java b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/CreatedModifiedFiles.java index 83da20e64132..3a170a7663e8 100644 --- a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/CreatedModifiedFiles.java +++ b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/CreatedModifiedFiles.java @@ -1136,7 +1136,7 @@ public String[] getCreatedPaths() { for (String file : externalFiles) { s.add(prefix + file); } - return s.toArray(new String[s.size()]); + return s.toArray(new String[0]); } @Override diff --git a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/WizardUtils.java b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/WizardUtils.java index 341c7326c814..9bfff20f563a 100644 --- a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/WizardUtils.java +++ b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/WizardUtils.java @@ -151,7 +151,7 @@ public static KeyStroke[] stringToKeyStrokes(String keyStrokes) { } result.add(keyStroke); } - return result.toArray(new KeyStroke[result.size()]); + return result.toArray(new KeyStroke[0]); } public static String keyStrokesToString(final KeyStroke[] keyStrokes) { diff --git a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/NewLoaderIterator.java b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/NewLoaderIterator.java index a25a946fc252..fdb1a4389789 100644 --- a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/NewLoaderIterator.java +++ b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/NewLoaderIterator.java @@ -417,7 +417,7 @@ public void run(FileSystem layer) throws IOException { } kids.add(DataObject.find(kid)); } - DataFolder.findFolder(folder).setOrder(kids.toArray(new DataObject[kids.size()])); + DataFolder.findFolder(folder).setOrder(kids.toArray(new DataObject[0])); } }, Collections.emptySet())); diff --git a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/options/OptionsPanel0.java b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/options/OptionsPanel0.java index 6fe09aa6585c..e9eaa685f92e 100644 --- a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/options/OptionsPanel0.java +++ b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/options/OptionsPanel0.java @@ -96,7 +96,7 @@ private String[] getPrimaryIdsFromLayer() { } primaryIds.remove("Advanced"); // NOI18N primaryIds.add(0, "Advanced"); // NOI18N - return primaryIds.toArray(new String[primaryIds.size()]); + return primaryIds.toArray(new String[0]); } private void addListeners() { diff --git a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/winsys/BasicSettingsPanel.java b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/winsys/BasicSettingsPanel.java index 8c1b7d93c774..f653b76f4ae2 100644 --- a/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/winsys/BasicSettingsPanel.java +++ b/apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/winsys/BasicSettingsPanel.java @@ -119,7 +119,7 @@ public void construct() { @Override public void finished() { - comMode.setModel(new DefaultComboBoxModel(modes != null ? modes.toArray(new String[modes.size()]) : DEFAULT_MODES)); + comMode.setModel(new DefaultComboBoxModel(modes != null ? modes.toArray(new String[0]) : DEFAULT_MODES)); setComModeSelectedItem(); windowPosChanged(null); setCursor(currentCursor); diff --git a/apisupport/maven.apisupport/manifest.mf b/apisupport/maven.apisupport/manifest.mf index 7f43bd2787f2..5ddfb1a6b17a 100644 --- a/apisupport/maven.apisupport/manifest.mf +++ b/apisupport/maven.apisupport/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.apisupport/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/apisupport/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.82 +OpenIDE-Module-Specification-Version: 1.84 diff --git a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/AccessQueryImpl.java b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/AccessQueryImpl.java index d516709deab9..5832872f6fc5 100644 --- a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/AccessQueryImpl.java +++ b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/AccessQueryImpl.java @@ -30,7 +30,6 @@ import java.util.regex.Pattern; import org.netbeans.api.annotations.common.SuppressWarnings; import org.netbeans.modules.maven.api.NbMavenProject; -import org.codehaus.plexus.util.IOUtil; import org.netbeans.api.project.Project; import org.netbeans.spi.java.queries.AccessibilityQueryImplementation; import org.netbeans.spi.project.ProjectServiceProvider; @@ -166,17 +165,13 @@ private static List loadPublicPackagesPatterns(Project project) { } else { FileObject obj = project.getProjectDirectory().getFileObject(MANIFEST_PATH); if (obj != null) { - InputStream in = null; - try { - in = obj.getInputStream(); + try (InputStream in = obj.getInputStream()) { Manifest man = new Manifest(); man.read(in); String value = man.getMainAttributes().getValue(ATTR_PUBLIC_PACKAGE); toRet = prepareManifestPublicPackagesPatterns(value); } catch (Exception ex) { Exceptions.printStackTrace(ex); - } finally { - IOUtil.close(in); } } } diff --git a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/IDEOutputListenerProvider.java b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/IDEOutputListenerProvider.java index a10d60dca103..e45d75b8121c 100644 --- a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/IDEOutputListenerProvider.java +++ b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/IDEOutputListenerProvider.java @@ -74,7 +74,7 @@ private ClassPath createCP(Project prj, HashSet parents) { } } if (list.size() > 0) { - return ClassPathSupport.createProxyClassPath(list.toArray(new ClassPath[list.size()])); + return ClassPathSupport.createProxyClassPath(list.toArray(new ClassPath[0])); } return null; } diff --git a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java index 57500b4f7b89..f437c1ba3cc8 100644 --- a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java +++ b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/MavenWhiteListQueryImpl.java @@ -44,7 +44,6 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; -import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.netbeans.api.annotations.common.NonNull; @@ -367,18 +366,14 @@ private Tuple cacheOrLoad() { private Manifest getManifest(FileObject root) { FileObject manifestFo = root.getFileObject("META-INF/MANIFEST.MF"); if (manifestFo != null) { - InputStream is = null; - try { - is = manifestFo.getInputStream(); - return new Manifest(is); + try (InputStream is = manifestFo.getInputStream()) { + Manifest manifest = new Manifest(is); + return manifest; } catch (IOException ex) { //Exceptions.printStackTrace(ex); - } finally { - IOUtil.close(is); } } return null; - } private static class MavenWhiteListImplementation implements WhiteListImplementation { diff --git a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NBMNativeMWI.java b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NBMNativeMWI.java index b736d1e66f15..16b3c8508079 100644 --- a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NBMNativeMWI.java +++ b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NBMNativeMWI.java @@ -24,6 +24,8 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Collections; import java.util.List; import java.util.Properties; @@ -32,7 +34,6 @@ import org.apache.maven.model.Dependency; import org.apache.maven.model.PluginManagement; import org.apache.maven.project.MavenProject; -import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.eclipse.aether.repository.RemoteRepository; import org.netbeans.modules.apisupport.project.api.EditableManifest; @@ -103,14 +104,10 @@ public void run() { if (packageName != null) { String path = packageName.replace(".", "/") + "/Bundle.properties"; mf.setAttribute("OpenIDE-Module-Localizing-Bundle", path, null); - BufferedOutputStream bos = null; - try { - bos = new BufferedOutputStream(new FileOutputStream(new File(src, "manifest.mf"))); - mf.write(bos); + try (OutputStream os = new BufferedOutputStream(new FileOutputStream(new File(src, "manifest.mf")))) { + mf.write(os); } catch (IOException ex) { Exceptions.printStackTrace(ex); - } finally { - IOUtil.close(bos); } } @@ -121,20 +118,13 @@ public void run() { String path = packageName.replace(".", File.separator); File res = new File(src, path); res.mkdirs(); - OutputStream bos = null; - try { - bos = new BufferedOutputStream(new FileOutputStream(new File(res, "Bundle.properties"))); + try (OutputStream os = new BufferedOutputStream(new FileOutputStream(new File(res, "Bundle.properties")))) { Properties p = new Properties(); - p.store(bos, EMPTY_BUNDLE_FILE); - + p.store(os, EMPTY_BUNDLE_FILE); } catch (IOException ex) { Exceptions.printStackTrace(ex); - } finally { - IOUtil.close(bos); } - } - } } diff --git a/apisupport/timers/manifest.mf b/apisupport/timers/manifest.mf index d9b28d66c865..7015ddff5895 100644 --- a/apisupport/timers/manifest.mf +++ b/apisupport/timers/manifest.mf @@ -3,6 +3,6 @@ OpenIDE-Module: org.netbeans.modules.timers/1 OpenIDE-Module-Layer: org/netbeans/modules/timers/resources/layer.xml OpenIDE-Module-Install: org/netbeans/modules/timers/Install.class OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/timers/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.56 AutoUpdate-Show-In-Client: true diff --git a/contrib/cordova.platforms.ios/src/org/netbeans/modules/cordova/platforms/ios/IOSConfigurationPanel.java b/contrib/cordova.platforms.ios/src/org/netbeans/modules/cordova/platforms/ios/IOSConfigurationPanel.java index 587471f0978e..5e1f28c38811 100644 --- a/contrib/cordova.platforms.ios/src/org/netbeans/modules/cordova/platforms/ios/IOSConfigurationPanel.java +++ b/contrib/cordova.platforms.ios/src/org/netbeans/modules/cordova/platforms/ios/IOSConfigurationPanel.java @@ -50,7 +50,7 @@ public class IOSConfigurationPanel extends javax.swing.JPanel { final RequestProcessor RP = new RequestProcessor(IOSConfigurationPanel.class); private void refreshDeviceCombo(Collection sdKs) { - final IOSSDK[] sdks = (IOSSDK[]) sdKs.toArray(new IOSSDK[sdKs.size()]); + final IOSSDK[] sdks = (IOSSDK[]) sdKs.toArray(new IOSSDK[0]); sdkCombo.setEnabled(true); sdkCombo.setRenderer(new SDKRenderer()); sdkCombo.setModel(new DefaultComboBoxModel(sdks)); diff --git a/contrib/form.j2ee/src/org/netbeans/modules/form/j2ee/J2EEPropertyModifier.java b/contrib/form.j2ee/src/org/netbeans/modules/form/j2ee/J2EEPropertyModifier.java index a68c102d8a62..8bdf3e4c8f9d 100644 --- a/contrib/form.j2ee/src/org/netbeans/modules/form/j2ee/J2EEPropertyModifier.java +++ b/contrib/form.j2ee/src/org/netbeans/modules/form/j2ee/J2EEPropertyModifier.java @@ -600,7 +600,7 @@ public String[] getTags() { tags.addAll(Arrays.asList(superTags)); String none = noneString(); tags.remove(none); - return tags.toArray(new String[tags.size()]); + return tags.toArray(new String[0]); } } diff --git a/contrib/groovy.grails/src/org/netbeans/modules/groovy/grails/api/GrailsPlatform.java b/contrib/groovy.grails/src/org/netbeans/modules/groovy/grails/api/GrailsPlatform.java index 4fb26e3deceb..87bdbccacaeb 100644 --- a/contrib/groovy.grails/src/org/netbeans/modules/groovy/grails/api/GrailsPlatform.java +++ b/contrib/groovy.grails/src/org/netbeans/modules/groovy/grails/api/GrailsPlatform.java @@ -194,7 +194,7 @@ public ClassPath getClassPath() { } } - classpath = ClassPathSupport.createClassPath(urls.toArray(new URL[urls.size()])); + classpath = ClassPathSupport.createClassPath(urls.toArray(new URL[0])); return classpath; } } diff --git a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/GrailsSources.java b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/GrailsSources.java index b9f3f2d522e4..da5be8423a06 100644 --- a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/GrailsSources.java +++ b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/GrailsSources.java @@ -161,7 +161,7 @@ public SourceGroup[] getSourceGroups(String type) { addUnknownGroups(KNOWN_FOLDERS_IN_GRAILS_APP, result, "grails-app", null); addUnknownGroups(KNOWN_OR_IGNORED_FOLDERS_IN_TEST, result, "test", "LBL_SomeTests"); } - return result.toArray(new SourceGroup[result.size()]); + return result.toArray(new SourceGroup[0]); } public void addChangeListener(ChangeListener listener) { diff --git a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/classpath/ProjectClassPathImplementation.java b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/classpath/ProjectClassPathImplementation.java index 9bf2351a690f..b54f6f38b12e 100644 --- a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/classpath/ProjectClassPathImplementation.java +++ b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/classpath/ProjectClassPathImplementation.java @@ -108,7 +108,7 @@ private List getPath() { // compile dependencies List compileDeps = buildConfig.getCompileDependencies(); - addJars(compileDeps.toArray(new File[compileDeps.size()]), result, false); + addJars(compileDeps.toArray(new File[0]), result, false); // FIXME move this to plugin specific support // http://grails.org/GWT+Plugin diff --git a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/classpath/SourceRoots.java b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/classpath/SourceRoots.java index ae2bb54efa1c..1b72ea213f6e 100644 --- a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/classpath/SourceRoots.java +++ b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/classpath/SourceRoots.java @@ -78,7 +78,7 @@ public FileObject[] getRoots() { } } - return result.toArray(new FileObject[result.size()]); + return result.toArray(new FileObject[0]); } public List getRootURLs() { diff --git a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/commands/GrailsCommandSupport.java b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/commands/GrailsCommandSupport.java index a069bf788b3c..a2c51705d7be 100644 --- a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/commands/GrailsCommandSupport.java +++ b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/commands/GrailsCommandSupport.java @@ -186,7 +186,7 @@ private InputProcessorFactory createInputProcessorFactory(InputProcessorFactory. if (real.size() == 1) { return real.get(0); } - return new ProxyInputProcessorFactory(real.toArray(new InputProcessorFactory[real.size()])); + return new ProxyInputProcessorFactory(real.toArray(new InputProcessorFactory[0])); } public void refreshGrailsCommands() { diff --git a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/debug/Utils.java b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/debug/Utils.java index e3dc188bcb8c..187885a224b0 100644 --- a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/debug/Utils.java +++ b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/debug/Utils.java @@ -85,7 +85,7 @@ static ClassPath createSourcePath(Project project) { // this is dup of above line in fact urls.addAll(grailsProject.getTestSourceRoots().getRootURLs()); - return ClassPathSupport.createClassPath(urls.toArray(new URL[urls.size()])); + return ClassPathSupport.createClassPath(urls.toArray(new URL[0])); } static ClassPath createJDKSourcePath(Project nbproject) { @@ -106,7 +106,7 @@ private static ClassPath convertToClassPath(File[] roots) { URL url = Utils.fileToURL(roots[i]); l.add(url); } - URL[] urls = l.toArray(new URL[l.size()]); + URL[] urls = l.toArray(new URL[0]); return ClassPathSupport.createClassPath(urls); } diff --git a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/plugins/GrailsPluginSupport.java b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/plugins/GrailsPluginSupport.java index d1ad7a9cbd39..b29e76e6130a 100644 --- a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/plugins/GrailsPluginSupport.java +++ b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/plugins/GrailsPluginSupport.java @@ -339,7 +339,7 @@ public Boolean call() { } Callable callable = ExecutionSupport.getInstance().createSimpleCommand( - command, GrailsProjectConfig.forProject(project), args.toArray(new String[args.size()])); + command, GrailsProjectConfig.forProject(project), args.toArray(new String[0])); ExecutionDescriptor descriptor = new ExecutionDescriptor().frontWindow(true) .postExecution(new RefreshProjectRunnable(project)); diff --git a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/GrailsLogicalViewProvider.java b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/GrailsLogicalViewProvider.java index e4c1532c4a8c..b71e784a1ac8 100644 --- a/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/GrailsLogicalViewProvider.java +++ b/contrib/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/GrailsLogicalViewProvider.java @@ -141,7 +141,7 @@ private Action[] getAdditionalActions() { actions.add(null); actions.add(CommonProjectActions.customizeProjectAction()); - return actions.toArray(new Action[actions.size()]); + return actions.toArray(new Action[0]); } private Action getCommandAction(String commandName, String localizationName) { diff --git a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java index 5f928acc049b..5b1517cc246c 100644 --- a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java +++ b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java @@ -413,9 +413,9 @@ private DeploymentFactory getFactory(String instanceURL) { if(version!= null && "7".equals(version.getMajorNumber())) { Class c = loader.loadClass("org.jboss.as.ee.deployment.spi.factories.DeploymentFactoryImpl"); c.getMethod("register").invoke(null); - jbossFactory = (DeploymentFactory) c.newInstance();//NOI18N + jbossFactory = (DeploymentFactory) c.getDeclaredConstructor().newInstance();//NOI18N } else { - jbossFactory = (DeploymentFactory) loader.loadClass("org.jboss.deployment.spi.factories.DeploymentFactoryImpl").newInstance();//NOI18N + jbossFactory = (DeploymentFactory) loader.loadClass("org.jboss.deployment.spi.factories.DeploymentFactoryImpl").getDeclaredConstructor().newInstance();//NOI18N } diff --git a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBTargetModuleID.java b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBTargetModuleID.java index 0a94569c69a3..12e7036567ba 100644 --- a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBTargetModuleID.java +++ b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBTargetModuleID.java @@ -61,7 +61,7 @@ public void addChild(JBTargetModuleID child) { } public TargetModuleID[] getChildTargetModuleID() { - return (TargetModuleID[]) childs.toArray(new TargetModuleID[childs.size()]); + return (TargetModuleID[]) childs.toArray(new TargetModuleID[0]); } //Retrieve a list of identifiers of the children of this deployed module. public String getModuleID() { diff --git a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStartRunnable.java b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStartRunnable.java index a65dd2ab1828..881261695849 100644 --- a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStartRunnable.java +++ b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStartRunnable.java @@ -26,6 +26,7 @@ import java.io.FileWriter; import java.io.IOException; import java.io.StringReader; +import java.nio.file.Files; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeoutException; @@ -452,11 +453,11 @@ String getRunFileName(){ boolean needChangeConf = matcherConf != null && matcherConf.matches(); try { if (needChangeRun || needChangeConf) { - File startBat = File.createTempFile(RUN_FILE_NAME, ".bat"); // NOI18N + File startBat = Files.createTempFile(RUN_FILE_NAME, ".bat").toFile(); // NOI18N File confBat = null; if (contentConf != null) { - confBat = File.createTempFile(CONF_FILE_NAME, ".bat", // NOI18N - startBat.getParentFile()); // NOI18N + confBat = Files.createTempFile(// NOI18N + startBat.getParentFile().toPath(), CONF_FILE_NAME, ".bat").toFile(); // NOI18N } startBat.deleteOnExit(); contentRun = replaceJavaOpts(contentRun, matcherRun); diff --git a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStopRunnable.java b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStopRunnable.java index c4e8ed68e22d..815b1dfcb9d7 100644 --- a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStopRunnable.java +++ b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStopRunnable.java @@ -85,7 +85,7 @@ private String[] createEnvironment() { // the shutdown script should not wait for a key press envp.add("NOPAUSE=true"); // NOI18N } - return (String[]) envp.toArray(new String[envp.size()]); + return (String[]) envp.toArray(new String[0]); } public void run() { diff --git a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java index 1f60e1d0919a..ab1b2f4f47f8 100644 --- a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java +++ b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java @@ -39,7 +39,7 @@ public JpaSupportImpl(JBJ2eePlatformFactory.J2eePlatformImplImpl platformImpl) { public JpaProvider getDefaultProvider() { String defaultProvider = platformImpl.getDefaultJpaProvider(); boolean jpa2 = platformImpl.isJpa2Available(); - return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, jpa2, false, false, false, false); + return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, jpa2, false, false, false, false, false); } @Override @@ -48,13 +48,16 @@ public Set getProviders() { boolean jpa2 = platformImpl.isJpa2Available(); Set providers = new HashSet(); if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER, JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), true, jpa2, false, false)); + providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER, + JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), true, jpa2, false, false, false, false, false)); } if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER, JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), true, false, false, false)); + providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER, + JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); } if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.KODO_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.KODO_JPA_PROVIDER, JBJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), true, false, false, false)); + providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.KODO_JPA_PROVIDER, + JBJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); } return providers; } diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLPluginProperties.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLPluginProperties.java index c1c14f5b05b6..e32ed1ef8e11 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLPluginProperties.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLPluginProperties.java @@ -257,7 +257,7 @@ public static String[] getRegisteredDomainPaths(String serverRoot) { if (result.isEmpty()) { result.addAll(getDomainsFromNodeManager(serverRoot)); } - return result.toArray(new String[result.size()]); + return result.toArray(new String[0]); } @CheckForNull diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLTrustHandler.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLTrustHandler.java index 137a5e9d1aef..e30129dd8374 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLTrustHandler.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/WLTrustHandler.java @@ -380,7 +380,7 @@ private static X509Certificate[] sortChain(X509Certificate[] certificates) { } } } - return chainList.toArray(new X509Certificate[chainList.size()]); + return chainList.toArray(new X509Certificate[0]); } } diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLDeploymentManager.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLDeploymentManager.java index 2c9b970b86cd..69fda5fb269a 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLDeploymentManager.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLDeploymentManager.java @@ -622,7 +622,7 @@ public Target[] call(MBeanServerConnection connection, ObjectName service) throw } } } - return targets.toArray(new Target[targets.size()]); + return targets.toArray(new Target[0]); } }); } catch (Exception ex) { @@ -643,7 +643,7 @@ public Target[] execute(DeploymentManager manager) throws ExecutionException { ret.add(t); } } - return ret.toArray(new Target[ret.size()]); + return ret.toArray(new Target[0]); } return targets; } @@ -745,7 +745,7 @@ public ProgressObject execute(DeploymentManager manager) throws ExecutionExcepti } } return registerProgressObject(new ServerProgressObject( - manager.redeploy(toRedeploy.toArray(new TargetModuleID[toRedeploy.size()]), (File) null, null))); + manager.redeploy(toRedeploy.toArray(new TargetModuleID[0]), (File) null, null))); } catch (TargetException ex) { throw new ExecutionException(ex); } catch (IllegalStateException ex) { @@ -899,7 +899,7 @@ private static Target[] translateTargets(DeploymentManager manager, Target[] ori } } } - return deployTargets.toArray(new Target[deployTargets.size()]); + return deployTargets.toArray(new Target[0]); } private static ProgressObject registerProgressObject(ServerProgressObject po) { diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleID.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleID.java index 68ca0a0942b8..7c06900106bc 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleID.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleID.java @@ -83,7 +83,7 @@ public synchronized void addChild(WLTargetModuleID child) { } public synchronized TargetModuleID[] getChildTargetModuleID(){ - return (TargetModuleID[]) children.toArray(new TargetModuleID[children.size()]); + return (TargetModuleID[]) children.toArray(new TargetModuleID[0]); } public synchronized void addUrl(URL url) { diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleIDResolver.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleIDResolver.java index e4b6ecfc2e95..06f1ba758d0b 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleIDResolver.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleIDResolver.java @@ -59,7 +59,7 @@ public TargetModuleID[] lookupTargetModuleID(Map targetModuleInfo, Target[] targ Logger.getLogger(WLTargetModuleIDResolver.class.getName()).log(Level.INFO, null, ex); } - return (TargetModuleID[]) result.toArray(new TargetModuleID[result.size()]); + return (TargetModuleID[]) result.toArray(new TargetModuleID[0]); } private void addCollisions(String contextRoot, String noSlashContextRoot, List result, TargetModuleID[] candidates) { diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JaxRsStackSupportImpl.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JaxRsStackSupportImpl.java index 48a121895c33..59deaf9095c6 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JaxRsStackSupportImpl.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JaxRsStackSupportImpl.java @@ -683,8 +683,7 @@ private boolean addJars( Project project, Collection jars ){ classPathType = ClassPath.COMPILE; } try { - ProjectClassPathModifier.addRoots(urls.toArray( new URL[ urls.size()]), - sourceRoot, classPathType); + ProjectClassPathModifier.addRoots(urls.toArray(new URL[0]), sourceRoot, classPathType); } catch(UnsupportedOperationException ex) { return false; @@ -715,8 +714,7 @@ private void removeLibraries(Project project, Collection urls) { String[] classPathTypes = new String[]{ ClassPath.COMPILE , ClassPath.EXECUTE }; for (String type : classPathTypes) { try { - ProjectClassPathModifier.removeRoots(urls.toArray( - new URL[ urls.size()]), sourceRoot, type); + ProjectClassPathModifier.removeRoots(urls.toArray(new URL[0]), sourceRoot, type); } catch(UnsupportedOperationException ex) { Logger.getLogger( JaxRsStackSupportImpl.class.getName() ). diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JaxWsPoliciesSupportImpl.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JaxWsPoliciesSupportImpl.java index e316d753cbc1..3f0d66538f40 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JaxWsPoliciesSupportImpl.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JaxWsPoliciesSupportImpl.java @@ -149,7 +149,7 @@ public void extendsProjectClasspath(Project project, Collection fqns) { } List urls = new LinkedList(archive2Url.values()); try { - ProjectClassPathModifier.addRoots(urls.toArray(new URL[urls.size()]), sourceRoot, ClassPath.COMPILE); + ProjectClassPathModifier.addRoots(urls.toArray(new URL[0]), sourceRoot, ClassPath.COMPILE); } catch (IOException ex) { Logger.getLogger(getClass().getName()).log(Level.INFO, "Couldn't extends compile classpath with required jars " + "for WL policy support", ex); // NOI18N } diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java index 20e7f36c17e7..0e31bae10c67 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java @@ -39,7 +39,7 @@ public JpaSupportImpl(WLJ2eePlatformFactory.J2eePlatformImplImpl platformImpl) { public JpaProvider getDefaultProvider() { String defaultProvider = platformImpl.getDefaultJpaProvider(); return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, - platformImpl.isJpa2Available(), platformImpl.isJpa21Available(), false); + platformImpl.isJpa2Available(), platformImpl.isJpa21Available(), false, false, false, false); } @Override @@ -47,11 +47,11 @@ public Set getProviders() { String defaultProvider = platformImpl.getDefaultJpaProvider(); Set providers = new HashSet(); providers.add(JpaProviderFactory.createJpaProvider(WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER, - WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER.equals(defaultProvider), true, false, false, false)); + WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); providers.add(JpaProviderFactory.createJpaProvider( WLJ2eePlatformFactory.ECLIPSELINK_JPA_PROVIDER, WLJ2eePlatformFactory.ECLIPSELINK_JPA_PROVIDER.equals(defaultProvider), - true, platformImpl.isJpa2Available(), platformImpl.isJpa21Available(), false)); + true, platformImpl.isJpa2Available(), platformImpl.isJpa21Available(), false, false, false, false)); return providers; } diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java index 2f9a1db254ff..a7f3c5aaeb31 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java @@ -730,7 +730,7 @@ public LibraryImplementation[] getLibraries(Set librari // issues like #188753 serverImpl.addAll(Arrays.asList(getLibraries())); - return serverImpl.toArray(new LibraryImplementation[serverImpl.size()]); + return serverImpl.toArray(new LibraryImplementation[0]); } public void notifyLibrariesChange() { diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/JdbcRetriever.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/JdbcRetriever.java index fb2ada2f9732..5a1af6d58360 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/JdbcRetriever.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/JdbcRetriever.java @@ -246,7 +246,7 @@ private void loadDeployedDataSource(String path, List list, jdbcConfig.getInputStream()), handler); List jndiNames = handler.getJndiNames(); list.add( new JDBCDataBean( handler.getName(), - jndiNames.toArray(new String[jndiNames.size()]), deplName)); + jndiNames.toArray(new String[0]), deplName)); } catch (ParserConfigurationException e) { LOGGER.log(Level.INFO, null, e); } catch (SAXException e) { diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/WLModuleNode.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/WLModuleNode.java index ed07cd0f247e..ea03e56629c9 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/WLModuleNode.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/WLModuleNode.java @@ -100,7 +100,7 @@ public Action[] getActions(boolean context) { actions.add(SystemAction.get(OpenModuleUrlAction.class)); actions.add(null); actions.add(SystemAction.get(UndeployModuleAction.class)); - return actions.toArray(new Action[actions.size()]); + return actions.toArray(new Action[0]); } @Override diff --git a/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/client/ClientView.java b/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/client/ClientView.java index a8d786708594..8bf44957432f 100644 --- a/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/client/ClientView.java +++ b/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/client/ClientView.java @@ -126,11 +126,11 @@ public class ClientView extends SectionView { nodes.add(advancedConfigNode); } - bindingChildren.add(nodes.toArray(new Node[nodes.size()])); + bindingChildren.add(nodes.toArray(new Node[0])); addSection(bindingCont, false); bindingNodes.add(bindingNodeContainer); } - rootChildren.add(bindingNodes.toArray(new Node[bindingNodes.size()])); + rootChildren.add(bindingNodes.toArray(new Node[0])); } else { if (bindings.size() > 0) { Binding binding = (Binding) bindings.toArray()[0]; @@ -165,7 +165,7 @@ public class ClientView extends SectionView { addSection(advancedConfigPanel); nodes.add(advancedConfigNode); } - rootChildren.add(nodes.toArray(new Node[nodes.size()])); + rootChildren.add(nodes.toArray(new Node[0])); } } setRoot(root); diff --git a/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/service/ServiceView.java b/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/service/ServiceView.java index a8a0e6e7e2ce..729db70c5a35 100644 --- a/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/service/ServiceView.java +++ b/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/ui/service/ServiceView.java @@ -98,7 +98,7 @@ public class ServiceView extends SectionView { addSection(bindingCont, false); ArrayList nodes = initOperationView(bindingCont, binding, serviceOnly); - bindingChildren.add(nodes.toArray(new Node[nodes.size()])); + bindingChildren.add(nodes.toArray(new Node[0])); bindingNodes[i++] = bindingNodeContainer; } @@ -111,7 +111,7 @@ public class ServiceView extends SectionView { } ArrayList nodes = initOperationView(null, b, serviceOnly); - rootChildren.add(nodes.toArray(new Node[nodes.size()])); + rootChildren.add(nodes.toArray(new Node[0])); } } @@ -168,7 +168,7 @@ private ArrayList initOperationView(SectionContainer bindingCont, Binding SectionPanel bfPanel = new SectionPanel(this, bfNode, bf, false); opCont.addSection(bfPanel, false); } - opChildren.add(subNodes.toArray(new Node[subNodes.size()])); + opChildren.add(subNodes.toArray(new Node[0])); nodes.add(opNodeContainer); } } diff --git a/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/util/Util.java b/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/util/Util.java index 18b7e4f09da2..00a863d39cbd 100644 --- a/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/util/Util.java +++ b/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/util/Util.java @@ -143,7 +143,7 @@ public static SourceGroup[] getJavaSourceGroups(Project project) { result.add(sourceGroups[i]); } } - return result.toArray(new SourceGroup[result.size()]); + return result.toArray(new SourceGroup[0]); } private static Set getTestSourceGroups(SourceGroup[] sourceGroups) { diff --git a/contrib/websvc.wsitconf/test/unit/src/org/netbeans/modules/websvc/wsitconf/util/TestUtil.java b/contrib/websvc.wsitconf/test/unit/src/org/netbeans/modules/websvc/wsitconf/util/TestUtil.java index 327eba384238..e3b87814a6cd 100644 --- a/contrib/websvc.wsitconf/test/unit/src/org/netbeans/modules/websvc/wsitconf/util/TestUtil.java +++ b/contrib/websvc.wsitconf/test/unit/src/org/netbeans/modules/websvc/wsitconf/util/TestUtil.java @@ -29,6 +29,7 @@ import java.io.OutputStream; import java.io.PrintWriter; import java.net.URI; +import java.nio.file.Files; import javax.swing.text.Document; import org.netbeans.modules.xml.wsdl.model.WSDLModel; import org.openide.filesystems.FileObject; @@ -99,7 +100,7 @@ public static void dumpToFile(Document doc, File f) throws Exception { } public static File dumpToTempFile(Document doc) throws Exception { - File f = File.createTempFile("xsm", "xsd"); + File f = Files.createTempFile("xsm", "xsd").toFile(); dumpToFile(doc, f); return f; } diff --git a/cpplite/cpplite.debugger/manifest.mf b/cpplite/cpplite.debugger/manifest.mf index f5ba1b39caf9..dceff650eab9 100644 --- a/cpplite/cpplite.debugger/manifest.mf +++ b/cpplite/cpplite.debugger/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.cpplite.debugger OpenIDE-Module-Layer: org/netbeans/modules/cpplite/debugger/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cpplite/debugger/Bundle.properties -OpenIDE-Module-Specification-Version: 1.15 +OpenIDE-Module-Specification-Version: 1.17 diff --git a/cpplite/cpplite.debugger/nbproject/org-netbeans-modules-cpplite-debugger.sig b/cpplite/cpplite.debugger/nbproject/org-netbeans-modules-cpplite-debugger.sig index 070f662e6b10..b7410d2a1c76 100644 --- a/cpplite/cpplite.debugger/nbproject/org-netbeans-modules-cpplite-debugger.sig +++ b/cpplite/cpplite.debugger/nbproject/org-netbeans-modules-cpplite-debugger.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.14 +#Version 1.15 CLSS public java.lang.Object cons public init() diff --git a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/breakpoints/CPPLiteBreakpoint.java b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/breakpoints/CPPLiteBreakpoint.java index f4e6eb0d1ab9..6e382ded0160 100644 --- a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/breakpoints/CPPLiteBreakpoint.java +++ b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/breakpoints/CPPLiteBreakpoint.java @@ -303,7 +303,7 @@ public DebuggerEngine[] getEngines() { if (antEngines == null) { return null; } else { - return antEngines.toArray(new DebuggerEngine[antEngines.size()]); + return antEngines.toArray(new DebuggerEngine[0]); } } diff --git a/cpplite/cpplite.editor/manifest.mf b/cpplite/cpplite.editor/manifest.mf index 280d65f6417e..708c207e824d 100644 --- a/cpplite/cpplite.editor/manifest.mf +++ b/cpplite/cpplite.editor/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.cpplite.editor OpenIDE-Module-Layer: org/netbeans/modules/cpplite/editor/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cpplite/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.14 +OpenIDE-Module-Specification-Version: 1.16 diff --git a/cpplite/cpplite.editor/nbproject/org-netbeans-modules-cpplite-editor.sig b/cpplite/cpplite.editor/nbproject/org-netbeans-modules-cpplite-editor.sig index dfdd0405204c..f9a8deb1a815 100644 --- a/cpplite/cpplite.editor/nbproject/org-netbeans-modules-cpplite-editor.sig +++ b/cpplite/cpplite.editor/nbproject/org-netbeans-modules-cpplite-editor.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.13 +#Version 1.14 CLSS public java.lang.Object cons public init() diff --git a/cpplite/cpplite.kit/manifest.mf b/cpplite/cpplite.kit/manifest.mf index 372eda5a9c3d..cea2d0344ac2 100644 --- a/cpplite/cpplite.kit/manifest.mf +++ b/cpplite/cpplite.kit/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.cpplite.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cpplite/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.14 +OpenIDE-Module-Specification-Version: 1.16 diff --git a/cpplite/cpplite.project/manifest.mf b/cpplite/cpplite.project/manifest.mf index a5cae820b3c9..b444bd2fe41e 100644 --- a/cpplite/cpplite.project/manifest.mf +++ b/cpplite/cpplite.project/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.cpplite.project OpenIDE-Module-Layer: org/netbeans/modules/cpplite/project/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cpplite/project/Bundle.properties -OpenIDE-Module-Specification-Version: 1.14 +OpenIDE-Module-Specification-Version: 1.16 diff --git a/enterprise/api.web.webmodule/manifest.mf b/enterprise/api.web.webmodule/manifest.mf index 0d05fcd7f229..71d15edd5143 100644 --- a/enterprise/api.web.webmodule/manifest.mf +++ b/enterprise/api.web.webmodule/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.web.webmodule -OpenIDE-Module-Specification-Version: 1.61 +OpenIDE-Module-Specification-Version: 1.63 OpenIDE-Module-Layer: org/netbeans/modules/web/webmodule/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/webmodule/Bundle.properties diff --git a/enterprise/api.web.webmodule/nbproject/org-netbeans-api-web-webmodule.sig b/enterprise/api.web.webmodule/nbproject/org-netbeans-api-web-webmodule.sig index 6c385805d7f8..5efd26bc39c6 100644 --- a/enterprise/api.web.webmodule/nbproject/org-netbeans-api-web-webmodule.sig +++ b/enterprise/api.web.webmodule/nbproject/org-netbeans-api-web-webmodule.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.60 +#Version 1.61 CLSS public abstract interface !annotation java.lang.Deprecated anno 0 java.lang.annotation.Documented() diff --git a/enterprise/cloud.amazon/manifest.mf b/enterprise/cloud.amazon/manifest.mf index 081d96635556..915f38913b56 100644 --- a/enterprise/cloud.amazon/manifest.mf +++ b/enterprise/cloud.amazon/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module: org.netbeans.modules.cloud.amazon/0 OpenIDE-Module-Provides: org.netbeans.modules.serverplugins.javaee OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cloud/amazon/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/cloud/amazon/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.35 +OpenIDE-Module-Specification-Version: 1.37 diff --git a/enterprise/cloud.amazon/src/org/netbeans/modules/cloud/amazon/ui/serverplugin/AmazonJ2EEServerWizardComponent.java b/enterprise/cloud.amazon/src/org/netbeans/modules/cloud/amazon/ui/serverplugin/AmazonJ2EEServerWizardComponent.java index e8dc1da8a98f..74cef478ae01 100644 --- a/enterprise/cloud.amazon/src/org/netbeans/modules/cloud/amazon/ui/serverplugin/AmazonJ2EEServerWizardComponent.java +++ b/enterprise/cloud.amazon/src/org/netbeans/modules/cloud/amazon/ui/serverplugin/AmazonJ2EEServerWizardComponent.java @@ -271,7 +271,7 @@ private void initComponents() { private void initAccounts() { List l = AmazonInstanceManager.getDefault().getInstances(); - DefaultComboBoxModel model = new DefaultComboBoxModel(l.toArray(new AmazonInstance[l.size()])); + DefaultComboBoxModel model = new DefaultComboBoxModel(l.toArray(new AmazonInstance[0])); accountComboBox.setModel(model); accountComboBox.setRenderer(new ListCellRenderer() { @Override @@ -346,7 +346,7 @@ private void reloadTemplates() { if (templateNames != null && templateNames.size() > 0) { templateNames = new ArrayList(templateNames); templateNames.add(0, ""); - templateComboBox.setModel(new DefaultComboBoxModel(templateNames.toArray(new String[templateNames.size()]))); + templateComboBox.setModel(new DefaultComboBoxModel(templateNames.toArray(new String[0]))); templateComboBox.setSelectedIndex(0); templateComboBox.setEnabled(true); templateLabel.setEnabled(true); @@ -372,7 +372,7 @@ public Void call() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - appNameComboBox.setModel(new DefaultComboBoxModel(apps.toArray(new String[apps.size()]))); + appNameComboBox.setModel(new DefaultComboBoxModel(apps.toArray(new String[0]))); appNameComboBox.setSelectedIndex(0); } }); @@ -445,7 +445,7 @@ public Void call() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - containerComboBox.setModel(new DefaultComboBoxModel(containers.toArray(new String[containers.size()]))); + containerComboBox.setModel(new DefaultComboBoxModel(containers.toArray(new String[0]))); } }); return null; diff --git a/enterprise/cloud.common/manifest.mf b/enterprise/cloud.common/manifest.mf index 53161897b780..e51c5462d868 100644 --- a/enterprise/cloud.common/manifest.mf +++ b/enterprise/cloud.common/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.cloud.common OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cloud/common/Bundle.properties -OpenIDE-Module-Specification-Version: 1.34 +OpenIDE-Module-Specification-Version: 1.36 diff --git a/enterprise/cloud.common/nbproject/org-netbeans-modules-cloud-common.sig b/enterprise/cloud.common/nbproject/org-netbeans-modules-cloud-common.sig index 38d2ee645686..fb26293eb89f 100644 --- a/enterprise/cloud.common/nbproject/org-netbeans-modules-cloud-common.sig +++ b/enterprise/cloud.common/nbproject/org-netbeans-modules-cloud-common.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.33 +#Version 1.34 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/cloud.oracle/manifest.mf b/enterprise/cloud.oracle/manifest.mf index 9436b7456714..eb908421be8b 100644 --- a/enterprise/cloud.oracle/manifest.mf +++ b/enterprise/cloud.oracle/manifest.mf @@ -4,6 +4,6 @@ OpenIDE-Module: org.netbeans.modules.cloud.oracle OpenIDE-Module-Layer: org/netbeans/modules/cloud/oracle/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cloud/oracle/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.serverplugins.javaee -OpenIDE-Module-Specification-Version: 1.9 +OpenIDE-Module-Specification-Version: 1.11 OpenIDE-Module-Display-Category: Cloud diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/BrokenProfileNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/BrokenProfileNode.java index d9c18de1ff36..5a579598694a 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/BrokenProfileNode.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/BrokenProfileNode.java @@ -55,7 +55,7 @@ public Action[] getActions(boolean context) { result.add(commonAction); } } - return result.toArray(new Action[result.size()]); + return result.toArray(new Action[0]); } @Override diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/RunFileADMAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/RunFileADMAction.java index ba5f9391ec27..85f98b4643e3 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/RunFileADMAction.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/RunFileADMAction.java @@ -50,7 +50,7 @@ @ActionReferences(value = { @ActionReference(position = 251, path = "Loaders/text/x-maven-pom+xml/Actions"), - @ActionReference(position = 1800, path = "Projects/org-netbeans-modules-maven/Actions") + @ActionReference(position = 1850, path = "Projects/org-netbeans-modules-maven/Actions") }) @NbBundle.Messages({ diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java index b00f42363d6e..68adc66efa5f 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java @@ -43,12 +43,14 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.stream.Collectors; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.netbeans.api.editor.mimelookup.MimeRegistration; @@ -71,8 +73,8 @@ import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.NbBundle; +import org.openide.util.Pair; import org.openide.util.RequestProcessor; -import org.openide.util.RequestProcessor.Task; /** * @@ -131,6 +133,192 @@ public class VulnerabilityWorker implements ErrorProvider{ // @GuardedBy(class) private static VulnerabilityWorker instance; + private static String nonNull(String s) { + return s == null ? "" : s; + } + + /** + * Holds mapping from vulnerable dependencies to the source. This is invalidated and + * recomputed after each source change from the same dependency result. + * This is computed for dependencies found in vulnerability items. + */ + final static class SourceMapping { + /** + * For each reported Depdendency, its closest parent (including self) with source + * information. + */ + final Map nodesWithSource = new HashMap<>(); + + /** + * Source locations for the dependencies. Note the SourceLocation may be implied, + * so that it points to a different Dependnecy. + */ + final Map locations = new HashMap<>(); + + /** + * Set of files with reported locations. Usually just one. + */ + final Set files = new HashSet<>(); + } + + + /** + * Records all vulnerabilities for a certain group-artifact-version. Collects all + * locations (paths) in the dependency tree where the GAV appears. + */ + final static class VulnerabilityItem { + /** + * GAV coordinates of the reported artifact + */ + final String gav; + /** + * List of vulnerabilities found for this artifact GAV + */ + final List reports; + + /** + * All paths to the artifact through the dependency graph. Each List is a path + * from the project root to the identified dependency. + */ + final Set> paths = new LinkedHashSet<>(); + + public VulnerabilityItem(String gav, List reports) { + this.gav = gav; + this.reports = reports; + } + } + + private static String getDependencyId(Dependency d) { + if (d.getProject() != null) { + return d.getProject().getProjectId(); + } else if (d.getArtifact() != null) { + return createGAV(d.getArtifact()); + } else { + return d.toString(); + } + } + + static Pair findSource(DependencyResult dependencyResult, Dependency dependency) { + SourceLocation sourcePath = null; + Dependency sd = dependency; + for (; sd != null; sd = sd.getParent()) { + try { + sourcePath = dependencyResult.getDeclarationRange(dependency, null); + if (sourcePath != null) { + break; + } + } catch (IOException ex) { + LOG.log(Level.WARNING, "Could not load dependency source", ex); + } + } + return Pair.of(sd, sourcePath); + } + + static class SourceMappingBuilder { + private final DependencyResult dependencyResult; + private final Map itemIndex; + private SourceMapping result = new SourceMapping(); + + public SourceMappingBuilder(DependencyResult dependencyResult, Map itemIndex) { + this.dependencyResult = dependencyResult; + this.itemIndex = itemIndex; + } + + public SourceMapping build() { + for (VulnerabilityItem item : itemIndex.values()) { + for (List path : item.paths) { + Dependency node = path.get(path.size() - 1); + if (result.nodesWithSource.containsKey(node)) { + continue; + } + Pair s = findSource(dependencyResult, node); + result.nodesWithSource.put(node, s.first()); + if (s.first() == null || s.second() == null) { + continue; + } + SourceLocation l = s.second(); + result.nodesWithSource.put(node, s.first()); + if (l != null) { + result.locations.putIfAbsent(s.first(), l); + result.files.add(l.getFile()); + } + } + } + return result; + } + } + + + /** + * Builds the vulnerability indices from the vulnerability report and project dependencies. The outcome is "itemIdex" and + * "sourceMapping" which are then copied to {@link CacheItem}. + */ + static class CacheDataBuilder { + private final DependencyResult dependencyResult; + private final VulnerabilityReport report; + + private Map itemIndex = new HashMap<>(); + private SourceMapping sourceMapping; + private Set uniqueDeps = new HashSet<>(); + + public CacheDataBuilder(DependencyResult dependencyResult, VulnerabilityReport report) { + this.dependencyResult = dependencyResult; + this.report = report; + } + + private void initVulnerabilityIndex() { + this.itemIndex = new HashMap<>(); + for (ApplicationDependencyVulnerabilitySummary s: report.items) { + VulnerabilityItem item = new VulnerabilityItem(s.getGav(), s.getVulnerabilities()); + itemIndex.put(s.getGav(), item); + } + } + + private void buildDependencyMap(Dependency dependency, List path, Set pathToRoot) { + String gav = getDependencyId(dependency); + if (gav == null || !pathToRoot.add(gav)) { + return; + } + uniqueDeps.add(gav); + + pathToRoot.add(gav); + try { + VulnerabilityItem item = itemIndex.get(gav); + if (item != null) { + List p = new ArrayList<>(path); + p.add(dependency); + item.paths.add(p); + } + + if (dependency != dependencyResult.getRoot()) { + path.add(dependency); + } + dependency.getChildren().forEach((childDependency) -> { + buildDependencyMap(childDependency, path, pathToRoot); + }); + if (!path.isEmpty()) { + Dependency x = path.remove(path.size() - 1); + assert x == dependency; + } + } finally { + pathToRoot.remove(gav); + } + } + + Map build() { + initVulnerabilityIndex(); + SourceLocation rootLocation = null; + try { + rootLocation = dependencyResult.getDeclarationRange(dependencyResult.getRoot(), null); + } catch (IOException ex) { + LOG.log(Level.WARNING, "Could not load dependency source", ex); + } + buildDependencyMap(this.dependencyResult.getRoot(), new ArrayList<>(), new HashSet<>()); + sourceMapping = new SourceMappingBuilder(dependencyResult, itemIndex).build(); + return itemIndex; + } + } + /** * Cached information + watcher over the project file data. Will watch for dependency change event, * that is fired e.g. after project reload, and will REPLACE ITSELF in the cache + fire @@ -141,17 +329,24 @@ static class CacheItem { private final DependencyResult dependencyResult; private final VulnerabilityReport report; + // @GuardedBy(this) -- initialization only + private Map itemIndex; + + // @GuardedBy(this) -- initialization only + private SourceMapping sourceMapping; /** - * Maps GAV -> dependency. + * Number of dependencies */ - private Map dependencyMap; - + // @GuardedBy(this) -- initialization only + private int uniqueDependencies; + // @GuardedBy(this) private ChangeListener depChange; + private ChangeListener sourceChange; // @GuardedBy(this) private RequestProcessor.Task pendingRefresh; - + public CacheItem(Project project, DependencyResult dependency, VulnerabilityReport report) { this.project = project; this.dependencyResult = dependency; @@ -169,52 +364,76 @@ public VulnerabilityAuditSummary getAudit() { public List getVulnerabilities() { return report.items; } - - public Map getDependencyMap() { - if (dependencyMap == null) { - dependencyMap = new HashMap<>(); - buildDependecyMap(dependencyResult.getRoot(), dependencyMap); - } - return dependencyMap; - } - private void buildDependecyMap(Dependency dependency, Map result) { - String gav = createGAV(dependency.getArtifact()); - if (gav != null && result.putIfAbsent(gav, dependency) == null) { - dependency.getChildren().forEach((childDependency) -> { - buildDependecyMap(childDependency, result); - }); + private synchronized void initialize() { + if (itemIndex != null) { + return; } + startListening(); + CacheDataBuilder b = new CacheDataBuilder(dependencyResult, report); + Map items = b.build(); + this.itemIndex = b.itemIndex; + this.sourceMapping = b.sourceMapping; + this.uniqueDependencies = b.uniqueDeps.size(); } public Set getProblematicFiles() { if (getAudit().getIsSuccess()) { return Collections.EMPTY_SET; } - Set result = new HashSet<>(); - for (ApplicationDependencyVulnerabilitySummary v: getVulnerabilities()){ - List vulnerabilities = v.getVulnerabilities(); - if (!vulnerabilities.isEmpty()) { - Dependency dep = getDependencyMap().get(v.getGav()); - if (dep != null) { - try { - SourceLocation declarationRange = this.dependencyResult.getDeclarationRange(dep, null); - if (declarationRange == null) { - declarationRange = this.dependencyResult.getDeclarationRange(dep, DependencyResult.PART_CONTAINER); - } - if(declarationRange != null && declarationRange.getFile() != null) { - result.add(declarationRange.getFile()); - } - } catch (IOException ex) { - // expected, ignore. - } - } + initialize(); + return sourceMapping.files; + } + + VulnerabilityItem findVulnerability(String gav) { + initialize(); + return itemIndex.get(gav); + } + + void refreshSourceMapping(RequestProcessor.Task t) { + SourceMapping old; + SourceMapping m = new SourceMappingBuilder(dependencyResult, itemIndex).build(); + Set files = new HashSet<>(); + synchronized (this) { + // should block on this until t[0] is assigned + if (pendingRefresh != t) { + return; } + old = this.sourceMapping; + sourceMapping = m; } - return result; + if (old != null) { + files.addAll(old.files); + } + Diagnostic.ReporterControl reporter = Diagnostic.findReporterControl(Lookup.getDefault(), project.getProjectDirectory()); + files.addAll(m.files); + reporter.diagnosticChanged(files, null); } void refreshDependencies(RequestProcessor.Task t) { + boolean model; + synchronized (cache) { + CacheItem registered = cache.get(project); + if (registered != this) { + return; + } + } + synchronized (this) { + // should block on this until t[0] is assigned + if (pendingRefresh != t) { + return; + } + model = modelChanged || itemIndex == null; + modelChanged = false; + } + if (model) { + refreshProjectDependencies(t); + } else { + refreshSourceMapping(t); + } + } + + void refreshProjectDependencies(RequestProcessor.Task t) { DependencyResult dr = ProjectDependencies.findDependencies(project, ProjectDependencies.newQuery(Scopes.RUNTIME)); LOG.log(Level.FINER, "{0} - dependencies refreshed", this); synchronized (this) { @@ -222,12 +441,13 @@ void refreshDependencies(RequestProcessor.Task t) { if (pendingRefresh != t) { return; } + modelChanged = false; } CacheItem novy = new CacheItem( project, dr, report); if (LOG.isLoggable(Level.FINER)) { LOG.log(Level.FINER, "{0} - trying to replace for {1}", new Object[] { this, novy }); } - if (replaceCacheItem(this, novy)) { + if (replaceCacheItem(project, this, novy)) { novy.startListening(); Diagnostic.ReporterControl reporter = Diagnostic.findReporterControl(Lookup.getDefault(), project.getProjectDirectory()); Set allFiles = new HashSet<>(); @@ -236,16 +456,31 @@ void refreshDependencies(RequestProcessor.Task t) { if (LOG.isLoggable(Level.FINER)) { LOG.log(Level.FINER, "{0} - refreshing files: {1}", new Object[] { this, allFiles }); } - reporter.diagnosticChanged(novy.getProblematicFiles(), null); + reporter.diagnosticChanged(allFiles, null); } } + /** + * True, if the project model changed; false, if only source has changed. + */ + private boolean modelChanged; + + void scheduleSourceRefresh(ChangeEvent e) { + // PENDING: enable when Maven and gradle dependency implementation stabilizaes on reading the + // actual source. + // scheduleRefresh(false); + } + void scheduleDependencyRefresh(ChangeEvent e) { + scheduleRefresh(true); + } + + private void scheduleRefresh(boolean modelChanged) { synchronized (this) { if (pendingRefresh != null) { pendingRefresh.cancel(); } - + modelChanged |= modelChanged; RequestProcessor.Task[] task = new RequestProcessor.Task[1]; if (LOG.isLoggable(Level.FINER)) { LOG.log(Level.FINER, "{0} - scheduling refresh for {1}", new Object[] { this, project }); @@ -261,15 +496,12 @@ void scheduleDependencyRefresh(ChangeEvent e) { } } - SourceLocation getDependencyRange(Dependency d) throws IOException { - return getDependencyRange(d, null); - } - void startListening() { synchronized (this) { if (depChange == null) { dependencyResult.addChangeListener(depChange = this::scheduleDependencyRefresh); LOG.log(Level.FINER, "{0} - start listen for dependencies", this); + dependencyResult.addSourceChangeListener(sourceChange = this::scheduleSourceRefresh); } } } @@ -280,13 +512,38 @@ void stopListening() { dependencyResult.removeChangeListener(depChange); // intentionally does not clean depChange, to make a subsequent startListening no-op. LOG.log(Level.FINER, "{0} - stop listen for dependencies", this); + dependencyResult.removeSourceChangeListener(sourceChange); } } } - SourceLocation getDependencyRange(Dependency d, String part) throws IOException { - startListening(); - return dependencyResult.getDeclarationRange(d, part); + Diagnostic createDiagnostic(Dependency owner, Dependency dependency, List path, Vulnerability vulnerability, SourceLocation declarationRange) { + String ownerGav = owner == null ? null : getDependencyId(owner); + String message = + ownerGav == null ? + Bundle.MSG_Diagnostic( + formatCvssScore(vulnerability.getCvssV2Score()), + formatCvssScore(vulnerability.getCvssV3Score()), + getDependencyId(dependency)) : + Bundle.MSG_Diagnostic_Included( + formatCvssScore(vulnerability.getCvssV2Score()), + formatCvssScore(vulnerability.getCvssV3Score()), + getDependencyId(dependency), + ownerGav); + SourceLocation fDeclarationRange = declarationRange; + Diagnostic.Builder builder = Diagnostic.Builder.create(() -> fDeclarationRange.getStartOffset(), () -> fDeclarationRange.getEndOffset(), message); + builder.setSeverity(Diagnostic.Severity.Warning); + try { + builder.setCodeDescription(new URL(GOV_DETAIL_URL + vulnerability.getId())); + } catch (MalformedURLException ex) { + // perhaps should not happen at all + LOG.log(Level.INFO, "Could not link to vulnerability: {0}", vulnerability.getId()); + } + + // TODO: when Diagnostic supports (some) ID, change to report the unique id separately, now it is embedded into the diagnostic code. + String pathString = path.stream().map(d -> getDependencyId(d)).collect(Collectors.joining("/")); + builder.setCode(vulnerability.getId() + "~~" + pathString); + return builder.build(); } public List getDiagnosticsForFile(FileObject file) { @@ -297,69 +554,68 @@ public List getDiagnosticsForFile(FileObject file) { return null; } + initialize(); + List result = new ArrayList<>(); - for (ApplicationDependencyVulnerabilitySummary v: getVulnerabilities()){ - List vulnerabilities = v.getVulnerabilities(); - if (!vulnerabilities.isEmpty()) { - startListening(); - Dependency dependency = getDependencyMap().get(v.getGav()); - SourceLocation declarationRange = null; + SourceLocation containerLocation = null; + + for (VulnerabilityItem item : this.itemIndex.values()) { + boolean unreported = true; + Set anchors = new HashSet<>(); + for (List path : item.paths) { + Dependency dependency = path.get(path.size() - 1); - if (dependency != null) { - try { - declarationRange = getDependencyRange(dependency); - } catch (IOException ex) { - Exceptions.printStackTrace(ex); - } - } - // display the vulnerabilities that were never mapped on the dependency container's line. - // also display the vulnerabilities that we KNOW about, but do can not map them back to the project file, i.e. - // plugin-introduced dependencies (gradle). - if (declarationRange == null && (dependency != null || !report.mappedVulnerabilities.contains(v.getGav()))) { - try { - if (LOG.isLoggable(Level.FINER)) { - LOG.log(Level.FINER, "{0} getDiagnostics called for {1}", new Object[] { this, file }); - } + SourceLocation declarationRange = null; - declarationRange = getDependencyRange(dependency, DependencyResult.PART_CONTAINER); - if (declarationRange != null) { - // discard end location, since it could span a whole section - declarationRange = new SourceLocation(declarationRange.getFile(), - declarationRange.getStartOffset(), declarationRange.getStartOffset(), null); - } - } catch (IOException ex) { - // ignore - } + String ownerGav = null; + Dependency withSource = sourceMapping.nodesWithSource.get(dependency); + if (withSource != null) { + declarationRange = sourceMapping.locations.get(withSource); // XXX, neprepisovat nullem + } + if (declarationRange == null) { + // will deal with unampped vulnerabilities later. + continue; + } + Dependency owner = withSource; + if (withSource != dependency) { + // the dependency result may not report implied sources, so fallback + // to the closest parent artifact + ownerGav = getDependencyId(withSource); } - if (declarationRange != null && declarationRange.hasPosition() && declarationRange.getFile().equals(file)) { - final SourceLocation fDeclarationRange = declarationRange; - String ownerGav = null; - if (fDeclarationRange.getImpliedBy() instanceof Dependency) { - Dependency owner = (Dependency)fDeclarationRange.getImpliedBy(); - ownerGav = createGAV(owner.getArtifact()); - } - for(Vulnerability vulnerability: vulnerabilities) { - String message = - ownerGav == null ? - Bundle.MSG_Diagnostic( - formatCvssScore(vulnerability.getCvssV2Score()), - formatCvssScore(vulnerability.getCvssV3Score()), - createGAV(dependency.getArtifact())) : - Bundle.MSG_Diagnostic_Included( - formatCvssScore(vulnerability.getCvssV2Score()), - formatCvssScore(vulnerability.getCvssV3Score()), - createGAV(dependency.getArtifact()), - ownerGav); - Diagnostic.Builder builder = Diagnostic.Builder.create(() -> fDeclarationRange.getStartOffset(), () -> fDeclarationRange.getEndOffset(), message); - builder.setSeverity(Diagnostic.Severity.Warning).setCode(vulnerability.getId()); + if (declarationRange.getImpliedBy() instanceof Dependency) { + owner = (Dependency)declarationRange.getImpliedBy(); + ownerGav = getDependencyId(owner); + } + if (!anchors.add(owner)) { + // do not report additional "foo" included from "bar", if already reported. + continue; + } + for (Vulnerability vulnerability : item.reports) { + unreported = false; + result.add(createDiagnostic(owner, dependency, path, vulnerability, declarationRange)); + } + } + if (unreported && !item.paths.isEmpty()) { + // if the vulnerability item was matched initially and now it is not found, or mapped to a source, + // the user may have removed it from the project without running the analysis again - it should not be reported, it will eventually reappear + // after next analysis. + // But if it is not in the original map for some reason, report on the container location + if (!report.getMappedVulnerabilities().contains(item.gav)) { + if (containerLocation == null) { try { - builder.setCodeDescription(new URL(GOV_DETAIL_URL + vulnerability.getId())); - } catch (MalformedURLException ex) { - // perhaps should not happen at all - LOG.log(Level.INFO, "Could not link to vulnerability: {0}", vulnerability.getId()); + containerLocation = dependencyResult.getDeclarationRange(dependencyResult.getRoot(), DependencyResult.PART_CONTAINER); + } catch (IOException ex) { + LOG.log(Level.WARNING, "Could not load container location", ex); } - result.add(builder.build()); + if (containerLocation == null) { + containerLocation = new SourceLocation(project.getProjectDirectory(), 0, 0, null); + } + } + for (Vulnerability vulnerability : item.reports) { + List path = item.paths.iterator().next(); + Dependency dependency = path.get(path.size() - 1); + result.add(createDiagnostic(null, dependency, path, vulnerability, containerLocation)); } } } @@ -375,18 +631,25 @@ private String formatCvssScore(Float value) { } } - private static boolean replaceCacheItem(CacheItem old, CacheItem novy) { + private static boolean replaceCacheItem(Project p, CacheItem novy) { + return replaceCacheItem(p, null, novy); + } + + private static boolean replaceCacheItem(Project p, CacheItem old, CacheItem novy) { + CacheItem registered; synchronized (cache) { - CacheItem registered = cache.get(old.project); - if (old != null && registered != old) { - old.stopListening(); - return false; + registered = cache.get(p); + if (old != null) { + if (old != registered) { + old.stopListening(); + return false; + } + } + if (registered != null) { + registered.stopListening(); } cache.put(novy.project, novy); } - if (old != null) { - old.stopListening(); - } return true; } @@ -549,7 +812,7 @@ private AuditResult doFindVulnerability(Project project, String compartmentId, S if (cacheItem != null) { synchronized (cache) { - cache.put(project, cacheItem); + replaceCacheItem(project, cacheItem); } Set problematicFiles = new HashSet<>(); @@ -572,8 +835,17 @@ private AuditResult doFindVulnerability(Project project, String compartmentId, S reporter.diagnosticChanged(problematicFiles, null); List arts = new ArrayList<>(); + Set gavs = new HashSet<>(); for (ApplicationDependencyVulnerabilitySummary s : cacheItem.getVulnerabilities()) { - Dependency d = cacheItem.getDependencyMap().get(s.getGav()); + if (!gavs.add(s.getGav())) { + continue; + } + VulnerabilityItem i = cacheItem.findVulnerability(s.getGav()); + if (i == null || i.paths.isEmpty()) { + continue; + } + List p = i.paths.iterator().next(); + Dependency d = p.get(p.size() - 1); if (d == null) { continue; } @@ -583,7 +855,7 @@ private AuditResult doFindVulnerability(Project project, String compartmentId, S } } AuditResult res = new AuditResult(project, projectDisplayName, cacheItem.report.summary.getId(), - cacheItem.getDependencyMap().size(), cacheItem.getAudit().getVulnerableArtifactsCount(), + cacheItem.uniqueDependencies, cacheItem.getAudit().getVulnerableArtifactsCount(), arts); return res; } else { @@ -630,9 +902,14 @@ private static String createGAV(ArtifactSpec artifact) { } // use a random constant that could be sufficient to hold gav text (micronaut-core has max 86) StringBuilder sb = new StringBuilder(120); - sb.append(artifact.getGroupId()).append(':'); - sb.append(artifact.getArtifactId()).append(':'); - sb.append(artifact.getVersionSpec()); + sb.append(String.format("%s:%s:%s", + nonNull(artifact.getGroupId()), + nonNull(artifact.getArtifactId()), + nonNull(artifact.getVersionSpec())) + ); + if (artifact.getClassifier() != null) { + sb.append(':').append(artifact.getClassifier()); + } return sb.toString(); } @@ -691,8 +968,8 @@ private CacheItem fetchVulnerabilityItems(Project project, ApplicationDependency for (ApplicationDependencyVulnerabilitySummary v : items) { List vulnerabilities = v.getVulnerabilities(); if (!vulnerabilities.isEmpty()) { - Dependency dependency = cache.getDependencyMap().get(v.getGav()); - if (dependency != null) { + VulnerabilityItem item = cache.findVulnerability(v.getGav()); + if (item != null && !item.paths.isEmpty()) { mapped.add(v.getGav()); } } diff --git a/enterprise/el.lexer/manifest.mf b/enterprise/el.lexer/manifest.mf index eeaf40a73e10..a4b61f7b83bd 100644 --- a/enterprise/el.lexer/manifest.mf +++ b/enterprise/el.lexer/manifest.mf @@ -1,5 +1,5 @@ OpenIDE-Module: org.netbeans.modules.el.lexer/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/el/lexer/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.52 OpenIDE-Module-Layer: org/netbeans/modules/el/lexer/resources/layer.xml diff --git a/enterprise/el.lexer/nbproject/org-netbeans-modules-el-lexer.sig b/enterprise/el.lexer/nbproject/org-netbeans-modules-el-lexer.sig index 32828340de0d..374a91db9853 100644 --- a/enterprise/el.lexer/nbproject/org-netbeans-modules-el-lexer.sig +++ b/enterprise/el.lexer/nbproject/org-netbeans-modules-el-lexer.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.49 +#Version 1.50 CLSS public abstract interface java.io.Serializable diff --git a/enterprise/glassfish.common/manifest.mf b/enterprise/glassfish.common/manifest.mf index 91e410ed3efa..e09ba0561912 100644 --- a/enterprise/glassfish.common/manifest.mf +++ b/enterprise/glassfish.common/manifest.mf @@ -4,6 +4,6 @@ OpenIDE-Module: org.netbeans.modules.glassfish.common/0 OpenIDE-Module-Install: org/netbeans/modules/glassfish/common/Installer.class OpenIDE-Module-Layer: org/netbeans/modules/glassfish/common/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/glassfish/common/Bundle.properties -OpenIDE-Module-Specification-Version: 1.97 +OpenIDE-Module-Specification-Version: 1.99 OpenIDE-Module-Provides: org.netbeans.modules.glassfish.common diff --git a/enterprise/glassfish.common/nbproject/org-netbeans-modules-glassfish-common.sig b/enterprise/glassfish.common/nbproject/org-netbeans-modules-glassfish-common.sig index cfd95b62e4e6..c6f29780deb8 100644 --- a/enterprise/glassfish.common/nbproject/org-netbeans-modules-glassfish-common.sig +++ b/enterprise/glassfish.common/nbproject/org-netbeans-modules-glassfish-common.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.96 +#Version 1.97 CLSS public abstract java.awt.Component cons protected init() @@ -1636,6 +1636,8 @@ fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLAS fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLASSFISH_SERVER_6_2_5 fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLASSFISH_SERVER_7_0_0 fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLASSFISH_SERVER_7_0_1 +fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLASSFISH_SERVER_7_0_10 +fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLASSFISH_SERVER_7_0_11 fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLASSFISH_SERVER_7_0_2 fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLASSFISH_SERVER_7_0_3 fld public final static org.netbeans.modules.glassfish.common.ServerDetails GLASSFISH_SERVER_7_0_4 diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties index 228f2fd82f40..7087914838b5 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties @@ -178,6 +178,10 @@ STR_708_SERVER_NAME=GlassFish Server 7.0.8 STR_709_SERVER_NAME=GlassFish Server 7.0.9 STR_7010_SERVER_NAME=GlassFish Server 7.0.10 STR_7011_SERVER_NAME=GlassFish Server 7.0.11 +STR_7012_SERVER_NAME=GlassFish Server 7.0.12 +STR_7013_SERVER_NAME=GlassFish Server 7.0.13 +STR_7014_SERVER_NAME=GlassFish Server 7.0.14 +STR_800_SERVER_NAME=GlassFish Server 8.0.0 # CommonServerSupport.java MSG_FLAKEY_NETWORK=Network communication problem
Could not establish \ diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/CreateDomain.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/CreateDomain.java index 515819477762..b4fe2daa3885 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/CreateDomain.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/CreateDomain.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; +import java.nio.file.Files; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -272,7 +273,7 @@ private static File createTempPasswordFile(String password, String masterPasswor PrintWriter p = null; File retVal = null; try { - retVal = File.createTempFile("admin", null);//NOI18N + retVal = Files.createTempFile("admin", null).toFile();//NOI18N retVal.deleteOnExit(); output = new FileOutputStream(retVal); diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstance.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstance.java index a1a4df3d46b3..cbf856d708ff 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstance.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstance.java @@ -1648,7 +1648,7 @@ private void updateFactories() { } if (!proxies.isEmpty()) { - full = new ProxyLookup(proxies.toArray(new Lookup[proxies.size()])); + full = new ProxyLookup(proxies.toArray(Lookup[]::new)); } } diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java index bca68933b0d9..081be2bca9f8 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java @@ -69,6 +69,7 @@ public final class GlassfishInstanceProvider implements ServerInstanceProvider, public static final String JAKARTAEE9_DEPLOYER_FRAGMENT = "deployer:gfv6ee9"; public static final String JAKARTAEE91_DEPLOYER_FRAGMENT = "deployer:gfv610ee9"; public static final String JAKARTAEE10_DEPLOYER_FRAGMENT = "deployer:gfv700ee10"; + public static final String JAKARTAEE11_DEPLOYER_FRAGMENT = "deployer:gfv800ee11"; public static final String EE6WC_DEPLOYER_FRAGMENT = "deployer:gfv3ee6wc"; // NOI18N public static final String PRELUDE_DEPLOYER_FRAGMENT = "deployer:gfv3"; // NOI18N private static String EE6_INSTANCES_PATH = "/GlassFishEE6/Instances"; // NOI18N @@ -78,6 +79,7 @@ public final class GlassfishInstanceProvider implements ServerInstanceProvider, private static String JAKARTAEE9_INSTANCES_PATH = "/GlassFishJakartaEE9/Instances"; // NOI18N private static String JAKARTAEE91_INSTANCES_PATH = "/GlassFishJakartaEE91/Instances"; // NOI18N private static String JAKARTAEE10_INSTANCES_PATH = "/GlassFishJakartaEE10/Instances"; // NOI18N + private static String JAKARTAEE11_INSTANCES_PATH = "/GlassFishJakartaEE11/Instances"; // NOI18N private static String EE6WC_INSTANCES_PATH = "/GlassFishEE6WC/Instances"; // NOI18N public static String PRELUDE_DEFAULT_NAME = "GlassFish_v3_Prelude"; //NOI18N @@ -102,11 +104,13 @@ public static GlassfishInstanceProvider getProvider() { new String[]{EE6_DEPLOYER_FRAGMENT, EE6WC_DEPLOYER_FRAGMENT, EE7_DEPLOYER_FRAGMENT, EE8_DEPLOYER_FRAGMENT, JAKARTAEE8_DEPLOYER_FRAGMENT, JAKARTAEE9_DEPLOYER_FRAGMENT, - JAKARTAEE91_DEPLOYER_FRAGMENT, JAKARTAEE10_DEPLOYER_FRAGMENT}, + JAKARTAEE91_DEPLOYER_FRAGMENT, JAKARTAEE10_DEPLOYER_FRAGMENT, + JAKARTAEE11_DEPLOYER_FRAGMENT}, new String[]{EE6_INSTANCES_PATH, EE6WC_INSTANCES_PATH, EE7_INSTANCES_PATH, EE8_INSTANCES_PATH, JAKARTAEE8_INSTANCES_PATH, JAKARTAEE9_INSTANCES_PATH, - JAKARTAEE91_INSTANCES_PATH, JAKARTAEE10_INSTANCES_PATH}, + JAKARTAEE91_INSTANCES_PATH, JAKARTAEE10_INSTANCES_PATH, + JAKARTAEE11_INSTANCES_PATH}, null, true, new String[]{"--nopassword"}, // NOI18N @@ -535,7 +539,7 @@ String[] getNoPasswordCreatDomainCommand(String startScript, String jarLocation, retVal.addAll(noPasswordOptions); } retVal.add(domain); - return retVal.toArray(new String[retVal.size()]); + return retVal.toArray(String[]::new); } public CommandFactory getCommandFactory() { diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java index ac283ad3d5a6..5737b8d993c2 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java @@ -411,6 +411,50 @@ public enum ServerDetails { "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.11/glassfish-7.0.11.zip", // NOI18N "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.11/glassfish-7.0.11.zip", // NOI18N "http://www.eclipse.org/legal/epl-2.0" //NOI18N + ), + + /** + * details for an instance of GlassFish Server 7.0.12 + */ + GLASSFISH_SERVER_7_0_12(NbBundle.getMessage(ServerDetails.class, "STR_7012_SERVER_NAME", new Object[]{}), // NOI18N + GlassfishInstanceProvider.JAKARTAEE10_DEPLOYER_FRAGMENT, + GlassFishVersion.GF_7_0_12, + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.12/glassfish-7.0.12.zip", // NOI18N + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.12/glassfish-7.0.12.zip", // NOI18N + "http://www.eclipse.org/legal/epl-2.0" //NOI18N + ), + + /** + * details for an instance of GlassFish Server 7.0.13 + */ + GLASSFISH_SERVER_7_0_13(NbBundle.getMessage(ServerDetails.class, "STR_7013_SERVER_NAME", new Object[]{}), // NOI18N + GlassfishInstanceProvider.JAKARTAEE10_DEPLOYER_FRAGMENT, + GlassFishVersion.GF_7_0_13, + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.13/glassfish-7.0.13.zip", // NOI18N + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.13/glassfish-7.0.13.zip", // NOI18N + "http://www.eclipse.org/legal/epl-2.0" //NOI18N + ), + + /** + * details for an instance of GlassFish Server 7.0.14 + */ + GLASSFISH_SERVER_7_0_14(NbBundle.getMessage(ServerDetails.class, "STR_7014_SERVER_NAME", new Object[]{}), // NOI18N + GlassfishInstanceProvider.JAKARTAEE10_DEPLOYER_FRAGMENT, + GlassFishVersion.GF_7_0_14, + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.14/glassfish-7.0.14.zip", // NOI18N + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.14/glassfish-7.0.14.zip", // NOI18N + "http://www.eclipse.org/legal/epl-2.0" //NOI18N + ), + + /** + * details for an instance of GlassFish Server 8.0.0 + */ + GLASSFISH_SERVER_8_0_0(NbBundle.getMessage(ServerDetails.class, "STR_800_SERVER_NAME", new Object[]{}), // NOI18N + GlassfishInstanceProvider.JAKARTAEE11_DEPLOYER_FRAGMENT, + GlassFishVersion.GF_8_0_0, + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/8.0.0-M4/glassfish-8.0.0-M4.zip", // NOI18N + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/8.0.0-M4/glassfish-8.0.0-M4.zip", // NOI18N + "http://www.eclipse.org/legal/epl-2.0" //NOI18N ); /** diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/StartTask.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/StartTask.java index 01b22287ec63..2a12787c6819 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/StartTask.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/StartTask.java @@ -168,7 +168,7 @@ public void operationStateChanged(TaskState newState, } } }); - this.stateListener = listeners.toArray(new TaskStateListener[listeners.size()]); + this.stateListener = listeners.toArray(TaskStateListener[]::new); this.support = support; this.recognizers = recognizers; this.jvmArgs = (jvmArgs != null) ? Arrays.asList(removeEscapes(jvmArgs)) : null; diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/nodes/Hk2ItemNode.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/nodes/Hk2ItemNode.java index be7e66c539b8..c16318f595dc 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/nodes/Hk2ItemNode.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/nodes/Hk2ItemNode.java @@ -303,7 +303,7 @@ public Action[] getActions(boolean context) { if (decorator.canEditDetails()) { actions.add(SystemAction.get(EditDetailsAction.class)); } - return actions.toArray(new Action[actions.size()]); + return actions.toArray(Action[]::new); } //////////////////////////////////////////////////////////////////////////// diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java index bc1cc25d9cf1..5c906f0f9a8e 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java @@ -84,7 +84,10 @@ private static int autoregisterGlassFishInstance(String clusterDirValue, String String deployer = "deployer:gfv3ee6"; String defaultDisplayNamePrefix = "GlassFish Server "; GlassFishVersion version = ServerUtils.getServerVersion(glassfishRoot); - if (GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { + if (GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { + deployer = "deployer:gfv800ee11"; + config = "GlassFishJakartaEE11/Instances"; + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { deployer = "deployer:gfv700ee10"; config = "GlassFishJakartaEE10/Instances"; } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_6_1_0)) { diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ui/BasePanel.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ui/BasePanel.java index a6ff97acba81..1d3599199fb3 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ui/BasePanel.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ui/BasePanel.java @@ -231,7 +231,7 @@ public void run() { } } if (l.size() > 0) { - table.setModel(new AttributedPropertyTableModel(l.toArray(new String[l.size()][]), specComp, pushPrefix)); + table.setModel(new AttributedPropertyTableModel(l.toArray(String[][]::new), specComp, pushPrefix)); } else { // this data is from a post beta build... pattern = Pattern.compile(".*\\." + name + "\\." + specComp[0] + "\\..*"); @@ -252,7 +252,7 @@ public void run() { } } if (l.size() > 0) { - table.setModel(new NameValueTableModel(l.toArray(new String[l.size()][]), specComp, pushPrefix)); + table.setModel(new NameValueTableModel(l.toArray(String[][]::new), specComp, pushPrefix)); } } } diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties index 1c5d8de127bc..bb5d8172963b 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties @@ -179,6 +179,12 @@ STR_708_SERVER_NAME=GlassFish Server 7.0.8 STR_709_SERVER_NAME=GlassFish Server 7.0.9 STR_7010_SERVER_NAME=GlassFish Server 7.0.10 STR_7011_SERVER_NAME=GlassFish Server 7.0.11 +STR_7012_SERVER_NAME=GlassFish Server 7.0.12 +STR_7013_SERVER_NAME=GlassFish Server 7.0.13 +STR_7014_SERVER_NAME=GlassFish Server 7.0.14 + +STR_V8_FAMILY_NAME=GlassFish Server +STR_800_SERVER_NAME=GlassFish Server 8.0.0 LBL_SELECT_BITS=Select LBL_ChooseOne=Choose server to download: diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java index 9a433efcccfe..e095842f864a 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java @@ -75,7 +75,14 @@ public static GlassfishWizardProvider createJakartaEe91() { public static GlassfishWizardProvider createJakartaEe10() { return new GlassfishWizardProvider( org.openide.util.NbBundle.getMessage(GlassfishWizardProvider.class, - "STR_V7_FAMILY_NAME", new Object[]{}) // NOI18N + "STR_V7_FAMILY_NAME", new Object[]{}) // NOI18N + ); + } + + public static GlassfishWizardProvider createJakartaEe11() { + return new GlassfishWizardProvider( + org.openide.util.NbBundle.getMessage(GlassfishWizardProvider.class, + "STR_V8_FAMILY_NAME", new Object[]{}) // NOI18N ); } diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java index 3a17762b28e7..e81b108df9f2 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java @@ -112,6 +112,12 @@ public static ServerUtilities getJakartaEe10Utilities() { return null == gip ? null : new ServerUtilities(gip, GlassfishWizardProvider.createJakartaEe10()); } + + public static ServerUtilities getJakartaEe11Utilities() { + GlassfishInstanceProvider gip = GlassfishInstanceProvider.getProvider(); + return null == gip ? null : new ServerUtilities(gip, + GlassfishWizardProvider.createJakartaEe11()); + } // public static ServerUtilities getEe6WCUtilities() { // GlassfishInstanceProvider gip = GlassfishInstanceProvider.getProvider(); diff --git a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java index 0be18423d0c4..37e1a77d83ad 100644 --- a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java +++ b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java @@ -28,6 +28,38 @@ */ public class AutomaticRegistrationTest { + @Test + public void testRegistrationGF8() { + GlassFishVersion version = GlassFishVersion.GF_8_0_0; + if (GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { + assertTrue("Success!", true); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_6)) { + fail("GF_6"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) { + fail("GF_5_1_0"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5)) { + fail("GF_5"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_3_1)) { + fail("GF_3_1"); + } + } + + @Test + public void testRegistrationGF7() { + GlassFishVersion version = GlassFishVersion.GF_7_0_11; + if (GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { + assertTrue("Success!", true); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_6)) { + fail("GF_6"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) { + fail("GF_5_1_0"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5)) { + fail("GF_5"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_3_1)) { + fail("GF_3_1"); + } + } + @Test public void testRegistrationGF625() { GlassFishVersion version = GlassFishVersion.GF_6_2_5; diff --git a/enterprise/glassfish.eecommon/nbproject/org-netbeans-modules-glassfish-eecommon.sig b/enterprise/glassfish.eecommon/nbproject/org-netbeans-modules-glassfish-eecommon.sig index 3f8581542beb..363d7ed1e7aa 100644 --- a/enterprise/glassfish.eecommon/nbproject/org-netbeans-modules-glassfish-eecommon.sig +++ b/enterprise/glassfish.eecommon/nbproject/org-netbeans-modules-glassfish-eecommon.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.59.0 +#Version 1.60.0 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/glassfish.eecommon/nbproject/project.properties b/enterprise/glassfish.eecommon/nbproject/project.properties index a9e548516f74..85211376ab37 100644 --- a/enterprise/glassfish.eecommon/nbproject/project.properties +++ b/enterprise/glassfish.eecommon/nbproject/project.properties @@ -18,7 +18,7 @@ is.autoload=true javac.source=11 javac.target=11 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.60.0 +spec.version.base=1.62.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/DomainEditor.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/DomainEditor.java index 7d00be2af894..ba9ff195d427 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/DomainEditor.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/DomainEditor.java @@ -242,7 +242,7 @@ public String[] getHttpProxyOptions(){ Document domainDoc = getDomainDocument(); NodeList javaConfigNodeList = domainDoc.getElementsByTagName("java-config"); if (javaConfigNodeList == null || javaConfigNodeList.getLength() == 0) { - return httpProxyOptions.toArray(new String[httpProxyOptions.size()]); + return httpProxyOptions.toArray(String[]::new); } NodeList jvmOptionNodeList = domainDoc.getElementsByTagName(CONST_JVM_OPTIONS); diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java index cb66083ad4f3..eed7b79be86c 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java @@ -81,6 +81,13 @@ public final class AppClientVersion extends J2EEBaseVersion { "10.0", 10000, // NOI18N "10.0", 10000 // NOI18N ); + + /** Represents application-client version 11.0 + */ + public static final AppClientVersion APP_CLIENT_11_0 = new AppClientVersion( + "11.0", 11000, // NOI18N + "11.0", 11000 // NOI18N + ); /** ----------------------------------------------------------------------- * Implementation */ @@ -122,6 +129,8 @@ public static AppClientVersion getAppClientVersion(String version) { result = APP_CLIENT_9_0; } else if(APP_CLIENT_10_0.toString().equals(version)) { result = APP_CLIENT_10_0; + } else if(APP_CLIENT_11_0.toString().equals(version)) { + result = APP_CLIENT_11_0; } return result; diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java index 382dc79a118d..61a37d8f3725 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java @@ -81,6 +81,13 @@ public final class ApplicationVersion extends J2EEBaseVersion { "10.0", 10000, // NOI18N "10.0", 10000 // NOI18N ); + + /** Represents application version 11.0 + */ + public static final ApplicationVersion APPLICATION_11_0 = new ApplicationVersion( + "11.0", 11000, // NOI18N + "11.0", 11000 // NOI18N + ); /** ----------------------------------------------------------------------- * Implementation diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java index 0f279f1c5f99..53a8d2676fd9 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java @@ -81,6 +81,14 @@ public final class EjbJarVersion extends J2EEBaseVersion { "4.0", 4000, // NOI18N "9.0", 9000 // NOI18N ); + + /** + * Represents ejbjar version 4.0.1 + */ + public static final EjbJarVersion EJBJAR_4_0_1 = new EjbJarVersion( + "4.0.1", 4010, // NOI18N + "10.0", 10000 // NOI18N + ); /** ----------------------------------------------------------------------- * Implementation */ diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java index 9208f7eb3bfb..6a5230180e5b 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java @@ -70,7 +70,7 @@ import org.openide.util.RequestProcessor; /** - * Basic Java EE server configuration API support for V2, V3 and V4 plugins. + * Basic Java/Jakarta EE server configuration API support for V2-V8 plugins. *

* @author Peter Williams, Tomas Kraus */ @@ -85,7 +85,7 @@ public abstract class GlassfishConfiguration implements //////////////////////////////////////////////////////////////////////////// /** GlassFish Java EE common module Logger. */ - private static final Logger LOGGER = Logger.getLogger("glassfish-eecommon"); + private static final Logger LOGGER = Logger.getLogger(GlassfishConfiguration.class.getName()); /** GlassFish resource file suffix is {@code .xml}. */ private static final String RESOURCE_FILES_SUFFIX = ".xml"; @@ -136,19 +136,7 @@ private static int[] versionToResourceFilesIndexes( if (version == null) { return new int[]{0,1}; } - // glassfish-resources.xml for v7 - if (GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { - return new int[]{0}; - } - // glassfish-resources.xml for v6 - if (GlassFishVersion.ge(version, GlassFishVersion.GF_6) || GlassFishVersion.ge(version, GlassFishVersion.GF_6_1_0)) { - return new int[]{0}; - } - // glassfish-resources.xml for v5 - if (GlassFishVersion.ge(version, GlassFishVersion.GF_5) || GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) { - return new int[]{0}; - } - // glassfish-resources.xml for v4 + // glassfish-resources.xml for v4 and onwards if (GlassFishVersion.ge(version, GlassFishVersion.GF_4)) { return new int[]{0}; } @@ -515,7 +503,8 @@ void internalSetAppServerVersion(ASDDVersion asVersion) { "gfv510ee8", "gfv6ee9", "gfv610ee9", - "gfv700ee10" + "gfv700ee10", + "gfv800ee11" }; protected ASDDVersion getTargetAppServerVersion() { @@ -567,7 +556,13 @@ static ASDDVersion getInstalledAppServerVersionFromDirectory(File asInstallFolde boolean geGF5 = false; boolean geGF6 = false; boolean geGF7 = false; + boolean geGF8 = false; if(schemaFolder.exists()){ + if(new File(schemaFolder, "jakartaee11.xsd").exists() && + new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()){ + geGF8 = true; + return ASDDVersion.GLASSFISH_8; + } if(new File(schemaFolder, "jakartaee10.xsd").exists() && new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()){ geGF7 = true; @@ -584,7 +579,7 @@ static ASDDVersion getInstalledAppServerVersionFromDirectory(File asInstallFolde return ASDDVersion.GLASSFISH_5_1; } } - if (!geGF5 && !geGF6 && !geGF7 && dtdFolder.exists()) { + if (!geGF5 && !geGF6 && !geGF7 && !geGF8 && dtdFolder.exists()) { if (new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()) { return ASDDVersion.SUN_APPSERVER_10_1; } diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java index 26855cab1b32..dcd0dd32683b 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java @@ -202,6 +202,12 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.SUN_APPSERVER_10_0; } else if (ServletVersion.SERVLET_4_0.equals(servletVersion)) { result = ASDDVersion.GLASSFISH_5_1; + } else if (ServletVersion.SERVLET_5_0.equals(servletVersion)) { + result = ASDDVersion.GLASSFISH_6; + } else if (ServletVersion.SERVLET_6_0.equals(servletVersion)) { + result = ASDDVersion.GLASSFISH_7; + } else if (ServletVersion.SERVLET_6_1.equals(servletVersion)) { + result = ASDDVersion.GLASSFISH_8; } return result; } @@ -236,6 +242,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_6; } else if (ServletVersion.SERVLET_6_0.equals(servletVersion)) { result = ASDDVersion.GLASSFISH_7; + } else if (ServletVersion.SERVLET_6_1.equals(servletVersion)) { + result = ASDDVersion.GLASSFISH_8; } return result; } @@ -275,6 +283,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_5_1; } else if (EjbJarVersion.EJBJAR_4_0.equals(ejbJarVersion)) { result = ASDDVersion.GLASSFISH_7; + } else if (EjbJarVersion.EJBJAR_4_0_1.equals(ejbJarVersion)) { + result = ASDDVersion.GLASSFISH_8; } return result; } @@ -314,6 +324,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_6; } else if (ApplicationVersion.APPLICATION_10_0.equals(applicationVersion)) { result = ASDDVersion.GLASSFISH_7; + } else if (ApplicationVersion.APPLICATION_11_0.equals(applicationVersion)) { + result = ASDDVersion.GLASSFISH_8; } return result; } @@ -353,6 +365,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_6; } else if (AppClientVersion.APP_CLIENT_10_0.equals(appClientVersion)) { result = ASDDVersion.GLASSFISH_7; + } else if (AppClientVersion.APP_CLIENT_11_0.equals(appClientVersion)) { + result = ASDDVersion.GLASSFISH_8; } return result; } diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ServletVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ServletVersion.java index e9b3ce87c064..e4db268c9fdf 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ServletVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ServletVersion.java @@ -81,6 +81,13 @@ public final class ServletVersion extends J2EEBaseVersion { "6.0", 6000, // NOI18N "10.0", 10000 // NOI18N ); + + /** Represents servlet version 6.1 + */ + public static final ServletVersion SERVLET_6_1 = new ServletVersion( + "6.1", 6100, // NOI18N + "11.0", 11000 // NOI18N + ); /** ----------------------------------------------------------------------- * Implementation diff --git a/enterprise/glassfish.javaee/manifest.mf b/enterprise/glassfish.javaee/manifest.mf index 04d77feac547..7ef8943b0656 100644 --- a/enterprise/glassfish.javaee/manifest.mf +++ b/enterprise/glassfish.javaee/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module: org.netbeans.modules.glassfish.javaee/0 OpenIDE-Module-Layer: org/netbeans/modules/glassfish/javaee/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/glassfish/javaee/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.serverplugins.javaee -OpenIDE-Module-Specification-Version: 1.64 +OpenIDE-Module-Specification-Version: 1.66 diff --git a/enterprise/glassfish.javaee/nbproject/org-netbeans-modules-glassfish-javaee.sig b/enterprise/glassfish.javaee/nbproject/org-netbeans-modules-glassfish-javaee.sig index c47fbfb241fe..5e4f6fb5c573 100644 --- a/enterprise/glassfish.javaee/nbproject/org-netbeans-modules-glassfish-javaee.sig +++ b/enterprise/glassfish.javaee/nbproject/org-netbeans-modules-glassfish-javaee.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.63 +#Version 1.64 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/AbstractHk2ConfigurationFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/AbstractHk2ConfigurationFactory.java index 05b729f23c50..0e4c91c26bd7 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/AbstractHk2ConfigurationFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/AbstractHk2ConfigurationFactory.java @@ -107,7 +107,10 @@ public ModuleConfiguration create(final @NonNull J2eeModule module, ? instance.getVersion() : null; try { Hk2DeploymentManager evaluatedDm = null; - if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { + if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe11() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe10() .getDisconnectedDeploymentManager(instanceUrl); } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_6_1_0)) { @@ -136,6 +139,10 @@ public ModuleConfiguration create(final @NonNull J2eeModule module, ? hk2dm : evaluatedDm; if (version != null + && GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { + retVal = new ModuleConfigurationImpl( + module, new Hk2Configuration(module, version), dm); + } else if (version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { retVal = new ModuleConfigurationImpl( module, new Hk2Configuration(module, version), dm); diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties index 0733a43ca8cd..bbb293440dce 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties @@ -50,6 +50,7 @@ LBL_V6ServerLibraries=GlassFish Server 6 Libraries LBL_V610ServerLibraries=GlassFish Server 6.1 Libraries LBL_V620ServerLibraries=GlassFish Server 6.2 Libraries LBL_V700ServerLibraries=GlassFish Server 7.0.0 Libraries +LBL_V800ServerLibraries=GlassFish Server 8.0.0 Libraries MSG_V1ServerPlatform=Unsupported GlassFish Server 1 Platform MSG_V2ServerPlatform=Unsupported GlassFish Server 2 Platform @@ -61,6 +62,7 @@ MSG_V6ServerPlatform=GlassFish Server 6 Platform MSG_V610ServerPlatform=GlassFish Server 6.1 Platform MSG_V620ServerPlatform=GlassFish Server 6.2 Platform MSG_V700ServerPlatform=GlassFish Server 7.0.0 Platform +MSG_V800ServerPlatform=GlassFish Server 8.0.0 Platform LBL_V3RunTimeDDCatalog=GlassFish Server 3 Catalog DESC_V3RunTimeDDCatalog=List of all the runtime descriptors DTDs for GlassFish Server 3 diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentFactory.java index ccb48cfe06b2..1b1b6e5214d2 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentFactory.java @@ -42,6 +42,7 @@ public class Hk2DeploymentFactory implements DeploymentFactory { private static Hk2DeploymentFactory jakartaee9Instance; private static Hk2DeploymentFactory jakartaee91Instance; private static Hk2DeploymentFactory jakartaee10Instance; + private static Hk2DeploymentFactory jakartaee11Instance; private String[] uriFragments; private String version; private String displayName; @@ -168,6 +169,22 @@ public static synchronized DeploymentFactory createJakartaEe10() { } return jakartaee10Instance; } + + /** + * + * @return + */ + public static synchronized DeploymentFactory createJakartaEe11() { + // FIXME -- these strings should come from some constant place + if (jakartaee11Instance == null) { + ServerUtilities tmp = ServerUtilities.getJakartaEe11Utilities(); + jakartaee11Instance = new Hk2DeploymentFactory(new String[]{"deployer:gfv800ee11:", "deployer:gfv8"}, "0.9", // NOI18N + NbBundle.getMessage(Hk2DeploymentFactory.class, "TXT_FactoryDisplayName")); // NOI18N + DeploymentFactoryManager.getInstance().registerDeploymentFactory(jakartaee11Instance); + jakartaee11Instance.setServerUtilities(tmp); + } + return jakartaee11Instance; + } /** * diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentManager.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentManager.java index e95b669d97d6..a77d6c3568ee 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentManager.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentManager.java @@ -426,7 +426,7 @@ public boolean isLocaleSupported(java.util.Locale locale) { } } } - return moduleList.size() > 0 ? moduleList.toArray(new TargetModuleID[moduleList.size()]) : + return moduleList.size() > 0 ? moduleList.toArray(TargetModuleID[]::new) : new TargetModuleID[0]; } diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformFactory.java index 8034e694a478..7f40ea6230e8 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformFactory.java @@ -67,6 +67,9 @@ public class Hk2JavaEEPlatformFactory extends J2eePlatformFactory { /** GlassFish V7 JakartaEE platform lookup key. */ private static final String V7_LOOKUP_KEY = "J2EE/DeploymentPlugins/gfv700ee10/Lookup"; + + /** GlassFish V8 JakartaEE platform lookup key. */ + private static final String V8_LOOKUP_KEY = "J2EE/DeploymentPlugins/gfv800ee11/Lookup"; /** GlassFish JavaEE platform factory singleton object. */ private static volatile Hk2JavaEEPlatformFactory instance; @@ -94,15 +97,18 @@ public static Hk2JavaEEPlatformFactory getFactory() { } /** - * Get GlassFish JavaEE platform name from bundle properties for given - * GlassFish server version. + * Get GlassFish Java/Jakarta EE platform name from bundle properties + * for given GlassFish server version. *

* @param version GlassFish server version used to pick up display name. * @return GlassFish JavaEE platform name related to given server version. */ private static String getDisplayName(final GlassFishVersion version) { final int ord = version.ordinal(); - if(ord >= GlassFishVersion.GF_7_0_0.ordinal()) { + if(ord >= GlassFishVersion.GF_8_0_0.ordinal()) { + return NbBundle.getMessage( + Hk2JavaEEPlatformFactory.class, "MSG_V800ServerPlatform"); + } else if(ord >= GlassFishVersion.GF_7_0_0.ordinal()) { return NbBundle.getMessage( Hk2JavaEEPlatformFactory.class, "MSG_V700ServerPlatform"); } else if(ord >= GlassFishVersion.GF_6_2_0.ordinal()) { @@ -137,15 +143,18 @@ private static String getDisplayName(final GlassFishVersion version) { } /** - * Get GlassFish JavaEE library name from bundle properties for given - * GlassFish server version. + * Get GlassFish Java/Jakarta EE library name from bundle properties + * for given GlassFish server version. *

* @param version GlassFish server version used to pick up display name. * @return GlassFish JavaEE library name related to given server version. */ private static String getLibraryName(final GlassFishVersion version) { final int ord = version.ordinal(); - if (ord >= GlassFishVersion.GF_7_0_0.ordinal()) { + if (ord >= GlassFishVersion.GF_8_0_0.ordinal()) { + return NbBundle.getMessage( + Hk2JavaEEPlatformFactory.class, "LBL_V800ServerLibraries"); + } else if (ord >= GlassFishVersion.GF_7_0_0.ordinal()) { return NbBundle.getMessage( Hk2JavaEEPlatformFactory.class, "LBL_V700ServerLibraries"); } else if (ord >= GlassFishVersion.GF_6_2_0.ordinal()) { @@ -180,7 +189,7 @@ private static String getLibraryName(final GlassFishVersion version) { } /** - * Get GlassFish JavaEE platform lookup key for given GlassFish + * Get GlassFish Java/Jakarta EE platform lookup key for given GlassFish * server version. *

* @param version GlassFish server version used to pick up lookup key. @@ -188,7 +197,9 @@ private static String getLibraryName(final GlassFishVersion version) { */ private static String getLookupKey(final GlassFishVersion version) { final int ord = version.ordinal(); - if (ord >= GlassFishVersion.GF_7_0_0.ordinal()){ + if (ord >= GlassFishVersion.GF_8_0_0.ordinal()){ + return V8_LOOKUP_KEY; + } else if (ord >= GlassFishVersion.GF_7_0_0.ordinal()){ return V7_LOOKUP_KEY; } else if (ord >= GlassFishVersion.GF_6_1_0.ordinal()){ return V610_LOOKUP_KEY; diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformImpl.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformImpl.java index 015988fe6dae..8004397d7096 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformImpl.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformImpl.java @@ -210,6 +210,10 @@ public static Profile[] nbJavaEEProfiles( break; case v10_0_0: profiles[index++] = Profile.JAKARTA_EE_10_FULL; break; + case v11_0_0_web: profiles[index++] = Profile.JAKARTA_EE_11_WEB; + break; + case v11_0_0: profiles[index++] = Profile.JAKARTA_EE_11_FULL; + break; } } else { profiles = new Profile[0]; @@ -509,7 +513,7 @@ public File[] getToolClasspathEntries(String toolName) { cPath.add(f); } } - return cPath.toArray(new File[cPath.size()]); + return cPath.toArray(File[]::new); } if (TOOL_WSCOMPILE.equals(toolName)) { @@ -522,7 +526,7 @@ public File[] getToolClasspathEntries(String toolName) { cPath.add(f); } } - return cPath.toArray(new File[cPath.size()]); + return cPath.toArray(File[]::new); } File domainDir; @@ -1026,7 +1030,7 @@ private boolean addJars(final Project project, Collection jars ){ else { classPathType = ClassPath.COMPILE; } - ProjectClassPathModifier.addRoots(urls.toArray( new URL[ urls.size()]), + ProjectClassPathModifier.addRoots(urls.toArray(URL[]::new), sourceRoot, classPathType ); } catch (UnsupportedOperationException | IOException ex) { diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxRpcStack.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxRpcStack.java index 69d5a1bf29e0..4cab01a93c21 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxRpcStack.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxRpcStack.java @@ -107,7 +107,7 @@ public URL[] getLibraries() { } } } - return cPath.toArray(new URL[cPath.size()]); + return cPath.toArray(URL[]::new); } } diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxWsStack.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxWsStack.java index f5f2048d4626..b07ff5ac8c7b 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxWsStack.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxWsStack.java @@ -73,33 +73,21 @@ public JaxWs get() { @Override public WSStackVersion getVersion() { Set supportedProfiles = platform.getSupportedProfiles(); - if (supportedProfiles.contains(Profile.JAKARTA_EE_10_FULL) - || supportedProfiles.contains(Profile.JAKARTA_EE_10_WEB) - || supportedProfiles.contains(Profile.JAKARTA_EE_9_1_FULL) - || supportedProfiles.contains(Profile.JAKARTA_EE_9_1_WEB) - || supportedProfiles.contains(Profile.JAKARTA_EE_9_FULL) - || supportedProfiles.contains(Profile.JAKARTA_EE_9_WEB) - || supportedProfiles.contains(Profile.JAKARTA_EE_8_FULL) - || supportedProfiles.contains(Profile.JAKARTA_EE_8_WEB) - || supportedProfiles.contains(Profile.JAVA_EE_8_FULL) - || supportedProfiles.contains(Profile.JAVA_EE_8_WEB) - || supportedProfiles.contains(Profile.JAVA_EE_7_FULL) - || supportedProfiles.contains(Profile.JAVA_EE_7_WEB) - || supportedProfiles.contains(Profile.JAVA_EE_6_FULL) - || supportedProfiles.contains(Profile.JAVA_EE_6_WEB)) { - // gfv3ee6 GF id - if (isMetroInstalled()) { - return WSStackVersion.valueOf(2, 2, 0, 0); - } - return WSStackVersion.valueOf(2, 1, 4, 1); - } - else { - // gfv3 GF id - if (isMetroInstalled()) { + + for (Profile profile : supportedProfiles) { + if (profile.isAtLeast(Profile.JAVA_EE_6_WEB)) { + // gfv3ee6 GF id + if (isMetroInstalled()) { + return WSStackVersion.valueOf(2, 2, 0, 0); + } return WSStackVersion.valueOf(2, 1, 4, 1); } - return WSStackVersion.valueOf(2, 1, 3, 0); } + // gfv3 GF id + if (isMetroInstalled()) { + return WSStackVersion.valueOf(2, 1, 4, 1); + } + return WSStackVersion.valueOf(2, 1, 3, 0); } @Override @@ -193,7 +181,7 @@ public URL[] getLibraries() { } } } - return cPath.toArray(new URL[cPath.size()]); + return cPath.toArray(URL[]::new); } } diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JpaSupportImpl.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JpaSupportImpl.java index cf0e55097954..9b0699d1e442 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JpaSupportImpl.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JpaSupportImpl.java @@ -51,16 +51,18 @@ private static class JpaSupportVector { * @param jpa_2_2 JPA 2.2 supported. * @param jpa_3_0 JPA 3.0 supported. * @param jpa_3_1 JPA 3.1 supported. + * @param jpa_3_2 JPA 3.2 supported. */ JpaSupportVector(boolean jpa_1_0, boolean jpa_2_0, boolean jpa_2_1, boolean jpa_2_2, - boolean jpa_3_0, boolean jpa_3_1) { + boolean jpa_3_0, boolean jpa_3_1, boolean jpa_3_2) { _1_0 = jpa_1_0; _2_0 = jpa_2_0; _2_1 = jpa_2_1; _2_2 = jpa_2_2; _3_0 = jpa_3_0; _3_1 = jpa_3_1; + _3_2 = jpa_3_2; } /** JPA 1.0 supported. */ @@ -80,6 +82,9 @@ private static class JpaSupportVector { /** JPA 3.1 supported. */ boolean _3_1; + + /** JPA 3.2 supported. */ + boolean _3_2; } //////////////////////////////////////////////////////////////////////////// @@ -95,14 +100,15 @@ private static class JpaSupportVector { /** * GlassFish JPA support matrix:

* - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * *
GlassFishJPA 1.0JPA 2.0JPA 2.1JPA 2.2JPA 3.0JPA 3.1
V1YESNONONONONO
V2YESNONONONONO
V3YESYESNONONONO
V4YESYESYESNONONO
V5YESYESYESYESNONO
V6NONONONOYESNO
V7NONONONOYESYES
JPA 2.2JPA 3.0JPA 3.1JPA 3.2
V1YESNONONONONONO
V2YESNONONONONONO
V3YESYESNONONONONO
V4YESYESYESNONONONO
V5YESYESYESYESNONONO
V6NONONONOYESNONO
V7NONONONOYESYESNO
V8NONONONOYESYESYES
*/ private static final JpaSupportVector jpaSupport[] @@ -117,7 +123,8 @@ private static class JpaSupportVector { GlassFishVersion.lt(version, GlassFishVersion.GF_6) && GlassFishVersion.ge(version, GlassFishVersion.GF_4), GlassFishVersion.lt(version, GlassFishVersion.GF_6) && GlassFishVersion.ge(version, GlassFishVersion.GF_5), GlassFishVersion.lt(version, GlassFishVersion.GF_7_0_0) && GlassFishVersion.ge(version, GlassFishVersion.GF_6), - GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0) + GlassFishVersion.lt(version, GlassFishVersion.GF_8_0_0) && GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0), + GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0) ); } } @@ -196,7 +203,8 @@ public JpaProvider getDefaultProvider() { instanceJpaSupport._2_1, instanceJpaSupport._2_2, instanceJpaSupport._3_0, - instanceJpaSupport._3_1); + instanceJpaSupport._3_1, + instanceJpaSupport._3_2); } } return defaultProvider; diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2OptionalFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2OptionalFactory.java index cddb782fcd35..8fb55ba79adf 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2OptionalFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2OptionalFactory.java @@ -103,6 +103,12 @@ public static Hk2OptionalFactory createJakartaEe10() { return null == t ? null : new Hk2OptionalFactory(Hk2DeploymentFactory.createJakartaEe10(), t, true); } + + public static Hk2OptionalFactory createJakartaEe11() { + ServerUtilities t = ServerUtilities.getJakartaEe11Utilities(); + return null == t ? null : new Hk2OptionalFactory(Hk2DeploymentFactory.createJakartaEe11(), + t, true); + } @Override public StartServer getStartServer(DeploymentManager dm) { diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEServerModuleFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEServerModuleFactory.java index ae15f4e28b14..3e77dc5538b5 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEServerModuleFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEServerModuleFactory.java @@ -183,6 +183,7 @@ private static boolean ensureEclipseLinkSupport(String installRoot) { libraryList.add(ServerUtilities.fileToUrl(f)); } } + // TODO: add support for JPA 3.x File j2eeDoc = InstalledFileLocator.getDefault().locate( "docs/" + PERSISTENCE_JAVADOC, @@ -241,7 +242,8 @@ private static boolean ensureCometSupport(String installRoot) { {"jackson-asl", "jackson-core-asl", "jersey-bundle", "jersey-gf-bundle", "jersey-multipart", "jettison", "mimepull", "jsr311-api"}; //NOI18N private static final String[] JAXRS_LIBRARIES_31 = - {"jackson-core-asl", "jackson-jaxrs", "jackson-mapper-asl", "jersey-client", "jersey-core", JERSEY_GF_SERVER, "jersey-json", "jersey-multipart", "jettison", "mimepull"}; //NOI18N + {"jackson-core-asl", "jackson-jaxrs", "jackson-mapper-asl", "jersey-client", + "jersey-core", JERSEY_GF_SERVER, "jersey-json", "jersey-multipart", "jettison", "mimepull"}; //NOI18N private static final String JAVA_EE_6_LIB = "Java-EE-GlassFish-v3"; // NOI18N private static final String JAVA_EE_5_LIB = "Java-EE-GlassFish-v3-Prelude"; // NOI18N @@ -250,6 +252,7 @@ private static boolean ensureCometSupport(String installRoot) { private static final String JAKARTA_EE_8_JAVADOC = "jakartaee8-doc-api.jar"; // NOI18N private static final String JAKARTA_EE_9_JAVADOC = "jakartaee9-doc-api.jar"; // NOI18N private static final String JAKARTA_EE_10_JAVADOC = "jakartaee10-doc-api.jar"; // NOI18N + private static final String JAKARTA_EE_11_JAVADOC = "jakartaee11-doc-api.jar"; // NOI18N private static boolean ensureGlassFishApiSupport(GlassFishServer server) { String installRoot = server.getServerRoot(); @@ -263,7 +266,11 @@ private static boolean ensureGlassFishApiSupport(GlassFishServer server) { } File j2eeDoc; - if (GlassFishVersion.ge(server.getVersion(), GlassFishVersion.GF_7_0_0)) { + if (GlassFishVersion.ge(server.getVersion(), GlassFishVersion.GF_8_0_0)) { + j2eeDoc = InstalledFileLocator.getDefault().locate( + "docs/" + JAKARTA_EE_11_JAVADOC, + Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); + } else if (GlassFishVersion.ge(server.getVersion(), GlassFishVersion.GF_7_0_0)) { j2eeDoc = InstalledFileLocator.getDefault().locate( "docs/" + JAKARTA_EE_10_JAVADOC, Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/RunTimeDDCatalog.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/RunTimeDDCatalog.java index 5ae0f41df8e6..a4542df2c588 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/RunTimeDDCatalog.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/RunTimeDDCatalog.java @@ -23,6 +23,7 @@ import java.beans.PropertyChangeListener; import java.io.File; import java.io.IOException; +import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Enumeration; import java.util.HashMap; @@ -44,6 +45,7 @@ import org.netbeans.modules.xml.catalog.spi.CatalogListener; import org.netbeans.modules.xml.catalog.spi.CatalogReader; import org.netbeans.spi.server.ServerInstanceProvider; +import org.openide.util.Utilities; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -57,10 +59,11 @@ * @author Ludo */ -public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogReader, CatalogDescriptor2,org.xml.sax.EntityResolver { - - private static final String XML_XSD="http://www.w3.org/2001/xml.xsd"; // NOI18N - private static final String XML_XSD_DEF="In due course, we should install the relevant ISO 2- and 3-letter codes as the enumerated possible values . . ."; // NOI18N +public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogReader, CatalogDescriptor2, org.xml.sax.EntityResolver { + + private static final Logger LOGGER = Logger.getLogger("glassfish-javaee"); + private static final String XML_XSD = "http://www.w3.org/2001/xml.xsd"; // NOI18N + private static final String XML_XSD_DEF = "In due course, we should install the relevant ISO 2- and 3-letter codes as the enumerated possible values . . ."; // NOI18N private static final String TypeToURLMap[] = { "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 J2EE Application 1.3//EN" , "sun-application_1_3-0.dtd" , "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 J2EE Application 1.4//EN" , "sun-application_1_4-0.dtd" , ///[THIS IS DEPRECATED] @@ -83,7 +86,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Servlet 2.3//EN" , "sun-web-app_2_3-0.dtd" , "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 Servlet 2.4//EN" , "sun-web-app_2_4-0.dtd" , ///[THIS IS DEPRECATED] "-//Sun Microsystems, Inc.//DTD Application Server 8.0 Servlet 2.4//EN" , "sun-web-app_2_4-0.dtd" , - "-//Sun Microsystems, Inc.//DTD Sun ONE Web Server 6.1 Servlet 2.3//EN" , "sun-web-app_2_3-1.dtd" , + "-//Sun Microsystems, Inc.//DTD Sun ONE Web Server 6.1 Servlet 2.3//EN" , "sun-web-app_2_3-1.dtd" , "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" , "sun-web-app_2_4-1.dtd" , "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" , "sun-web-app_2_5-0.dtd" , "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Application Client Container 1.0//EN" , "sun-application-client-container_1_0.dtd" , @@ -100,7 +103,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "-//Sun Microsystems Inc.//DTD GlassFish Communications Server 1.5 Domain//EN" ,"sun-domain_1_4.dtd", "-//Sun Microsystems Inc.//DTD GlassFish Communications Server 2.0 Domain//EN" ,"sun-domain_1_5.dtd", "-//Sun Microsystems, Inc.//DTD Application Server 9.0 SIP Servlet 1.1//EN" , "sun-sip-app_1_1-0.dtd", - + "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" , "application_1_3.dtd", "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" , "application_1_2.dtd", "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" , "ejb-jar_2_0.dtd", @@ -114,7 +117,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" , "web-jsptaglibrary_1_2.dtd", "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" , "web-jsptaglibrary_1_1.dtd", }; - + private static final String JavaEE6TypeToURLMap[] = { "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Java EE Application 6.0//EN" , "sun-application_6_0-0.dtd", "-//GlassFish.org//DTD GlassFish Application Server 3.1 Java EE Application 6.0//EN" , "glassfish-application_6_0-1.dtd", @@ -130,7 +133,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead /*******NetBeans 3.6 is NOT ready yet to support schemas for code completion... What a pity!: */ private static final String SchemaToURLMap[] = { - + "SCHEMA:http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" , "ejb-jar_2_1", "SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" , "ejb-jar_3_0", "SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" , "ejb-jar_3_1", @@ -150,6 +153,8 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_9.xsd" , "application_9", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_10.xsd" , "application-client_10", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_10.xsd" , "application_10", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_11.xsd" , "application-client_11", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_11.xsd" , "application_11", "SCHEMA:http://java.sun.com/xml/ns/j2ee/jax-rpc-ri-config.xsd" , "jax-rpc-ri-config", "SCHEMA:http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" , "connector_1_5", "SCHEMA:http://java.sun.com/xml/ns/javaee/connector_1_6.xsd" , "connector_1_6", @@ -178,13 +183,15 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/orm_2_2.xsd" , "orm_2_2", "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_0.xsd" , "orm_3_0", "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_1.xsd" , "orm_3_1", + "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_2.xsd" , "orm_3_2", "SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" , "persistence_1_0", "SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" , "persistence_2_0", "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" , "persistence_2_1", "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd" , "persistence_2_2", "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" , "persistence_3_0", + "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_2.xsd" , "persistence_3_2", }; - + private static final String JavaEE6SchemaToURLMap[] = { "SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" , "ejb-jar_3_1", @@ -204,8 +211,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:http://xmlns.oracle.com/weblogic/jdbc-data-source/1.0/jdbc-data-source.xsd", "jdbc-data-source", }; - private static Map ddCatalogMap = new HashMap<>(); -// private static RunTimeDDCatalog preludeDDCatalog; + private static final Map ddCatalogMap = new HashMap<>(); private static RunTimeDDCatalog javaEE6DDCatalog; private File platformRootDir=null; @@ -216,18 +222,28 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead /** Creates a new instance of RunTimeDDCatalog */ public RunTimeDDCatalog() { } - + public void setInstanceProvider(ServerInstanceProvider ip) { if (ddCatalogMap.get(ip) == null) { ddCatalogMap.put(ip, this); } } - /** Factory method providing catalog for XML completion of DD */ + /** + * Factory method providing catalog for XML completion of DD + * + * @param ip + * @return + */ public static RunTimeDDCatalog getRunTimeDDCatalog(ServerInstanceProvider ip){ return ddCatalogMap.get(ip); } - /** Factory method providing catalog for XML completion of DD */ + /** + * Factory method providing catalog for XML completion of DD + * + * @return + */ + @SuppressWarnings("AccessingNonPublicFieldOfAnotherObject") public static synchronized RunTimeDDCatalog getEE6RunTimeDDCatalog(){ if (javaEE6DDCatalog==null) { javaEE6DDCatalog = new RunTimeDDCatalog(); @@ -250,35 +266,37 @@ public Iterator getPublicIDs() { if (!platformRootDir.exists()) { return null; } - - String installRoot = platformRootDir.getAbsolutePath(); + + String installRoot = platformRootDir.getAbsolutePath(); if (installRoot == null) { return null; } - + List list = new ArrayList<>(); - for (int i=0;i catalogListeners = new ArrayList<>(1); - + + private final List catalogListeners = new ArrayList<>(1); + /** * Optional operation allowing to listen at catalog for changes. - * @throws UnsupportedOpertaionException if not supported by the implementation. + * + * @param listener */ @Override - public void addCatalogListener(CatalogListener l) { - if (null == l) + public void addCatalogListener(CatalogListener listener) { + if (null == listener) return; - if (catalogListeners.contains(l)) + if (catalogListeners.contains(listener)) return; - catalogListeners.add(l); + catalogListeners.add(listener); } - + /** * Optional operation couled with addCatalogListener. - * @throws UnsupportedOpertaionException if not supported by the implementation. + * + * @param listener */ @Override - public void removeCatalogListener(CatalogListener l) { - if (null == l) + public void removeCatalogListener(CatalogListener listener) { + if (null == listener) return; - catalogListeners.remove(l); + catalogListeners.remove(listener); } - + public void fireCatalogListeners() { for (CatalogListener l : catalogListeners) { l.notifyInvalidate(); } } - - /** Registers new listener. */ + + /** + * Registers new listener. + * + * @param propertyChangeListener + */ @Override - public void addPropertyChangeListener(PropertyChangeListener l) { + public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener) { } - + + /** + * Unregister the listener. + * + * @param propertyChangeListener + */ + @Override + public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener) { + } + /** * @return I18N display name */ @@ -416,7 +451,7 @@ public void addPropertyChangeListener(PropertyChangeListener l) { public String getDisplayName() { return NbBundle.getMessage(RunTimeDDCatalog.class, displayNameKey); } - + /** * Return visuaized state of given catalog. * @param type of icon defined by JavaBeans specs @@ -426,7 +461,7 @@ public String getDisplayName() { public String getIconResource(int type) { return "org/netbeans/modules/glassfish/javaee/resources/ServerInstanceIcon.png"; // NOI18N } - + /** * @return I18N short description */ @@ -434,12 +469,7 @@ public String getIconResource(int type) { public String getShortDescription() { return NbBundle.getMessage(RunTimeDDCatalog.class, shortDescriptionKey); } - - /** Unregister the listener. */ - @Override - public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { - } - + public static final String J2EE_NS = "http://java.sun.com/xml/ns/j2ee"; // NOI18N public static final String JAVAEE_NS = "http://java.sun.com/xml/ns/javaee"; // NOI18N public static final String NEW_JAVAEE_NS = "http://xmlns.jcp.org/xml/ns/javaee"; // NOI18N @@ -448,80 +478,82 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { public static final String IBM_J2EE_NS = "http://www.ibm.com/webservices/xsd"; // NOI18N private static final String XMLNS_ATTR="xmlns"; //NOI18N - // public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException, java.io.IOException { - // return null; - // } + private static final String EJB_JAR_TAG="ejb-jar"; //NOI18N private static final String EJBJAR_2_1_XSD="ejb-jar_2_1.xsd"; // NOI18N private static final String EJBJAR_2_1 = J2EE_NS+"/"+EJBJAR_2_1_XSD; // NOI18N public static final String EJBJAR_2_1_ID = "SCHEMA:"+EJBJAR_2_1; // NOI18N - + private static final String EJBJAR_3_0_XSD="ejb-jar_3_0.xsd"; // NOI18N private static final String EJBJAR_3_0 = JAVAEE_NS+"/"+EJBJAR_3_0_XSD; // NOI18N public static final String EJBJAR_3_0_ID = "SCHEMA:"+EJBJAR_3_0; // NOI18N - + private static final String EJBJAR_3_1_XSD="ejb-jar_3_1.xsd"; // NOI18N private static final String EJBJAR_3_1 = JAVAEE_NS+"/"+EJBJAR_3_1_XSD; // NOI18N public static final String EJBJAR_3_1_ID = "SCHEMA:"+EJBJAR_3_1; // NOI18N - + private static final String EJBJAR_3_2_XSD="ejb-jar_3_2.xsd"; // NOI18N private static final String EJBJAR_3_2 = NEW_JAVAEE_NS+"/"+EJBJAR_3_2_XSD; // NOI18N public static final String EJBJAR_3_2_ID = "SCHEMA:"+EJBJAR_3_2; // NOI18N - + private static final String EJBJAR_4_0_XSD="ejb-jar_4_0.xsd"; // NOI18N private static final String EJBJAR_4_0 = JAKARTAEE_NS+"/"+EJBJAR_4_0_XSD; // NOI18N public static final String EJBJAR_4_0_ID = "SCHEMA:"+EJBJAR_4_0; // NOI18N - + private static final String APP_TAG="application"; //NOI18N private static final String APP_1_4_XSD="application_1_4.xsd"; // NOI18N private static final String APP_1_4= J2EE_NS+"/"+APP_1_4_XSD; // NOI18N public static final String APP_1_4_ID = "SCHEMA:"+APP_1_4; // NOI18N - + private static final String APP_5_XSD="application_5.xsd"; // NOI18N private static final String APP_5= JAVAEE_NS+"/"+APP_5_XSD; // NOI18N public static final String APP_5_ID = "SCHEMA:"+APP_5; // NOI18N - + private static final String APP_6_XSD="application_6.xsd"; // NOI18N private static final String APP_6= JAVAEE_NS+"/"+APP_6_XSD; // NOI18N public static final String APP_6_ID = "SCHEMA:"+APP_6; // NOI18N - + private static final String APP_7_XSD="application_7.xsd"; // NOI18N private static final String APP_7= NEW_JAVAEE_NS+"/"+APP_7_XSD; // NOI18N public static final String APP_7_ID = "SCHEMA:"+APP_7; // NOI18N - + private static final String APP_8_XSD="application_8.xsd"; // NOI18N private static final String APP_8= NEW_JAVAEE_NS+"/"+APP_8_XSD; // NOI18N public static final String APP_8_ID = "SCHEMA:"+APP_8; // NOI18N - + private static final String APP_9_XSD="application_9.xsd"; // NOI18N private static final String APP_9= JAKARTAEE_NS+"/"+APP_9_XSD; // NOI18N public static final String APP_9_ID = "SCHEMA:"+APP_9; // NOI18N - + private static final String APP_10_XSD="application_10.xsd"; // NOI18N private static final String APP_10= JAKARTAEE_NS+"/"+APP_10_XSD; // NOI18N public static final String APP_10_ID = "SCHEMA:"+APP_10; // NOI18N - + + private static final String APP_11_XSD="application_11.xsd"; // NOI18N + private static final String APP_11= JAKARTAEE_NS+"/"+APP_11_XSD; // NOI18N + public static final String APP_11_ID = "SCHEMA:"+APP_11; // NOI18N + private static final String APPCLIENT_TAG="application-client"; //NOI18N private static final String APPCLIENT_1_4_XSD="application-client_1_4.xsd"; // NOI18N private static final String APPCLIENT_1_4= J2EE_NS+"/"+APPCLIENT_1_4_XSD; // NOI18N public static final String APPCLIENT_1_4_ID = "SCHEMA:"+APPCLIENT_1_4; // NOI18N - + private static final String APPCLIENT_5_XSD="application-client_5.xsd"; // NOI18N private static final String APPCLIENT_5= JAVAEE_NS+"/"+APPCLIENT_5_XSD; // NOI18N public static final String APPCLIENT_5_ID = "SCHEMA:"+APPCLIENT_5; // NOI18N - + private static final String APPCLIENT_6_XSD="application-client_6.xsd"; // NOI18N private static final String APPCLIENT_6= JAVAEE_NS+"/"+APPCLIENT_6_XSD; // NOI18N public static final String APPCLIENT_6_ID = "SCHEMA:"+APPCLIENT_6; // NOI18N - + private static final String APPCLIENT_7_XSD="application-client_7.xsd"; // NOI18N private static final String APPCLIENT_7= NEW_JAVAEE_NS+"/"+APPCLIENT_7_XSD; // NOI18N public static final String APPCLIENT_7_ID = "SCHEMA:"+APPCLIENT_7; // NOI18N - + private static final String APPCLIENT_8_XSD="application-client_8.xsd"; // NOI18N private static final String APPCLIENT_8= NEW_JAVAEE_NS+"/"+APPCLIENT_8_XSD; // NOI18N public static final String APPCLIENT_8_ID = "SCHEMA:"+APPCLIENT_8; // NOI18N - + private static final String APPCLIENT_9_XSD="application-client_9.xsd"; // NOI18N private static final String APPCLIENT_9= JAKARTAEE_NS+"/"+APPCLIENT_9_XSD; // NOI18N public static final String APPCLIENT_9_ID = "SCHEMA:"+APPCLIENT_9; // NOI18N @@ -530,6 +562,10 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String APPCLIENT_10= JAKARTAEE_NS+"/"+APPCLIENT_10_XSD; // NOI18N public static final String APPCLIENT_10_ID = "SCHEMA:"+APPCLIENT_10; // NOI18N + private static final String APPCLIENT_11_XSD="application-client_11.xsd"; // NOI18N + private static final String APPCLIENT_11= JAKARTAEE_NS+"/"+APPCLIENT_11_XSD; // NOI18N + public static final String APPCLIENT_11_ID = "SCHEMA:"+APPCLIENT_11; // NOI18N + private static final String WEBSERVICES_TAG="webservices"; //NOI18N private static final String WEBSERVICES_1_1_XSD="j2ee_web_services_1_1.xsd"; // NOI18N private static final String WEBSERVICES_1_1= IBM_J2EE_NS+"/"+WEBSERVICES_1_1_XSD; // NOI18N @@ -542,15 +578,15 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBSERVICES_1_2_XSD="javaee_web_services_1_2.xsd"; // NOI18N private static final String WEBSERVICES_1_2= JAVAEE_NS+"/"+WEBSERVICES_1_2_XSD; // NOI18N public static final String WEBSERVICES_1_2_ID = "SCHEMA:"+WEBSERVICES_1_2; // NOI18N - + private static final String WEBSERVICES_1_3_XSD="javaee_web_services_1_3.xsd"; // NOI18N private static final String WEBSERVICES_1_3= JAVAEE_NS+"/"+WEBSERVICES_1_3_XSD; // NOI18N public static final String WEBSERVICES_1_3_ID = "SCHEMA:"+WEBSERVICES_1_3; // NOI18N - + private static final String WEBSERVICES_1_4_XSD="javaee_web_services_1_4.xsd"; // NOI18N private static final String WEBSERVICES_1_4= NEW_JAVAEE_NS+"/"+WEBSERVICES_1_4_XSD; // NOI18N public static final String WEBSERVICES_1_4_ID = "SCHEMA:"+WEBSERVICES_1_4; // NOI18N - + private static final String WEBSERVICES_2_0_XSD="jakartaee_web_services_2_0.xsd"; // NOI18N private static final String WEBSERVICES_2_0= JAKARTAEE_NS+"/"+WEBSERVICES_2_0_XSD; // NOI18N public static final String WEBSERVICES_2_0_ID = "SCHEMA:"+WEBSERVICES_2_0; // NOI18N @@ -558,15 +594,15 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBSERVICES_CLIENT_1_2_XSD="javaee_web_services_client_1_2.xsd"; // NOI18N private static final String WEBSERVICES_CLIENT_1_2= JAVAEE_NS+"/"+WEBSERVICES_CLIENT_1_2_XSD; // NOI18N public static final String WEBSERVICES_CLIENT_1_2_ID = "SCHEMA:"+WEBSERVICES_CLIENT_1_2; // NOI18N - + private static final String WEBSERVICES_CLIENT_1_3_XSD="javaee_web_services_client_1_3.xsd"; // NOI18N private static final String WEBSERVICES_CLIENT_1_3= JAVAEE_NS+"/"+WEBSERVICES_CLIENT_1_3_XSD; // NOI18N public static final String WEBSERVICES_CLIENT_1_3_ID = "SCHEMA:"+WEBSERVICES_CLIENT_1_3; // NOI18N - + private static final String WEBSERVICES_CLIENT_1_4_XSD="javaee_web_services_client_1_4.xsd"; // NOI18N private static final String WEBSERVICES_CLIENT_1_4= NEW_JAVAEE_NS+"/"+WEBSERVICES_CLIENT_1_4_XSD; // NOI18N public static final String WEBSERVICES_CLIENT_1_4_ID = "SCHEMA:"+WEBSERVICES_CLIENT_1_4; // NOI18N - + private static final String WEBSERVICES_CLIENT_2_0_XSD="jakartaee_web_services_client_2_0.xsd"; // NOI18N private static final String WEBSERVICES_CLIENT_2_0= JAKARTAEE_NS+"/"+WEBSERVICES_CLIENT_2_0_XSD; // NOI18N public static final String WEBSERVICES_CLIENT_2_0_ID = "SCHEMA:"+WEBSERVICES_CLIENT_2_0; // NOI18N @@ -579,47 +615,47 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBAPP_3_0_XSD="web-app_3_0.xsd"; // NOI18N private static final String WEBAPP_3_0 = JAVAEE_NS+"/"+WEBAPP_3_0_XSD; // NOI18N public static final String WEBAPP_3_0_ID = "SCHEMA:"+WEBAPP_3_0; // NOI18N - + private static final String WEBCOMMON_3_0_XSD="web-common_3_0.xsd"; // NOI18N private static final String WEBCOMMON_3_0 = JAVAEE_NS+"/"+WEBCOMMON_3_0_XSD; // NOI18N public static final String WEBCOMMON_3_0_ID = "SCHEMA:"+WEBCOMMON_3_0; // NOI18N - + private static final String WEBFRAGMENT_3_0_XSD="web-fragment_3_0.xsd"; // NOI18N private static final String WEBFRAGMENT_3_0 = JAVAEE_NS+"/"+WEBFRAGMENT_3_0_XSD; // NOI18N public static final String WEBFRAGMENT_3_0_ID = "SCHEMA:"+WEBFRAGMENT_3_0; // NOI18N - + private static final String WEBAPP_3_1_XSD="web-app_3_1.xsd"; // NOI18N private static final String WEBAPP_3_1 = NEW_JAVAEE_NS+"/"+WEBAPP_3_1_XSD; // NOI18N public static final String WEBAPP_3_1_ID = "SCHEMA:"+WEBAPP_3_1; // NOI18N - + private static final String WEBCOMMON_3_1_XSD="web-common_3_1.xsd"; // NOI18N private static final String WEBCOMMON_3_1 = NEW_JAVAEE_NS+"/"+WEBCOMMON_3_1_XSD; // NOI18N public static final String WEBCOMMON_3_1_ID = "SCHEMA:"+WEBCOMMON_3_1; // NOI18N - + private static final String WEBFRAGMENT_3_1_XSD="web-fragment_3_1.xsd"; // NOI18N private static final String WEBFRAGMENT_3_1 = NEW_JAVAEE_NS+"/"+WEBFRAGMENT_3_1_XSD; // NOI18N public static final String WEBFRAGMENT_3_1_ID = "SCHEMA:"+WEBFRAGMENT_3_1; // NOI18N - + private static final String WEBAPP_4_0_XSD="web-app_4_0.xsd"; // NOI18N private static final String WEBAPP_4_0 = NEW_JAVAEE_NS+"/"+WEBAPP_4_0_XSD; // NOI18N public static final String WEBAPP_4_0_ID = "SCHEMA:"+WEBAPP_4_0; // NOI18N - + private static final String WEBCOMMON_4_0_XSD="web-common_4_0.xsd"; // NOI18N private static final String WEBCOMMON_4_0 = NEW_JAVAEE_NS+"/"+WEBCOMMON_4_0_XSD; // NOI18N public static final String WEBCOMMON_4_0_ID = "SCHEMA:"+WEBCOMMON_4_0; // NOI18N - + private static final String WEBFRAGMENT_4_0_XSD="web-fragment_4_0.xsd"; // NOI18N private static final String WEBFRAGMENT_4_0 = NEW_JAVAEE_NS+"/"+WEBFRAGMENT_4_0_XSD; // NOI18N public static final String WEBFRAGMENT_4_0_ID = "SCHEMA:"+WEBFRAGMENT_4_0; // NOI18N - + private static final String WEBAPP_5_0_XSD="web-app_5_0.xsd"; // NOI18N private static final String WEBAPP_5_0 = JAKARTAEE_NS+"/"+WEBAPP_5_0_XSD; // NOI18N public static final String WEBAPP_5_0_ID = "SCHEMA:"+WEBAPP_5_0; // NOI18N - + private static final String WEBCOMMON_5_0_XSD="web-common_5_0.xsd"; // NOI18N private static final String WEBCOMMON_5_0 = JAKARTAEE_NS+"/"+WEBCOMMON_5_0_XSD; // NOI18N public static final String WEBCOMMON_5_0_ID = "SCHEMA:"+WEBCOMMON_5_0; // NOI18N - + private static final String WEBFRAGMENT_5_0_XSD="web-fragment_5_0.xsd"; // NOI18N private static final String WEBFRAGMENT_5_0 = JAKARTAEE_NS+"/"+WEBFRAGMENT_5_0_XSD; // NOI18N public static final String WEBFRAGMENT_5_0_ID = "SCHEMA:"+WEBFRAGMENT_5_0; // NOI18N @@ -627,51 +663,65 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBAPP_6_0_XSD="web-app_6_0.xsd"; // NOI18N private static final String WEBAPP_6_0 = JAKARTAEE_NS+"/"+WEBAPP_6_0_XSD; // NOI18N public static final String WEBAPP_6_0_ID = "SCHEMA:"+WEBAPP_6_0; // NOI18N - + private static final String WEBCOMMON_6_0_XSD="web-common_6_0.xsd"; // NOI18N private static final String WEBCOMMON_6_0 = JAKARTAEE_NS+"/"+WEBCOMMON_6_0_XSD; // NOI18N public static final String WEBCOMMON_6_0_ID = "SCHEMA:"+WEBCOMMON_6_0; // NOI18N - + private static final String WEBFRAGMENT_6_0_XSD="web-fragment_6_0.xsd"; // NOI18N private static final String WEBFRAGMENT_6_0 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_0_XSD; // NOI18N public static final String WEBFRAGMENT_6_0_ID = "SCHEMA:"+WEBFRAGMENT_6_0; // NOI18N + private static final String WEBAPP_6_1_XSD="web-app_6_1.xsd"; // NOI18N + private static final String WEBAPP_6_1 = JAKARTAEE_NS+"/"+WEBAPP_6_1_XSD; // NOI18N + public static final String WEBAPP_6_1_ID = "SCHEMA:"+WEBAPP_6_1; // NOI18N + + private static final String WEBCOMMON_6_1_XSD="web-common_6_1.xsd"; // NOI18N + private static final String WEBCOMMON_6_1 = JAKARTAEE_NS+"/"+WEBCOMMON_6_1_XSD; // NOI18N + public static final String WEBCOMMON_6_1_ID = "SCHEMA:"+WEBCOMMON_6_1; // NOI18N + + private static final String WEBFRAGMENT_6_1_XSD="web-fragment_6_1.xsd"; // NOI18N + private static final String WEBFRAGMENT_6_1 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_1_XSD; // NOI18N + public static final String WEBFRAGMENT_6_1_ID = "SCHEMA:"+WEBFRAGMENT_6_1; // NOI18N + public static final String PERSISTENCE_NS = "http://java.sun.com/xml/ns/persistence"; // NOI18N public static final String NEW_PERSISTENCE_NS = "http://xmlns.jcp.org/xml/ns/persistence"; // NOI18N public static final String JAKARTA_PERSISTENCE_NS = "https://jakarta.ee/xml/ns/persistence"; // NOI18N - + private static final String PERSISTENCE_TAG="persistence"; //NOI18N - private static final String PERSISTENCE_XSD="persistence_1_0.xsd"; // NOI18N private static final String PERSISTENCE = PERSISTENCE_NS+"/"+PERSISTENCE_XSD; // NOI18N - public static final String PERSISTENCE_ID = "SCHEMA:"+PERSISTENCE; // NOI18N - + public static final String PERSISTENCE_ID = "SCHEMA:"+PERSISTENCE; // NOI18N + private static final String PERSISTENCE_2_0_XSD="persistence_2_0.xsd"; // NOI18N private static final String PERSISTENCE_2_0 = PERSISTENCE_NS+"/"+PERSISTENCE_2_0_XSD; // NOI18N - public static final String PERSISTENCE_2_0_ID = "SCHEMA:"+PERSISTENCE_2_0; // NOI18N - + public static final String PERSISTENCE_2_0_ID = "SCHEMA:"+PERSISTENCE_2_0; // NOI18N + private static final String PERSISTENCE_2_1_XSD="persistence_2_1.xsd"; // NOI18N private static final String PERSISTENCE_2_1 = NEW_PERSISTENCE_NS+"/"+PERSISTENCE_2_1_XSD; // NOI18N - public static final String PERSISTENCE_2_1_ID = "SCHEMA:"+PERSISTENCE_2_1; // NOI18N - + public static final String PERSISTENCE_2_1_ID = "SCHEMA:"+PERSISTENCE_2_1; // NOI18N + private static final String PERSISTENCE_2_2_XSD="persistence_2_2.xsd"; // NOI18N private static final String PERSISTENCE_2_2 = NEW_PERSISTENCE_NS+"/"+PERSISTENCE_2_2_XSD; // NOI18N - public static final String PERSISTENCE_2_2_ID = "SCHEMA:"+PERSISTENCE_2_2; // NOI18N - + public static final String PERSISTENCE_2_2_ID = "SCHEMA:"+PERSISTENCE_2_2; // NOI18N + private static final String PERSISTENCE_3_0_XSD="persistence_3_0.xsd"; // NOI18N private static final String PERSISTENCE_3_0 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_0_XSD; // NOI18N - public static final String PERSISTENCE_3_0_ID = "SCHEMA:"+PERSISTENCE_3_0; // NOI18N - + public static final String PERSISTENCE_3_0_ID = "SCHEMA:"+PERSISTENCE_3_0; // NOI18N + private static final String PERSISTENCE_3_1_XSD="persistence_3_0.xsd"; // NOI18N private static final String PERSISTENCE_3_1 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_1_XSD; // NOI18N - public static final String PERSISTENCE_3_1_ID = "SCHEMA:"+PERSISTENCE_3_1; // NOI18N - + public static final String PERSISTENCE_3_1_ID = "SCHEMA:"+PERSISTENCE_3_1; // NOI18N + + private static final String PERSISTENCE_3_2_XSD="persistence_3_2.xsd"; // NOI18N + private static final String PERSISTENCE_3_2 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_2_XSD; // NOI18N + public static final String PERSISTENCE_3_2_ID = "SCHEMA:"+PERSISTENCE_3_2; // NOI18N + public static final String PERSISTENCEORM_NS = "http://java.sun.com/xml/ns/persistence/orm"; // NOI18N public static final String NEW_PERSISTENCEORM_NS = "http://xmlns.jcp.org/xml/ns/persistence/orm"; // NOI18N public static final String JAKARTA_PERSISTENCEORM_NS = "https://jakarta.ee/xml/ns/persistence/orm"; // NOI18N - + private static final String PERSISTENCEORM_TAG="entity-mappings"; //NOI18N - private static final String PERSISTENCEORM_XSD="orm_1_0.xsd"; // NOI18N private static final String PERSISTENCEORM = PERSISTENCE_NS+"/"+PERSISTENCEORM_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_ID = "SCHEMA:"+PERSISTENCEORM; // NOI18N @@ -679,29 +729,71 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String PERSISTENCEORM_2_0_XSD="orm_2_0.xsd"; // NOI18N private static final String PERSISTENCEORM_2_0 = PERSISTENCE_NS+"/"+PERSISTENCEORM_2_0_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_2_0_ID = "SCHEMA:"+PERSISTENCEORM_2_0; // NOI18N - + private static final String PERSISTENCEORM_2_1_XSD="orm_2_1.xsd"; // NOI18N private static final String PERSISTENCEORM_2_1 = NEW_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_2_1_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_2_1_ID = "SCHEMA:"+PERSISTENCEORM_2_1; // NOI18N - + private static final String PERSISTENCEORM_2_2_XSD="orm_2_2.xsd"; // NOI18N private static final String PERSISTENCEORM_2_2 = NEW_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_2_2_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_2_2_ID = "SCHEMA:"+PERSISTENCEORM_2_2; // NOI18N - + private static final String PERSISTENCEORM_3_0_XSD="orm_3_0.xsd"; // NOI18N private static final String PERSISTENCEORM_3_0 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_0_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_3_0_ID = "SCHEMA:"+PERSISTENCEORM_3_0; // NOI18N - + private static final String PERSISTENCEORM_3_1_XSD="orm_3_1.xsd"; // NOI18N private static final String PERSISTENCEORM_3_1 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_1_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_3_1_ID = "SCHEMA:"+PERSISTENCEORM_3_1; // NOI18N - + + private static final String PERSISTENCEORM_3_2_XSD="orm_3_2.xsd"; // NOI18N + private static final String PERSISTENCEORM_3_2 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_2_XSD; // NOI18N yes not ORM NS!!! + public static final String PERSISTENCEORM_3_2_ID = "SCHEMA:"+PERSISTENCEORM_3_2; // NOI18N + + private static final String[] SUPPORTED_SCHEMAS = new String[]{ + // ejb + EJBJAR_2_1_XSD, EJBJAR_3_0_XSD, EJBJAR_3_1_XSD, EJBJAR_3_2_XSD, EJBJAR_4_0_XSD, + // application & application-client + APP_1_4_XSD, APPCLIENT_1_4_XSD, APP_5_XSD, APPCLIENT_5_XSD, + APP_6_XSD, APPCLIENT_6_XSD, APP_7_XSD, APPCLIENT_7_XSD, + APP_8_XSD, APPCLIENT_8_XSD, APP_9_XSD, APPCLIENT_9_XSD, + APP_10_XSD, APPCLIENT_10_XSD, APP_11_XSD, APPCLIENT_11_XSD, + //web-app, web-common & web-fragment + WEBAPP_2_5_XSD, + WEBAPP_3_0_XSD, WEBFRAGMENT_3_0_XSD, WEBCOMMON_3_0_XSD, + WEBAPP_3_1_XSD, WEBFRAGMENT_3_1_XSD, WEBCOMMON_3_1_XSD, + WEBAPP_4_0_XSD, WEBFRAGMENT_4_0_XSD, WEBCOMMON_4_0_XSD, + WEBAPP_5_0_XSD, WEBFRAGMENT_5_0_XSD, WEBCOMMON_5_0_XSD, + WEBAPP_6_0_XSD, WEBFRAGMENT_6_0_XSD, WEBCOMMON_6_0_XSD, + WEBAPP_6_1_XSD, WEBFRAGMENT_6_1_XSD, WEBCOMMON_6_1_XSD, + //persistence & orm + PERSISTENCE_XSD, PERSISTENCEORM_XSD, + PERSISTENCE_2_0_XSD, PERSISTENCEORM_2_0_XSD, + PERSISTENCE_2_1_XSD, PERSISTENCEORM_2_1_XSD, + PERSISTENCE_2_2_XSD, PERSISTENCEORM_2_2_XSD, + PERSISTENCE_3_0_XSD, PERSISTENCEORM_3_0_XSD, + PERSISTENCE_3_1_XSD, PERSISTENCEORM_3_1_XSD, + PERSISTENCE_3_2_XSD, PERSISTENCEORM_3_2_XSD, + //webservice & webservice-client + WEBSERVICES_1_1_XSD, WEBSERVICES_CLIENT_1_1_XSD, + WEBSERVICES_1_2_XSD, WEBSERVICES_CLIENT_1_2_XSD, + WEBSERVICES_1_3_XSD, WEBSERVICES_CLIENT_1_3_XSD, + WEBSERVICES_1_4_XSD, WEBSERVICES_CLIENT_1_4_XSD, + WEBSERVICES_2_0_XSD, WEBSERVICES_CLIENT_2_0_XSD, + // weblogic + "weblogic-web-app.xsd", "weblogic-ejb-jar.xsd", //NOI18N + "weblogic-application.xsd", "weblogic-application-client.xsd", //NOI18N + "weblogic-connector.xsd", "weblogic-javaee.xsd", //NOI18N + "weblogic-jms.xsd", "weblogic-webservices.xsd", //NOI18N + "jdbc-data-source.xsd" + }; + public String getFullURLFromSystemId(String systemId){ return null; - + } - - private static String SCHEMASLOCATION=null; + + private static File SCHEMASLOCATION=null; /** * Resolves schema definition file for deployment descriptor (spec.2_4) * @param publicId publicId for resolved entity (null in our case) @@ -710,7 +802,7 @@ public String getFullURLFromSystemId(String systemId){ */ @Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { - + if (SCHEMASLOCATION == null) { if (platformRootDir == null) { return null; @@ -718,171 +810,41 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc if (!platformRootDir.exists()) { return null; } - - String installRoot = platformRootDir.getAbsolutePath(); //System.getProperty("com.sun.aas.installRoot"); - if (installRoot==null) + + String installRoot = platformRootDir.getAbsolutePath(); //System.getProperty("com.sun.aas.installRoot"); + if (installRoot == null) { return null; + } File f = new File(installRoot); - if (f.exists()==false) + if (!f.exists()) { return null; - File file = new File(installRoot+"/lib/schemas/"); - SCHEMASLOCATION = ""; - try{ - SCHEMASLOCATION= file.toURI().toURL().toExternalForm(); - }catch(Exception e){ - Logger.getLogger("glassfish-javaee").log(Level.INFO, file.getAbsolutePath(), e); // NOI18N - } - } - - if (systemId != null) { - // ejb - if ( systemId.endsWith(EJBJAR_2_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+EJBJAR_2_1_XSD); - } else if ( systemId.endsWith(EJBJAR_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+EJBJAR_3_0_XSD); - } else if ( systemId.endsWith(EJBJAR_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+EJBJAR_3_1_XSD); - } else if ( systemId.endsWith(EJBJAR_3_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+EJBJAR_3_2_XSD); - } else if ( systemId.endsWith(EJBJAR_4_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+EJBJAR_4_0_XSD); - } - // application & application-client - else if ( systemId.endsWith(APP_1_4_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APP_1_4_XSD); - } else if ( systemId.endsWith(APPCLIENT_1_4_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APPCLIENT_1_4_XSD); - } else if ( systemId.endsWith(APP_5_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APP_5_XSD); - } else if ( systemId.endsWith(APPCLIENT_5_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APPCLIENT_5_XSD); - } else if ( systemId.endsWith(APP_6_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APP_6_XSD); - } else if ( systemId.endsWith(APPCLIENT_6_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APPCLIENT_6_XSD); - } else if ( systemId.endsWith(APP_7_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APP_7_XSD); - } else if ( systemId.endsWith(APPCLIENT_7_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APPCLIENT_7_XSD); - } else if ( systemId.endsWith(APP_8_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APP_8_XSD); - } else if ( systemId.endsWith(APPCLIENT_8_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APPCLIENT_8_XSD); - } else if ( systemId.endsWith(APP_9_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APP_9_XSD); - } else if ( systemId.endsWith(APPCLIENT_9_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APPCLIENT_9_XSD); - } else if ( systemId.endsWith(APP_10_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APP_10_XSD); - } else if ( systemId.endsWith(APPCLIENT_10_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+APPCLIENT_10_XSD); } - //web-app, web-common & web-fragment - else if ( systemId.endsWith(WEBAPP_2_5_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBAPP_2_5_XSD); - } else if ( systemId.endsWith(WEBAPP_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBAPP_3_0_XSD); - } else if ( systemId.endsWith(WEBFRAGMENT_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBFRAGMENT_3_0_XSD); - } else if ( systemId.endsWith(WEBCOMMON_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBCOMMON_3_0_XSD); - } else if ( systemId.endsWith(WEBAPP_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBAPP_3_1_XSD); - } else if ( systemId.endsWith(WEBFRAGMENT_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBFRAGMENT_3_1_XSD); - } else if ( systemId.endsWith(WEBCOMMON_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBCOMMON_3_1_XSD); - } else if ( systemId.endsWith(WEBAPP_4_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBAPP_4_0_XSD); - } else if ( systemId.endsWith(WEBFRAGMENT_4_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBFRAGMENT_4_0_XSD); - } else if ( systemId.endsWith(WEBCOMMON_4_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBCOMMON_4_0_XSD); - } else if ( systemId.endsWith(WEBAPP_5_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBAPP_5_0_XSD); - } else if ( systemId.endsWith(WEBFRAGMENT_5_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBFRAGMENT_5_0_XSD); - } else if ( systemId.endsWith(WEBCOMMON_5_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBCOMMON_5_0_XSD); - } else if ( systemId.endsWith(WEBAPP_6_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBAPP_6_0_XSD); - } else if ( systemId.endsWith(WEBFRAGMENT_6_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBFRAGMENT_6_0_XSD); - } else if ( systemId.endsWith(WEBCOMMON_6_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBCOMMON_6_0_XSD); - } - //persistence & orm - else if ( systemId.endsWith(PERSISTENCEORM_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCEORM_XSD); - } else if ( systemId.endsWith(PERSISTENCE_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCE_XSD); - } else if ( systemId.endsWith(PERSISTENCEORM_2_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCEORM_2_0_XSD); - } else if ( systemId.endsWith(PERSISTENCE_2_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCE_2_0_XSD); - } else if ( systemId.endsWith(PERSISTENCEORM_2_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCEORM_2_1_XSD); - } else if ( systemId.endsWith(PERSISTENCE_2_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCE_2_1_XSD); - } else if ( systemId.endsWith(PERSISTENCEORM_2_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCEORM_2_2_XSD); - } else if ( systemId.endsWith(PERSISTENCE_2_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCE_2_2_XSD); - } else if ( systemId.endsWith(PERSISTENCEORM_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCEORM_3_0_XSD); - } else if ( systemId.endsWith(PERSISTENCEORM_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCEORM_3_1_XSD); - } else if ( systemId.endsWith(PERSISTENCE_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCE_3_0_XSD); + File f2 = new File(installRoot, "/lib/schemas/"); + if (!f2.exists()) { + return null; } - //webservice & webservice-client - else if ( systemId.endsWith(WEBSERVICES_1_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_1_1_XSD); - } else if ( systemId.endsWith(WEBSERVICES_1_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_1_2_XSD); - } else if ( systemId.endsWith(WEBSERVICES_1_3_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_1_3_XSD); - } else if ( systemId.endsWith(WEBSERVICES_1_4_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_1_4_XSD); - } else if ( systemId.endsWith(WEBSERVICES_2_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_2_0_XSD); - } else if ( systemId.endsWith(WEBSERVICES_CLIENT_1_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_CLIENT_1_1_XSD); - } else if ( systemId.endsWith(WEBSERVICES_CLIENT_1_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_CLIENT_1_2_XSD); - } else if ( systemId.endsWith(WEBSERVICES_CLIENT_1_3_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_CLIENT_1_3_XSD); - } else if ( systemId.endsWith(WEBSERVICES_CLIENT_1_4_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_CLIENT_1_4_XSD); - } else if ( systemId.endsWith(WEBSERVICES_CLIENT_2_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+WEBSERVICES_CLIENT_2_0_XSD); + SCHEMASLOCATION = f2; + } + + if (systemId != null) { + for(String schema : SUPPORTED_SCHEMAS) { + if (systemId.endsWith(schema)) { + File schemaFile = new File(SCHEMASLOCATION, schema); + if(! schemaFile.exists()) { + return null; + } else { + return new org.xml.sax.InputSource(Utilities.toURI(schemaFile).toURL().toExternalForm()); + } + } } - // weblogic - else if ( systemId.endsWith("weblogic-web-app.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"weblogic-web-app.xsd"); //NOI18N - } else if ( systemId.endsWith("weblogic-ejb-jar.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"weblogic-ejb-jar.xsd"); //NOI18N - } else if ( systemId.endsWith("weblogic-application.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"weblogic-application.xsd"); //NOI18N - } else if ( systemId.endsWith("weblogic-application-client.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"weblogic-application-client.xsd"); //NOI18N - } else if ( systemId.endsWith("weblogic-connector.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"weblogic-connector.xsd"); //NOI18N - } else if ( systemId.endsWith("weblogic-javaee.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"weblogic-javaee.xsd"); //NOI18N - } else if ( systemId.endsWith("weblogic-jms.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"weblogic-jms.xsd"); //NOI18N - } else if ( systemId.endsWith("weblogic-webservices.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"weblogic-webservices.xsd"); //NOI18N - } else if ( systemId.endsWith("jdbc-data-source.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION+"jdbc-data-source.xsd"); //NOI18N - } else if (XML_XSD.equals(systemId)) { + if (XML_XSD.equals(systemId)) { return new org.xml.sax.InputSource(new java.io.StringReader(XML_XSD_DEF)); } } + return null; } - + @Override public Enumeration enabled(GrammarEnvironment ctx) { if (ctx.getFileObject() == null) return null; @@ -895,16 +857,16 @@ public Enumeration enabled(GrammarEnvironment ctx) { Element element = (Element) next; String tag = element.getTagName(); String xmlns = element.getAttribute(XMLNS_ATTR); - if ( xmlns != null && ( EJB_JAR_TAG.equals(tag) || APP_TAG.equals(tag) - || WEBAPP_TAG.equals(tag) || APPCLIENT_TAG.equals(tag) - || PERSISTENCEORM_TAG.equals(tag) || PERSISTENCE_TAG.equals(tag) - || WEBSERVICES_TAG.equals(tag) ) ) { // NOI18N - - if ( J2EE_NS.equals(xmlns) - || JAVAEE_NS.equals(xmlns) - || NEW_JAVAEE_NS.equals(xmlns) - || JAKARTAEE_NS.equals(xmlns) ) { // NOI18N - Vector v = new Vector(); + if (xmlns != null && (EJB_JAR_TAG.equals(tag) || APP_TAG.equals(tag) + || WEBAPP_TAG.equals(tag) || APPCLIENT_TAG.equals(tag) + || PERSISTENCEORM_TAG.equals(tag) || PERSISTENCE_TAG.equals(tag) + || WEBSERVICES_TAG.equals(tag))) { // NOI18N + + if (J2EE_NS.equals(xmlns) + || JAVAEE_NS.equals(xmlns) + || NEW_JAVAEE_NS.equals(xmlns) + || JAKARTAEE_NS.equals(xmlns)) { // NOI18N + Vector v = new Vector<>(); v.add(next); return v.elements(); // return org.openide.util.Enumerations.singleton(next); @@ -914,12 +876,12 @@ public Enumeration enabled(GrammarEnvironment ctx) { } return null; } - + @Override public FeatureDescriptor getDescriptor() { return new FeatureDescriptor(); } - + /** Returns pseudo DTD for code completion */ @Override @@ -931,16 +893,16 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { //System.out.println(is.getSystemId()); //System.out.println(is); if (catalog != null) { - + EntityResolver resolver = catalog.getEntityResolver(); if (resolver != null) { try { - + if (ctx.getFileObject() == null) { return null; } - InputSource inputSource = null; - + InputSource inputSource = null; + String mimeType = ctx.getFileObject().getMIMEType(); if (mimeType == null){ return null; @@ -961,6 +923,12 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-ejbjar2.1": // NOI18N inputSource = resolver.resolveEntity(EJBJAR_2_1_ID, ""); break; + case "text/x-dd-application11.0": // NOI18N + inputSource = resolver.resolveEntity(APP_11_ID, ""); + break; + case "text/x-dd-application10.0": // NOI18N + inputSource = resolver.resolveEntity(APP_10_ID, ""); + break; case "text/x-dd-application9.0": // NOI18N inputSource = resolver.resolveEntity(APP_9_ID, ""); break; @@ -979,6 +947,12 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-application1.4": // NOI18N inputSource = resolver.resolveEntity(APP_1_4_ID, ""); break; + case "text/x-dd-client11.0": // NOI18N + inputSource = resolver.resolveEntity(APPCLIENT_11_ID, ""); + break; + case "text/x-dd-client10.0": // NOI18N + inputSource = resolver.resolveEntity(APPCLIENT_10_ID, ""); + break; case "text/x-dd-client9.0": // NOI18N inputSource = resolver.resolveEntity(APPCLIENT_9_ID, ""); break; @@ -997,6 +971,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-client1.4": // NOI18N inputSource = resolver.resolveEntity(APPCLIENT_1_4_ID, ""); break; + case "text/x-dd-servlet6.1": // NOI18N + inputSource = resolver.resolveEntity(WEBAPP_6_1_ID, ""); + break; case "text/x-dd-servlet6.0": // NOI18N inputSource = resolver.resolveEntity(WEBAPP_6_0_ID, ""); break; @@ -1015,6 +992,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-servlet2.5": // NOI18N inputSource = resolver.resolveEntity(WEBAPP_2_5_ID, ""); break; + case "text/x-dd-servlet-fragment6.1": // NOI18N + inputSource = resolver.resolveEntity(WEBFRAGMENT_6_1_ID, ""); + break; case "text/x-dd-servlet-fragment6.0": // NOI18N inputSource = resolver.resolveEntity(WEBFRAGMENT_6_0_ID, ""); break; @@ -1030,6 +1010,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-servlet-fragment3.0": // NOI18N inputSource = resolver.resolveEntity(WEBFRAGMENT_3_0_ID, ""); break; + case "text/x-persistence3.2": // NOI18N + inputSource = resolver.resolveEntity(PERSISTENCE_3_2_ID, ""); + break; case "text/x-persistence3.1": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCE_3_1_ID, ""); break; @@ -1048,6 +1031,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-persistence1.0": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCE_ID, ""); break; + case "text/x-orm3.2": // NOI18N + inputSource = resolver.resolveEntity(PERSISTENCEORM_3_2_ID, ""); + break; case "text/x-orm3.1": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCEORM_3_1_ID, ""); break; @@ -1073,7 +1059,7 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { if (inputSource != null) { return DTDUtil.parseDTD(true, inputSource); } - + if (is.getSystemId().endsWith("webservices.xml") ) { // NOI18N // System.out.println("webservices tag"); inputSource = resolver.resolveEntity(WEBSERVICES_1_1_ID, ""); @@ -1081,11 +1067,11 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { return DTDUtil.parseDTD(true, inputSource); } } - + } catch(SAXException e) { } catch(java.io.IOException e) { //System.out.println("eeee"); - e.printStackTrace(); + LOGGER.log(Level.WARNING, null, e); } } } @@ -1094,6 +1080,8 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { /** * Get registered URI for the given name or null if not registered. + * + * @param name * @return null if not registered */ @Override @@ -1105,34 +1093,37 @@ public String resolveURI(String name) { if (!platformRootDir.exists()) { return null; } - String installRoot = platformRootDir.getAbsolutePath(); - String prefix =""; - File file = new File(installRoot+"/lib/schemas/"); - try{ - prefix= file.toURI().toURL().toExternalForm(); - }catch(Exception e){ - Logger.getLogger("glassfish-javaee").log(Level.INFO, file.getAbsolutePath(), e); // NOI18N + String installRoot = platformRootDir.getAbsolutePath(); + String prefix = ""; + File file = new File(installRoot + "/lib/schemas/"); + try { + prefix = Utilities.toURI(file).toURL().toExternalForm(); + } catch (RuntimeException | MalformedURLException e) { + LOGGER.log(Level.INFO, file.getAbsolutePath(), e); // NOI18N } - if (name.equals("http://java.sun.com/xml/ns/jax-rpc/ri/config")){ - return prefix +"jax-rpc-ri-config.xsd"; + if (name.equals("http://java.sun.com/xml/ns/jax-rpc/ri/config")) { + return prefix + "jax-rpc-ri-config.xsd"; } // if (name.equals("http://java.sun.com/xml/ns/persistence")){ // System.out.println("prefix +persistence.xsd="+ prefix +"persistence.xsd"); // return prefix +"persistence.xsd"; -// } +// } // ludo: this is meant to be this way. - if (name.equals("http://java.sun.com/xml/ns/j2eeppppppp")){ - return prefix +"j2ee_web_services_1_1.xsd"; + if (name.equals("http://java.sun.com/xml/ns/j2eeppppppp")) { + return prefix + "j2ee_web_services_1_1.xsd"; } - + return null; } + /** * Get registered URI for the given publicId or null if not registered. + * + * @param publicId * @return null if not registered - */ + */ @Override public String resolvePublic(String publicId) { return null; - } + } } diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/DbUtil.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/DbUtil.java index ac5c78a9a261..f5dafdf696bd 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/DbUtil.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/DbUtil.java @@ -81,7 +81,7 @@ public static Map normalizePoolMap(Map poolValue String password = poolValues.get(__Password); String user = poolValues.get(__User); - if (driverClassName.indexOf("pointbase") != -1) { + if (driverClassName != null && driverClassName.indexOf("pointbase") != -1) { url = poolValues.get(__DatabaseName); } // Search for server name key should be case insensitive. diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/Hk2TargetModuleID.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/Hk2TargetModuleID.java index dc88498be24b..7b6b8c30acbc 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/Hk2TargetModuleID.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/Hk2TargetModuleID.java @@ -111,7 +111,7 @@ public TargetModuleID getParentTargetModuleID() { } public TargetModuleID [] getChildTargetModuleID() { - return children.toArray(new TargetModuleID[children.size()]); + return children.toArray(TargetModuleID[]::new); } public void setParent(Hk2TargetModuleID parent) { diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/layer.xml b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/layer.xml index 6cac2ce5dbc7..8e55afc6fcd9 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/layer.xml +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/layer.xml @@ -407,13 +407,74 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -424,7 +485,7 @@ - + diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/nbdepjakartaee11.xml b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/nbdepjakartaee11.xml new file mode 100644 index 000000000000..a34755601895 --- /dev/null +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/nbdepjakartaee11.xml @@ -0,0 +1,54 @@ + + + + org/netbeans/modules/glassfish/common/resources/server + + + deployer:gfv800ee11 + + + + + / + contextRoot + + + diff --git a/enterprise/glassfish.tooling/manifest.mf b/enterprise/glassfish.tooling/manifest.mf index d020f619f4cc..0a8fd416b5c1 100644 --- a/enterprise/glassfish.tooling/manifest.mf +++ b/enterprise/glassfish.tooling/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.glassfish.tooling/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/glassfish/tooling/Bundle.properties -OpenIDE-Module-Specification-Version: 1.30 +OpenIDE-Module-Specification-Version: 1.32 diff --git a/enterprise/glassfish.tooling/nbproject/org-netbeans-modules-glassfish-tooling.sig b/enterprise/glassfish.tooling/nbproject/org-netbeans-modules-glassfish-tooling.sig index cecbe71f931c..39653d84aedf 100644 --- a/enterprise/glassfish.tooling/nbproject/org-netbeans-modules-glassfish-tooling.sig +++ b/enterprise/glassfish.tooling/nbproject/org-netbeans-modules-glassfish-tooling.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.29 +#Version 1.30 CLSS public abstract interface java.io.Closeable intf java.lang.AutoCloseable @@ -1416,6 +1416,8 @@ fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVer fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion GF_6_2_5 fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion GF_7_0_0 fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion GF_7_0_1 +fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion GF_7_0_10 +fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion GF_7_0_11 fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion GF_7_0_2 fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion GF_7_0_3 fld public final static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion GF_7_0_4 @@ -1445,7 +1447,7 @@ meth public static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion meth public static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion valueOf(java.lang.String) meth public static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion[] values() supr java.lang.Enum -hfds GF_1_STR,GF_1_STR_NEXT,GF_2_1_1_STR,GF_2_1_1_STR_NEXT,GF_2_1_STR,GF_2_1_STR_NEXT,GF_2_STR,GF_2_STR_NEXT,GF_3_0_1_STR,GF_3_0_1_STR_NEXT,GF_3_1_1_STR,GF_3_1_1_STR_NEXT,GF_3_1_2_2_STR,GF_3_1_2_3_STR,GF_3_1_2_4_STR,GF_3_1_2_5_STR,GF_3_1_2_STR,GF_3_1_2_STR_NEXT,GF_3_1_STR,GF_3_1_STR_NEXT,GF_3_STR,GF_3_STR_NEXT,GF_4_0_1_STR,GF_4_0_1_STR_NEXT,GF_4_1_1_STR,GF_4_1_1_STR_NEXT,GF_4_1_2_STR,GF_4_1_2_STR_NEXT,GF_4_1_STR,GF_4_1_STR_NEXT,GF_4_STR,GF_4_STR_NEXT,GF_5_0_1_STR,GF_5_0_1_STR_NEXT,GF_5_1_0_STR,GF_5_1_0_STR_NEXT,GF_5_STR,GF_5_STR_NEXT,GF_6_1_0_STR,GF_6_1_0_STR_NEXT,GF_6_2_0_STR,GF_6_2_0_STR_NEXT,GF_6_2_1_STR,GF_6_2_1_STR_NEXT,GF_6_2_2_STR,GF_6_2_2_STR_NEXT,GF_6_2_3_STR,GF_6_2_3_STR_NEXT,GF_6_2_4_STR,GF_6_2_4_STR_NEXT,GF_6_2_5_STR,GF_6_2_5_STR_NEXT,GF_6_STR,GF_6_STR_NEXT,GF_7_0_0_STR,GF_7_0_0_STR_NEXT,GF_7_0_1_STR,GF_7_0_1_STR_NEXT,GF_7_0_2_STR,GF_7_0_2_STR_NEXT,GF_7_0_3_STR,GF_7_0_3_STR_NEXT,GF_7_0_4_STR,GF_7_0_4_STR_NEXT,GF_7_0_5_STR,GF_7_0_5_STR_NEXT,GF_7_0_6_STR,GF_7_0_6_STR_NEXT,GF_7_0_7_STR,GF_7_0_7_STR_NEXT,GF_7_0_8_STR,GF_7_0_8_STR_NEXT,GF_7_0_9_STR,GF_7_0_9_STR_NEXT,build,major,minor,stringValuesMap,update,value +hfds GF_1_STR,GF_1_STR_NEXT,GF_2_1_1_STR,GF_2_1_1_STR_NEXT,GF_2_1_STR,GF_2_1_STR_NEXT,GF_2_STR,GF_2_STR_NEXT,GF_3_0_1_STR,GF_3_0_1_STR_NEXT,GF_3_1_1_STR,GF_3_1_1_STR_NEXT,GF_3_1_2_2_STR,GF_3_1_2_3_STR,GF_3_1_2_4_STR,GF_3_1_2_5_STR,GF_3_1_2_STR,GF_3_1_2_STR_NEXT,GF_3_1_STR,GF_3_1_STR_NEXT,GF_3_STR,GF_3_STR_NEXT,GF_4_0_1_STR,GF_4_0_1_STR_NEXT,GF_4_1_1_STR,GF_4_1_1_STR_NEXT,GF_4_1_2_STR,GF_4_1_2_STR_NEXT,GF_4_1_STR,GF_4_1_STR_NEXT,GF_4_STR,GF_4_STR_NEXT,GF_5_0_1_STR,GF_5_0_1_STR_NEXT,GF_5_1_0_STR,GF_5_1_0_STR_NEXT,GF_5_STR,GF_5_STR_NEXT,GF_6_1_0_STR,GF_6_1_0_STR_NEXT,GF_6_2_0_STR,GF_6_2_0_STR_NEXT,GF_6_2_1_STR,GF_6_2_1_STR_NEXT,GF_6_2_2_STR,GF_6_2_2_STR_NEXT,GF_6_2_3_STR,GF_6_2_3_STR_NEXT,GF_6_2_4_STR,GF_6_2_4_STR_NEXT,GF_6_2_5_STR,GF_6_2_5_STR_NEXT,GF_6_STR,GF_6_STR_NEXT,GF_7_0_0_STR,GF_7_0_0_STR_NEXT,GF_7_0_10_STR,GF_7_0_10_STR_NEXT,GF_7_0_11_STR,GF_7_0_11_STR_NEXT,GF_7_0_1_STR,GF_7_0_1_STR_NEXT,GF_7_0_2_STR,GF_7_0_2_STR_NEXT,GF_7_0_3_STR,GF_7_0_3_STR_NEXT,GF_7_0_4_STR,GF_7_0_4_STR_NEXT,GF_7_0_5_STR,GF_7_0_5_STR_NEXT,GF_7_0_6_STR,GF_7_0_6_STR_NEXT,GF_7_0_7_STR,GF_7_0_7_STR_NEXT,GF_7_0_8_STR,GF_7_0_8_STR_NEXT,GF_7_0_9_STR,GF_7_0_9_STR_NEXT,build,major,minor,stringValuesMap,update,value CLSS public org.netbeans.modules.glassfish.tooling.data.IdeContext anno 0 java.lang.Deprecated(boolean forRemoval=false, java.lang.String since="") @@ -1727,7 +1729,7 @@ meth public static java.net.URL getBuilderConfig(org.netbeans.modules.glassfish. meth public static org.netbeans.modules.glassfish.tooling.server.config.ConfigBuilder getBuilder(org.netbeans.modules.glassfish.tooling.data.GlassFishServer) meth public static void destroyBuilder(org.netbeans.modules.glassfish.tooling.data.GlassFishServer) supr java.lang.Object -hfds CONFIG_V3,CONFIG_V4,CONFIG_V4_1,CONFIG_V5,CONFIG_V5_0_1,CONFIG_V5_1,CONFIG_V6,CONFIG_V6_1_0,CONFIG_V6_2_0,CONFIG_V6_2_1,CONFIG_V6_2_2,CONFIG_V6_2_3,CONFIG_V6_2_4,CONFIG_V6_2_5,CONFIG_V7_0_0,CONFIG_V7_0_1,CONFIG_V7_0_2,CONFIG_V7_0_3,CONFIG_V7_0_4,CONFIG_V7_0_5,CONFIG_V7_0_6,CONFIG_V7_0_7,CONFIG_V7_0_8,CONFIG_V7_0_9,builders,config +hfds CONFIG_V3,CONFIG_V4,CONFIG_V4_1,CONFIG_V5,CONFIG_V5_0_1,CONFIG_V5_1,CONFIG_V6,CONFIG_V6_1_0,CONFIG_V6_2_0,CONFIG_V6_2_1,CONFIG_V6_2_2,CONFIG_V6_2_3,CONFIG_V6_2_4,CONFIG_V6_2_5,CONFIG_V7_0_0,CONFIG_V7_0_1,CONFIG_V7_0_10,CONFIG_V7_0_11,CONFIG_V7_0_2,CONFIG_V7_0_3,CONFIG_V7_0_4,CONFIG_V7_0_5,CONFIG_V7_0_6,CONFIG_V7_0_7,CONFIG_V7_0_8,CONFIG_V7_0_9,builders,config CLSS public org.netbeans.modules.glassfish.tooling.server.config.ConfigUtils cons public init() @@ -1859,6 +1861,7 @@ fld public final static org.netbeans.modules.glassfish.tooling.server.config.Jav fld public final static org.netbeans.modules.glassfish.tooling.server.config.JavaSEPlatform v20 fld public final static org.netbeans.modules.glassfish.tooling.server.config.JavaSEPlatform v21 fld public final static org.netbeans.modules.glassfish.tooling.server.config.JavaSEPlatform v22 +fld public final static org.netbeans.modules.glassfish.tooling.server.config.JavaSEPlatform v23 meth public java.lang.String toString() meth public static org.netbeans.modules.glassfish.tooling.server.config.JavaSEPlatform toValue(java.lang.String) meth public static org.netbeans.modules.glassfish.tooling.server.config.JavaSEPlatform valueOf(java.lang.String) diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java index 98a3b277edcb..0affc06f8268 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java @@ -120,7 +120,15 @@ public enum GlassFishVersion { /** GlassFish 7.0.10 */ GF_7_0_10 ((short) 7, (short) 0, (short) 10, (short) 0, GlassFishVersion.GF_7_0_10_STR), /** GlassFish 7.0.11 */ - GF_7_0_11 ((short) 7, (short) 0, (short) 11, (short) 0, GlassFishVersion.GF_7_0_11_STR); + GF_7_0_11 ((short) 7, (short) 0, (short) 11, (short) 0, GlassFishVersion.GF_7_0_11_STR), + /** GlassFish 7.0.12 */ + GF_7_0_12 ((short) 7, (short) 0, (short) 12, (short) 0, GlassFishVersion.GF_7_0_12_STR), + /** GlassFish 7.0.13 */ + GF_7_0_13 ((short) 7, (short) 0, (short) 13, (short) 0, GlassFishVersion.GF_7_0_13_STR), + /** GlassFish 7.0.14 */ + GF_7_0_14 ((short) 7, (short) 0, (short) 14, (short) 0, GlassFishVersion.GF_7_0_14_STR), + /** GlassFish 8.0.0 */ + GF_8_0_0 ((short) 8, (short) 0, (short) 0, (short) 0, GlassFishVersion.GF_8_0_0_STR); //////////////////////////////////////////////////////////////////////////// // Class attributes // //////////////////////////////////////////////////////////////////////////// @@ -331,6 +339,26 @@ public enum GlassFishVersion { /** Additional {@code String} representations of GF_7_0_11 value. */ static final String GF_7_0_11_STR_NEXT[] = {"7.0.11", "7.0.11.0"}; + /** A {@code String} representation of GF_7_0_12 value. */ + static final String GF_7_0_12_STR = "7.0.12"; + /** Additional {@code String} representations of GF_7_0_12 value. */ + static final String GF_7_0_12_STR_NEXT[] = {"7.0.12", "7.0.12.0"}; + + /** A {@code String} representation of GF_7_0_13 value. */ + static final String GF_7_0_13_STR = "7.0.13"; + /** Additional {@code String} representations of GF_7_0_13 value. */ + static final String GF_7_0_13_STR_NEXT[] = {"7.0.13", "7.0.13.0"}; + + /** A {@code String} representation of GF_7_0_14 value. */ + static final String GF_7_0_14_STR = "7.0.14"; + /** Additional {@code String} representations of GF_7_0_14 value. */ + static final String GF_7_0_14_STR_NEXT[] = {"7.0.14", "7.0.14.0"}; + + /** A {@code String} representation of GF_8_0_0 value. */ + static final String GF_8_0_0_STR = "8.0.0"; + /** Additional {@code String} representations of GF_8_0_0 value. */ + static final String GF_8_0_0_STR_NEXT[] = {"8.0.0", "8.0.0.0"}; + /** * Stored String values for backward String * conversion. @@ -379,6 +407,10 @@ public enum GlassFishVersion { initStringValuesMapFromArray(GF_7_0_9, GF_7_0_9_STR_NEXT); initStringValuesMapFromArray(GF_7_0_10, GF_7_0_10_STR_NEXT); initStringValuesMapFromArray(GF_7_0_11, GF_7_0_11_STR_NEXT); + initStringValuesMapFromArray(GF_7_0_12, GF_7_0_12_STR_NEXT); + initStringValuesMapFromArray(GF_7_0_13, GF_7_0_13_STR_NEXT); + initStringValuesMapFromArray(GF_7_0_14, GF_7_0_14_STR_NEXT); + initStringValuesMapFromArray(GF_8_0_0, GF_8_0_0_STR_NEXT); } //////////////////////////////////////////////////////////////////////////// diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ConfigBuilderProvider.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ConfigBuilderProvider.java index 7ce0531bd0df..a44b7584cd3a 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ConfigBuilderProvider.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ConfigBuilderProvider.java @@ -174,6 +174,26 @@ public class ConfigBuilderProvider { = new Config.Next(GlassFishVersion.GF_7_0_11, ConfigBuilderProvider.class.getResource("GlassFishV7_0_9.xml")); + /** Library builder configuration since GlassFish 7.0.12. */ + private static final Config.Next CONFIG_V7_0_12 + = new Config.Next(GlassFishVersion.GF_7_0_12, + ConfigBuilderProvider.class.getResource("GlassFishV7_0_9.xml")); + + /** Library builder configuration since GlassFish 7.0.13. */ + private static final Config.Next CONFIG_V7_0_13 + = new Config.Next(GlassFishVersion.GF_7_0_13, + ConfigBuilderProvider.class.getResource("GlassFishV7_0_9.xml")); + + /** Library builder configuration since GlassFish 7.0.14. */ + private static final Config.Next CONFIG_V7_0_14 + = new Config.Next(GlassFishVersion.GF_7_0_14, + ConfigBuilderProvider.class.getResource("GlassFishV7_0_9.xml")); + + /** Library builder configuration since GlassFish 8.0.0. */ + private static final Config.Next CONFIG_V8_0_0 + = new Config.Next(GlassFishVersion.GF_8_0_0, + ConfigBuilderProvider.class.getResource("GlassFishV8_0_0.xml")); + /** Library builder configuration for GlassFish cloud. */ private static final Config config = new Config(CONFIG_V3, CONFIG_V4, CONFIG_V4_1, CONFIG_V5, @@ -183,7 +203,9 @@ public class ConfigBuilderProvider { CONFIG_V7_0_0, CONFIG_V7_0_1, CONFIG_V7_0_2, CONFIG_V7_0_3, CONFIG_V7_0_4, CONFIG_V7_0_5, CONFIG_V7_0_6, CONFIG_V7_0_7, CONFIG_V7_0_8, - CONFIG_V7_0_9, CONFIG_V7_0_10, CONFIG_V7_0_11); + CONFIG_V7_0_9, CONFIG_V7_0_10, CONFIG_V7_0_11, + CONFIG_V7_0_12, CONFIG_V7_0_13, CONFIG_V7_0_14, + CONFIG_V8_0_0); /** Builders array for each server instance. */ private static final ConcurrentMap builders diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV8_0_0.xml b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV8_0_0.xml new file mode 100644 index 000000000000..02a55b5eef3e --- /dev/null +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV8_0_0.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaEEProfile.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaEEProfile.java index a9a6ad5e0037..b0b09be4e27f 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaEEProfile.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaEEProfile.java @@ -84,7 +84,13 @@ public enum JavaEEProfile { v10_0_0_web(Version.v10_0_0, Type.WEB, "10.0.0-web"), /** JakartaEE 10 full profile. */ - v10_0_0(Version.v10_0_0, Type.FULL, "10.0.0"); + v10_0_0(Version.v10_0_0, Type.FULL, "10.0.0"), + + /** JakartaEE 11 web profile. */ + v11_0_0_web(Version.v11_0_0, Type.WEB, "11.0.0-web"), + + /** JakartaEE 11 full profile. */ + v11_0_0(Version.v11_0_0, Type.FULL, "11.0.0"); //////////////////////////////////////////////////////////////////////////// // Inner enums // @@ -144,7 +150,9 @@ public enum Version { /** JakartaEE 9.1. */ v9_1_0("9.1.0"), /** JakartaEE 10 */ - v10_0_0("10.0.0"); + v10_0_0("10.0.0"), + /** JakartaEE 11 */ + v11_0_0("11.0.0"); /** JavaEE profile type name. */ private final String name; diff --git a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/admin/AdminFactoryTest.java b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/admin/AdminFactoryTest.java index 8f7d9455e35c..6e2d1ab002a7 100644 --- a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/admin/AdminFactoryTest.java +++ b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/admin/AdminFactoryTest.java @@ -168,7 +168,7 @@ public void testGetInstanceforVersionGF6() { } /** - * Test factory functionality for GlassFish v. 7.0.11 + * Test factory functionality for GlassFish v. 7.0.14 *

* Factory should initialize REST {@code Runner} and point it to * provided {@code Command} instance. @@ -176,7 +176,33 @@ public void testGetInstanceforVersionGF6() { @Test public void testGetInstanceforVersionGF7() { GlassFishServerEntity srv = new GlassFishServerEntity(); - srv.setVersion(GlassFishVersion.GF_7_0_11); + srv.setVersion(GlassFishVersion.GF_7_0_14); + AdminFactory af = AdminFactory.getInstance(srv.getVersion()); + assertTrue(af instanceof AdminFactoryRest); + Command cmd = new CommandVersion(); + Runner runner; + try { + runner = af.getRunner(srv, cmd); + } catch (GlassFishIdeException gfie) { + runner = null; + fail("Exception in Runner initialization: " + gfie.getMessage()); + } + // Returned runner should be REST interface. + assertTrue(runner instanceof RunnerRest); + // Stored command entity should be the one we supplied. + assertTrue(cmd.equals(runner.getCommand())); + } + + /** + * Test factory functionality for GlassFish v. 8.0.0 + *

+ * Factory should initialize REST {@code Runner} and point it to + * provided {@code Command} instance. + */ + @Test + public void testGetInstanceforVersionGF8() { + GlassFishServerEntity srv = new GlassFishServerEntity(); + srv.setVersion(GlassFishVersion.GF_8_0_0); AdminFactory af = AdminFactory.getInstance(srv.getVersion()); assertTrue(af instanceof AdminFactoryRest); Command cmd = new CommandVersion(); diff --git a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersionTest.java b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersionTest.java index 5fa8fabfa8ac..44dde392c56a 100644 --- a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersionTest.java +++ b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersionTest.java @@ -121,6 +121,14 @@ public void testToValue() { GlassFishVersion.GF_7_0_10_STR_NEXT); verifyToValueFromAdditionalArray(GlassFishVersion.GF_7_0_11, GlassFishVersion.GF_7_0_11_STR_NEXT); + verifyToValueFromAdditionalArray(GlassFishVersion.GF_7_0_12, + GlassFishVersion.GF_7_0_12_STR_NEXT); + verifyToValueFromAdditionalArray(GlassFishVersion.GF_7_0_13, + GlassFishVersion.GF_7_0_13_STR_NEXT); + verifyToValueFromAdditionalArray(GlassFishVersion.GF_7_0_14, + GlassFishVersion.GF_7_0_14_STR_NEXT); + verifyToValueFromAdditionalArray(GlassFishVersion.GF_8_0_0, + GlassFishVersion.GF_8_0_0_STR_NEXT); } /** @@ -147,7 +155,9 @@ public void testToValueIncomplete() { GlassFishVersion.GF_7_0_4, GlassFishVersion.GF_7_0_5, GlassFishVersion.GF_7_0_6, GlassFishVersion.GF_7_0_7, GlassFishVersion.GF_7_0_8, GlassFishVersion.GF_7_0_9, - GlassFishVersion.GF_7_0_10, GlassFishVersion.GF_7_0_11 + GlassFishVersion.GF_7_0_10, GlassFishVersion.GF_7_0_11, + GlassFishVersion.GF_7_0_12, GlassFishVersion.GF_7_0_13, + GlassFishVersion.GF_7_0_14, GlassFishVersion.GF_8_0_0 }; String strings[] = { "1.0.1.4", "2.0.1.5", "2.1.0.3", "2.1.1.7", @@ -159,7 +169,8 @@ public void testToValueIncomplete() { "6.2.4.0", "6.2.5.0", "7.0.0.0", "7.0.1.0", "7.0.2.0", "7.0.3.0", "7.0.4.0", "7.0.5.0", "7.0.6.0", "7.0.7.0", "7.0.8.0", "7.0.9.0", - "7.0.10.0", "7.0.11.0" + "7.0.10.0", "7.0.11.0", "7.0.12.0", "7.0.13.0", + "7.0.14.0", "8.0.0.0" }; for (int i = 0; i < versions.length; i++) { GlassFishVersion version = GlassFishVersion.toValue(strings[i]); diff --git a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/utils/EnumUtilsTest.java b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/utils/EnumUtilsTest.java index 0b272a43beb4..a2b7204f93eb 100644 --- a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/utils/EnumUtilsTest.java +++ b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/utils/EnumUtilsTest.java @@ -21,7 +21,8 @@ import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_3; import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_4; import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_6_2_5; -import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_7_0_11; +import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_7_0_14; +import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_8_0_0; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; import org.testng.annotations.Test; @@ -47,8 +48,10 @@ public class EnumUtilsTest { */ @Test public void testEq() { - assertFalse(EnumUtils.eq(GF_7_0_11, GF_6_2_5), "Equals for a > b shall be false."); - assertTrue(EnumUtils.eq(GF_7_0_11, GF_7_0_11), "Equals for a == b shall be true."); + assertFalse(EnumUtils.eq(GF_8_0_0, GF_7_0_14), "Equals for a > b shall be false."); + assertTrue(EnumUtils.eq(GF_8_0_0, GF_8_0_0), "Equals for a == b shall be true."); + assertFalse(EnumUtils.eq(GF_7_0_14, GF_6_2_5), "Equals for a > b shall be false."); + assertTrue(EnumUtils.eq(GF_7_0_14, GF_7_0_14), "Equals for a == b shall be true."); assertFalse(EnumUtils.eq(GF_4, GF_3), "Equals for a > b shall be false."); assertTrue(EnumUtils.eq(GF_4, GF_4), "Equals for a == b shall be true."); assertFalse(EnumUtils.eq(GF_3, GF_4), "Equals for a < b shall be false."); @@ -69,8 +72,10 @@ public void testEq() { */ @Test public void testNe() { - assertTrue(EnumUtils.ne(GF_7_0_11, GF_6_2_5), "Not equals for a > b shall be true."); - assertFalse(EnumUtils.ne(GF_7_0_11, GF_7_0_11), "Not equals for a == b shall be false."); + assertTrue(EnumUtils.ne(GF_8_0_0, GF_7_0_14), "Not equals for a > b shall be true."); + assertFalse(EnumUtils.ne(GF_8_0_0, GF_8_0_0), "Not equals for a == b shall be false."); + assertTrue(EnumUtils.ne(GF_7_0_14, GF_6_2_5), "Not equals for a > b shall be true."); + assertFalse(EnumUtils.ne(GF_7_0_14, GF_7_0_14), "Not equals for a == b shall be false."); assertTrue(EnumUtils.ne(GF_4, GF_3), "Not equals for a > b shall be true."); assertFalse(EnumUtils.ne(GF_4, GF_4), "Not equals for a == b shall be false."); assertTrue(EnumUtils.ne(GF_3, GF_4), "Not equals for a < b shall be true."); @@ -91,8 +96,10 @@ public void testNe() { */ @Test public void testLt() { - assertFalse(EnumUtils.lt(GF_7_0_11, GF_6_2_5), "Less than for a > b shall be false."); - assertFalse(EnumUtils.lt(GF_7_0_11, GF_7_0_11), "Less than for a == b shall be false."); + assertFalse(EnumUtils.lt(GF_8_0_0, GF_7_0_14), "Less than for a > b shall be false."); + assertFalse(EnumUtils.lt(GF_8_0_0, GF_8_0_0), "Less than for a == b shall be false."); + assertFalse(EnumUtils.lt(GF_7_0_14, GF_6_2_5), "Less than for a > b shall be false."); + assertFalse(EnumUtils.lt(GF_7_0_14, GF_7_0_14), "Less than for a == b shall be false."); assertFalse(EnumUtils.lt(GF_4, GF_3), "Less than for a > b shall be false."); assertFalse(EnumUtils.lt(GF_4, GF_4), "Less than for a == b shall be false."); assertTrue(EnumUtils.lt(GF_3, GF_4), "Less than for a < b shall be true."); @@ -113,8 +120,10 @@ public void testLt() { */ @Test public void testLe() { - assertFalse(EnumUtils.le(GF_7_0_11, GF_6_2_5), "Less than or equal for a > b shall be false."); - assertTrue(EnumUtils.le(GF_7_0_11, GF_7_0_11), "Less than or equal for a == b shall be true."); + assertFalse(EnumUtils.le(GF_8_0_0, GF_7_0_14), "Less than or equal for a > b shall be false."); + assertTrue(EnumUtils.le(GF_8_0_0, GF_8_0_0), "Less than or equal for a == b shall be true."); + assertFalse(EnumUtils.le(GF_7_0_14, GF_6_2_5), "Less than or equal for a > b shall be false."); + assertTrue(EnumUtils.le(GF_7_0_14, GF_7_0_14), "Less than or equal for a == b shall be true."); assertFalse(EnumUtils.le(GF_4, GF_3), "Less than or equal for a > b shall be false."); assertTrue(EnumUtils.le(GF_4, GF_4), "Less than or equal for a == b shall be true."); assertTrue(EnumUtils.le(GF_3, GF_4), "Less than or equal for a < b shall be true."); @@ -135,8 +144,10 @@ public void testLe() { */ @Test public void testGt() { - assertTrue(EnumUtils.gt(GF_7_0_11, GF_6_2_5), "Greater than for a > b shall be true."); - assertFalse(EnumUtils.gt(GF_7_0_11, GF_7_0_11), "Greater than for a == b shall be false."); + assertTrue(EnumUtils.gt(GF_8_0_0, GF_7_0_14), "Greater than for a > b shall be true."); + assertFalse(EnumUtils.gt(GF_8_0_0, GF_8_0_0), "Greater than for a == b shall be false."); + assertTrue(EnumUtils.gt(GF_7_0_14, GF_6_2_5), "Greater than for a > b shall be true."); + assertFalse(EnumUtils.gt(GF_7_0_14, GF_7_0_14), "Greater than for a == b shall be false."); assertTrue(EnumUtils.gt(GF_4, GF_3), "Greater than for a > b shall be true."); assertFalse(EnumUtils.gt(GF_4, GF_4), "Greater than for a == b shall be false."); assertFalse(EnumUtils.gt(GF_3, GF_4), "Greater than for a < b shall be false."); @@ -157,8 +168,10 @@ public void testGt() { */ @Test public void testGe() { - assertTrue(EnumUtils.ge(GF_7_0_11, GF_6_2_5), "Greater than or equal for a > b shall be true."); - assertTrue(EnumUtils.ge(GF_7_0_11, GF_7_0_11), "Greater than or equal for a == b shall be true."); + assertTrue(EnumUtils.ge(GF_8_0_0, GF_7_0_14), "Greater than or equal for a > b shall be true."); + assertTrue(EnumUtils.ge(GF_8_0_0, GF_8_0_0), "Greater than or equal for a == b shall be true."); + assertTrue(EnumUtils.ge(GF_7_0_14, GF_6_2_5), "Greater than or equal for a > b shall be true."); + assertTrue(EnumUtils.ge(GF_7_0_14, GF_7_0_14), "Greater than or equal for a == b shall be true."); assertTrue(EnumUtils.ge(GF_4, GF_3), "Greater than or equal for a > b shall be true."); assertTrue(EnumUtils.ge(GF_4, GF_4), "Greater than or equal for a == b shall be true."); assertFalse(EnumUtils.ge(GF_3, GF_4), "Greater than or equal for a < b shall be false."); diff --git a/enterprise/gradle.javaee/manifest.mf b/enterprise/gradle.javaee/manifest.mf index 94177419eb2e..aab366fc5992 100644 --- a/enterprise/gradle.javaee/manifest.mf +++ b/enterprise/gradle.javaee/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.gradle.javaee OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gradle/javaee/Bundle.properties -OpenIDE-Module-Specification-Version: 1.18 +OpenIDE-Module-Specification-Version: 1.20 diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/GradleJavaEEProjectSettings.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/GradleJavaEEProjectSettings.java index 5ed63c58b0e3..fc9c65609541 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/GradleJavaEEProjectSettings.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/GradleJavaEEProjectSettings.java @@ -55,12 +55,14 @@ public class GradleJavaEEProjectSettings implements JavaEEProjectSettingsImpleme static final Map PROFILE_DEPENDENCIES = new LinkedHashMap<>(); static { - PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:10.*", JAKARTA_EE_10_FULL); - PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:10.*", JAKARTA_EE_10_WEB); - PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:9.*", JAKARTA_EE_9_FULL); - PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:9.*", JAKARTA_EE_9_WEB); - PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:8.*", JAKARTA_EE_8_FULL); - PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:8.*", JAKARTA_EE_8_WEB); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:11.*", JAKARTA_EE_11_FULL); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:11.*", JAKARTA_EE_11_WEB); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:10.*", JAKARTA_EE_10_FULL); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:10.*", JAKARTA_EE_10_WEB); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:9.*", JAKARTA_EE_9_FULL); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:9.*", JAKARTA_EE_9_WEB); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:8.*", JAKARTA_EE_8_FULL); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:8.*", JAKARTA_EE_8_WEB); PROFILE_DEPENDENCIES.put("javax:javaee-api:8.*", JAVA_EE_8_FULL); PROFILE_DEPENDENCIES.put("javax:javaee-web-api:8.*", JAVA_EE_8_WEB); PROFILE_DEPENDENCIES.put("javax:javaee-api:7.*", JAVA_EE_7_FULL); diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/JavaEESourcesImpl.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/JavaEESourcesImpl.java index e3dff8b888d3..2b93272ae503 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/JavaEESourcesImpl.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/JavaEESourcesImpl.java @@ -107,7 +107,7 @@ public SourceGroup[] getSourceGroups(String str) { if (webResourceRoots == null) { webResourceRoots = getWebSourceGroups(); } - return webResourceRoots.toArray(new SourceGroup[webResourceRoots.size()]); + return webResourceRoots.toArray(new SourceGroup[0]); } } return new SourceGroup[0]; diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/api/ui/support/JavaEEServerComboBoxModel.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/api/ui/support/JavaEEServerComboBoxModel.java index 05292337738f..b55cf69b86c6 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/api/ui/support/JavaEEServerComboBoxModel.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/api/ui/support/JavaEEServerComboBoxModel.java @@ -49,7 +49,7 @@ private JavaEEServerComboBoxModel(J2eeModule.Type moduleType, Profile javaeeProf //Simply not add this item to the list } } - platforms = order.toArray(new J2eePlatformModel[order.size()]); + platforms = order.toArray(new J2eePlatformModel[0]); } diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/WebModuleProviderImpl.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/WebModuleProviderImpl.java index 9343f7a0546c..d0e1edbe2c2e 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/WebModuleProviderImpl.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/WebModuleProviderImpl.java @@ -99,7 +99,7 @@ public FileObject[] getSourceRoots() { fos.add(fo); } } - return fos.toArray(new FileObject[fos.size()]); + return fos.toArray(new FileObject[0]); } return super.getSourceRoots(); } diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/ServerSelectionPanelVisual.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/ServerSelectionPanelVisual.java index d16a78ca615b..ecbfba272074 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/ServerSelectionPanelVisual.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/ServerSelectionPanelVisual.java @@ -157,14 +157,14 @@ private void cbServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS if (profile == Profile.JAVA_EE_6_FULL || profile == Profile.JAVA_EE_7_FULL || profile == Profile.JAVA_EE_8_FULL || profile == Profile.JAKARTA_EE_8_FULL || profile == Profile.JAKARTA_EE_9_FULL || profile == Profile.JAKARTA_EE_9_1_FULL - || profile == Profile.JAKARTA_EE_10_FULL) { + || profile == Profile.JAKARTA_EE_10_FULL || profile == Profile.JAKARTA_EE_11_FULL) { continue; } } else { if (profile == Profile.JAVA_EE_6_WEB || profile == Profile.JAVA_EE_7_WEB || profile == Profile.JAVA_EE_8_WEB || profile == Profile.JAKARTA_EE_8_WEB || profile == Profile.JAKARTA_EE_9_WEB || profile == Profile.JAKARTA_EE_9_1_WEB - || profile == Profile.JAKARTA_EE_10_WEB) { + || profile == Profile.JAKARTA_EE_10_WEB || profile == Profile.JAKARTA_EE_11_WEB) { continue; } } diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/WebApplicationProjectWizard.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/WebApplicationProjectWizard.java index 040515721bb4..c02263e1cad2 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/WebApplicationProjectWizard.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/WebApplicationProjectWizard.java @@ -109,6 +109,12 @@ public String getLicensePath() { private static List webDependencies(String profileId) { Profile profile = Profile.fromPropertiesString(profileId); List ret = new LinkedList<>(); + if (profile == Profile.JAKARTA_EE_11_WEB) { + ret.add("providedCompile 'jakarta.platform:jakarta.jakartaee-web-api:11.0.0'"); + } + if (profile == Profile.JAKARTA_EE_11_FULL) { + ret.add("providedCompile 'jakarta.platform:jakarta.jakartaee-api:11.0.0'"); + } if (profile == Profile.JAKARTA_EE_10_WEB) { ret.add("providedCompile 'jakarta.platform:jakarta.jakartaee-web-api:10.0.0'"); } diff --git a/enterprise/j2ee.ant/nbproject/project.properties b/enterprise/j2ee.ant/nbproject/project.properties index e75dba2d89db..44ecc45045ac 100644 --- a/enterprise/j2ee.ant/nbproject/project.properties +++ b/enterprise/j2ee.ant/nbproject/project.properties @@ -16,4 +16,4 @@ # under the License. ant.jar=${ant.core.lib} -spec.version.base=1.57.0 +spec.version.base=1.59.0 diff --git a/enterprise/j2ee.api.ejbmodule/manifest.mf b/enterprise/j2ee.api.ejbmodule/manifest.mf index 431baf482f5c..ead89a7e3935 100644 --- a/enterprise/j2ee.api.ejbmodule/manifest.mf +++ b/enterprise/j2ee.api.ejbmodule/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.api.ejbmodule -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.62 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/ejbjar/Bundle.properties diff --git a/enterprise/j2ee.api.ejbmodule/nbproject/org-netbeans-modules-j2ee-api-ejbmodule.sig b/enterprise/j2ee.api.ejbmodule/nbproject/org-netbeans-modules-j2ee-api-ejbmodule.sig index d989070f8cdd..0253790777ee 100644 --- a/enterprise/j2ee.api.ejbmodule/nbproject/org-netbeans-modules-j2ee-api-ejbmodule.sig +++ b/enterprise/j2ee.api.ejbmodule/nbproject/org-netbeans-modules-j2ee-api-ejbmodule.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.59 +#Version 1.60 CLSS public abstract interface java.io.Serializable diff --git a/enterprise/j2ee.clientproject/nbproject/org-netbeans-modules-j2ee-clientproject.sig b/enterprise/j2ee.clientproject/nbproject/org-netbeans-modules-j2ee-clientproject.sig index 74f181437406..8e7539b42797 100644 --- a/enterprise/j2ee.clientproject/nbproject/org-netbeans-modules-j2ee-clientproject.sig +++ b/enterprise/j2ee.clientproject/nbproject/org-netbeans-modules-j2ee-clientproject.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.68.0 +#Version 1.69.0 CLSS public java.lang.Object cons public init() diff --git a/enterprise/j2ee.clientproject/nbproject/project.properties b/enterprise/j2ee.clientproject/nbproject/project.properties index 6242a8a34d1a..18ef632b61be 100644 --- a/enterprise/j2ee.clientproject/nbproject/project.properties +++ b/enterprise/j2ee.clientproject/nbproject/project.properties @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -spec.version.base=1.69.0 +spec.version.base=1.71.0 javadoc.arch=${basedir}/arch.xml javadoc.preview=true javac.compilerargs=-Xlint -Xlint:-serial diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientCompilationClassPathModifierImpl.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientCompilationClassPathModifierImpl.java index 8a4ea18304f5..801e4d3c2e77 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientCompilationClassPathModifierImpl.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientCompilationClassPathModifierImpl.java @@ -115,7 +115,7 @@ private static URI[] convertURLsToURIs(URL[] entry) { for (URL url : entry) { content.add(URI.create(url.toExternalForm())); } - return content.toArray(new URI[content.size()]); + return content.toArray(new URI[0]); } private static ClassPathUiSupport.Callback createClassPathUiSupportCallback(final String path) { diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProject.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProject.java index 989b684138e4..d488fd7944c3 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProject.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProject.java @@ -575,7 +575,7 @@ protected void projectOpened() { libs.add(FileUtil.getArchiveRoot(children[i].toURL())); } } - cpMod.getClassPathModifier().addRoots(libs.toArray(new URL[libs.size()]), ProjectProperties.JAVAC_CLASSPATH); + cpMod.getClassPathModifier().addRoots(libs.toArray(new URL[0]), ProjectProperties.JAVAC_CLASSPATH); libFolder.addFileChangeListener (AppClientProject.this); } diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java index 21ba8c0aee2c..2aea1b1edc1f 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java @@ -174,7 +174,7 @@ public File[] getRequiredLibraries() { } files.add(FileUtil.toFile(FileUtil.getArchiveFile(fo))); } - return files.toArray(new File[files.size()]); + return files.toArray(new File[0]); } @Override @@ -351,24 +351,32 @@ public String getModuleVersion() { if (p == null) { return AppClient.VERSION_6_0; } - if (Profile.JAKARTA_EE_10_FULL.equals(p) || Profile.JAKARTA_EE_10_WEB.equals(p)) { - return AppClient.VERSION_10_0; - } else if (Profile.JAKARTA_EE_9_1_FULL.equals(p) || Profile.JAKARTA_EE_9_1_WEB.equals(p)) { - return AppClient.VERSION_9_0; - } else if (Profile.JAKARTA_EE_9_FULL.equals(p) || Profile.JAKARTA_EE_9_WEB.equals(p)) { - return AppClient.VERSION_9_0; - } else if (Profile.JAKARTA_EE_8_FULL.equals(p) || Profile.JAKARTA_EE_8_FULL.equals(p)) { - return AppClient.VERSION_8_0; - } else if (Profile.JAVA_EE_8_FULL.equals(p) || Profile.JAVA_EE_8_WEB.equals(p)) { - return AppClient.VERSION_8_0; - } else if (Profile.JAVA_EE_7_FULL.equals(p) || Profile.JAVA_EE_7_WEB.equals(p)) { - return AppClient.VERSION_7_0; - } else if (Profile.JAVA_EE_5.equals(p)) { - return AppClient.VERSION_5_0; - } else if (Profile.J2EE_14.equals(p)) { - return AppClient.VERSION_1_4; - } else { - return AppClient.VERSION_6_0; + switch (p) { + case JAKARTA_EE_11_FULL: + case JAKARTA_EE_11_WEB: + return AppClient.VERSION_11_0; + case JAKARTA_EE_10_FULL: + case JAKARTA_EE_10_WEB: + return AppClient.VERSION_10_0; + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_9_1_WEB: + case JAKARTA_EE_9_FULL: + case JAKARTA_EE_9_WEB: + return AppClient.VERSION_9_0; + case JAKARTA_EE_8_FULL: + case JAKARTA_EE_8_WEB: + case JAVA_EE_8_FULL: + case JAVA_EE_8_WEB: + return AppClient.VERSION_8_0; + case JAVA_EE_7_FULL: + case JAVA_EE_7_WEB: + return AppClient.VERSION_7_0; + case JAVA_EE_5: + return AppClient.VERSION_5_0; + case J2EE_14: + return AppClient.VERSION_1_4; + default: + return AppClient.VERSION_6_0; } } diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java index 3db60b9f55e6..ccebb909b204 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java @@ -160,26 +160,44 @@ private static AntProjectHelper createProjectImpl(final AppClientProjectCreateDa // create application-client.xml String resource; - if(j2eeProfile == null) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-6.xml"; // NOI18N - } else if (Profile.JAKARTA_EE_10_FULL.equals(j2eeProfile) || Profile.JAKARTA_EE_10_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-10.xml"; // NOI18N - } else if (Profile.JAKARTA_EE_9_1_FULL.equals(j2eeProfile) || Profile.JAKARTA_EE_9_1_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-9.xml"; // NOI18N - } else if (Profile.JAKARTA_EE_9_FULL.equals(j2eeProfile) || Profile.JAKARTA_EE_9_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-9.xml"; // NOI18N - } else if (Profile.JAKARTA_EE_8_FULL.equals(j2eeProfile) || Profile.JAKARTA_EE_8_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-8.xml"; // NOI18N - } else if (Profile.JAVA_EE_8_FULL.equals(j2eeProfile) || Profile.JAVA_EE_8_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-8.xml"; // NOI18N - } else if (Profile.JAVA_EE_7_FULL.equals(j2eeProfile) || Profile.JAVA_EE_7_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-7.xml"; // NOI18N - } else if (Profile.JAVA_EE_5.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-5.xml"; // NOI18N - } else if (Profile.J2EE_14.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-1.4.xml"; // NOI18N - } else { + if(null == j2eeProfile) { resource = "org-netbeans-modules-j2ee-clientproject/application-client-6.xml"; // NOI18N + } else { + switch (j2eeProfile) { + case JAKARTA_EE_11_FULL: + case JAKARTA_EE_11_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-11.xml"; // NOI18N + break; + case JAKARTA_EE_10_FULL: + case JAKARTA_EE_10_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-10.xml"; // NOI18N + break; + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_9_1_WEB: + case JAKARTA_EE_9_FULL: + case JAKARTA_EE_9_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-9.xml"; // NOI18N + break; + case JAKARTA_EE_8_FULL: + case JAKARTA_EE_8_WEB: + case JAVA_EE_8_FULL: + case JAVA_EE_8_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-8.xml"; // NOI18N + break; + case JAVA_EE_7_FULL: + case JAVA_EE_7_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-7.xml"; // NOI18N + break; + case JAVA_EE_5: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-5.xml"; // NOI18N + break; + case J2EE_14: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-1.4.xml"; // NOI18N + break; + default: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-6.xml"; // NOI18N + break; + } } FileObject foSource = FileUtil.getConfigFile(resource); FileObject ddFile = FileUtil.copyFile(foSource, confRoot, "application-client"); //NOI18N @@ -389,26 +407,44 @@ public Void run() throws Exception { } else { // XXX just temporary, since now the import would fail due to another bug String resource; - if (j2eeProfile == null) { + if (null == j2eeProfile) { resource = "org-netbeans-modules-j2ee-clientproject/application-client-6.xml"; // NOI18N - } else if (Profile.JAKARTA_EE_10_FULL.equals(j2eeProfile) || Profile.JAKARTA_EE_10_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-10.xml"; // NOI18N - } else if (Profile.JAKARTA_EE_9_1_FULL.equals(j2eeProfile) || Profile.JAKARTA_EE_9_1_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-9.xml"; // NOI18N - } else if (Profile.JAKARTA_EE_9_FULL.equals(j2eeProfile) || Profile.JAKARTA_EE_9_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-9.xml"; // NOI18N - } else if (Profile.JAKARTA_EE_8_FULL.equals(j2eeProfile) || Profile.JAKARTA_EE_8_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-8.xml"; // NOI18N - } else if (Profile.JAVA_EE_8_FULL.equals(j2eeProfile) || Profile.JAVA_EE_8_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-8.xml"; // NOI18N - } else if (Profile.JAVA_EE_7_FULL.equals(j2eeProfile) || Profile.JAVA_EE_7_WEB.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-7.xml"; // NOI18N - } else if (Profile.JAVA_EE_5.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-5.xml"; // NOI18N - } else if (Profile.J2EE_14.equals(j2eeProfile)) { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-1.4.xml"; // NOI18N } else { - resource = "org-netbeans-modules-j2ee-clientproject/application-client-6.xml"; // NOI18N + switch (j2eeProfile) { + case JAKARTA_EE_11_FULL: + case JAKARTA_EE_11_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-11.xml"; // NOI18N + break; + case JAKARTA_EE_10_FULL: + case JAKARTA_EE_10_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-10.xml"; // NOI18N + break; + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_9_1_WEB: + case JAKARTA_EE_9_FULL: + case JAKARTA_EE_9_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-9.xml"; // NOI18N + break; + case JAKARTA_EE_8_FULL: + case JAKARTA_EE_8_WEB: + case JAVA_EE_8_FULL: + case JAVA_EE_8_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-8.xml"; // NOI18N + break; + case JAVA_EE_7_FULL: + case JAVA_EE_7_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-7.xml"; // NOI18N + break; + case JAVA_EE_5: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-5.xml"; // NOI18N + break; + case J2EE_14: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-1.4.xml"; // NOI18N + break; + default: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-6.xml"; // NOI18N + break; + } } FileUtil.copyFile(FileUtil.getConfigFile(resource), confFolderFO, "application-client"); //NOI18N diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/classpath/DelagatingProjectClassPathModifierImpl.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/classpath/DelagatingProjectClassPathModifierImpl.java index ce827a5f4dfe..2be4ec3b218a 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/classpath/DelagatingProjectClassPathModifierImpl.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/classpath/DelagatingProjectClassPathModifierImpl.java @@ -59,7 +59,7 @@ protected SourceGroup[] getExtensibleSourceGroups() { protected String[] getExtensibleClassPathTypes(SourceGroup sourceGroup) { List res = new ArrayList(Arrays.asList(cpMod.getExtensibleClassPathTypes(sourceGroup))); res.add(JavaClassPathConstants.COMPILE_ONLY); - return res.toArray(new String[res.size()]); + return res.toArray(new String[0]); } @Override diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/AppClientProjectProperties.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/AppClientProjectProperties.java index 9428283f8159..026e3ea28c5a 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/AppClientProjectProperties.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/AppClientProjectProperties.java @@ -323,16 +323,30 @@ private void init() { PLATFORM_LIST_RENDERER = PlatformUiSupport.createPlatformListCellRenderer(); SpecificationVersion minimalSourceLevel = null; Profile profile = Profile.fromPropertiesString(evaluator.getProperty(J2EE_PLATFORM)); - if (Profile.JAKARTA_EE_9_1_FULL.equals(profile) || Profile.JAKARTA_EE_10_FULL.equals(profile)) { - minimalSourceLevel = new SpecificationVersion("11"); - } else if (Profile.JAKARTA_EE_8_FULL.equals(profile) || Profile.JAVA_EE_8_FULL.equals(profile) || Profile.JAKARTA_EE_9_FULL.equals(profile)) { - minimalSourceLevel = new SpecificationVersion("1.8"); - } else if (Profile.JAVA_EE_7_FULL.equals(profile)) { - minimalSourceLevel = new SpecificationVersion("1.7"); - } else if (Profile.JAVA_EE_6_FULL.equals(profile)) { - minimalSourceLevel = new SpecificationVersion("1.6"); - } else if (Profile.JAVA_EE_5.equals(profile)) { - minimalSourceLevel = new SpecificationVersion("1.5"); + switch (profile) { + case JAKARTA_EE_11_FULL: + minimalSourceLevel = new SpecificationVersion("21"); + break; + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_10_FULL: + minimalSourceLevel = new SpecificationVersion("11"); + break; + case JAKARTA_EE_8_FULL: + case JAVA_EE_8_FULL: + case JAKARTA_EE_9_FULL: + minimalSourceLevel = new SpecificationVersion("1.8"); + break; + case JAVA_EE_7_FULL: + minimalSourceLevel = new SpecificationVersion("1.7"); + break; + case JAVA_EE_6_FULL: + minimalSourceLevel = new SpecificationVersion("1.6"); + break; + case JAVA_EE_5: + minimalSourceLevel = new SpecificationVersion("1.5"); + break; + default: + break; } JAVAC_SOURCE_MODEL = PlatformUiSupport.createSourceLevelComboBoxModel(PLATFORM_MODEL, evaluator.getProperty(JAVAC_SOURCE), evaluator.getProperty(JAVAC_TARGET), minimalSourceLevel); JAVAC_SOURCE_RENDERER = PlatformUiSupport.createSourceLevelListCellRenderer (); @@ -809,7 +823,7 @@ void loadIncludesExcludes(IncludeExcludeVisualizer v) { } } } - v.setRoots(roots.toArray(new File[roots.size()])); + v.setRoots(roots.toArray(new File[0])); v.setIncludePattern(includes); v.setExcludePattern(excludes); } diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/MainClassChooser.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/MainClassChooser.java index e74954dc9f6d..811c0eaa5ddd 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/MainClassChooser.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/MainClassChooser.java @@ -106,7 +106,7 @@ public void run () { }); } else { @SuppressWarnings("unchecked") - final ElementHandle[] arr = possibleMainClasses.toArray(new ElementHandle[possibleMainClasses.size()]); + final ElementHandle[] arr = possibleMainClasses.toArray(new ElementHandle[0]); // #46861, sort name of classes Arrays.sort (arr, new MainClassComparator()); SwingUtilities.invokeLater(new Runnable () { diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java index 84e1b584ec60..6a09706ecd45 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java @@ -90,36 +90,35 @@ protected FileObject getXmlArtifactsRoot() { protected String getProjectJavaEEVersion() { Car j2eeClientModule = Car.getCar(project.getProjectDirectory()); if (j2eeClientModule != null) { - if (Profile.JAVA_EE_6_WEB.equals(j2eeClientModule.getJ2eeProfile())) { - return JAVA_EE_VERSION_16; - } else if (Profile.JAVA_EE_6_FULL.equals(j2eeClientModule.getJ2eeProfile())) { - return JAVA_EE_VERSION_16; - } else if (Profile.JAVA_EE_7_WEB.equals(j2eeClientModule.getJ2eeProfile())) { - return JAVA_EE_VERSION_17; - } else if (Profile.JAVA_EE_7_FULL.equals(j2eeClientModule.getJ2eeProfile())) { - return JAVA_EE_VERSION_17; - } else if (Profile.JAVA_EE_8_WEB.equals(j2eeClientModule.getJ2eeProfile())) { - return JAVA_EE_VERSION_18; - } else if (Profile.JAVA_EE_8_FULL.equals(j2eeClientModule.getJ2eeProfile())) { - return JAVA_EE_VERSION_18; - } else if (Profile.JAKARTA_EE_8_WEB.equals(j2eeClientModule.getJ2eeProfile())) { - return JAKARTA_EE_VERSION_8; - } else if (Profile.JAKARTA_EE_8_FULL.equals(j2eeClientModule.getJ2eeProfile())) { - return JAKARTA_EE_VERSION_8; - } else if (Profile.JAKARTA_EE_9_WEB.equals(j2eeClientModule.getJ2eeProfile())) { - return JAKARTA_EE_VERSION_9; - } else if (Profile.JAKARTA_EE_9_FULL.equals(j2eeClientModule.getJ2eeProfile())) { - return JAKARTA_EE_VERSION_9; - } else if (Profile.JAKARTA_EE_9_1_WEB.equals(j2eeClientModule.getJ2eeProfile())) { - return JAKARTA_EE_VERSION_91; - } else if (Profile.JAKARTA_EE_9_1_FULL.equals(j2eeClientModule.getJ2eeProfile())) { - return JAKARTA_EE_VERSION_91; - } else if (Profile.JAKARTA_EE_10_WEB.equals(j2eeClientModule.getJ2eeProfile())) { - return JAKARTA_EE_VERSION_10; - } else if (Profile.JAKARTA_EE_10_FULL.equals(j2eeClientModule.getJ2eeProfile())) { - return JAKARTA_EE_VERSION_10; - } else if (Profile.JAVA_EE_5.equals(j2eeClientModule.getJ2eeProfile())) { - return JAVA_EE_VERSION_15; + switch (j2eeClientModule.getJ2eeProfile()) { + case JAVA_EE_6_WEB: + case JAVA_EE_6_FULL: + return JAVA_EE_VERSION_16; + case JAVA_EE_7_WEB: + case JAVA_EE_7_FULL: + return JAVA_EE_VERSION_17; + case JAVA_EE_8_WEB: + case JAVA_EE_8_FULL: + return JAVA_EE_VERSION_18; + case JAKARTA_EE_8_WEB: + case JAKARTA_EE_8_FULL: + return JAKARTA_EE_VERSION_8; + case JAKARTA_EE_9_WEB: + case JAKARTA_EE_9_FULL: + return JAKARTA_EE_VERSION_9; + case JAKARTA_EE_9_1_WEB: + case JAKARTA_EE_9_1_FULL: + return JAKARTA_EE_VERSION_91; + case JAKARTA_EE_10_WEB: + case JAKARTA_EE_10_FULL: + return JAKARTA_EE_VERSION_10; + case JAKARTA_EE_11_WEB: + case JAKARTA_EE_11_FULL: + return JAKARTA_EE_VERSION_11; + case JAVA_EE_5: + return JAVA_EE_VERSION_15; + default: + break; } } return JAVA_EE_VERSION_NONE; diff --git a/enterprise/j2ee.common/licenseinfo.xml b/enterprise/j2ee.common/licenseinfo.xml index b42331580466..60333ee39d25 100644 --- a/enterprise/j2ee.common/licenseinfo.xml +++ b/enterprise/j2ee.common/licenseinfo.xml @@ -28,10 +28,12 @@ src/org/netbeans/modules/j2ee/common/dd/resources/beans-2.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/beans-3.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/beans-4.0.xml + src/org/netbeans/modules/j2ee/common/dd/resources/beans-4.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint-1.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint-2.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint-3.0.xml + src/org/netbeans/modules/j2ee/common/dd/resources/constraint-3.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-1.3.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-1.4.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-5.xml @@ -40,10 +42,12 @@ src/org/netbeans/modules/j2ee/common/dd/resources/ear-8.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-9.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-10.xml + src/org/netbeans/modules/j2ee/common/dd/resources/ear-11.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation-1.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation-2.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation-3.0.xml + src/org/netbeans/modules/j2ee/common/dd/resources/validation-3.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-2.3.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-2.4.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-2.5.xml @@ -52,11 +56,13 @@ src/org/netbeans/modules/j2ee/common/dd/resources/web-4.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-5.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-6.0.xml + src/org/netbeans/modules/j2ee/common/dd/resources/web-6.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-3.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-3.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-4.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-5.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.0.xml + src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.1.xml test/unit/src/templates/Class.template test/unit/src/templates/Interface.template diff --git a/enterprise/j2ee.common/manifest.mf b/enterprise/j2ee.common/manifest.mf index 5adf8465b0d1..5490cc5a9eec 100644 --- a/enterprise/j2ee.common/manifest.mf +++ b/enterprise/j2ee.common/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.common/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/common/Bundle.properties OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.126 +OpenIDE-Module-Specification-Version: 1.128 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.common/nbproject/org-netbeans-modules-j2ee-common.sig b/enterprise/j2ee.common/nbproject/org-netbeans-modules-j2ee-common.sig index 842d4a9cc389..a1b4fc406ffa 100644 --- a/enterprise/j2ee.common/nbproject/org-netbeans-modules-j2ee-common.sig +++ b/enterprise/j2ee.common/nbproject/org-netbeans-modules-j2ee-common.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.125 +#Version 1.126 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/j2ee.common/nbproject/project.xml b/enterprise/j2ee.common/nbproject/project.xml index 7ce39afc5dc6..d3188a0893e6 100644 --- a/enterprise/j2ee.common/nbproject/project.xml +++ b/enterprise/j2ee.common/nbproject/project.xml @@ -530,7 +530,6 @@ org.netbeans.modules.web.jsf.richfaces org.netbeans.modules.web.primefaces org.netbeans.modules.web.project - org.netbeans.modules.web.struts org.netbeans.modules.websvc.core org.netbeans.modules.websvc.jaxrpc org.netbeans.modules.websvc.restapi diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/DatasourceUIHelper.java b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/DatasourceUIHelper.java index affc750c5bc0..310f224015e9 100644 --- a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/DatasourceUIHelper.java +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/DatasourceUIHelper.java @@ -30,7 +30,6 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.LinkedList; @@ -608,7 +607,7 @@ private static List getDatasources(final J2eeModuleProvider provider datasources.addAll(serverDatasources); ArrayList sortedDatasources = new ArrayList(datasources); - Collections.sort(sortedDatasources, new DatasourceComparator()); + sortedDatasources.sort(new DatasourceComparator()); return sortedDatasources; } diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilities.java b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilities.java index 9949940624ff..6fdcfd672e2d 100644 --- a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilities.java +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilities.java @@ -35,7 +35,8 @@ import org.netbeans.modules.web.api.webmodule.WebModule; /** - * Facade allowing queries for certain capabilities provided by Java EE runtime. + * Facade allowing queries for certain capabilities provided by + * Java/Jakarta EE runtime. * * @author Petr Hejl * @since 1.58 @@ -91,86 +92,92 @@ public static J2eeProjectCapabilities forProject(@NonNull Project project) { /** * EJB 3.0 functionality is supported in EjbJar project which is targeting - * Java EE 5 or Java EE 6 platform. + * from Java EE 5 to Jakarta EE 8 platform. */ public boolean isEjb30Supported() { J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); - boolean eeOk = ejbJarProfile != null && (ejbJarProfile.equals(Profile.JAVA_EE_5) || - ejbJarProfile.equals(Profile.JAVA_EE_6_FULL) || ejbJarProfile.equals(Profile.JAVA_EE_7_FULL) || ejbJarProfile.equals(Profile.JAVA_EE_8_FULL) || ejbJarProfile.equals(Profile.JAKARTA_EE_8_FULL)); + boolean eeOk = ejbJarProfile != null && ejbJarProfile.isFullProfile() && + ejbJarProfile.isAtLeast(Profile.JAVA_EE_5) && ejbJarProfile.isAtMost(Profile.JAKARTA_EE_8_FULL); return J2eeModule.Type.EJB.equals(moduleType) && eeOk; } /** * EJB 3.1 functionality is supported in EjbJar and Web project which is targeting - * full Java EE 6 platform. + * full platform profiles from Java EE 6 to Jakarta EE 8 platform. * @return {@code true} if the project is targeting full Java EE 6 or newer platform */ public boolean isEjb31Supported() { J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); - boolean ee6or7 = ejbJarProfile != null && (ejbJarProfile.equals(Profile.JAVA_EE_6_FULL) || ejbJarProfile.equals(Profile.JAVA_EE_7_FULL) || ejbJarProfile.equals(Profile.JAVA_EE_8_FULL) || ejbJarProfile.equals(Profile.JAKARTA_EE_8_FULL)); + boolean ee6or7 = ejbJarProfile != null && ejbJarProfile.isFullProfile() && + ejbJarProfile.isAtLeast(Profile.JAVA_EE_6_FULL) && ejbJarProfile.isAtMost(Profile.JAKARTA_EE_8_FULL); return ee6or7 && (J2eeModule.Type.EJB.equals(moduleType) || J2eeModule.Type.WAR.equals(moduleType)); } /** - * EJB 3.1 Lite functionality is supported in Web project targeting Java EE 6 - * web profile or newer and wherever full EJB 3.1 is supported. + * EJB 3.1 Lite functionality is supported in Web projects targeting from + * Java EE 6 to Jakarta EE 8 web profile, and wherever full EJB 3.1 is supported. */ public boolean isEjb31LiteSupported() { J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); - boolean ee6or7Web = ejbJarProfile != null && (ejbJarProfile.equals(Profile.JAVA_EE_6_WEB) || ejbJarProfile.equals(Profile.JAVA_EE_7_WEB) || ejbJarProfile.equals(Profile.JAVA_EE_8_WEB) || ejbJarProfile.equals(Profile.JAKARTA_EE_8_WEB)); + boolean ee6or7Web = ejbJarProfile != null && + ejbJarProfile.isAtLeast(Profile.JAVA_EE_6_WEB) && ejbJarProfile.isAtMost(Profile.JAKARTA_EE_8_WEB); return isEjb31Supported() || (J2eeModule.Type.WAR.equals(moduleType) && ee6or7Web); } /** * EJB 3.2 functionality is supported in EjbJar and Web project which is targeting - * full Java EE or newer platform. + * full platform profiles from Java EE 7 to Jakarta EE 8 platform. * * @return {@code true} if the project is targeting full Java EE 7 or newer platform * @since 1.76 */ public boolean isEjb32Supported() { J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); - boolean ee7 = ejbJarProfile != null && (ejbJarProfile.equals(Profile.JAVA_EE_7_FULL) || ejbJarProfile.equals(Profile.JAVA_EE_8_FULL) || ejbJarProfile.equals(Profile.JAKARTA_EE_8_FULL)); + boolean ee7 = ejbJarProfile != null && ejbJarProfile.isFullProfile() && + ejbJarProfile.isAtLeast(Profile.JAVA_EE_7_FULL) && ejbJarProfile.isAtMost(Profile.JAKARTA_EE_8_FULL); return ee7 && (J2eeModule.Type.EJB.equals(moduleType) || J2eeModule.Type.WAR.equals(moduleType)); } /** - * EJB 3.2 Lite functionality is supported in Web project targeting Java EE 7 - * web profile and wherever full EJB 3.2 is supported. + * EJB 3.2 Lite functionality is supported in Web projects targeting from + * Java EE 7 to Jakarta EE 8 web profile, and wherever full EJB 3.2 is supported. * * @return {@code true} if the project is targeting full or web profile Java EE 7 or newer platform * @since 1.76 */ public boolean isEjb32LiteSupported() { J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); - boolean ee7Web = ejbJarProfile != null && (ejbJarProfile.equals(Profile.JAVA_EE_7_WEB) || ejbJarProfile.equals(Profile.JAVA_EE_8_WEB) || ejbJarProfile.equals(Profile.JAKARTA_EE_8_WEB)); + boolean ee7Web = ejbJarProfile != null && + ejbJarProfile.isAtLeast(Profile.JAVA_EE_7_WEB) && ejbJarProfile.isAtMost(Profile.JAKARTA_EE_8_WEB); return isEjb32Supported() || (J2eeModule.Type.WAR.equals(moduleType) && ee7Web); } /** * EJB 4.0 functionality is supported in EjbJar and Web project which is targeting - * full Jakarta EE 9/9.1 platform. + * full platform profiles from Jakarta EE 9 to Jakarta EE 11 platform. * * @return {@code true} if the project is targeting full Jakarta EE 9/9.1 or newer platform * @since 1.76 */ public boolean isEjb40Supported() { J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); - boolean ee9 = ejbJarProfile != null && (ejbJarProfile.equals(Profile.JAKARTA_EE_9_FULL) || ejbJarProfile.equals(Profile.JAKARTA_EE_9_1_FULL) || ejbJarProfile.equals(Profile.JAKARTA_EE_10_FULL)); + boolean ee9 = ejbJarProfile != null && ejbJarProfile.isFullProfile() && + ejbJarProfile.isAtLeast(Profile.JAKARTA_EE_9_FULL) && ejbJarProfile.isAtMost(Profile.JAKARTA_EE_11_FULL); return ee9 && (J2eeModule.Type.EJB.equals(moduleType) || J2eeModule.Type.WAR.equals(moduleType)); } /** - * EJB 4.0 Lite functionality is supported in Web project targeting Jakarta EE 9/9.1 - * web profile and wherever full EJB 4.0 is supported. + * EJB 4.0 Lite functionality is supported in Web projects targeting from + * Jakarta EE 9 to Jakarta EE 11 web profile, and wherever full EJB 4.0 is supported. * * @return {@code true} if the project is targeting full or web profile Jakarta EE 9/9.1 or newer platform * @since 1.76 */ public boolean isEjb40LiteSupported() { J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); - boolean ee9Web = ejbJarProfile != null && (ejbJarProfile.equals(Profile.JAKARTA_EE_9_WEB) || ejbJarProfile.equals(Profile.JAKARTA_EE_9_1_WEB) || ejbJarProfile.equals(Profile.JAKARTA_EE_10_WEB)); + boolean ee9Web = ejbJarProfile != null && + ejbJarProfile.isAtLeast(Profile.JAKARTA_EE_9_WEB) && ejbJarProfile.isAtMost(Profile.JAKARTA_EE_11_WEB); return isEjb40Supported() || (J2eeModule.Type.WAR.equals(moduleType) && ee9Web); } @@ -182,7 +189,7 @@ public boolean isEjb40LiteSupported() { public boolean isCdi10Supported() { return Profile.JAVA_EE_6_FULL.equals(ejbJarProfile) || Profile.JAVA_EE_6_WEB.equals(webProfile) || - Profile.JAVA_EE_6_FULL.equals(ejbJarProfile); + Profile.JAVA_EE_6_FULL.equals(carProfile); } /** @@ -242,6 +249,18 @@ public boolean isCdi40Supported() { || Profile.JAKARTA_EE_10_WEB.equals(webProfile) || Profile.JAKARTA_EE_10_FULL.equals(carProfile); } + + /** + * Is CDI 4.1 supported in this project? + * + * @return {@code true} if the project targets Jakarta EE 11 profile, + * {@code false} otherwise + */ + public boolean isCdi41Supported() { + return Profile.JAKARTA_EE_11_FULL.equals(ejbJarProfile) + || Profile.JAKARTA_EE_11_WEB.equals(webProfile) + || Profile.JAKARTA_EE_11_FULL.equals(carProfile); + } /** * Returns true if the server used by project supports EJB lite. diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/SharabilityUtility.java b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/SharabilityUtility.java index 08c021cf942d..7f70dcd744c7 100644 --- a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/SharabilityUtility.java +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/SharabilityUtility.java @@ -82,7 +82,7 @@ public void run() { List roots = lib.getContent("classpath"); // NOI18N // CopyFiles.class was not present in NB 6.1 boolean version61 = org.netbeans.spi.java.classpath.support.ClassPathSupport. - createClassPath(roots.toArray(new URL[roots.size()])). + createClassPath(roots.toArray(new URL[0])). findResource("org/netbeans/modules/java/j2seproject/copylibstask/CopyFiles.class") == null; // NOI18N if (!version61) { return; diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java index ec0298a273be..c59d22b16300 100644 --- a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java @@ -66,7 +66,9 @@ public static FileObject createWebXml(Profile j2eeProfile, FileObject dir) throw */ public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequired, FileObject dir) throws IOException { String template = null; - if ((Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) && webXmlRequired) { + if ((Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) && webXmlRequired) { + template = "web-6.1.xml"; //NOI18N + } else if ((Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) && webXmlRequired) { template = "web-6.0.xml"; //NOI18N } else if ((Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile || Profile.JAKARTA_EE_9_FULL == j2eeProfile || Profile.JAKARTA_EE_9_WEB == j2eeProfile) && webXmlRequired) { @@ -105,7 +107,9 @@ public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequire */ public static FileObject createWebFragmentXml(Profile j2eeProfile, FileObject dir) throws IOException { String template = null; - if (Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { + if (Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) { + template = "web-fragment-6.1.xml"; //NOI18N + } else if (Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { template = "web-fragment-6.0.xml"; //NOI18N } else if (Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile || Profile.JAKARTA_EE_9_FULL == j2eeProfile || Profile.JAKARTA_EE_9_WEB == j2eeProfile) { @@ -152,7 +156,9 @@ public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir) thr */ public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { String template = null; - if (Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { + if (Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) { + template = "beans-4.1.xml"; //NOI18N + } else if (Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { template = "beans-4.0.xml"; //NOI18N } else if (Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile || Profile.JAKARTA_EE_9_FULL == j2eeProfile || Profile.JAKARTA_EE_9_WEB == j2eeProfile) { @@ -211,6 +217,8 @@ public static FileObject createValidationXml(Profile j2eeProfile, FileObject dir || Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile || Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { template = "validation-3.0.xml"; //NOI18N + } else if (Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) { + template = "validation-3.1.xml"; //NOI18N } if (template == null) return null; @@ -257,6 +265,8 @@ public static FileObject createConstraintXml(Profile j2eeProfile, FileObject dir || Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile || Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { template = "constraint-3.0.xml"; //NOI18N + } else if (Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) { + template = "constraint-3.1.xml"; //NOI18N } if (template == null) return null; @@ -285,7 +295,9 @@ public static FileObject createApplicationXml(final Profile profile, final FileO boolean forceCreation) throws IOException { String template = null; - if (profile != null && profile.equals(Profile.JAKARTA_EE_10_FULL) && forceCreation) { + if (profile != null && profile.equals(Profile.JAKARTA_EE_11_FULL) && forceCreation) { + template = "ear-11.xml"; // NOI18N + } else if (profile != null && profile.equals(Profile.JAKARTA_EE_10_FULL) && forceCreation) { template = "ear-10.xml"; // NOI18N } else if (profile != null && (profile.equals(Profile.JAKARTA_EE_9_FULL) || profile.equals(Profile.JAKARTA_EE_9_1_FULL)) && forceCreation) { template = "ear-9.xml"; // NOI18N diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/beans-4.1.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/beans-4.1.xml new file mode 100644 index 000000000000..5c5e6fe0231d --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/beans-4.1.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/constraint-3.1.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/constraint-3.1.xml new file mode 100644 index 000000000000..5145f6849044 --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/constraint-3.1.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/ear-11.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/ear-11.xml new file mode 100644 index 000000000000..6fadd79c3997 --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/ear-11.xml @@ -0,0 +1,7 @@ + + + + diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/validation-3.1.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/validation-3.1.xml new file mode 100644 index 000000000000..834da5a7137b --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/validation-3.1.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-6.1.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-6.1.xml new file mode 100644 index 000000000000..20d6dbbc30c9 --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-6.1.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.1.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.1.xml new file mode 100644 index 000000000000..22db23644db4 --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.1.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/ui/NoSelectedServerWarning.java b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/ui/NoSelectedServerWarning.java index 9890ff0bedb3..e1cbd4342035 100644 --- a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/ui/NoSelectedServerWarning.java +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/ui/NoSelectedServerWarning.java @@ -98,7 +98,7 @@ public static String selectServerDialog(Object[] moduleTypes, String j2eeSpec, S types.add(type); } } - return selectServerDialog(types.toArray(new J2eeModule.Type[types.size()]), + return selectServerDialog(types.toArray(new J2eeModule.Type[0]), Profile.fromPropertiesString(j2eeSpec), title, description); } diff --git a/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilitiesTest.java b/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilitiesTest.java index 768cd24506da..eedb3c6bf08d 100644 --- a/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilitiesTest.java +++ b/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilitiesTest.java @@ -201,6 +201,26 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb40Supported()); // assertTrue(cap.isEjb40LiteSupported()); + p = createProject(Profile.JAKARTA_EE_11_FULL, Type.EJB); + cap = J2eeProjectCapabilities.forProject(p); + assertFalse(cap.isEjb30Supported()); + assertFalse(cap.isEjb31Supported()); + assertFalse(cap.isEjb31LiteSupported()); + assertFalse(cap.isEjb32Supported()); + assertFalse(cap.isEjb32LiteSupported()); + assertTrue(cap.isEjb40Supported()); + assertTrue(cap.isEjb40LiteSupported()); + + p = createProject(Profile.JAKARTA_EE_11_WEB, Type.EJB); + cap = J2eeProjectCapabilities.forProject(p); + assertFalse(cap.isEjb30Supported()); + assertFalse(cap.isEjb31Supported()); + assertFalse(cap.isEjb31LiteSupported()); + assertFalse(cap.isEjb32Supported()); + assertFalse(cap.isEjb32LiteSupported()); + assertFalse(cap.isEjb40Supported()); +// assertTrue(cap.isEjb40LiteSupported()); + p = createProject(Profile.JAVA_EE_5, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); assertFalse(cap.isEjb30Supported()); @@ -351,6 +371,26 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + p = createProject(Profile.JAKARTA_EE_11_FULL, Type.WAR); + cap = J2eeProjectCapabilities.forProject(p); + assertFalse(cap.isEjb30Supported()); + assertFalse(cap.isEjb31Supported()); + assertFalse(cap.isEjb31LiteSupported()); + assertFalse(cap.isEjb32Supported()); + assertFalse(cap.isEjb32LiteSupported()); + assertTrue(cap.isEjb40Supported()); + assertTrue(cap.isEjb40LiteSupported()); + + p = createProject(Profile.JAKARTA_EE_11_WEB, Type.WAR); + cap = J2eeProjectCapabilities.forProject(p); + assertFalse(cap.isEjb30Supported()); + assertFalse(cap.isEjb31Supported()); + assertFalse(cap.isEjb31LiteSupported()); + assertFalse(cap.isEjb32Supported()); + assertFalse(cap.isEjb32LiteSupported()); + assertFalse(cap.isEjb40Supported()); + assertTrue(cap.isEjb40LiteSupported()); + } private Project createProject(final Profile profile, final Type type) throws IOException { diff --git a/enterprise/j2ee.core/manifest.mf b/enterprise/j2ee.core/manifest.mf index c055143561cb..83cd53905b27 100644 --- a/enterprise/j2ee.core/manifest.mf +++ b/enterprise/j2ee.core/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.core/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/core/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.48 +OpenIDE-Module-Specification-Version: 1.50 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.core/nbproject/org-netbeans-modules-j2ee-core.sig b/enterprise/j2ee.core/nbproject/org-netbeans-modules-j2ee-core.sig index 052bc10deba0..ce5255ca0b69 100644 --- a/enterprise/j2ee.core/nbproject/org-netbeans-modules-j2ee-core.sig +++ b/enterprise/j2ee.core/nbproject/org-netbeans-modules-j2ee-core.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.47 +#Version 1.48 CLSS public abstract interface java.io.Serializable diff --git a/enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/Profile.java b/enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/Profile.java index 743eb3eb2241..b8b4d65ef557 100644 --- a/enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/Profile.java +++ b/enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/Profile.java @@ -86,7 +86,13 @@ public enum Profile { JAKARTA_EE_10_WEB("10", "web"), @Messages("JAKARTA_EE_10_FULL.displayName=Jakarta EE 10") - JAKARTA_EE_10_FULL("10"); + JAKARTA_EE_10_FULL("10"), + + @Messages("JAKARTA_EE_11_WEB.displayName=Jakarta EE 11 Web") + JAKARTA_EE_11_WEB("11", "web"), + + @Messages("JAKARTA_EE_11_FULL.displayName=Jakarta EE 11") + JAKARTA_EE_11_FULL("11"); // !!! ATTENTION: BE AWARE OF THE ENUM ORDER! It controls compatibility and UI position. public static final Comparator UI_COMPARATOR = (Profile o1, Profile o2) -> -(o1.ordinal() - o2.ordinal()); @@ -116,6 +122,28 @@ public String getDisplayName() { public String toPropertiesString() { return propertiesString; } + + /** + * Find out if this profile is a Web profile Platform. + * + * @return true if this is a Java/Jakarta EE Web profile, false if is a Full + * Platform + */ + @NonNull + public boolean isWebProfile() { + return propertiesString.endsWith("web"); + } + + /** + * Find out if this profile is a Full profile Platform. + * + * @return true if this is a Java/Jakarta EE Full profile, false if is a Web + * profile Platform + */ + @NonNull + public boolean isFullProfile() { + return !propertiesString.endsWith("web"); + } /** * Find out if the version of the profile is equal or higher to given profile. @@ -123,12 +151,12 @@ public String toPropertiesString() { * Please be aware of the following rules: *

* - * 1) Each Java EE X version is considered as lower than Java EE X+1 version + * 1) Each Java/Jakarta EE X version is considered as lower than Java EE X+1 version * (this applies regardless on Web/Full specification and in reality it means * that even Java EE 6 Full version is considered as lower than Java EE 7 Web) *

* - * 2) Each Java EE X Web version is considered as lower than Java EE X Full + * 2) Each Java/Jakarta EE X Web version is considered as lower than Java/Jakarta EE X Full *
* * @param profile profile to compare against @@ -139,6 +167,29 @@ public String toPropertiesString() { public boolean isAtLeast(@NonNull Profile profile) { return this.ordinal() >= profile.ordinal(); } + + /** + * Find out if the version of the profile is equal or lower to given profile. + * + * Please be aware of the following rules: + *

+ * + * 1) Each Java/Jakarta EE X version is considered as lower than Java/Jakarta EE X+1 version + * (this applies regardless on Web/Full specification and in reality it means + * that even Java EE 6 Full version is considered as lower than Java EE 7 Web) + *

+ * + * 2) Each Java/Jakarta EE X Web version is considered as lower than Java/Jakarta EE X Full + *
+ * + * @param profile profile to compare against + * @return true if this profile is equal or lower to given one, + * false otherwise + * @since 1.19 + */ + public boolean isAtMost(@NonNull Profile profile) { + return this.ordinal() <= profile.ordinal(); + } @Override public String toString() { diff --git a/enterprise/j2ee.core/test/unit/src/org/netbeans/api/j2ee/core/ProfileTest.java b/enterprise/j2ee.core/test/unit/src/org/netbeans/api/j2ee/core/ProfileTest.java index 5535d2d633ea..65ec47ed7e6d 100644 --- a/enterprise/j2ee.core/test/unit/src/org/netbeans/api/j2ee/core/ProfileTest.java +++ b/enterprise/j2ee.core/test/unit/src/org/netbeans/api/j2ee/core/ProfileTest.java @@ -63,6 +63,10 @@ public void testFromPropertiesString() { assertEquals(Profile.JAKARTA_EE_10_FULL, Profile.fromPropertiesString("JAKARTA_EE_10_FULL")); assertEquals(Profile.JAKARTA_EE_10_WEB, Profile.fromPropertiesString("10-web")); assertEquals(Profile.JAKARTA_EE_10_WEB, Profile.fromPropertiesString("JAKARTA_EE_10_WEB")); + assertEquals(Profile.JAKARTA_EE_11_FULL, Profile.fromPropertiesString("11")); + assertEquals(Profile.JAKARTA_EE_11_FULL, Profile.fromPropertiesString("JAKARTA_EE_11_FULL")); + assertEquals(Profile.JAKARTA_EE_11_WEB, Profile.fromPropertiesString("11-web")); + assertEquals(Profile.JAKARTA_EE_11_WEB, Profile.fromPropertiesString("JAKARTA_EE_11_WEB")); assertNull(Profile.fromPropertiesString("something")); assertNull(Profile.fromPropertiesString(null)); } @@ -86,6 +90,8 @@ public void testIsHigherJavaEEVersionJavaEE5() { assertTrue(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAVA_EE_5)); assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAVA_EE_5)); assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAVA_EE_5)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAVA_EE_5)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAVA_EE_5)); } public void testIsHigherJavaEEVersionJavaEE6full() { @@ -107,6 +113,8 @@ public void testIsHigherJavaEEVersionJavaEE6full() { assertTrue(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAVA_EE_6_WEB)); assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAVA_EE_6_WEB)); assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAVA_EE_6_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAVA_EE_6_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAVA_EE_6_WEB)); } public void testIsHigherJavaEEVersionJavaEE7full() { @@ -128,6 +136,8 @@ public void testIsHigherJavaEEVersionJavaEE7full() { assertTrue(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAVA_EE_7_WEB)); assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAVA_EE_7_WEB)); assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAVA_EE_7_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAVA_EE_7_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAVA_EE_7_WEB)); } public void testIsHigherJavaEEVersionJavaEE8full() { @@ -149,6 +159,8 @@ public void testIsHigherJavaEEVersionJavaEE8full() { assertTrue(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAVA_EE_8_WEB)); assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAVA_EE_8_WEB)); assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAVA_EE_8_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAVA_EE_8_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAVA_EE_8_WEB)); } public void testIsHigherJavaEEVersionJakartaEE8full() { @@ -170,6 +182,8 @@ public void testIsHigherJavaEEVersionJakartaEE8full() { assertTrue(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAKARTA_EE_8_WEB)); assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAKARTA_EE_8_WEB)); assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_8_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_8_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_8_WEB)); } public void testIsHigherJavaEEVersionJakartaEE9full() { @@ -191,6 +205,8 @@ public void testIsHigherJavaEEVersionJakartaEE9full() { assertTrue(Profile.JAKARTA_EE_9_1_FULL.isAtLeast(Profile.JAKARTA_EE_9_WEB)); assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAKARTA_EE_9_WEB)); assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_9_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_9_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_9_WEB)); } public void testIsHigherJavaEEVersionJakartaEE91full() { @@ -212,6 +228,8 @@ public void testIsHigherJavaEEVersionJakartaEE91full() { assertTrue(Profile.JAKARTA_EE_9_1_FULL.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); } public void testIsHigherJavaEEVersionJakartaEE10full() { @@ -233,6 +251,8 @@ public void testIsHigherJavaEEVersionJakartaEE10full() { assertFalse(Profile.JAKARTA_EE_9_1_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); } public void testAllEnumsHaveDisplayNames() { diff --git a/enterprise/j2ee.dd.webservice/manifest.mf b/enterprise/j2ee.dd.webservice/manifest.mf index af076ab889a8..4807490979ee 100644 --- a/enterprise/j2ee.dd.webservice/manifest.mf +++ b/enterprise/j2ee.dd.webservice/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.dd.webservice OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/dd/webservice/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.56 diff --git a/enterprise/j2ee.dd.webservice/nbproject/org-netbeans-modules-j2ee-dd-webservice.sig b/enterprise/j2ee.dd.webservice/nbproject/org-netbeans-modules-j2ee-dd-webservice.sig index 86654d648e98..bc57faef95b9 100644 --- a/enterprise/j2ee.dd.webservice/nbproject/org-netbeans-modules-j2ee-dd-webservice.sig +++ b/enterprise/j2ee.dd.webservice/nbproject/org-netbeans-modules-j2ee-dd-webservice.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.53 +#Version 1.54 CLSS public java.lang.Object cons public init() diff --git a/enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/CommonDDAccess.java b/enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/CommonDDAccess.java index ca79217ff4ea..1411b9f8f165 100644 --- a/enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/CommonDDAccess.java +++ b/enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/CommonDDAccess.java @@ -58,7 +58,7 @@ public static BaseBean newBean(CommonDDBean parent, String beanName, String vers PACKAGE_PREFIX + version + DOT + beanName); - return (BaseBean) beanClass.newInstance(); + return (BaseBean) beanClass.getDeclaredConstructor().newInstance(); } catch (Exception e) { if (e instanceof ClassNotFoundException) diff --git a/enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/annotation/WebservicesImpl.java b/enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/annotation/WebservicesImpl.java index 255cd4b9cda3..8110f2226c4e 100644 --- a/enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/annotation/WebservicesImpl.java +++ b/enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/annotation/WebservicesImpl.java @@ -89,7 +89,7 @@ public BigDecimal getVersion() { public WebserviceDescription[] getWebserviceDescription() { Collection webservices = webserviceManager.getObjects(); - return webservices.toArray(new WebserviceDescriptionImpl[webservices.size()]); + return webservices.toArray(new WebserviceDescriptionImpl[0]); } public WebserviceDescription getWebserviceDescription(int index) { diff --git a/enterprise/j2ee.dd/.gitignore b/enterprise/j2ee.dd/.gitignore index 33e900917b5d..1c791390b00f 100644 --- a/enterprise/j2ee.dd/.gitignore +++ b/enterprise/j2ee.dd/.gitignore @@ -6,6 +6,7 @@ src/org/netbeans/modules/j2ee/dd/impl/application/model_7/* src/org/netbeans/modules/j2ee/dd/impl/application/model_8/* src/org/netbeans/modules/j2ee/dd/impl/application/model_9/* src/org/netbeans/modules/j2ee/dd/impl/application/model_10/* +src/org/netbeans/modules/j2ee/dd/impl/application/model_11/* src/org/netbeans/modules/j2ee/dd/impl/client/model_1_4/* src/org/netbeans/modules/j2ee/dd/impl/client/model_5_0/* src/org/netbeans/modules/j2ee/dd/impl/client/model_6_0/* @@ -13,6 +14,7 @@ src/org/netbeans/modules/j2ee/dd/impl/client/model_7_0/* src/org/netbeans/modules/j2ee/dd/impl/client/model_8_0/* src/org/netbeans/modules/j2ee/dd/impl/client/model_9_0/* src/org/netbeans/modules/j2ee/dd/impl/client/model_10_0/* +src/org/netbeans/modules/j2ee/dd/impl/client/model_11_0/* src/org/netbeans/modules/j2ee/dd/impl/ejb/model_2_1/* src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_0/* src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_1/* @@ -29,4 +31,6 @@ src/org/netbeans/modules/j2ee/dd/impl/web/model_4_0_frag/* src/org/netbeans/modules/j2ee/dd/impl/web/model_5_0/* src/org/netbeans/modules/j2ee/dd/impl/web/model_5_0_frag/* src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0/* -src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0_frag/* \ No newline at end of file +src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0_frag/* +src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1/* +src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1_frag/* \ No newline at end of file diff --git a/enterprise/j2ee.dd/build.xml b/enterprise/j2ee.dd/build.xml index 1f54393a7314..709c27a90f93 100644 --- a/enterprise/j2ee.dd/build.xml +++ b/enterprise/j2ee.dd/build.xml @@ -31,11 +31,13 @@ + + @@ -48,6 +50,7 @@ + @@ -56,6 +59,7 @@ + @@ -203,6 +207,28 @@ rootDir="src" java5="true"/> @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.web.model_6_0_frag; + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.web.model_6_1; + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.web.model_6_1_frag; org.netbeans.modules.j2ee.dd.api.web.ServletMapping25 @@ -542,6 +568,66 @@ public void setServletName(java.lang.String[] value) { public void setServletNames(java.lang.String[] value) { + + public java.lang.String[] getUrlPattern() { + public java.lang.String[] getUrlPatterns() { + + + public void setUrlPattern(java.lang.String[] value) { + public void setUrlPatterns(java.lang.String[] value) { + + + org.netbeans.modules.j2ee.dd.api.web.ServletMapping25 + org.netbeans.modules.j2ee.dd.api.web.ServletMapping + + + + public java.lang.String[] getUrlPattern() { + public java.lang.String[] getUrlPatterns() { + + + public void setUrlPattern(java.lang.String[] value) { + public void setUrlPatterns(java.lang.String[] value) { + + + public java.lang.String[] getServletName() { + public java.lang.String[] getServletNames() { + + + public void setServletName(java.lang.String[] value) { + public void setServletNames(java.lang.String[] value) { + + + + org.netbeans.modules.j2ee.dd.api.web.ServletMapping25 + org.netbeans.modules.j2ee.dd.api.web.ServletMapping + + + + public java.lang.String[] getUrlPattern() { + public java.lang.String[] getUrlPatterns() { + + + public void setUrlPattern(java.lang.String[] value) { + public void setUrlPatterns(java.lang.String[] value) { + + + + public java.lang.String[] getUrlPattern() { + public java.lang.String[] getUrlPatterns() { + + + public void setUrlPattern(java.lang.String[] value) { + public void setUrlPatterns(java.lang.String[] value) { + + + public java.lang.String[] getServletName() { + public java.lang.String[] getServletNames() { + + + public void setServletName(java.lang.String[] value) { + public void setServletNames(java.lang.String[] value) { + setDescription(null); setDisplayName(null); @@ -873,6 +959,72 @@ setLocaleEncodingMappingList(null); setDistributable(null); + setDescription(null); + setDisplayName(null); + setIcon(null); + setName(null); + setContextParam(null); + setFilter(null); + setFilterMapping(null); + setListener(null); + setServlet(null); + setServletMapping(null); + setSessionConfig(null); + setMimeMapping(null); + setWelcomeFileList(null); + setErrorPage(null); + setJspConfig(null); + setSecurityConstraint(null); + setLoginConfig(null); + setSecurityRole(null); + setEnvEntry(null); + setEjbRef(null); + setEjbLocalRef(null); + setServiceRef(null); + setResourceRef(null); + setResourceEnvRef(null); + setMessageDestinationRef(null); + setPersistenceContextRef(null); + setPersistenceUnitRef(null); + setPostConstruct(null); + setPreDestroy(null); + setMessageDestination(null); + setLocaleEncodingMappingList(null); + setDistributable(null); + + setDescription(null); + setDisplayName(null); + setIcon(null); + setName(null); + setContextParam(null); + setFilter(null); + setFilterMapping(null); + setListener(null); + setServlet(null); + setServletMapping(null); + setSessionConfig(null); + setMimeMapping(null); + setWelcomeFileList(null); + setErrorPage(null); + setJspConfig(null); + setSecurityConstraint(null); + setLoginConfig(null); + setSecurityRole(null); + setEnvEntry(null); + setEjbRef(null); + setEjbLocalRef(null); + setServiceRef(null); + setResourceRef(null); + setResourceEnvRef(null); + setMessageDestinationRef(null); + setPersistenceContextRef(null); + setPersistenceUnitRef(null); + setPostConstruct(null); + setPreDestroy(null); + setMessageDestination(null); + setLocaleEncodingMappingList(null); + setDistributable(null); + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.application.model_10; + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.application.model_11; public java.lang.String getVersion() { @@ -1168,6 +1331,22 @@ setVersion("10"); setVersionString("10"); + + public java.lang.String getVersion() { + public java.lang.String getVersionString() { + + + public void setVersion(java.lang.String value) { + public void setVersionString(java.lang.String value) { + + + (getVersion() + (getVersionString() + + + setVersion("11"); + setVersionString("11"); + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.client.model_10_0; + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.client.model_11_0; public java.lang.String getVersion() { @@ -1327,6 +1517,22 @@ setVersion("10"); setVersionString("10"); + + public java.lang.String getVersion() { + public java.lang.String getVersionString() { + + + public void setVersion(java.lang.String value) { + public void setVersionString(java.lang.String value) { + + + (getVersion() + (getVersionString() + + + setVersion("11"); + setVersionString("11"); + @@ -1346,6 +1552,8 @@ + + @@ -1358,6 +1566,7 @@ + @@ -1365,6 +1574,7 @@ + @@ -1439,6 +1649,18 @@ + + + + + + + + + + + + @@ -1513,6 +1735,12 @@ + + + + + + @@ -1556,6 +1784,12 @@ + + + + + + diff --git a/enterprise/j2ee.dd/doc/ddapi_architecture.html b/enterprise/j2ee.dd/doc/ddapi_architecture.html index 5ec6eeac3143..0de651decced 100644 --- a/enterprise/j2ee.dd/doc/ddapi_architecture.html +++ b/enterprise/j2ee.dd/doc/ddapi_architecture.html @@ -625,7 +625,7 @@

5. Time Estimates of the Work

  • October 2003 - DD API proposal and architecture discussion. [done]
  • November 2003 - DD API initial implementation, NbUnit tests. [done]
  • December 2003 - DD API documentation, DD API architecture document, DD API architecture question document. [done]
  • -
  • December 5. 2003 - DD API review - the overall architecture [done] See DDAPI Rewiev Report
  • +
  • December 5. 2003 - DD API review - the overall architecture [done] See DDAPI Rewiev Report
  • January 2004 - DD API review - architecture details (Commitment Review)
  • January 2004 - implementation of (final) changes emerging from DD API Commitment Review
  • diff --git a/enterprise/j2ee.dd/licenseinfo.xml b/enterprise/j2ee.dd/licenseinfo.xml index 8abafdce5d82..1afb7a12332f 100755 --- a/enterprise/j2ee.dd/licenseinfo.xml +++ b/enterprise/j2ee.dd/licenseinfo.xml @@ -125,16 +125,24 @@ src/org/netbeans/modules/j2ee/dd/impl/resources/application_10.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_10.mdd src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_10.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/connector_2_0.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/connector_2_1.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_0.mdd src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_9.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_10.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_11.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_web_services_2_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_web_services_client_2_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_3_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_3_1.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/permissions_9.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/permissions_10.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_5_0.mdd src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_5_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_5_0.xsd @@ -145,6 +153,11 @@ src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_0.mdd src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_0.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_1.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_1.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_1.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.xsd diff --git a/enterprise/j2ee.dd/nbproject/org-netbeans-modules-j2ee-dd.sig b/enterprise/j2ee.dd/nbproject/org-netbeans-modules-j2ee-dd.sig index c0d0b8d729ef..af476a3995eb 100644 --- a/enterprise/j2ee.dd/nbproject/org-netbeans-modules-j2ee-dd.sig +++ b/enterprise/j2ee.dd/nbproject/org-netbeans-modules-j2ee-dd.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.62.0 +#Version 1.63.0 CLSS public abstract interface java.io.Serializable diff --git a/enterprise/j2ee.dd/nbproject/project.properties b/enterprise/j2ee.dd/nbproject/project.properties index c4108f2ff22e..9fcd3a8a745c 100644 --- a/enterprise/j2ee.dd/nbproject/project.properties +++ b/enterprise/j2ee.dd/nbproject/project.properties @@ -18,7 +18,7 @@ javac.compilerargs=-Xlint:all -Xlint:-serial javac.source=1.8 javac.fork=true -spec.version.base=1.63.0 +spec.version.base=1.65.0 is.autoload=true javadoc.arch=${basedir}/arch.xml diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/Application.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/Application.java index b8f758945219..7efc0715a889 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/Application.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/Application.java @@ -38,24 +38,28 @@ public interface Application extends org.netbeans.modules.j2ee.dd.api.common.Roo public static final String VERSION_6="6"; //NOI18N /** - * application.xml DD version for JavaEE7 + * application.xml DD version for Java EE 7 * @since 1.29 */ public static final String VERSION_7 = "7"; //NOI18N /** - * application.xml DD version for JavaEE8/JakartaEE8 + * application.xml DD version for Java EE 8/Jakarta EE 8 * @since 2 */ public static final String VERSION_8 = "8"; //NOI18N /** - * application.xml DD version for JakartaEE9/JakartaEE9.1 + * application.xml DD version for Jakarta EE 9/Jakarta EE 9.1 * @since 2 */ public static final String VERSION_9 = "9"; //NOI18N /** - * application.xml DD version for JakartaEE10 + * application.xml DD version for Jakarta EE 10 */ public static final String VERSION_10 = "10"; //NOI18N + /** + * application.xml DD version for Jakarta EE 11 + */ + public static final String VERSION_11 = "11"; //NOI18N public static final int STATE_VALID=0; public static final int STATE_INVALID_PARSABLE=1; public static final int STATE_INVALID_UNPARSABLE=2; diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java index e25401db687f..89ba3f2e4610 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java @@ -246,8 +246,10 @@ private static Application createApplication(DDParse parse) { return new org.netbeans.modules.j2ee.dd.impl.application.model_8.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); } else if (Application.VERSION_9.equals(version)) { return new org.netbeans.modules.j2ee.dd.impl.application.model_9.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); - }else if (Application.VERSION_10.equals(version)) { + } else if (Application.VERSION_10.equals(version)) { return new org.netbeans.modules.j2ee.dd.impl.application.model_10.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + } else if (Application.VERSION_11.equals(version)) { + return new org.netbeans.modules.j2ee.dd.impl.application.model_11.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); } return jar; } @@ -274,6 +276,10 @@ public InputSource resolveEntity (String publicId, String systemId) { return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_8.xsd"); //NOI18N } else if ("https://jakarta.ee/xml/ns/jakartaee/application_9.xsd".equals(systemId)) { return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_9.xsd"); //NOI18N + } else if ("https://jakarta.ee/xml/ns/jakartaee/application_10.xsd".equals(systemId)) { + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_10.xsd"); //NOI18N + } else if ("https://jakarta.ee/xml/ns/jakartaee/application_11.xsd".equals(systemId)) { + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_11.xsd"); //NOI18N } else { // use the default behaviour return null; @@ -390,7 +396,11 @@ private void extractVersion () { Node vNode = attrs.getNamedItem("version");//NOI18N if(vNode != null) { String versionValue = vNode.getNodeValue(); - if (Application.VERSION_9.equals(versionValue)) { + if (Application.VERSION_11.equals(versionValue)) { + version = Application.VERSION_11; + } else if (Application.VERSION_10.equals(versionValue)) { + version = Application.VERSION_10; + } else if (Application.VERSION_9.equals(versionValue)) { version = Application.VERSION_9; } else if (Application.VERSION_8.equals(versionValue)) { version = Application.VERSION_8; diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/AppClient.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/AppClient.java index f77703239167..61175e205c27 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/AppClient.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/AppClient.java @@ -46,6 +46,7 @@ public interface AppClient extends RootInterface { public static final String VERSION_8_0 = "8"; //NOI18N public static final String VERSION_9_0 = "9"; //NOI18N public static final String VERSION_10_0 = "10"; //NOI18N + public static final String VERSION_11_0 = "11"; //NOI18N public static final int STATE_VALID=0; public static final int STATE_INVALID_PARSABLE=1; public static final int STATE_INVALID_UNPARSABLE=2; diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java index 098a331e7315..f1095478b304 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java @@ -65,6 +65,10 @@ public interface WebApp extends org.netbeans.modules.j2ee.dd.api.common.RootInte * web.xml, web-fragment.xml DD version for JakartaEE10 */ static final String VERSION_6_0 = "6.0"; //NOI18N + /** + * web.xml, web-fragment.xml DD version for Jakarta EE 11 + */ + static final String VERSION_6_1 = "6.1"; //NOI18N static final int STATE_VALID = 0; static final int STATE_INVALID_PARSABLE = 1; static final int STATE_INVALID_UNPARSABLE = 2; diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebFragmentProvider.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebFragmentProvider.java index de00d64f8820..3b5feac01988 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebFragmentProvider.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebFragmentProvider.java @@ -79,7 +79,12 @@ public WebFragment getWebFragmentRoot(FileObject fo) throws IOException, FileNot private WebFragment createWebFragment(FileObject fo, String version) throws IOException, SAXException { try { - if (WebFragment.VERSION_6_0.equals(version)) { + if (WebFragment.VERSION_6_1.equals(version)) { + try (InputStream inputStream = fo.getInputStream()) { + return org.netbeans.modules.j2ee.dd.impl.web.model_6_1_frag.WebFragment.createGraph(inputStream); + } + } else + if (WebFragment.VERSION_6_0.equals(version)) { try (InputStream inputStream = fo.getInputStream()) { return org.netbeans.modules.j2ee.dd.impl.web.model_6_0_frag.WebFragment.createGraph(inputStream); } diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/annotation/AppClientImpl.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/annotation/AppClientImpl.java index 7391505ccbaf..67dd4857a976 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/annotation/AppClientImpl.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/annotation/AppClientImpl.java @@ -113,7 +113,7 @@ private void initEjbRefs() { EjbRefHelper.setEjbRefs(helper, resultEjbRefs, null); - ejbRefs = resultEjbRefs.toArray(new EjbRef[resultEjbRefs.size()]); + ejbRefs = resultEjbRefs.toArray(new EjbRef[0]); } diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/CommonDDAccess.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/CommonDDAccess.java index d26277440d24..5fd6d6d889a2 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/CommonDDAccess.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/CommonDDAccess.java @@ -90,7 +90,7 @@ public static BaseBean newBean(CommonDDBean parent, String beanName, String pkgN pkgName + DOT + beanName); - return (BaseBean) beanClass.newInstance(); + return (BaseBean) beanClass.getDeclaredConstructor().newInstance(); } catch (Exception e) { if (e instanceof ClassNotFoundException) diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/DDUtils.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/DDUtils.java index 0913f6eca722..5a74cbfc8d1d 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/DDUtils.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/DDUtils.java @@ -125,6 +125,8 @@ public static WebApp createWebApp(InputStream is, String version) throws IOExcep return org.netbeans.modules.j2ee.dd.impl.web.model_5_0.WebApp.createGraph(is); } else if (WebApp.VERSION_6_0.equals(version)) { return org.netbeans.modules.j2ee.dd.impl.web.model_6_0.WebApp.createGraph(is); + } else if (WebApp.VERSION_6_1.equals(version)) { + return org.netbeans.modules.j2ee.dd.impl.web.model_6_1.WebApp.createGraph(is); } else { return null; } @@ -155,6 +157,8 @@ public static AppClient createAppClient(InputStream is, String version) throws I return org.netbeans.modules.j2ee.dd.impl.client.model_9_0.ApplicationClient.createGraph(is); } else if (AppClient.VERSION_10_0.equals(version)) { return org.netbeans.modules.j2ee.dd.impl.client.model_10_0.ApplicationClient.createGraph(is); + } else if (AppClient.VERSION_11_0.equals(version)) { + return org.netbeans.modules.j2ee.dd.impl.client.model_11_0.ApplicationClient.createGraph(is); } } catch (RuntimeException ex) { throw new SAXException(ex); diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/CommonAnnotationHelper.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/CommonAnnotationHelper.java index c4bf602d5ea8..e7d042ff7b38 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/CommonAnnotationHelper.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/CommonAnnotationHelper.java @@ -130,7 +130,7 @@ public void handleAnnotation(TypeElement type, Element element, AnnotationMirror } catch (InterruptedException e) { return new SecurityRole[0]; } - return result.toArray(new SecurityRole[result.size()]); + return result.toArray(new SecurityRole[0]); } /** @@ -259,7 +259,7 @@ public static ServiceRef[] getServiceRefs(final AnnotationModelHelper helper, fi List resources = getResources(helper, typeElement); serviceRefs.addAll(getServiceRefs(resources)); - return serviceRefs.toArray(new ServiceRef[serviceRefs.size()]); + return serviceRefs.toArray(new ServiceRef[0]); } /** @@ -279,7 +279,7 @@ public static ServiceRef[] getServiceRefs(final AnnotationModelHelper helper) { List resources = getResources(helper); serviceRefs.addAll(getServiceRefs(resources)); - return serviceRefs.toArray(new ServiceRef[serviceRefs.size()]); + return serviceRefs.toArray(new ServiceRef[0]); } /** @@ -414,7 +414,7 @@ private static ResourceRef[] getResourceRefs(final List resources) elements.add(new ResourceRefImpl(resource)); } } - return elements.toArray(new ResourceRef[elements.size()]); + return elements.toArray(new ResourceRef[0]); } private static EnvEntry[] getEnvEntries(final List resources) { @@ -425,7 +425,7 @@ private static EnvEntry[] getEnvEntries(final List resources) { elements.add(new EnvEntryImpl(resource)); } } - return elements.toArray(new EnvEntry[elements.size()]); + return elements.toArray(new EnvEntry[0]); } private static MessageDestinationRef[] getMessageDestinationRefs(final List resources) { @@ -436,7 +436,7 @@ private static MessageDestinationRef[] getMessageDestinationRefs(final List getServiceRefs(final List resources) { @@ -461,7 +461,7 @@ private static ResourceEnvRef[] getResourceEnvRefs(final List reso elements.add(new ResourceEnvRefImpl(resource)); } } - return elements.toArray(new ResourceEnvRef[elements.size()]); + return elements.toArray(new ResourceEnvRef[0]); } private static void addServiceReference(final List serviceRefs, final Element element, TypeElement parentElement, final AnnotationModelHelper helper) { diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/ServiceRefImpl.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/ServiceRefImpl.java index 8ace7c652dcf..105f65a7d2ae 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/ServiceRefImpl.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/ServiceRefImpl.java @@ -156,7 +156,7 @@ private void initPortComponentRefs() { } } if (sei != null) portComponents.add(new PortComponentRefImpl(sei)); - portComponentRefs = portComponents.toArray(new PortComponentRef[portComponents.size()]); + portComponentRefs = portComponents.toArray(new PortComponentRef[0]); } } diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/ActivationConfigImpl.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/ActivationConfigImpl.java index 7582f7379d68..5c6f5b1027e2 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/ActivationConfigImpl.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/ActivationConfigImpl.java @@ -52,7 +52,7 @@ public void setActivationConfigProperty(ActivationConfigProperty[] value) { @Override public ActivationConfigProperty[] getActivationConfigProperty() { - return properties.toArray(new ActivationConfigProperty[properties.size()]); + return properties.toArray(new ActivationConfigProperty[0]); } @Override diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/EnterpriseBeansImpl.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/EnterpriseBeansImpl.java index 50f1bb7d6ad7..2e24526b0248 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/EnterpriseBeansImpl.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/EnterpriseBeansImpl.java @@ -104,12 +104,12 @@ public Ejb[] getEjbs() { public Session[] getSession() { Collection sessions = sessionManager.getObjects(); - return sessions.toArray(new Session[sessions.size()]); + return sessions.toArray(new Session[0]); } public MessageDriven[] getMessageDriven() { Collection messageDrivens = messageDrivenManager.getObjects(); - return messageDrivens.toArray(new MessageDriven[messageDrivens.size()]); + return messageDrivens.toArray(new MessageDriven[0]); } public Entity[] getEntity() { diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/MessageDrivenImpl.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/MessageDrivenImpl.java index 8fd4185dc459..6a2cea2b425c 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/MessageDrivenImpl.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/MessageDrivenImpl.java @@ -155,8 +155,8 @@ private void initLocalAndRemoteEjbRefs() { EjbRefHelper.setEjbRefsForClass(getHelper(), getTypeElement(), resultEjbRefs, resultEjbLocalRefs); - ejbRefs = resultEjbRefs.toArray(new EjbRef[resultEjbRefs.size()]); - ejbLocalRefs = resultEjbLocalRefs.toArray(new EjbLocalRef[resultEjbLocalRefs.size()]); + ejbRefs = resultEjbRefs.toArray(new EjbRef[0]); + ejbLocalRefs = resultEjbLocalRefs.toArray(new EjbLocalRef[0]); } // diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/SessionImpl.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/SessionImpl.java index 3042cef63c9a..4fac61b7dfba 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/SessionImpl.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/annotation/SessionImpl.java @@ -332,8 +332,8 @@ private void initLocalAndRemoteEjbRefs() { EjbRefHelper.setEjbRefsForClass(getHelper(), getTypeElement(), resultEjbRefs, resultEjbLocalRefs); - ejbRefs = resultEjbRefs.toArray(new EjbRef[resultEjbRefs.size()]); - ejbLocalRefs = resultEjbLocalRefs.toArray(new EjbLocalRef[resultEjbLocalRefs.size()]); + ejbRefs = resultEjbRefs.toArray(new EjbRef[0]); + ejbLocalRefs = resultEjbLocalRefs.toArray(new EjbLocalRef[0]); } @@ -409,12 +409,12 @@ public String getSessionType() { public String[] getBusinessLocal() throws VersionNotSupportedException { initBusinessInterfaces(); - return businessLocal.toArray(new String[businessLocal.size()]); + return businessLocal.toArray(new String[0]); } public String[] getBusinessRemote() throws VersionNotSupportedException { initBusinessInterfaces(); - return businessRemote.toArray(new String[businessRemote.size()]); + return businessRemote.toArray(new String[0]); } public EjbRef[] getEjbRef() { diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.mdd new file mode 100644 index 000000000000..48b4353d4987 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.mdd @@ -0,0 +1,385 @@ + + + + + application-client + https://jakarta.ee/xml/ns/jakartaee + ApplicationClient + org.netbeans.modules.j2ee.dd.api.client.AppClient + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + public void setVersion(java.math.BigDecimal value) { + setAttributeValue(VERSION, value.toString()); + } + public java.math.BigDecimal getVersion() { + return new java.math.BigDecimal(getAttributeValue(VERSION)); + } + + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntry + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EnvEntry, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EnvEntryName"; } + + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResRefName"; } + + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResourceEnvRefName"; } + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationRefName"; } + + + + persistence-context-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextRefType + + + persistence-unit-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceUnitRefType + + + lifecycle-callbackType + https://jakarta.ee/xml/ns/jakartaee + LifecycleCallbackType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClass + java.lang.String + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestination + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestination, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationName"; } + + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdStringType + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + DescriptionType + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayNameType + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.common.Icon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + injection-targetType + https://jakarta.ee/xml/ns/jakartaee + InjectionTarget + org.netbeans.modules.j2ee.dd.api.common.InjectionTarget + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + persistence-context-typeType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextTypeType + java.lang.String + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRef + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServiceRefName"; } + + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.net.URI + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRef + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.common.PortComponentRef + + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + service-ref_handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + service-ref_handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + service-ref_qname-pattern + https://jakarta.ee/xml/ns/jakartaee + ServiceRefQnamePattern + java.lang.String + + + service-ref_protocol-bindingListType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefProtocolBindingListType + String + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + InitParam + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.InitParam, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ParamName"; } + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + + + + handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + version + java.math.BigDecimal + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.xsd new file mode 100644 index 000000000000..538258a1d104 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.xsd @@ -0,0 +1,252 @@ + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/application-client_11.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The application-client element is the root element of an + application client deployment descriptor. The application + client deployment descriptor describes the enterprise bean + components and external resources referenced by the + application client. + + + + + + + + The env-entry-name element contains the name of an + application client's environment entry. The name is a JNDI + name relative to the java:comp/env context. The name must + be unique within an application client. + + + + + + + + + + + The ejb-ref-name element contains the name of an enterprise bean + reference. The enterprise bean reference is an entry + in the application client's environment and is relative to the + java:comp/env context. The name must be unique within the + application client. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference.The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within an application client. + + + + + + + + + + + The resource-env-ref-name element specifies the name of + a resource environment reference; its value is the + environment entry name used in the application client + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + application client. + + + + + + + + + + + The message-destination-ref-name element specifies the + name of a message destination reference; its value is + the message destination reference name used in the + application client code. The name is a JNDI name + relative to the java:comp/env context and must be unique + within an application client. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The callback-handler element names a class provided by + the application. The class must have a no args + constructor and must implement the + jakarta.security.auth.callback.CallbackHandler + interface. The class will be instantiated by the + application client container and used by the container + to collect authentication information from the user. + + + + + + + + + + + + + + + + + The required value for the version is 11. + + + + + + + + + The metadata-complete attribute defines whether this + deployment descriptor and other related deployment + descriptors for this module (e.g., web service + descriptors) are complete, or whether the class + files available to this module and packaged with + this application should be examined for annotations + that specify deployment information. + + If metadata-complete is set to "true", the deployment + tool must ignore any annotations that specify deployment + information, which might be present in the class files + of the application. + + If metadata-complete is not specified or is set to + "false", the deployment tool must examine the class + files of the application for annotations, as + specified by the specifications. + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.mdd new file mode 100644 index 000000000000..3f904a644a8d --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.mdd @@ -0,0 +1,111 @@ + + + + + application + https://jakarta.ee/xml/ns/jakartaee + Application + org.netbeans.modules.j2ee.dd.api.application.Application + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + public void setVersion(java.math.BigDecimal value) { + setAttributeValue(VERSION, value.toString()); + } + public java.math.BigDecimal getVersion() { + return new java.math.BigDecimal(getAttributeValue(VERSION)); + } + + + + moduleType + https://jakarta.ee/xml/ns/jakartaee + Module + org.netbeans.modules.j2ee.dd.api.application.Module + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRole + org.netbeans.modules.j2ee.dd.api.common.SecurityRole + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + pathType + https://jakarta.ee/xml/ns/jakartaee + Path + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + Description + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdString + java.lang.String + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleName + java.lang.String + + + webType + https://jakarta.ee/xml/ns/jakartaee + Web + org.netbeans.modules.j2ee.dd.api.application.Web + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + public String getWebUriId() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(org.netbeans.modules.j2ee.dd.api.application.Application.VERSION_11); + } + public void setWebUriId(String value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(org.netbeans.modules.j2ee.dd.api.application.Application.VERSION_11); + } + + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayName + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + org.netbeans.modules.j2ee.dd.api.common.Icon + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.xsd new file mode 100644 index 000000000000..f45bf73a859a --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.xsd @@ -0,0 +1,390 @@ + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/application_11.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + + The application element is the root element of a Jakarta EE + application deployment descriptor. + + + + + + + + + The context-root element content must be unique + in the ear. + + + + + + + + + + + + The security-role-name element content + must be unique in the ear. + + + + + + + + + + + + + + + + The applicationType defines the structure of the + application. + + + + + + + + + + + If initialize-in-order is true, modules must be initialized + in the order they're listed in this deployment descriptor, + with the exception of application client modules, which can + be initialized in any order. + If initialize-in-order is not set or set to false, the order + of initialization is unspecified and may be product-dependent. + + + + + + + + The application deployment descriptor must have one + module element for each Jakarta EE module in the + application package. A module element is defined + by moduleType definition. + + + + + + + + + + The library-directory element specifies the pathname + of a directory within the application package, relative + to the top level of the application package. All files + named "*.jar" in this directory must be made available + in the class path of all components included in this + application package. If this element isn't specified, + the directory named "lib" is searched. An empty element + may be used to disable searching. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The required value for the version is 11. + + + + + + + + + + + + + + + The moduleType defines a single Jakarta EE module and contains a + connector, ejb, java, or web element, which indicates the + module type and contains a path to the module file, and an + optional alt-dd element, which specifies an optional URI to + the post-assembly version of the deployment descriptor. + + + + + + + + + + + The connector element specifies the URI of a + resource adapter archive file, relative to the + top level of the application package. + + + + + + + + + The ejb element specifies the URI of an ejb-jar, + relative to the top level of the application + package. + + + + + + + + + The java element specifies the URI of a java + application client module, relative to the top + level of the application package. + + + + + + + + + + + The alt-dd element specifies an optional URI to the + post-assembly version of the deployment descriptor + file for a particular Jakarta EE module. The URI must + specify the full pathname of the deployment + descriptor file relative to the application's root + directory. If alt-dd is not specified, the deployer + must read the deployment descriptor from the default + location and file name required by the respective + component specification. + + + + + + + + + + + + + + + The webType defines the web-uri and context-root of + a web application module. + + + + + + + + + The web-uri element specifies the URI of a web + application file, relative to the top level of the + application package. + + + + + + + + + + The context-root element specifies the context root + of a web application. + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_4_0.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_4_0.xsd new file mode 100644 index 000000000000..71ae3d744356 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_4_0.xsd @@ -0,0 +1,372 @@ + + + + + + + + + + ... + + + The deployment descriptor may indicate the published version of + the schema using the xsi:schemaLocation attribute for the Java EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd + + ]]> + + + + + + + Bean classes of enabled beans must be + deployed in bean archives. A library jar, EJB jar, + application client jar or rar archive is a bean archive if + it has a file named beans.xml in the META-INF directory. The + WEB-INF/classes directory of a war is a bean archive if + there is a file named beans.xml in the WEB-INF directory of + the war. A directory in the JVM classpath is a bean archive + if it has a file named beans.xml in the META-INF directory. + + When running in a CDI Lite environment, the bean-discovery-mode + attribute is the only configuration value read from a beans.xml file. + + + + + + + + + + + + + + The version of CDI this beans.xml is for. If the version is "4.0" (or + later), then the attribute bean-discovery-mode must be added. + + + + + + + + + + + + It is strongly recommended you use "annotated". This is now the default and it + is also the default as of 4.0 when an empty beans.xml file is seen. When running + in a CDI Lite environment, this is the only aspect of the beans.xml file that + is used. + + If the bean discovery mode is "all", then all types in this + archive will be considered. If the bean discovery mode is + "annotated", then only those types with bean defining annotations will be + considered. If the bean discovery mode is "none", then no + types will be considered. + + + + + + + + Only those types with bean defining annotations will be + considered. + + + + + + + All types in this archive will be considered. + + + + + + + This archive will be ignored. + + + + + + + + + + + + + element allows exclusion of classes and packages from consideration. Various filters may be applied, and may be conditionally activated.]]> + + + + + + + + would exclude all classes and subpackages of com.acme.]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + would exclude all classes and subpackages of com.acme.]]> + + + + + + + + + + + + + + + + + + By default, a bean archive has no enabled + interceptors bound via interceptor bindings. An interceptor + must be explicitly enabled by listing its class under the + <interceptors> element of the beans.xml file of the + bean archive. The order of the interceptor declarations + determines the interceptor ordering. Interceptors which + occur earlier in the list are called first. If the same + class is listed twice under the <interceptors> + element, the container automatically detects the problem and + treats it as a deployment problem. + + + + + + + + Each child <class> element + must specify the name of an interceptor class. If + there is no class with the specified name, or if + the class with the specified name is not an + interceptor class, the container automatically + detects the problem and treats it as a deployment + problem. + + + + + + + + + + + By default, a bean archive has no enabled + decorators. A decorator must be explicitly enabled by + listing its bean class under the <decorators> element + of the beans.xml file of the bean archive. The order of the + decorator declarations determines the decorator ordering. + Decorators which occur earlier in the list are called first. + If the same class is listed twice under the + <decorators> element, the container automatically + detects the problem and treats it as a deployment problem. + + + + + + + + Each child <class> element + must specify the name of a decorator class. If + there is no class with the specified name, or if + the class with the specified name is not a + decorator class, the container automatically + detects the problem and treats it as a deployment + problem. + + + + + + + + + + + An alternative is a bean that must be + explicitly declared in the beans.xml file if it should be + available for lookup, injection or EL resolution. By + default, a bean archive has no selected alternatives. An + alternative must be explicitly declared using the + <alternatives> element of the beans.xml file of the + bean archive. The <alternatives> element contains a + list of bean classes and stereotypes. An alternative is + selected for the bean archive if either: the alternative is + a managed bean or session bean and the bean class of the + bean is listed, or the alternative is a producer method, + field or resource, and the bean class that declares the + method or field is listed, or any @Alternative stereotype of + the alternative is listed. + + + + + + + + Each child <class> element + must specify the name of an alternative bean class. + If there is no class with the specified name, or if + the class with the specified name is not an + alternative bean class, the container automatically + detects the problem and treats it as a deployment + problem. If the same class is listed twice under + the <alternatives> element, the container + automatically detects the problem and treats it as + a deployment problem. + + + + + + + + Each child <stereotype> + element must specify the name of an @Alternative + stereotype annotation. If there is no annotation + with the specified name, or the annotation is not + an @Alternative stereotype, the container + automatically detects the problem and treats it as + a deployment problem. If the same stereotype is + listed twice under the <alternatives> + element, the container automatically detects the + problem and treats it as a deployment problem. + + + + + + + + + + If an explicit bean archive contains the <trim/< element in its beans.xml file, types that don’t have + either a bean defining annotation (as defined in Bean defining annotations) or any scope annotation, + are removed from the set of discovered types. + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_4_1.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_4_1.xsd new file mode 100644 index 000000000000..f5e05e80a87c --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_4_1.xsd @@ -0,0 +1,372 @@ + + + + + + + + + + ... + + + The deployment descriptor may indicate the published version of + the schema using the xsi:schemaLocation attribute for the Java EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/beans_4_1.xsd + + ]]> + + + + + + + Bean classes of enabled beans must be + deployed in bean archives. A library jar, EJB jar, + application client jar or rar archive is a bean archive if + it has a file named beans.xml in the META-INF directory. The + WEB-INF/classes directory of a war is a bean archive if + there is a file named beans.xml in the WEB-INF directory of + the war. A directory in the JVM classpath is a bean archive + if it has a file named beans.xml in the META-INF directory. + + When running in a CDI Lite environment, the bean-discovery-mode + attribute is the only configuration value read from a beans.xml file. + + + + + + + + + + + + + + The version of CDI this beans.xml is for. If the version is "4.1" (or + later), then the attribute bean-discovery-mode must be added. + + + + + + + + + + + + It is strongly recommended you use "annotated". This is now the default and it + is also the default as of 4.1 when an empty beans.xml file is seen. When running + in a CDI Lite environment, this is the only aspect of the beans.xml file that + is used. + + If the bean discovery mode is "all", then all types in this + archive will be considered. If the bean discovery mode is + "annotated", then only those types with bean defining annotations will be + considered. If the bean discovery mode is "none", then no + types will be considered. + + + + + + + + Only those types with bean defining annotations will be + considered. + + + + + + + All types in this archive will be considered. + + + + + + + This archive will be ignored. + + + + + + + + + + + + + element allows exclusion of classes and packages from consideration. Various filters may be applied, and may be conditionally activated.]]> + + + + + + + + would exclude all classes and subpackages of com.acme.]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + would exclude all classes and subpackages of com.acme.]]> + + + + + + + + + + + + + + + + + + By default, a bean archive has no enabled + interceptors bound via interceptor bindings. An interceptor + must be explicitly enabled by listing its class under the + <interceptors> element of the beans.xml file of the + bean archive. The order of the interceptor declarations + determines the interceptor ordering. Interceptors which + occur earlier in the list are called first. If the same + class is listed twice under the <interceptors> + element, the container automatically detects the problem and + treats it as a deployment problem. + + + + + + + + Each child <class> element + must specify the name of an interceptor class. If + there is no class with the specified name, or if + the class with the specified name is not an + interceptor class, the container automatically + detects the problem and treats it as a deployment + problem. + + + + + + + + + + + By default, a bean archive has no enabled + decorators. A decorator must be explicitly enabled by + listing its bean class under the <decorators> element + of the beans.xml file of the bean archive. The order of the + decorator declarations determines the decorator ordering. + Decorators which occur earlier in the list are called first. + If the same class is listed twice under the + <decorators> element, the container automatically + detects the problem and treats it as a deployment problem. + + + + + + + + Each child <class> element + must specify the name of a decorator class. If + there is no class with the specified name, or if + the class with the specified name is not a + decorator class, the container automatically + detects the problem and treats it as a deployment + problem. + + + + + + + + + + + An alternative is a bean that must be + explicitly declared in the beans.xml file if it should be + available for lookup, injection or EL resolution. By + default, a bean archive has no selected alternatives. An + alternative must be explicitly declared using the + <alternatives> element of the beans.xml file of the + bean archive. The <alternatives> element contains a + list of bean classes and stereotypes. An alternative is + selected for the bean archive if either: the alternative is + a managed bean or session bean and the bean class of the + bean is listed, or the alternative is a producer method, + field or resource, and the bean class that declares the + method or field is listed, or any @Alternative stereotype of + the alternative is listed. + + + + + + + + Each child <class> element + must specify the name of an alternative bean class. + If there is no class with the specified name, or if + the class with the specified name is not an + alternative bean class, the container automatically + detects the problem and treats it as a deployment + problem. If the same class is listed twice under + the <alternatives> element, the container + automatically detects the problem and treats it as + a deployment problem. + + + + + + + + Each child <stereotype> + element must specify the name of an @Alternative + stereotype annotation. If there is no annotation + with the specified name, or the annotation is not + an @Alternative stereotype, the container + automatically detects the problem and treats it as + a deployment problem. If the same stereotype is + listed twice under the <alternatives> + element, the container automatically detects the + problem and treats it as a deployment problem. + + + + + + + + + + If an explicit bean archive contains the <trim/< element in its beans.xml file, types that don’t have + either a bean defining annotation (as defined in Bean defining annotations) or any scope annotation, + are removed from the set of discovered types. + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/connector_2_1.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/connector_2_1.xsd new file mode 100644 index 000000000000..e0ac46d5f1ab --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/connector_2_1.xsd @@ -0,0 +1,1165 @@ + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/connector_2_1.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The connector element is the root element of the deployment + descriptor for the resource adapter. This element includes + general information - vendor name, resource adapter version, + icon - about the resource adapter module. It also includes + information specific to the implementation of the resource + adapter library as specified through the element + resourceadapter. + + + + + + + + + + + + + The activationspecType specifies an activation + specification. The information includes fully qualified + Java class name of an activation specification and a set of + required configuration property names. + + + + + + + + com.wombat.ActivationSpecImpl + + + ]]> + + + + + + + + The required-config-property element is deprecated since + Connectors 1.6 specification. The resource adapter + implementation is recommended to use the @NotNull + Bean Validation annotation or its XML validation + descriptor equivalent to indicate that a configuration + property is required to be specified by the deployer. + See the Jakarta Connectors specification for more information. + + + + + + + + + + + + + + + + + The adminobjectType specifies information about an + administered object. Administered objects are specific to a + messaging style or message provider. This contains + information on the Java type of the interface implemented by + an administered object, its Java class name and its + configuration properties. + + + + + + + + jakarta.jms.Destination + + + ]]> + + + + + + + com.wombat.DestinationImpl + + + ]]> + + + + + + + + + + + + + + + + The authentication-mechanismType specifies an authentication + mechanism supported by the resource adapter. Note that this + support is for the resource adapter and not for the + underlying EIS instance. The optional description specifies + any resource adapter specific requirement for the support of + security contract and authentication mechanism. + + Note that BasicPassword mechanism type should support the + jakarta.resource.spi.security.PasswordCredential interface. + The Kerbv5 mechanism type should support the + org.ietf.jgss.GSSCredential interface or the deprecated + jakarta.resource.spi.security.GenericCredential interface. + + + + + + + + + BasicPassword + + + Kerbv5 + + + Any additional security mechanisms are outside the + scope of the Jakarta Connectors architecture specification. + + ]]> + + + + + + + + + + + + + + + ServerName + + ]]> + + + + + + + + + + + + + + java.lang.String + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + The config-propertyType contains a declaration of a single + configuration property that may be used for providing + configuration information. + + The declaration consists of an optional description, name, + type and an optional value of the configuration property. If + the resource adapter provider does not specify a value than + the deployer is responsible for providing a valid value for + a configuration property. + + Any bounds or well-defined values of properties should be + described in the description element. + + + + + + + + + + + WombatServer + + ]]> + + + + + + + + The element config-property-ignore is used to specify + whether the configuration tools must ignore considering the + configuration property during auto-discovery of + Configuration properties. See the Jakarta Connectors specification for + more details. If unspecified, the container must not ignore + the configuration property during auto-discovery. + This element must be one of the following, "true" or "false". + + + + + + + + + The element config-property-supports-dynamic-updates is used to specify + whether the configuration property allows its value to be updated, by + application server's configuration tools, during the lifetime of + the JavaBean instance. See the Jakarta Connectors specification for + more details. If unspecified, the container must not dynamically + reconfigure the property. + This element must be one of the following, "true" or "false". + + + + + + + + + The element config-property-confidential is used to specify + whether the configuration property is confidential and + recommends application server's configuration tools to use special + visual aids for editing them. See the Jakarta Connectors specification for + more details. If unspecified, the container must not treat the + property as confidential. + This element must be one of the following, "true" or "false". + + + + + + + + + + + + + + + + The connection-definitionType defines a set of connection + interfaces and classes pertaining to a particular connection + type. This also includes configurable properties for + ManagedConnectionFactory instances that may be produced out + of this set. + + + + + + + + + com.wombat.ManagedConnectionFactoryImpl + + + ]]> + + + + + + + + com.wombat.ConnectionFactory + + + OR + + jakarta.resource.cci.ConnectionFactory + + + ]]> + + + + + + + com.wombat.ConnectionFactoryImpl + + + ]]> + + + + + + + jakarta.resource.cci.Connection + + + ]]> + + + + + + + com.wombat.ConnectionImpl + + + ]]> + + + + + + + + + + + + + + + The connectorType defines a resource adapter. + + + + + + + + + The element module-name specifies the name of the + resource adapter. + + If there is no module-name specified, the module-name + is determined as defined in Section EE.8.1.1 and EE.8.1.2 + of the Java Platform, Enterprise Edition (Jakarta EE) + Specification, version 6. + + + + + + + + + + The element vendor-name specifies the name of + resource adapter provider vendor. + + If there is no vendor-name specified, the application + server must consider the default "" (empty string) as + the name of the resource adapter provider vendor. + + + + + + + + + The element eis-type contains information about the + type of the EIS. For example, the type of an EIS can + be product name of EIS independent of any version + info. + + This helps in identifying EIS instances that can be + used with this resource adapter. + + If there is no eis-type specified, the application + server must consider the default "" (empty string) as + the type of the EIS. + + + + + + + + + The element resourceadapter-version specifies a string-based version + of the resource adapter from the resource adapter + provider. + + If there is no resourceadapter-version specified, the application + server must consider the default "" (empty string) as + the version of the resource adapter. + + + + + + + + + + + + The element required-work-context specifies a fully qualified class + name that implements WorkContext interface, that the resource adapter + requires the application server to support. + + + + + + + + + + The version indicates the version of the schema to be used by the + deployment tool. This element doesn't have a default, and the resource adapter + developer/deployer is required to specify it. The element allows the deployment + tool to choose which schema to validate the descriptor against. + + + + + + + + + + The metadata-complete attribute defines whether the deployment + descriptor for the resource adapter module is complete, or whether + the class files available to the module and packaged with the resource + adapter should be examined for annotations that specify deployment + information. + + If metadata-complete is set to "true", the deployment tool of the + application server must ignore any annotations that specify deployment + information, which might be present in the class files of the + application.If metadata-complete is not specified or is set to "false", + the deployment tool must examine the class files of the application for + annotations, as specified by this specification. If the + deployment descriptor is not included or is included but not marked + metadata-complete, the deployment tool will process annotations. + + Application servers must assume that metadata-complete is true for + resource adapter modules with deployment descriptor version + lower than 1.6. + + + + + + + + + + + + + + + The credential-interfaceType specifies the + interface that the resource adapter implementation + supports for the representation of the + credentials. This element(s) that use this type, + i.e. credential-interface, should be used by + application server to find out the Credential + interface it should use as part of the security + contract. + + The possible values are: + + jakarta.resource.spi.security.PasswordCredential + org.ietf.jgss.GSSCredential + jakarta.resource.spi.security.GenericCredential + + + + + + + + + + + + + + + + + + + + The inbound-resourceadapterType specifies information + about an inbound resource adapter. This contains information + specific to the implementation of the resource adapter + library as specified through the messageadapter element. + + + + + + + + + + The messagelistener-type element content must be + unique in the messageadapter. Several messagelisteners + can not use the same messagelistener-type. + + + + + + + + + + + + + + + + + + + The licenseType specifies licensing requirements for the + resource adapter module. This type specifies whether a + license is required to deploy and use this resource adapter, + and an optional description of the licensing terms + (examples: duration of license, number of connection + restrictions). It is used by the license element. + + + + + + + + + + The element license-required specifies whether a + license is required to deploy and use the + resource adapter. This element must be one of + the following, "true" or "false". + + + + + + + + + + + + + + + + The messageadapterType specifies information about the + messaging capabilities of the resource adapter. This + contains information specific to the implementation of the + resource adapter library as specified through the + messagelistener element. + + + + + + + + + + + + + + + + + The messagelistenerType specifies information about a + specific message listener supported by the messaging + resource adapter. It contains information on the Java type + of the message listener interface and an activation + specification. + + + + + + + + jakarta.jms.MessageListener + + + ]]> + + + + + + + + + + + + + + + + The outbound-resourceadapterType specifies information about + an outbound resource adapter. The information includes fully + qualified names of classes/interfaces required as part of + the connector architecture specified contracts for + connection management, level of transaction support + provided, one or more authentication mechanisms supported + and additional required security permissions. + + If any of the outbound resource adapter elements (transaction-support, + authentication-mechanism, reauthentication-support) is specified through + this element or metadata annotations, and no connection-definition is + specified as part of this element or through annotations, the + application server must consider this an error and fail deployment. + + If there is no authentication-mechanism specified as part of + this element or metadata annotations, then the resource adapter does + not support any standard security authentication mechanisms as + part of security contract. The application server ignores the security + part of the system contracts in this case. + + If there is no transaction-support specified as part of this element + or metadata annotation, then the application server must consider that + the resource adapter does not support either the resource manager local + or Jakarta Transactions transactions and must consider the transaction support as + NoTransaction. Note that resource adapters may specify the level of + transaction support to be used at runtime for a ManagedConnectionFactory + through the TransactionSupport interface. + + If there is no reauthentication-support specified as part of + this element or metadata annotation, then the application server must consider + that the resource adapter does not support re-authentication of + ManagedConnections. + + + + + + + + + + + + The element reauthentication-support specifies + whether the resource adapter implementation supports + re-authentication of existing Managed- Connection + instance. Note that this information is for the + resource adapter implementation and not for the + underlying EIS instance. This element must have + either a "true" or "false" value. + + + + + + + + + + + + + + + + + Destination + + + ]]> + + + + + + + + + + + + + + + + + The resourceadapterType specifies information about the + resource adapter. The information includes fully qualified + resource adapter Java class name, configuration properties, + information specific to the implementation of the resource + adapter library as specified through the + outbound-resourceadapter and inbound-resourceadapter + elements, and an optional set of administered objects. + + + + + + + + + The element resourceadapter-class specifies the + fully qualified name of a Java class that implements + the jakarta.resource.spi.ResourceAdapter + interface. This Java class is provided as part of + resource adapter's implementation of connector + architecture specified contracts. The implementation + of this class is required to be a JavaBean. + + + + + + + + + + + The connectionfactory-interface element content + must be unique in the outbound-resourceadapter. + Multiple connection-definitions can not use the + same connectionfactory-type. + + + + + + + + + + + + + + The adminobject-interface and adminobject-class element content must be + unique in the resourceadapterType. Several admin objects + can not use the same adminobject-interface and adminobject-class. + + + + + + + + + + + + + + + + + + + + + The security-permissionType specifies a security + permission that is required by the resource adapter code. + + The security permission listed in the deployment descriptor + are ones that are different from those required by the + default permission set as specified in the connector + specification. The optional description can mention specific + reason that resource adapter requires a given security + permission. + + + + + + + + + + The element security-permission-spec specifies a security + permission based on the Security policy file + syntax. Refer to the following URL for Sun's + implementation of the security permission + specification: + + http://docs.oracle.com/javase/6/docs/technotes/guides/security/PolicyFiles.html + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_11.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_11.xsd new file mode 100644 index 000000000000..4f8e7c01a084 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_11.xsd @@ -0,0 +1,3631 @@ + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + The following definitions that appear in the common + shareable schema(s) of Jakarta EE deployment descriptors should be + interpreted with respect to the context they are included: + + + Deployment Component may indicate one of the following: + Jakarta EE application; + application client; + web application; + enterprise bean; + resource adapter; + + Deployment File may indicate one of the following: + ear file; + war file; + jar file; + rar file; + + + + + + + + + + + + + + + This group keeps the usage of the contained description related + elements consistent across Jakarta EE deployment descriptors. + + All elements may occur multiple times with different languages, + to support localization of the content. + + + + + + + + + + + + + + + + + This group keeps the usage of the contained JNDI environment + reference elements consistent across Jakarta EE deployment descriptors. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This group collects elements that are common to most + JNDI resource elements. + + + + + + + + + + + + The JNDI name to be looked up to resolve a resource reference. + + + + + + + + + + + + + + + This group collects elements that are common to all the + JNDI resource elements. It does not include the lookup-name + element, that is only applicable to some resource elements. + + + + + + + + + + + + + + + + + + + + + + + + Configuration of an administered object. + + + + + + + + + Description of this administered object. + + + + + + + + + The name element specifies the JNDI name of the + administered object being defined. + + + + + + + + + The administered object's interface type. + + + + + + + + + The administered object's class name. + + + + + + + + + Resource adapter name. + + + + + + + + + Property of the administered object property. This may be a + vendor-specific property. + + + + + + + + + + + + + + + Configuration of a Connector Connection Factory resource. + + + + + + + + + Description of this resource. + + + + + + + + + The name element specifies the JNDI name of the + resource being defined. + + + + + + + + + The fully qualified class name of the connection factory + interface. + + + + + + + + + + Resource adapter name. + + + + + + + + + Maximum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + Minimum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + The level of transaction support the connection factory + needs to support. + + + + + + + + + Resource property. This may be a vendor-specific + property. + + + + + + + + + + + + + + + Configuration of a ContextService. + + + + + + + + + Description of this ContextService. + + + + + + + + + JNDI name of the ContextService instance being defined. + The JNDI name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + + + + + + + + + A ContextService injection point annotated with these qualifier annotations + injects a bean that is produced by this context-service element. + Applications can define their own Producers for ContextService injection points + as long as the qualifier annotations on the producer do not conflict with the + non-empty qualifier list of a context-service. + + You can specify a single qualifier element with no value to indicate an + empty list of qualifier annotation classes. + + + + + + + + + Types of context to clear whenever a thread runs a + contextual task or action. The thread's previous context + is restored afterward. Context types that are defined by + the Jakarta EE Concurrency specification include: + Application, Security, Transaction, + and Remaining, which means all available thread context + types that are not specified elsewhere. You can also specify + vendor-specific context types. Absent other configuration, + cleared context defaults to Transaction. You can specify + a single cleared element with no value to indicate an + empty list of context types to clear. If neither + propagated nor unchanged specify (or default to) Remaining, + then Remaining is automatically appended to the list of + cleared context types. + + + + + + + + + Types of context to capture from the requesting thread + and propagate to a thread that runs a contextual task + or action. The captured context is re-established + when threads run the contextual task or action, + with the respective thread's previous context being + restored afterward. Context types that are defined by + the Jakarta EE Concurrency specification include: + Application, Security, + and Remaining, which means all available thread context + types that are not specified elsewhere. You can also specify + vendor-specific context types. Absent other configuration, + propagated context defaults to Remaining. You can specify + a single propagated element with no value to indicate that + no context types should be propagated. + + + + + + + + + Types of context that are left alone when a thread runs a + contextual task or action. Context types that are defined + by the Jakarta EE Concurrency specification include: + Application, Security, Transaction, + and Remaining, which means all available thread context + types that are not specified elsewhere. You can also specify + vendor-specific context types. Absent other configuration, + unchanged context defaults to empty. You can specify + a single unchanged element with no value to indicate that + no context types should be left unchanged. + + + + + + + + + Vendor-specific property. + + + + + + + + + + + + + + + + Configuration of a DataSource. + + + + + + + + + Description of this DataSource. + + + + + + + + + The name element specifies the JNDI name of the + data source being defined. + + + + + + + + + + DataSource, XADataSource or ConnectionPoolDataSource + implementation class. + + + + + + + + + Database server name. + + + + + + + + + Port number where a server is listening for requests. + + + + + + + + + Name of a database on a server. + + + + + + + + url property is specified + along with other standard DataSource properties + such as serverName, databaseName + and portNumber, the more specific properties will + take precedence and url will be ignored. + + ]]> + + + + + + + + User name to use for connection authentication. + + + + + + + + + Password to use for connection authentication. + + + + + + + + + JDBC DataSource property. This may be a vendor-specific + property or a less commonly used DataSource property. + + + + + + + + + Sets the maximum time in seconds that this data source + will wait while attempting to connect to a database. + + + + + + + + + Set to false if connections should not participate in + transactions. + + + + + + + + + Isolation level for connections. + + + + + + + + + Number of connections that should be created when a + connection pool is initialized. + + + + + + + + + Maximum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + Minimum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + The number of seconds that a physical connection should + remain unused in the pool before the connection is + closed for a connection pool. + + + + + + + + + The total number of statements that a connection pool + should keep open. + + + + + + + + + + + + + + + + The description type is used by a description element to + provide text describing the parent element. The elements + that use this type should include any information that the + Deployment Component's Deployment File file producer wants + to provide to the consumer of the Deployment Component's + Deployment File (i.e., to the Deployer). Typically, the + tools used by such a Deployment File consumer will display + the description when processing the parent element that + contains the description. + + The lang attribute defines the language that the + description is provided in. The default value is "en" (English). + + + + + + + + + + + + + + + + + This type defines a dewey decimal that is used + to describe versions of documents. + + + + + + + + + + + + + + + + Employee Self Service + + + The value of the xml:lang attribute is "en" (English) by default. + + ]]> + + + + + + + + + + + + + + + EmployeeRecord + + ../products/product.jar#ProductEJB + + ]]> + + + + + + + + + + + + + + The ejb-local-refType is used by ejb-local-ref elements for + the declaration of a reference to an enterprise bean's local + home or to the local business interface of a 3.0 bean. + The declaration consists of: + + - an optional description + - the enterprise bean's reference name used in the code of the + Deployment Component that's referencing the enterprise bean. + - the optional expected type of the referenced enterprise bean + - the optional expected local interface of the referenced + enterprise bean or the local business interface of the + referenced enterprise bean. + - the optional expected local home interface of the referenced + enterprise bean. Not applicable if this ejb-local-ref refers + to the local business interface of a 3.0 bean. + - optional ejb-link information, used to specify the + referenced enterprise bean + - optional elements to define injection of the named enterprise + bean into a component field or property. + + + + + + + + + + + + + + + + + + + + + + ejb/Payroll + + ]]> + + + + + + + + + + + + + + The ejb-refType is used by ejb-ref elements for the + declaration of a reference to an enterprise bean's home or + to the remote business interface of a 3.0 bean. + The declaration consists of: + + - an optional description + - the enterprise bean's reference name used in the code of + the Deployment Component that's referencing the enterprise + bean. + - the optional expected type of the referenced enterprise bean + - the optional remote interface of the referenced enterprise bean + or the remote business interface of the referenced enterprise + bean + - the optional expected home interface of the referenced + enterprise bean. Not applicable if this ejb-ref + refers to the remote business interface of a 3.0 bean. + - optional ejb-link information, used to specify the + referenced enterprise bean + - optional elements to define injection of the named enterprise + bean into a component field or property + + + + + + + + + + + + + + + + + + + + + + + + The ejb-ref-typeType contains the expected type of the + referenced enterprise bean. + + The ejb-ref-type designates a value + that must be one of the following: + + Entity + Session + + + + + + + + + + + + + + + + + + This type is used to designate an empty + element when used. + + + + + + + + + + + + + The env-entryType is used to declare an application's + environment entry. The declaration consists of an optional + description, the name of the environment entry, a type + (optional if the value is injected, otherwise required), and + an optional value. + + It also includes optional elements to define injection of + the named resource into fields or JavaBeans properties. + + If a value is not specified and injection is requested, + no injection will occur and no entry of the specified name + will be created. This allows an initial value to be + specified in the source code without being incorrectly + changed when no override has been specified. + + If a value is not specified and no injection is requested, + a value must be supplied during deployment. + + This type is used by env-entry elements. + + + + + + + + + + minAmount + + ]]> + + + + + + + + java.lang.Integer + + ]]> + + + + + + + + 100.00 + + ]]> + + + + + + + + + + + + + + + + java.lang.Boolean + java.lang.Class + com.example.Color + + ]]> + + + + + + + + + + + + + + The elements that use this type designate the name of a + Java class or interface. The name is in the form of a + "binary name", as defined in the JLS. This is the form + of name used in Class.forName(). Tools that need the + canonical name (the name used in source code) will need + to convert this binary name to the canonical name. + + + + + + + + + + + + + + + This type defines four different values which can designate + boolean values. This includes values yes and no which are + not designated by xsd:boolean + + + + + + + + + + + + + + + + + + + + The icon type contains small-icon and large-icon elements + that specify the file names for small and large GIF, JPEG, + or PNG icon images used to represent the parent element in a + GUI tool. + + The xml:lang attribute defines the language that the + icon file names are provided in. Its value is "en" (English) + by default. + + + + + + + + + employee-service-icon16x16.jpg + + ]]> + + + + + + + employee-service-icon32x32.jpg + + ]]> + + + + + + + + + + + + + + + + + + An injection target specifies a class and a name within + that class into which a resource should be injected. + + The injection target class specifies the fully qualified + class name that is the target of the injection. The + Jakarta EE specifications describe which classes can be an + injection target. + + The injection target name specifies the target within + the specified class. The target is first looked for as a + JavaBeans property name. If not found, the target is + looked for as a field name. + + The specified resource will be injected into the target + during initialization of the class by either calling the + set method for the target property or by setting a value + into the named field. + + + + + + + + + + + + + + + + The following transaction isolation levels are allowed + (see documentation for the java.sql.Connection interface): + TRANSACTION_READ_UNCOMMITTED + TRANSACTION_READ_COMMITTED + TRANSACTION_REPEATABLE_READ + TRANSACTION_SERIALIZABLE + + + + + + + + + + + + + + + + + + The java-identifierType defines a Java identifier. + The users of this type should further verify that + the content does not contain Java reserved keywords. + + + + + + + + + + + + + + + + + This is a generic type that designates a Java primitive + type or a fully qualified name of a Java interface/type, + or an array of such types. + + + + + + + + + + + + + + + + : + + Example: + + jdbc:mysql://localhost:3307/testdb + + ]]> + + + + + + + + + + + + + + + + Configuration of a Messaging Connection Factory. + + + + + + + + + Description of this Messaging Connection Factory. + + + + + + + + + The name element specifies the JNDI name of the + messaging connection factory being defined. + + + + + + + + + Fully-qualified name of the messaging connection factory + interface. Permitted values are jakarta.jms.ConnectionFactory, + jakarta.jms.QueueConnectionFactory, or + jakarta.jms.TopicConnectionFactory. If not specified, + jakarta.jms.ConnectionFactory will be used. + + + + + + + + + Fully-qualified name of the messaging connection factory + implementation class. Ignored if a resource adapter + is used. + + + + + + + + + Resource adapter name. If not specified, the application + server will define the default behavior, which may or may + not involve the use of a resource adapter. + + + + + + + + + User name to use for connection authentication. + + + + + + + + + Password to use for connection authentication. + + + + + + + + + Client id to use for connection. + + + + + + + + + Messaging Connection Factory property. This may be a vendor-specific + property or a less commonly used ConnectionFactory property. + + + + + + + + + Set to false if connections should not participate in + transactions. + + + + + + + + + Maximum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + Minimum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + + + + + + + + Configuration of a Messaging Destination. + + + + + + + + + Description of this Messaging Destination. + + + + + + + + + The name element specifies the JNDI name of the + messaging destination being defined. + + + + + + + + + Fully-qualified name of the messaging destination interface. + Permitted values are jakarta.jms.Queue and jakarta.jms.Topic + + + + + + + + + Fully-qualified name of the messaging destination implementation + class. Ignored if a resource adapter is used unless the + resource adapter defines more than one destination implementation + class for the specified interface. + + + + + + + + + Resource adapter name. If not specified, the application + server will define the default behavior, which may or may + not involve the use of a resource adapter. + + + + + + + + + Name of the queue or topic. + + + + + + + + + Messaging Destination property. This may be a vendor-specific + property or a less commonly used Destination property. + + + + + + + + + + + + + + + + + The jndi-nameType type designates a JNDI name in the + Deployment Component's environment and is relative to the + java:comp/env context. A JNDI name must be unique within the + Deployment Component. + + + + + + + + + + + + + + com.aardvark.payroll.PayrollHome + + ]]> + + + + + + + + + + + + + + + The lifecycle-callback type specifies a method on a + class to be called when a lifecycle event occurs. + Note that each class may have only one lifecycle callback + method for any given event and that the method may not + be overloaded. + + If the lifefycle-callback-class element is missing then + the class defining the callback is assumed to be the + component class in scope at the place in the descriptor + in which the callback definition appears. + + + + + + + + + + + + + + + + The listenerType indicates the deployment properties for a web + application listener bean. + + + + + + + + + + + The listener-class element declares a class in the + application must be registered as a web + application listener bean. The value is the fully + qualified classname of the listener class. + + + + + + + + + + + + + + + The localType defines the fully-qualified name of an + enterprise bean's local interface. + + + + + + + + + + + + + + + The local-homeType defines the fully-qualified + name of an enterprise bean's local home interface. + + + + + + + + + + + + + + + Configuration of a Mail Session resource. + + + + + + + + + Description of this Mail Session resource. + + + + + + + + + The name element specifies the JNDI name of the + Mail Session resource being defined. + + + + + + + + + Storage protocol. + + + + + + + + + Service provider store protocol implementation class + + + + + + + + + Transport protocol. + + + + + + + + + Service provider transport protocol implementation class + + + + + + + + + Mail server host name. + + + + + + + + + Mail server user name. + + + + + + + + + Password. + + + + + + + + + Email address to indicate the message sender. + + + + + + + + + Mail server property. This may be a vendor-specific + property. + + + + + + + + + + + + + + + + Configuration of a ManagedExecutorService. + + + + + + + + + Description of this ManagedExecutorService. + + + + + + + + + JNDI name of the ManagedExecutorService instance being defined. + The JNDI name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + + + + + + + + + Refers to the name of a ContextServiceDefinition or + context-service deployment descriptor element, + which determines how context is applied to tasks and actions + that run on this executor. + The name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + In the absence of a configured value, + java:comp/DefaultContextService is used. + + + + + + + + + A ManagedExecutorService injection point annotated with these qualifier annotations + injects a bean that is produced by this managed-executor element. + Applications can define their own Producers for ManagedExecutorService injection points + as long as the qualifier annotations on the producer do not conflict with the + non-empty qualifier list of a managed-executor. + + You can specify a single qualifier element with no value to indicate an + empty list of qualifier annotation classes. + + + + + + + + + Upper bound on contextual tasks and actions that this executor + will simultaneously execute asynchronously. This constraint does + not apply to tasks and actions that the executor runs inline, + such as when a thread requests CompletableFuture.join and the + action runs inline if it has not yet started. + The default is unbounded, although still subject to + resource constraints of the system. + + + + + + + + + The amount of time in milliseconds that a task or action + can execute before it is considered hung. + + + + + + + + + Indicates whether this executor is requested to + create virtual threads for tasks that do not run inline. + When true, the executor can create + virtual threads if it is capable of doing so + and if the request is not overridden by vendor-specific + configuration that restricts the use of virtual threads. + + + + + + + + + Vendor-specific property. + + + + + + + + + + + + + + + + Configuration of a ManagedScheduledExecutorService. + + + + + + + + + Description of this ManagedScheduledExecutorService. + + + + + + + + + JNDI name of the ManagedScheduledExecutorService instance + being defined. + The JNDI name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + + + + + + + + + Refers to the name of a ContextServiceDefinition or + context-service deployment descriptor element, + which determines how context is applied to tasks and actions + that run on this executor. + The name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + In the absence of a configured value, + java:comp/DefaultContextService is used. + + + + + + + + + A ManagedScheduledExecutorService injection point annotated with these qualifier annotations + injects a bean that is produced by this managed-scheduled-executor element. + Applications can define their own Producers for ManagedScheduledExecutorService injection points + as long as the qualifier annotations on the producer do not conflict with the + non-empty qualifier list of a managed-scheduled-executor. + + You can specify a single qualifier element with no value to indicate an + empty list of qualifier annotation classes. + + + + + + + + + Upper bound on contextual tasks and actions that this executor + will simultaneously execute asynchronously. This constraint does + not apply to tasks and actions that the executor runs inline, + such as when a thread requests CompletableFuture.join and the + action runs inline if it has not yet started. This constraint also + does not apply to tasks that are scheduled via the schedule methods. + The default is unbounded, although still subject to + resource constraints of the system. + + + + + + + + + The amount of time in milliseconds that a task or action + can execute before it is considered hung. + + + + + + + + + Indicates whether this executor is requested to + create virtual threads for tasks that do not run inline. + When true, the executor can create + virtual threads if it is capable of doing so + and if the request is not overridden by vendor-specific + configuration that restricts the use of virtual threads. + + + + + + + + + Vendor-specific property. + + + + + + + + + + + + + + + + Configuration of a ManagedThreadFactory. + + + + + + + + + Description of this ManagedThreadFactory. + + + + + + + + + JNDI name of the ManagedThreadFactory instance being defined. + The JNDI name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + + + + + + + + + Refers to the name of a ContextServiceDefinition or + context-service deployment descriptor element, + which determines how context is applied to threads + from this thread factory. + The name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + In the absence of a configured value, + java:comp/DefaultContextService is used. + + + + + + + + + A ManagedThreadFactory injection point annotated with these qualifier annotations + injects a bean that is produced by this managed-thread-factory element. + Applications can define their own Producers for ManagedThreadFactory injection points + as long as the qualifier annotations on the producer do not conflict with the + non-empty qualifier list of a managed-thread-factory. + + You can specify a single qualifier element with no value to indicate an + empty list of qualifier annotation classes. + + + + + + + + + Priority for threads created by this thread factory. + The default is 5 (java.lang.Thread.NORM_PRIORITY). + + + + + + + + + Indicates whether this executor is requested to + create virtual threads for tasks that do not run inline. + When true, the executor can create + virtual threads if it is capable of doing so + and if the request is not overridden by vendor-specific + configuration that restricts the use of virtual threads. + + + + + + + + + Vendor-specific property. + + + + + + + + + + + + + + + + This type is a general type that can be used to declare + parameter/value lists. + + + + + + + + + + + The param-name element contains the name of a + parameter. + + + + + + + + + + The param-value element contains the value of a + parameter. + + + + + + + + + + + + + + + The elements that use this type designate either a relative + path or an absolute path starting with a "/". + + In elements that specify a pathname to a file within the + same Deployment File, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the Deployment File's namespace. Absolute filenames (i.e., + those starting with "/") also specify names in the root of + the Deployment File's namespace. In general, relative names + are preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + myPersistenceContext + + + + + myPersistenceContext + + PersistenceUnit1 + + Extended + + + ]]> + + + + + + + + + The persistence-context-ref-name element specifies + the name of a persistence context reference; its + value is the environment entry name used in + Deployment Component code. The name is a JNDI name + relative to the java:comp/env context. + + + + + + + + + The Application Assembler(or BeanProvider) may use the + following syntax to avoid the need to rename persistence + units to have unique names within a Jakarta EE application. + + The Application Assembler specifies the pathname of the + root of the persistence.xml file for the referenced + persistence unit and appends the name of the persistence + unit separated from the pathname by #. The pathname is + relative to the referencing application component jar file. + In this manner, multiple persistence units with the same + persistence unit name may be uniquely identified when the + Application Assembler cannot change persistence unit names. + + + + + + + + + + + + + + Used to specify properties for the container or persistence + provider. Vendor-specific properties may be included in + the set of properties. Properties that are not recognized + by a vendor must be ignored. Entries that make use of the + namespace jakarta.persistence and its subnamespaces must not + be used for vendor-specific properties. The namespace + jakarta.persistence is reserved for use by the specification. + + + + + + + + + + + + + + + + + + + The persistence-context-synchronizationType specifies + whether a container-managed persistence context is automatically + synchronized with the current transaction. + + The value of the persistence-context-synchronization element + must be one of the following: + Synchronized + Unsynchronized + + + + + + + + + + + + + + + + + The persistence-context-typeType specifies the transactional + nature of a persistence context reference. + + The value of the persistence-context-type element must be + one of the following: + Transaction + Extended + + + + + + + + + + + + + + + + + + Specifies a thread priority value in the range of + 1 (java.lang.Thread.MIN_PRIORITY) to 10 (java.lang.Thread.MAX_PRIORITY). + + + + + + + + + + + + + + + + + Specifies a name/value pair. + + + + + + + + + + + + + + + + + + + + myPersistenceUnit + + + + + myPersistenceUnit + + PersistenceUnit1 + + + + ]]> + + + + + + + + + The persistence-unit-ref-name element specifies + the name of a persistence unit reference; its + value is the environment entry name used in + Deployment Component code. The name is a JNDI name + relative to the java:comp/env context. + + + + + + + + + The Application Assembler(or BeanProvider) may use the + following syntax to avoid the need to rename persistence + units to have unique names within a Jakarta EE application. + + The Application Assembler specifies the pathname of the + root of the persistence.xml file for the referenced + persistence unit and appends the name of the persistence + unit separated from the pathname by #. The pathname is + relative to the referencing application component jar file. + In this manner, multiple persistence units with the same + persistence unit name may be uniquely identified when the + Application Assembler cannot change persistence unit names. + + + + + + + + + + + + + + + + + + com.wombat.empl.EmployeeService + + ]]> + + + + + + + + + + + + + + jms/StockQueue + + jakarta.jms.Queue + + + + ]]> + + + + + + + + + + The resource-env-ref-name element specifies the name + of a resource environment reference; its value is + the environment entry name used in + the Deployment Component code. The name is a JNDI + name relative to the java:comp/env context and must + be unique within a Deployment Component. + + + + + + + + + + The resource-env-ref-type element specifies the type + of a resource environment reference. It is the + fully qualified name of a Java language class or + interface. + + + + + + + + + + + + + + + + + + jdbc/EmployeeAppDB + javax.sql.DataSource + Container + Shareable + + + ]]> + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. + The name is a JNDI name relative to the + java:comp/env context. + The name must be unique within a Deployment File. + + + + + + + + + + The res-type element specifies the type of the data + source. The type is specified by the fully qualified + Java language class or interface + expected to be implemented by the data source. + + + + + + + + + + + + + + + + + + + + + + The res-authType specifies whether the Deployment Component + code signs on programmatically to the resource manager, or + whether the Container will sign on to the resource manager + on behalf of the Deployment Component. In the latter case, + the Container uses information that is supplied by the + Deployer. + + The value must be one of the two following: + + Application + Container + + + + + + + + + + + + + + + + + + The res-sharing-scope type specifies whether connections + obtained through the given resource manager connection + factory reference can be shared. The value, if specified, + must be one of the two following: + + Shareable + Unshareable + + The default value is Shareable. + + + + + + + + + + + + + + + + + + The run-asType specifies the run-as identity to be + used for the execution of a component. It contains an + optional description, and the name of a security role. + + + + + + + + + + + + + + + + + + The role-nameType designates the name of a security role. + + The name must conform to the lexical rules for a token. + + + + + + + + + + + + + + + + + This role includes all employees who are authorized + to access the employee service application. + + employee + + + ]]> + + + + + + + + + + + + + + + + + The security-role-refType contains the declaration of a + security role reference in a component's or a + Deployment Component's code. The declaration consists of an + optional description, the security role name used in the + code, and an optional link to a security role. If the + security role is not specified, the Deployer must choose an + appropriate security role. + + + + + + + + + + + The value of the role-name element must be the String used + as the parameter to the + EJBContext.isCallerInRole(String roleName) method or the + HttpServletRequest.isUserInRole(String role) method. + + + + + + + + + + The role-link element is a reference to a defined + security role. The role-link element must contain + the name of one of the security roles defined in the + security-role elements. + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:QName. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:boolean. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:NMTOKEN. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:anyURI. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:integer. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:positiveInteger. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:nonNegativeInteger. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:string. + + + + + + + + + + + + + + + + + This is a special string datatype that is defined by Jakarta EE as + a base type for defining collapsed strings. When schemas + require trailing/leading space elimination as well as + collapsing the existing whitespace, this base type may be + used. + + + + + + + + + + + + + + + + + This simple type designates a boolean with only two + permissible values + + - true + - false + + + + + + + + + + + + + + + + + The url-patternType contains the url pattern of the mapping. + It must follow the rules specified in Section 11.2 of the + Servlet API Specification. This pattern is assumed to be in + URL-decoded form and must not contain CR(#xD) or LF(#xA). + If it contains those characters, the container must inform + the developer with a descriptive error message. + The container must preserve all characters including whitespaces. + + + + + + + + + + + + + + + CorporateStocks + + + + ]]> + + + + + + + + + The message-destination-name element specifies a + name for a message destination. This name must be + unique among the names of message destinations + within the Deployment File. + + + + + + + + + + + + + + + + + The JNDI name to be looked up to resolve the message destination. + + + + + + + + + + + + + + + + jms/StockQueue + + jakarta.jms.Queue + + Consumes + + CorporateStocks + + + + ]]> + + + + + + + + + The message-destination-ref-name element specifies + the name of a message destination reference; its + value is the environment entry name used in + Deployment Component code. + + + + + + + + + + + + + + + + + + + + + + The message-destination-usageType specifies the use of the + message destination indicated by the reference. The value + indicates whether messages are consumed from the message + destination, produced for the destination, or both. The + Assembler makes use of this information in linking producers + of a destination with its consumers. + + The value of the message-destination-usage element must be + one of the following: + Consumes + Produces + ConsumesProduces + + + + + + + + + + + + + + + + + + jakarta.jms.Queue + + + ]]> + + + + + + + + + + + + + + The message-destination-linkType is used to link a message + destination reference or message-driven bean to a message + destination. + + The Assembler sets the value to reflect the flow of messages + between producers and consumers in the application. + + The value must be the message-destination-name of a message + destination in the same Deployment File or in another + Deployment File in the same Jakarta EE application unit. + + Alternatively, the value may be composed of a path name + specifying a Deployment File containing the referenced + message destination with the message-destination-name of the + destination appended and separated from the path name by + "#". The path name is relative to the Deployment File + containing Deployment Component that is referencing the + message destination. This allows multiple message + destinations with the same name to be uniquely identified. + + + + + + + + + + + + + + + The transaction-supportType specifies the level of + transaction support provided by the resource adapter. It is + used by transaction-support elements. + + The value must be one of the following: + + NoTransaction + LocalTransaction + XATransaction + + + + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_0.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_0.xsd new file mode 100644 index 000000000000..3a8dae9d6c89 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_0.xsd @@ -0,0 +1,380 @@ + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + This is the XML Schema for the JSP 4.0 deployment descriptor + types. The JSP 4.0 schema contains all the special + structures and datatypes that are necessary to use JSP files + from a web application. + + The contents of this schema is used by the web-common_6_1.xsd + file to define JSP specific content. + + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + The jsp-configType is used to provide global configuration + information for the JSP files in a web application. It has + two subelements, taglib and jsp-property-group. + + + + + + + + + + + + + + + + + + The jsp-file element contains the full path to a JSP file + within the web application beginning with a `/'. + + + + + + + + + + + + + + + + The jsp-property-groupType is used to group a number of + files so they can be given global property information. + All files so described are deemed to be JSP files. The + following additional properties can be described: + + - Control whether EL is ignored. + - Control whether scripting elements are invalid. + - Indicate pageEncoding information. + - Indicate that a resource is a JSP document (XML). + - Prelude and Coda automatic includes. + - Control whether the character sequence #{ is allowed + when used as a String literal. + - Control whether template text containing only + whitespaces must be removed from the response output. + - Indicate the default contentType information. + - Indicate the default buffering model for JspWriter + - Control whether error should be raised for the use of + undeclared namespaces in a JSP page. + + + + + + + + + + + + Can be used to easily set the isELIgnored + property of a group of JSP pages. By default, the + EL evaluation is enabled for Web Applications using + a Servlet 2.4 or greater web.xml, and disabled + otherwise. + + + + + + + + + Can be used to easily set the errorOnELNotFound + property of a group of JSP pages. By default, this + property is false. + + + + + + + + + The valid values of page-encoding are those of the + pageEncoding page directive. It is a + translation-time error to name different encodings + in the pageEncoding attribute of the page directive + of a JSP page and in a JSP configuration element + matching the page. It is also a translation-time + error to name different encodings in the prolog + or text declaration of a document in XML syntax and + in a JSP configuration element matching the document. + It is legal to name the same encoding through + mulitple mechanisms. + + + + + + + + + Can be used to easily disable scripting in a + group of JSP pages. By default, scripting is + enabled. + + + + + + + + + If true, denotes that the group of resources + that match the URL pattern are JSP documents, + and thus must be interpreted as XML documents. + If false, the resources are assumed to not + be JSP documents, unless there is another + property group that indicates otherwise. + + + + + + + + + The include-prelude element is a context-relative + path that must correspond to an element in the + Web Application. When the element is present, + the given path will be automatically included (as + in an include directive) at the beginning of each + JSP page in this jsp-property-group. + + + + + + + + + The include-coda element is a context-relative + path that must correspond to an element in the + Web Application. When the element is present, + the given path will be automatically included (as + in an include directive) at the end of each + JSP page in this jsp-property-group. + + + + + + + + + The character sequence #{ is reserved for EL expressions. + Consequently, a translation error occurs if the #{ + character sequence is used as a String literal, unless + this element is enabled (true). Disabled (false) by + default. + + + + + + + + + Indicates that template text containing only whitespaces + must be removed from the response output. It has no + effect on JSP documents (XML syntax). Disabled (false) + by default. + + + + + + + + + The valid values of default-content-type are those of the + contentType page directive. It specifies the default + response contentType if the page directive does not include + a contentType attribute. + + + + + + + + + The valid values of buffer are those of the + buffer page directive. It specifies if buffering should be + used for the output to response, and if so, the size of the + buffer to use. + + + + + + + + + The default behavior when a tag with unknown namespace is used + in a JSP page (regular syntax) is to silently ignore it. If + set to true, then an error must be raised during the translation + time when an undeclared tag is used in a JSP page. Disabled + (false) by default. + + + + + + + + + + + + + + + The taglibType defines the syntax for declaring in + the deployment descriptor that a tag library is + available to the application. This can be done + to override implicit map entries from TLD files and + from the container. + + + + + + + + + + A taglib-uri element describes a URI identifying a + tag library used in the web application. The body + of the taglib-uri element may be either an + absolute URI specification, or a relative URI. + There should be no entries in web.xml with the + same taglib-uri value. + + + + + + + + + + the taglib-location element contains the location + (as a resource relative to the root of the web + application) where to find the Tag Library + Description file for the tag library. + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/permissions_10.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/permissions_10.xsd new file mode 100644 index 000000000000..fdb3c9d6d5e6 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/permissions_10.xsd @@ -0,0 +1,151 @@ + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/permissions_10.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The permissions element is the root element in a + declared permissions file. The declared permissions file + declares the code based permissions granted to classes and libraries + packaged in the application archive, or in a module if the module is + deployed standalone. + + + + + + + + + + + + + Each permission element declares a permission. If no permission + elements are declared, the application or module needs no special + permissions, and the Jakarta EE product may deploy it with no + permissions beyond those necessary for the operation of the + container. + + For details on the definition of the 'name' and 'actions' + elements, refer to the Java API documentation for the class + java.security.Permission, and its derived classes. + + + + + + + + + + + + + + + + + + + + The required value for the version is 10. + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_1.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_1.mdd new file mode 100644 index 000000000000..a16828a162fc --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_1.mdd @@ -0,0 +1,856 @@ + + + + + web-app + https://jakarta.ee/xml/ns/jakartaee + WebApp + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.WebApp + + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + public void setJspConfig(org.netbeans.modules.j2ee.dd.api.web.JspConfig value) { + if (value==null) setJspConfig(new org.netbeans.modules.j2ee.dd.api.web.JspConfig[]{}); + else setJspConfig(new org.netbeans.modules.j2ee.dd.api.web.JspConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.JspConfig getSingleJspConfig() { + org.netbeans.modules.j2ee.dd.api.web.JspConfig[] values = getJspConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setWelcomeFileList(org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList value) { + if (value==null) setWelcomeFileList(new org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[]{}); + setWelcomeFileList(new org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList getSingleWelcomeFileList() { + org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[] values = getWelcomeFileList(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setSessionConfig(org.netbeans.modules.j2ee.dd.api.web.SessionConfig value) { + if (value==null) setSessionConfig(new org.netbeans.modules.j2ee.dd.api.web.SessionConfig[]{}); + else setSessionConfig(new org.netbeans.modules.j2ee.dd.api.web.SessionConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.SessionConfig getSingleSessionConfig() { + org.netbeans.modules.j2ee.dd.api.web.SessionConfig[] values = getSessionConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setLoginConfig(org.netbeans.modules.j2ee.dd.api.web.LoginConfig value) { + if (value==null) setLoginConfig(new org.netbeans.modules.j2ee.dd.api.web.LoginConfig[]{}); + else setLoginConfig(new org.netbeans.modules.j2ee.dd.api.web.LoginConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.LoginConfig getSingleLoginConfig() { + org.netbeans.modules.j2ee.dd.api.web.LoginConfig[] values = getLoginConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setDistributable(boolean value) { + if (value) setDistributable(new EmptyType[]{new EmptyType()}); + else setDistributable(new EmptyType[]{}); + } + public boolean isDistributable() { + EmptyType[] values = getDistributable(); + if (values==null || values.length==0) return false; + else return true; + } + public void setLocaleEncodingMappingList(org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList value) { + if (value==null) setLocaleEncodingMappingList(new org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[]{}); + else setLocaleEncodingMappingList(new org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList getSingleLocaleEncodingMappingList() { + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[] values = getLocaleEncodingMappingList(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setName(String[] value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(WebApp.VERSION_6_1); + } + public String[] getName() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(WebApp.VERSION_6_1); + } + + + + emptyType + https://jakarta.ee/xml/ns/jakartaee + EmptyType + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + InitParam + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.InitParam, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ParamName"; } + + + + filterType + https://jakarta.ee/xml/ns/jakartaee + Filter + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Filter, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "FilterName"; } + + + + filter-mappingType + https://jakarta.ee/xml/ns/jakartaee + FilterMapping + + org.netbeans.modules.j2ee.dd.api.web.FilterMapping + + + public String getServletName() { + return this.sizeServletName() > 0 ? (String)this.getValue(SERVLET_NAME, 0) : null; + } + + public void setServletName(String value) { + setServletNames(value != null ? new String[]{value} : new String[]{}); + } + + public String getUrlPattern() { + return this.sizeUrlPattern() > 0 ? (String)this.getValue(URL_PATTERN, 0) : null; + } + + public void setUrlPattern(String value) { + setUrlPatterns(value != null ? new String[]{value} : new String[]{}); + } + + + + listenerType + https://jakarta.ee/xml/ns/jakartaee + Listener + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Listener + + + + servletType + https://jakarta.ee/xml/ns/jakartaee + Servlet + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Servlet, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServletName"; } + + + + servlet-mappingType + https://jakarta.ee/xml/ns/jakartaee + ServletMapping + + org.netbeans.modules.j2ee.dd.api.web.ServletMapping25, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "UrlPattern"; } + + public void setUrlPattern(String value) { + setUrlPatterns(new String[] {value}); + } + + public String getUrlPattern() { + String[] urlPatterns = getUrlPatterns(); + if (urlPatterns != null && urlPatterns.length > 0) { + return urlPatterns[0]; + } + return null; + } + + + + + session-configType + https://jakarta.ee/xml/ns/jakartaee + SessionConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + + org.netbeans.modules.j2ee.dd.api.web.SessionConfig + + + + mime-mappingType + https://jakarta.ee/xml/ns/jakartaee + MimeMapping + + org.netbeans.modules.j2ee.dd.api.web.MimeMapping, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "Extension"; } + + + + welcome-file-listType + https://jakarta.ee/xml/ns/jakartaee + WelcomeFileList + + org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList + + + + error-pageType + https://jakarta.ee/xml/ns/jakartaee + ErrorPage + org.netbeans.modules.j2ee.dd.impl.common.Comparator + + org.netbeans.modules.j2ee.dd.api.web.ErrorPage, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ErrorCode"; } + + + + jsp-configType + https://jakarta.ee/xml/ns/jakartaee + JspConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.JspConfig + + + + security-constraintType + https://jakarta.ee/xml/ns/jakartaee + SecurityConstraint + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.SecurityConstraint + + + + login-configType + https://jakarta.ee/xml/ns/jakartaee + LoginConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.LoginConfig + + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRole + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.SecurityRole, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "RoleName"; } + + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestination + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestination, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationName"; } + + + + locale-encoding-mapping-listType + https://jakarta.ee/xml/ns/jakartaee + LocaleEncodingMappingList + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList + + + + locale-encoding-mappingType + https://jakarta.ee/xml/ns/jakartaee + LocaleEncodingMapping + + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMapping, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "Locale"; } + + + + localeType + https://jakarta.ee/xml/ns/jakartaee + LocaleType + java.lang.String + + + encodingType + https://jakarta.ee/xml/ns/jakartaee + EncodingType + java.lang.String + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + DescriptionType + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdStringType + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayNameType + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + + org.netbeans.modules.j2ee.dd.api.common.Icon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntry + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EnvEntry, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EnvEntryName"; } + + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + ejb-local-refType + https://jakarta.ee/xml/ns/jakartaee + EjbLocalRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbLocalRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResRefName"; } + + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResourceEnvRefName"; } + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationRefName"; } + + + + persistence-context-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextRefType + + + persistence-unit-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceUnitRefType + + + lifecycle-callbackType + https://jakarta.ee/xml/ns/jakartaee + LifecycleCallbackType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClassType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + persistence-context-typeType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextTypeType + java.lang.String + + + propertyType + https://jakarta.ee/xml/ns/jakartaee + PropertyType + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + injection-targetType + https://jakarta.ee/xml/ns/jakartaee + InjectionTarget + org.netbeans.modules.j2ee.dd.api.common.InjectionTarget + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRef + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServiceRefName"; } + + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.net.URI + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRef + + org.netbeans.modules.j2ee.dd.api.common.PortComponentRef + + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + service-ref_handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + service-ref_handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChain + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + service-ref_qname-pattern + https://jakarta.ee/xml/ns/jakartaee + ServiceRefQnamePattern + java.lang.String + + + service-ref_protocol-bindingListType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefProtocolBindingListType + String + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + local-homeType + https://jakarta.ee/xml/ns/jakartaee + LocalHomeType + java.lang.String + + + localType + https://jakarta.ee/xml/ns/jakartaee + LocalType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleNameType + java.lang.String + + + auth-methodType + https://jakarta.ee/xml/ns/jakartaee + AuthMethodType + java.lang.String + + + form-login-configType + https://jakarta.ee/xml/ns/jakartaee + FormLoginConfig + + org.netbeans.modules.j2ee.dd.api.web.FormLoginConfig + + + + war-pathType + https://jakarta.ee/xml/ns/jakartaee + WarPathType + java.lang.String + + + web-resource-collectionType + https://jakarta.ee/xml/ns/jakartaee + WebResourceCollection + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.WebResourceCollection, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "WebResourceName"; } + + + + auth-constraintType + https://jakarta.ee/xml/ns/jakartaee + AuthConstraint + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.AuthConstraint + + + + user-data-constraintType + https://jakarta.ee/xml/ns/jakartaee + UserDataConstraint + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.UserDataConstraint + + + + transport-guaranteeType + https://jakarta.ee/xml/ns/jakartaee + TransportGuaranteeType + java.lang.String + + + url-patternType + https://jakarta.ee/xml/ns/jakartaee + UrlPatternType + java.lang.String + + + http-methodType + https://jakarta.ee/xml/ns/jakartaee + HttpMethodType + java.lang.String + + + taglibType + https://jakarta.ee/xml/ns/jakartaee + Taglib + + org.netbeans.modules.j2ee.dd.api.web.Taglib, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "TaglibUri"; } + + + + jsp-property-groupType + https://jakarta.ee/xml/ns/jakartaee + JspPropertyGroup + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.JspPropertyGroup + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + error-codeType + https://jakarta.ee/xml/ns/jakartaee + ErrorCodeType + Integer + + + string + http://www.w3.org/2001/XMLSchema + String + java.lang.String + + + mime-typeType + https://jakarta.ee/xml/ns/jakartaee + MimeTypeType + java.lang.String + + + xsdIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdIntegerType + java.math.BigInteger + + + servlet-nameType + https://jakarta.ee/xml/ns/jakartaee + ServletNameType + java.lang.String + + + nonEmptyStringType + https://jakarta.ee/xml/ns/jakartaee + NonEmptyStringType + java.lang.String + + + load-on-startupType + https://jakarta.ee/xml/ns/jakartaee + LoadOnStartupType + java.math.BigInteger + + + run-asType + https://jakarta.ee/xml/ns/jakartaee + RunAs + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.RunAs + + + + security-role-refType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.SecurityRoleRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "RoleName"; } + + + + jsp-fileType + https://jakarta.ee/xml/ns/jakartaee + JspFileType + java.lang.String + + + filter-nameType + https://jakarta.ee/xml/ns/jakartaee + FilterNameType + java.lang.String + + + dispatcherType + https://jakarta.ee/xml/ns/jakartaee + DispatcherType + java.lang.String + + + absoluteOrderingType + https://jakarta.ee/xml/ns/jakartaee + AbsoluteOrdering + + org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering + + + + + + + handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + version + java.math.BigDecimal + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_1.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_1.xsd new file mode 100644 index 000000000000..9a4cc4f3b7cc --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_1.xsd @@ -0,0 +1,351 @@ + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-app_6_1.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + The web-app element is the root of the deployment + descriptor for a web application. Note that the sub-elements + of this element can be in the arbitrary order. Because of + that, the multiplicity of the elements of distributable, + session-config, welcome-file-list, jsp-config, login-config, + and locale-encoding-mapping-list was changed from "?" to "*" + in this schema. However, the deployment descriptor instance + file must not contain multiple elements of session-config, + jsp-config, and login-config. When there are multiple elements of + welcome-file-list or locale-encoding-mapping-list, the container + must concatenate the element contents. The multiple occurence + of the element distributable is redundant and the container + treats that case exactly in the same way when there is only + one distributable. + + + + + + + + + The servlet element contains the name of a servlet. + The name must be unique within the web application. + + + + + + + + + + + + The filter element contains the name of a filter. + The name must be unique within the web application. + + + + + + + + + + + + The ejb-local-ref-name element contains the name of an + enterprise bean reference. The enterprise + bean reference is an entry in the web + application's environment and is relative to the + java:comp/env context. The name must be unique within + the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + + The ejb-ref-name element contains the name of an + enterprise bean reference. The enterprise bean + reference is an entry in the web application's environment + and is relative to the java:comp/env context. + The name must be unique within the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + + The resource-env-ref-name element specifies the name of + a resource environment reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + + The message-destination-ref-name element specifies the name of + a message destination reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within a web application. + + + + + + + + + + + + The env-entry-name element contains the name of a web + application's environment entry. The name is a JNDI + name relative to the java:comp/env context. The name + must be unique within a web application. + + + + + + + + + + + + + A role-name-key is specified to allow the references + from the security-role-refs. + + + + + + + + + + + + The keyref indicates the references from + security-role-ref to a specified role-name. + + + + + + + + + + + + + + + + + + + When specified, this element provides a default context path + of the web application. An empty value for this element must cause + the web application to be deployed at the root for the container. + Otherwise, the default context path must start with + a "/" character but not end with a "/" character. + Servlet containers may provide vendor specific configuration + options that allows specifying a value that overrides the value + specified here. + + + + + + + + + When specified, this element provides a default request + character encoding of the web application. + + + + + + + + + When specified, this element provides a default response + character encoding of the web application. + + + + + + + + + When specified, this element causes uncovered http methods + to be denied. For every url-pattern that is the target of a + security-constrant, this element causes all HTTP methods that + are NOT covered (by a security constraint) at the url-pattern + to be denied. + + + + + + + + + + + + + + + + Please see section 8.2.2 of the specification for details. + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_1.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_1.xsd new file mode 100644 index 000000000000..4cb8277c9934 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_1.xsd @@ -0,0 +1,1526 @@ + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-common_6_1.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + + + + + + + The context-param element contains the declaration + of a web application's servlet context + initialization parameters. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The metadata-complete attribute defines whether this + deployment descriptor and other related deployment + descriptors for this module (e.g., web service + descriptors) are complete, or whether the class + files available to this module and packaged with + this application should be examined for annotations + that specify deployment information. + + If metadata-complete is set to "true", the deployment + tool must ignore any annotations that specify deployment + information, which might be present in the class files + of the application. + + If metadata-complete is not specified or is set to + "false", the deployment tool must examine the class + files of the application for annotations, as + specified by the specifications. + + + + + + + + + + + + + This type is a general type that can be used to declare + attribute/value lists. + + + + + + + + + + + The attribute-name element contains the name of an + attribute. + + + + + + + + + + The attribute-value element contains the value of a + attribute. + + + + + + + + + + + + + + + The auth-constraintType indicates the user roles that + should be permitted access to this resource + collection. The role-name used here must either correspond + to the role-name of one of the security-role elements + defined for this web application, or be the specially + reserved role-name "*" that is a compact syntax for + indicating all roles in the web application. If both "*" + and rolenames appear, the container interprets this as all + roles. If no roles are defined, no user is allowed access + to the portion of the web application described by the + containing security-constraint. The container matches + role names case sensitively when determining access. + + + + + + + + + + + + + + + + + + The auth-methodType is used to configure the authentication + mechanism for the web application. As a prerequisite to + gaining access to any web resources which are protected by + an authorization constraint, a user must have authenticated + using the configured mechanism. Legal values are "BASIC", + "DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific + authentication scheme. + + Used in: login-config + + + + + + + + + + + + + + + + The dispatcher has five legal values: FORWARD, REQUEST, + INCLUDE, ASYNC, and ERROR. + + A value of FORWARD means the Filter will be applied under + RequestDispatcher.forward() calls. + A value of REQUEST means the Filter will be applied under + ordinary client calls to the path or servlet. + A value of INCLUDE means the Filter will be applied under + RequestDispatcher.include() calls. + A value of ASYNC means the Filter will be applied under + calls dispatched from an AsyncContext. + A value of ERROR means the Filter will be applied under the + error page mechanism. + + The absence of any dispatcher elements in a filter-mapping + indicates a default of applying filters only under ordinary + client calls to the path or servlet. + + + + + + + + + + + + + + + + + + + + + + The error-code contains an HTTP error code, ex: 404 + + Used in: error-page + + + + + + + + + + + + + + + + + + + The error-pageType contains a mapping between an error code + or exception type to the path of a resource in the web + application. + + Error-page declarations using the exception-type element in + the deployment descriptor must be unique up to the class name of + the exception-type. Similarly, error-page declarations using the + error-code element must be unique in the deployment descriptor + up to the status code. + + If an error-page element in the deployment descriptor does not + contain an exception-type or an error-code element, the error + page is a default error page. + + Used in: web-app + + + + + + + + + + + + The exception-type contains a fully qualified class + name of a Java exception type. + + + + + + + + + + + The location element contains the location of the + resource in the web application relative to the root of + the web application. The value of the location must have + a leading `/'. + + + + + + + + + + + + + + + The filterType is used to declare a filter in the web + application. The filter is mapped to either a servlet or a + URL pattern in the filter-mapping element, using the + filter-name value to reference. Filters can access the + initialization parameters declared in the deployment + descriptor at runtime via the FilterConfig interface. + + Used in: web-app + + + + + + + + + + + + The fully qualified classname of the filter. + + + + + + + + + + + The init-param element contains a name/value pair as + an initialization param of a servlet filter + + + + + + + + + + + + + + + Declaration of the filter mappings in this web + application is done by using filter-mappingType. + The container uses the filter-mapping + declarations to decide which filters to apply to a request, + and in what order. The container matches the request URI to + a Servlet in the normal way. To determine which filters to + apply it matches filter-mapping declarations either on + servlet-name, or on url-pattern for each filter-mapping + element, depending on which style is used. The order in + which filters are invoked is the order in which + filter-mapping declarations that match a request URI for a + servlet appear in the list of filter-mapping elements.The + filter-name value must be the value of the filter-name + sub-elements of one of the filter declarations in the + deployment descriptor. + + + + + + + + + + + + + + + + + + + + + This type defines a string which contains at least one + character. + + + + + + + + + + + + + + + + The logical name of the filter is declare + by using filter-nameType. This name is used to map the + filter. Each filter name is unique within the web + application. + + Used in: filter, filter-mapping + + + + + + + + + + + + + + + + The form-login-configType specifies the login and error + pages that should be used in form based login. If form based + authentication is not used, these elements are ignored. + + Used in: login-config + + + + + + + + + + + The form-login-page element defines the location in the web + app where the page that can be used for login can be + found. The path begins with a leading / and is interpreted + relative to the root of the WAR. + + + + + + + + + + The form-error-page element defines the location in + the web app where the error page that is displayed + when login is not successful can be found. + The path begins with a leading / and is interpreted + relative to the root of the WAR. + + + + + + + + + + + + + + + + + A HTTP method type as defined in HTTP 1.1 section 2.2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The login-configType is used to configure the authentication + method that should be used, the realm name that should be + used for this application, and the attributes that are + needed by the form login mechanism. + + Used in: web-app + + + + + + + + + + + The realm name element specifies the realm name to + use in HTTP Basic authorization. + + + + + + + + + + + + + + + + The mime-mappingType defines a mapping between an extension + and a mime type. + + Used in: web-app + + + + + + + + + The extension element contains a string describing an + extension. example: "txt" + + + + + + + + + + + + + + + + + The mime-typeType is used to indicate a defined mime type. + + Example: + "text/plain" + + Used in: mime-mapping + + + + + + + + + + + + + + + + + + The security-constraintType is used to associate + security constraints with one or more web resource + collections + + Used in: web-app + + + + + + + + + + + + + + + + + + + + The servletType is used to declare a servlet. + It contains the declarative data of a + servlet. If a jsp-file is specified and the load-on-startup + element is present, then the JSP should be precompiled and + loaded. + + Used in: web-app + + + + + + + + + + + + + The servlet-class element contains the fully + qualified class name of the servlet. + + + + + + + + + + + + + + + The load-on-startup element indicates that this + servlet should be loaded (instantiated and have + its init() called) on the startup of the web + application. The optional contents of these + element must be an integer indicating the order in + which the servlet should be loaded. If the value + is a negative integer, or the element is not + present, the container is free to load the servlet + whenever it chooses. If the value is a positive + integer or 0, the container must load and + initialize the servlet as the application is + deployed. The container must guarantee that + servlets marked with lower integers are loaded + before servlets marked with higher integers. The + container may choose the order of loading of + servlets with the same load-on-start-up value. + + + + + + + + + + + + + + + + + + + + The servlet-mappingType defines a mapping between a + servlet and a url pattern. + + Used in: web-app + + + + + + + + + + + + + + + + + + + The servlet-name element contains the canonical name of the + servlet. Each servlet name is unique within the web + application. + + + + + + + + + + + + + + + + The session-configType defines the session parameters + for this web application. + + Used in: web-app + + + + + + + + + + The session-timeout element defines the default + session timeout interval for all sessions created + in this web application. The specified timeout + must be expressed in a whole number of minutes. + If the timeout is 0 or less, the container ensures + the default behaviour of sessions is never to time + out. If this element is not specified, the container + must set its default timeout period. + + + + + + + + + The cookie-config element defines the configuration of the + session tracking cookies created by this web application. + + + + + + + + + The tracking-mode element defines the tracking modes + for sessions created by this web application + + + + + + + + + + + + + + + The cookie-configType defines the configuration for the + session tracking cookies of this web application. + + Used in: session-config + + + + + + + + + + The name that will be assigned to any session tracking + cookies created by this web application. + The default is JSESSIONID + + + + + + + + + The domain name that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + The path that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + The comment that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + Specifies whether any session tracking cookies created + by this web application will be marked as HttpOnly + + + + + + + + + Specifies whether any session tracking cookies created + by this web application will be marked as secure. + When true, all session tracking cookies must be marked + as secure independent of the nature of the request that + initiated the corresponding session. + When false, the session cookie should only be marked secure + if the request that initiated the session was secure. + + + + + + + + + The lifetime (in seconds) that will be assigned to any + session tracking cookies created by this web application. + Default is -1 + + + + + + + + + The attribute-param element contains a name/value pair to + be added as an attribute to every session cookie. + + + + + + + + + + + + + + + The name that will be assigned to any session tracking + cookies created by this web application. + The default is JSESSIONID + + Used in: cookie-config + + + + + + + + + + + + + + + + The domain name that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The path that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The comment that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The tracking modes for sessions created by this web + application + + Used in: session-config + + + + + + + + + + + + + + + + + + + + The transport-guaranteeType specifies that the communication + between client and server should be NONE, INTEGRAL, or + CONFIDENTIAL. NONE means that the application does not + require any transport guarantees. A value of INTEGRAL means + that the application requires that the data sent between the + client and server be sent in such a way that it can't be + changed in transit. CONFIDENTIAL means that the application + requires that the data be transmitted in a fashion that + prevents other entities from observing the contents of the + transmission. In most cases, the presence of the INTEGRAL or + CONFIDENTIAL flag will indicate that the use of SSL is + required. + + Used in: user-data-constraint + + + + + + + + + + + + + + + + + + + + The user-data-constraintType is used to indicate how + data communicated between the client and container should be + protected. + + Used in: security-constraint + + + + + + + + + + + + + + + + + + The elements that use this type designate a path starting + with a "/" and interpreted relative to the root of a WAR + file. + + + + + + + + + + + + + + + + + This type contains the recognized versions of + web-application supported. It is used to designate the + version of the web application. + + + + + + + + + + + + + + + The web-resource-collectionType is used to identify the + resources and HTTP methods on those resources to which a + security constraint applies. If no HTTP methods are specified, + then the security constraint applies to all HTTP methods. + If HTTP methods are specified by http-method-omission + elements, the security constraint applies to all methods + except those identified in the collection. + http-method-omission and http-method elements are never + mixed in the same collection. + + Used in: security-constraint + + + + + + + + + + The web-resource-name contains the name of this web + resource collection. + + + + + + + + + + + Each http-method names an HTTP method to which the + constraint applies. + + + + + + + Each http-method-omission names an HTTP method to + which the constraint does not apply. + + + + + + + + + + + + + + + The welcome-file-list contains an ordered list of welcome + files elements. + + Used in: web-app + + + + + + + + + + The welcome-file element contains file name to use + as a default welcome file, such as index.html + + + + + + + + + + + + + + + The localeType defines valid locale defined by ISO-639-1 + and ISO-3166. + + + + + + + + + + + + + + + + The encodingType defines IANA character sets. + + + + + + + + + + + + + + + + The locale-encoding-mapping-list contains one or more + locale-encoding-mapping(s). + + + + + + + + + + + + + + + + + The locale-encoding-mapping contains locale name and + encoding name. The locale name must be either "Language-code", + such as "ja", defined by ISO-639 or "Language-code_Country-code", + such as "ja_JP". "Country code" is defined by ISO-3166. + + + + + + + + + + + + + + + + + + This element indicates that the ordering sub-element in which + it was placed should take special action regarding the ordering + of this application resource relative to other application + configuration resources. + See section 8.2.2 of the specification for details. + + + + + + + + + + + + + This element specifies configuration information related to the + handling of multipart/form-data requests. + + + + + + + + The directory location where uploaded files will be stored + + + + + + + The maximum size limit of uploaded files + + + + + + + The maximum size limit of multipart/form-data requests + + + + + + + The size threshold after which an uploaded file will be + written to disk + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.mdd new file mode 100644 index 000000000000..77ab2f758830 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.mdd @@ -0,0 +1,910 @@ + + + + + + + + web-fragment + https://jakarta.ee/xml/ns/jakartaee + WebFragment + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.WebFragment + + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + // due to compatibility with servlet2.3 + public void setTaglib(int index, org.netbeans.modules.j2ee.dd.api.web.Taglib valueInterface) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_1); + } + public org.netbeans.modules.j2ee.dd.api.web.Taglib getTaglib(int index) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_1); + } + public void setTaglib(org.netbeans.modules.j2ee.dd.api.web.Taglib[] value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_1); + } + public org.netbeans.modules.j2ee.dd.api.web.Taglib[] getTaglib() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_1); + } + public int sizeTaglib() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_1); + } + public int addTaglib(org.netbeans.modules.j2ee.dd.api.web.Taglib valueInterface) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_1); + } + public int removeTaglib(org.netbeans.modules.j2ee.dd.api.web.Taglib valueInterface) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_1); + } + public void setJspConfig(org.netbeans.modules.j2ee.dd.api.web.JspConfig value) { + if (value==null) setJspConfig(new org.netbeans.modules.j2ee.dd.api.web.JspConfig[]{}); + else setJspConfig(new org.netbeans.modules.j2ee.dd.api.web.JspConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.JspConfig getSingleJspConfig() { + org.netbeans.modules.j2ee.dd.api.web.JspConfig[] values = getJspConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setWelcomeFileList(org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList value) { + if (value==null) setWelcomeFileList(new org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[]{}); + setWelcomeFileList(new org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList getSingleWelcomeFileList() { + org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[] values = getWelcomeFileList(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setSessionConfig(org.netbeans.modules.j2ee.dd.api.web.SessionConfig value) { + if (value==null) setSessionConfig(new org.netbeans.modules.j2ee.dd.api.web.SessionConfig[]{}); + else setSessionConfig(new org.netbeans.modules.j2ee.dd.api.web.SessionConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.SessionConfig getSingleSessionConfig() { + org.netbeans.modules.j2ee.dd.api.web.SessionConfig[] values = getSessionConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setLoginConfig(org.netbeans.modules.j2ee.dd.api.web.LoginConfig value) { + if (value==null) setLoginConfig(new org.netbeans.modules.j2ee.dd.api.web.LoginConfig[]{}); + else setLoginConfig(new org.netbeans.modules.j2ee.dd.api.web.LoginConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.LoginConfig getSingleLoginConfig() { + org.netbeans.modules.j2ee.dd.api.web.LoginConfig[] values = getLoginConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setDistributable(boolean value) { + if (value) setDistributable(new EmptyType[]{new EmptyType()}); + else setDistributable(new EmptyType[]{}); + } + public boolean isDistributable() { + EmptyType[] values = getDistributable(); + if (values==null || values.length==0) return false; + else return true; + } + public void setLocaleEncodingMappingList(org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList value) { + if (value==null) setLocaleEncodingMappingList(new org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[]{}); + else setLocaleEncodingMappingList(new org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList getSingleLocaleEncodingMappingList() { + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[] values = getLocaleEncodingMappingList(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering newAbsoluteOrdering() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException("web-fragment "+VERSION_6_1); + } + public void setAbsoluteOrdering(org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering[] value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException("web-fragment "+VERSION_6_1); + } + public org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering[] getAbsoluteOrdering() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException("web-fragment "+VERSION_6_1); + } + + + + emptyType + https://jakarta.ee/xml/ns/jakartaee + EmptyType + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + InitParam + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.InitParam, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ParamName"; } + + + + filterType + https://jakarta.ee/xml/ns/jakartaee + Filter + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Filter, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "FilterName"; } + + + + filter-mappingType + https://jakarta.ee/xml/ns/jakartaee + FilterMapping + + org.netbeans.modules.j2ee.dd.api.web.FilterMapping + + + public String getServletName() { + return this.sizeServletName() > 0 ? (String)this.getValue(SERVLET_NAME, 0) : null; + } + + public void setServletName(String value) { + setServletNames(value != null ? new String[]{value} : new String[]{}); + } + + public String getUrlPattern() { + return this.sizeUrlPattern() > 0 ? (String)this.getValue(URL_PATTERN, 0) : null; + } + + public void setUrlPattern(String value) { + setUrlPatterns(value != null ? new String[]{value} : new String[]{}); + } + + + + listenerType + https://jakarta.ee/xml/ns/jakartaee + Listener + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Listener + + + + servletType + https://jakarta.ee/xml/ns/jakartaee + Servlet + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Servlet, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServletName"; } + + + + servlet-mappingType + https://jakarta.ee/xml/ns/jakartaee + ServletMapping + + org.netbeans.modules.j2ee.dd.api.web.ServletMapping25, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "UrlPattern"; } + + public void setUrlPattern(String value) { + setUrlPatterns(new String[] {value}); + } + + public String getUrlPattern() { + String[] urlPatterns = getUrlPatterns(); + if (urlPatterns != null && urlPatterns.length > 0) { + return urlPatterns[0]; + } + return null; + } + + + + + session-configType + https://jakarta.ee/xml/ns/jakartaee + SessionConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + + org.netbeans.modules.j2ee.dd.api.web.SessionConfig + + + + mime-mappingType + https://jakarta.ee/xml/ns/jakartaee + MimeMapping + + org.netbeans.modules.j2ee.dd.api.web.MimeMapping, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "Extension"; } + + + + welcome-file-listType + https://jakarta.ee/xml/ns/jakartaee + WelcomeFileList + + org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList + + + + error-pageType + https://jakarta.ee/xml/ns/jakartaee + ErrorPage + org.netbeans.modules.j2ee.dd.impl.common.Comparator + + org.netbeans.modules.j2ee.dd.api.web.ErrorPage, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ErrorCode"; } + + + + jsp-configType + https://jakarta.ee/xml/ns/jakartaee + JspConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.JspConfig + + + + security-constraintType + https://jakarta.ee/xml/ns/jakartaee + SecurityConstraint + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.SecurityConstraint + + + + login-configType + https://jakarta.ee/xml/ns/jakartaee + LoginConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.LoginConfig + + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRole + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.SecurityRole, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "RoleName"; } + + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestination + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestination, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationName"; } + + + + locale-encoding-mapping-listType + https://jakarta.ee/xml/ns/jakartaee + LocaleEncodingMappingList + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList + + + + locale-encoding-mappingType + https://jakarta.ee/xml/ns/jakartaee + LocaleEncodingMapping + + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMapping, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "Locale"; } + + + + localeType + https://jakarta.ee/xml/ns/jakartaee + LocaleType + java.lang.String + + + encodingType + https://jakarta.ee/xml/ns/jakartaee + EncodingType + java.lang.String + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + DescriptionType + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdStringType + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayNameType + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + + org.netbeans.modules.j2ee.dd.api.common.Icon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntry + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EnvEntry, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EnvEntryName"; } + + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + ejb-local-refType + https://jakarta.ee/xml/ns/jakartaee + EjbLocalRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbLocalRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResRefName"; } + + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResourceEnvRefName"; } + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationRefName"; } + + + + persistence-context-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextRefType + + + persistence-unit-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceUnitRefType + + + lifecycle-callbackType + https://jakarta.ee/xml/ns/jakartaee + LifecycleCallbackType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClassType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + persistence-context-typeType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextTypeType + java.lang.String + + + propertyType + https://jakarta.ee/xml/ns/jakartaee + PropertyType + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + injection-targetType + https://jakarta.ee/xml/ns/jakartaee + InjectionTarget + org.netbeans.modules.j2ee.dd.api.common.InjectionTarget + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRef + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServiceRefName"; } + + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.net.URI + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRef + + org.netbeans.modules.j2ee.dd.api.common.PortComponentRef + + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + service-ref_handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + service-ref_handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChain + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + service-ref_qname-pattern + https://jakarta.ee/xml/ns/jakartaee + ServiceRefQnamePattern + java.lang.String + + + service-ref_protocol-bindingListType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefProtocolBindingListType + String + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + local-homeType + https://jakarta.ee/xml/ns/jakartaee + LocalHomeType + java.lang.String + + + localType + https://jakarta.ee/xml/ns/jakartaee + LocalType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleNameType + java.lang.String + + + auth-methodType + https://jakarta.ee/xml/ns/jakartaee + AuthMethodType + java.lang.String + + + form-login-configType + https://jakarta.ee/xml/ns/jakartaee + FormLoginConfig + + org.netbeans.modules.j2ee.dd.api.web.FormLoginConfig + + + + war-pathType + https://jakarta.ee/xml/ns/jakartaee + WarPathType + java.lang.String + + + web-resource-collectionType + https://jakarta.ee/xml/ns/jakartaee + WebResourceCollection + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.WebResourceCollection, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "WebResourceName"; } + + + + auth-constraintType + https://jakarta.ee/xml/ns/jakartaee + AuthConstraint + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.AuthConstraint + + + + user-data-constraintType + https://jakarta.ee/xml/ns/jakartaee + UserDataConstraint + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.UserDataConstraint + + + + transport-guaranteeType + https://jakarta.ee/xml/ns/jakartaee + TransportGuaranteeType + java.lang.String + + + url-patternType + https://jakarta.ee/xml/ns/jakartaee + UrlPatternType + java.lang.String + + + http-methodType + https://jakarta.ee/xml/ns/jakartaee + HttpMethodType + java.lang.String + + + taglibType + https://jakarta.ee/xml/ns/jakartaee + Taglib + + org.netbeans.modules.j2ee.dd.api.web.Taglib, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "TaglibUri"; } + + + + jsp-property-groupType + https://jakarta.ee/xml/ns/jakartaee + JspPropertyGroup + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.JspPropertyGroup + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + error-codeType + https://jakarta.ee/xml/ns/jakartaee + ErrorCodeType + Integer + + + string + http://www.w3.org/2001/XMLSchema + String + java.lang.String + + + mime-typeType + https://jakarta.ee/xml/ns/jakartaee + MimeTypeType + java.lang.String + + + xsdIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdIntegerType + java.math.BigInteger + + + servlet-nameType + https://jakarta.ee/xml/ns/jakartaee + ServletNameType + java.lang.String + + + nonEmptyStringType + https://jakarta.ee/xml/ns/jakartaee + NonEmptyStringType + java.lang.String + + + load-on-startupType + https://jakarta.ee/xml/ns/jakartaee + LoadOnStartupType + java.math.BigInteger + + + run-asType + https://jakarta.ee/xml/ns/jakartaee + RunAs + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.RunAs + + + + security-role-refType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.SecurityRoleRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "RoleName"; } + + + + jsp-fileType + https://jakarta.ee/xml/ns/jakartaee + JspFileType + java.lang.String + + + filter-nameType + https://jakarta.ee/xml/ns/jakartaee + FilterNameType + java.lang.String + + + dispatcherType + https://jakarta.ee/xml/ns/jakartaee + DispatcherType + java.lang.String + + + absoluteOrderingType + https://jakarta.ee/xml/ns/jakartaee + AbsoluteOrdering + + org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering + + + + orderingType + https://jakarta.ee/xml/ns/jakartaee + RelativeOrdering + + org.netbeans.modules.j2ee.dd.api.web.RelativeOrdering + + + + ordering-orderingType + https://jakarta.ee/xml/ns/jakartaee + RelativeOrderingItems + + org.netbeans.modules.j2ee.dd.api.web.RelativeOrderingItems + + + + ordering-othersType + https://jakarta.ee/xml/ns/jakartaee + RelativeOrderingOthersItem + + org.netbeans.modules.j2ee.dd.api.web.RelativeOrderingOthersItem + + + + + + + handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + version + java.math.BigDecimal + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.xsd new file mode 100644 index 000000000000..633b1d69f2f5 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.xsd @@ -0,0 +1,316 @@ + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-fragment_6_1.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The web-fragment element is the root of the deployment + descriptor for a web fragment. Note that the sub-elements + of this element can be in the arbitrary order. Because of + that, the multiplicity of the elements of distributable, + session-config, welcome-file-list, jsp-config, login-config, + and locale-encoding-mapping-list was changed from "?" to "*" + in this schema. However, the deployment descriptor instance + file must not contain multiple elements of session-config, + jsp-config, and login-config. When there are multiple elements of + welcome-file-list or locale-encoding-mapping-list, the container + must concatenate the element contents. The multiple occurence + of the element distributable is redundant and the container + treats that case exactly in the same way when there is only + one distributable. + + + + + + + + The servlet element contains the name of a servlet. + The name must be unique within the web application. + + + + + + + + + + + The filter element contains the name of a filter. + The name must be unique within the web application. + + + + + + + + + + + The ejb-local-ref-name element contains the name of an + enterprise bean reference. The enterprise bean reference + is an entry in the web application's environment and is relative + to the java:comp/env context. The name must be unique within + the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The ejb-ref-name element contains the name of an + enterprise bean reference. The enterprise bean reference + is an entry in the web application's environment and is relative + to the java:comp/env context. The name must be unique within + the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The resource-env-ref-name element specifies the name of + a resource environment reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + The message-destination-ref-name element specifies the name of + a message destination reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within a web application. + + + + + + + + + + + The env-entry-name element contains the name of a web + application's environment entry. The name is a JNDI + name relative to the java:comp/env context. The name + must be unique within a web application. + + + + + + + + + + + A role-name-key is specified to allow the references + from the security-role-refs. + + + + + + + + + + + The keyref indicates the references from + security-role-ref to a specified role-name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Please see section 8.2.2 of the specification for details. + + + + + + + + + + + + + + + + + This element contains a sequence of "name" elements, each of + which + refers to an application configuration resource by the "name" + declared on its web.xml fragment. This element can also contain + a single "others" element which specifies that this document + comes + before or after other documents within the application. + See section 8.2.2 of the specification for details. + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java index 2e7b533b7554..e28016222cba 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java @@ -960,6 +960,9 @@ public Object clone() { } else if (WebApp.VERSION_6_0.equals(version)) { ((org.netbeans.modules.j2ee.dd.impl.web.model_6_0.WebApp)clonedWebApp)._setSchemaLocation ("https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"); + } else if (WebApp.VERSION_6_1.equals(version)) { + ((org.netbeans.modules.j2ee.dd.impl.web.model_6_1.WebApp)clonedWebApp)._setSchemaLocation + ("https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_1.xsd"); } } proxy.setError(error); diff --git a/enterprise/j2ee.ddloaders/nbproject/project.properties b/enterprise/j2ee.ddloaders/nbproject/project.properties index 8b1a7e90e80b..3d220e48b9ff 100644 --- a/enterprise/j2ee.ddloaders/nbproject/project.properties +++ b/enterprise/j2ee.ddloaders/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint:all -Xlint:-serial javac.source=1.8 -spec.version.base=1.60.0 +spec.version.base=1.62.0 javadoc.arch=${basedir}/arch.xml diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/Bundle.properties b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/Bundle.properties index 080f26ff6038..d6ea216e8080 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/Bundle.properties +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/Bundle.properties @@ -30,6 +30,8 @@ Loaders/text/x-dd-application6.0/Factories/org-netbeans-modules-j2ee-ddloaders-w Loaders/text/x-dd-application7.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-application8.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-application9.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-application10.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-application11.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client1.3/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client1.4/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client5.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files @@ -38,6 +40,7 @@ Loaders/text/x-dd-client7.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DD Loaders/text/x-dd-client8.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client9.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client10.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-client11.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar2.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar2.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar3.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files @@ -53,11 +56,13 @@ Loaders/text/x-dd-servlet3.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-D Loaders/text/x-dd-servlet4.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet5.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet6.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-servlet6.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment3.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment3.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment4.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment5.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment6.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-servlet-fragment6.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-web2.5/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-web3.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataLoader.java index ec7cdefa3f52..37db80826b09 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataLoader.java @@ -49,6 +49,8 @@ public class EarDataLoader extends UniFileLoader { private static final String REQUIRED_MIME_PREFIX_6 = "text/x-dd-application9.0"; // NOI18N private static final String REQUIRED_MIME_PREFIX_7 = "text/x-dd-application10.0"; // NOI18N + + private static final String REQUIRED_MIME_PREFIX_8 = "text/x-dd-application11.0"; // NOI18N public EarDataLoader () { super ("org.netbeans.modules.j2ee.ddloaders.app.EarDataObject"); // NOI18N @@ -75,6 +77,7 @@ protected void initialize () { getExtensions().addMimeType(REQUIRED_MIME_PREFIX_5); getExtensions().addMimeType(REQUIRED_MIME_PREFIX_6); getExtensions().addMimeType(REQUIRED_MIME_PREFIX_7); + getExtensions().addMimeType(REQUIRED_MIME_PREFIX_8); } @Override diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataNode.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataNode.java index 0ca4caacd36e..55104f5ed05c 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataNode.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataNode.java @@ -91,7 +91,7 @@ public Action[] getActions(boolean context) { } actions.add(origActions[i]); } - filteredActions = actions.toArray(new Action[actions.size()]); + filteredActions = actions.toArray(new Action[0]); } return filteredActions; } diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/catalog/EnterpriseCatalog.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/catalog/EnterpriseCatalog.java index a5f93135a269..ca44a5355870 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/catalog/EnterpriseCatalog.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/catalog/EnterpriseCatalog.java @@ -49,7 +49,7 @@ public final class EnterpriseCatalog implements CatalogReader, CatalogDescriptor private static final String JAKARTAEE_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N private static final String RESOURCE_PATH = "nbres:/org/netbeans/modules/j2ee/dd/impl/resources/"; //NO18N - private List schemas = new ArrayList<>(); + private List schemas = new ArrayList<>(256); private static final Logger LOGGER = Logger.getLogger(EnterpriseCatalog.class.getName()); @@ -67,6 +67,8 @@ private void initialize(){ schemas.add(new SchemaInfo("application-client_7.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("application-client_8.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("application-client_9.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("application-client_10.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("application-client_11.xsd", JAKARTAEE_NS)); // Application schema schemas.add(new SchemaInfo("application_1_4.xsd", J2EE_NS)); schemas.add(new SchemaInfo("application_5.xsd", JAVAEE_NS)); @@ -74,6 +76,8 @@ private void initialize(){ schemas.add(new SchemaInfo("application_7.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("application_8.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("application_9.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("application_10.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("application_11.xsd", JAKARTAEE_NS)); // Web services schema schemas.add(new SchemaInfo("j2ee_web_services_1_1.xsd", J2EE_NS)); schemas.add(new SchemaInfo("javaee_web_services_1_2.xsd", JAVAEE_NS)); @@ -91,6 +95,7 @@ private void initialize(){ schemas.add(new SchemaInfo("connector_1_6.xsd", JAVAEE_NS)); schemas.add(new SchemaInfo("connector_1_7.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("connector_2_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("connector_2_1.xsd", JAKARTAEE_NS)); // Enterprise JavaBeans Deployment Descriptor Schema schemas.add(new SchemaInfo("ejb-jar_2_1.xsd", J2EE_NS)); schemas.add(new SchemaInfo("ejb-jar_3_0.xsd", JAVAEE_NS)); @@ -104,22 +109,30 @@ private void initialize(){ schemas.add(new SchemaInfo("web-app_3_1.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("web-app_4_0.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("web-app_5_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-app_6_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-app_6_1.xsd", JAKARTAEE_NS)); // Web Application Deployment Descriptor common definitions schema schemas.add(new SchemaInfo("web-common_3_0.xsd", JAVAEE_NS)); schemas.add(new SchemaInfo("web-common_3_1.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("web-common_4_0.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("web-common_5_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-common_6_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-common_6_1.xsd", JAKARTAEE_NS)); // Web Application Deployment Descriptor fragment schema schemas.add(new SchemaInfo("web-fragment_3_0.xsd", JAVAEE_NS)); schemas.add(new SchemaInfo("web-fragment_3_1.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("web-fragment_4_0.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("web-fragment_5_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-fragment_6_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-fragment_6_1.xsd", JAKARTAEE_NS)); // JavaServer Pages Deployment Descriptor schema schemas.add(new SchemaInfo("jsp_2_0.xsd", J2EE_NS)); schemas.add(new SchemaInfo("jsp_2_1.xsd", JAVAEE_NS)); schemas.add(new SchemaInfo("jsp_2_2.xsd", JAVAEE_NS)); schemas.add(new SchemaInfo("jsp_2_3.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("jsp_3_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("jsp_3_1.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("jsp_4_0.xsd", JAKARTAEE_NS)); // J2EE and Java EE definitions file that contains common schema components schemas.add(new SchemaInfo("j2ee_1_4.xsd", J2EE_NS)); schemas.add(new SchemaInfo("javaee_5.xsd", JAVAEE_NS)); @@ -127,6 +140,8 @@ private void initialize(){ schemas.add(new SchemaInfo("javaee_7.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("javaee_8.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("jakartaee_9.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("jakartaee_10.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("jakartaee_11.xsd", JAKARTAEE_NS)); // web 2.2 and 2.3 dtds schemas.add(new SchemaInfo("web-app_2_2.dtd", "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN", true)); //NO18N schemas.add(new SchemaInfo("web-app_2_3.dtd", "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", true)); //NO18N @@ -135,9 +150,12 @@ private void initialize(){ schemas.add(new SchemaInfo("beans_1_1.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("beans_2_0.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("beans_3_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("beans_4_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("beans_4_1.xsd", JAKARTAEE_NS)); // Java EE application permissions schema schemas.add(new SchemaInfo("permissions_7.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("permissions_9.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("permissions_10.xsd", JAKARTAEE_NS)); // Schema for batch.xml-based artifact loading in Java Batch schemas.add(new SchemaInfo("batchXML_1_0.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("batchXML_2_0.xsd", JAKARTAEE_NS)); diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/client/ClientDataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/client/ClientDataLoader.java index 257adaa87e7c..d2ab62e606b9 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/client/ClientDataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/client/ClientDataLoader.java @@ -42,6 +42,7 @@ public class ClientDataLoader extends UniFileLoader { private static final String REQUIRED_MIME_PREFIX_6 = "text/x-dd-client8.0"; // NOI18N private static final String REQUIRED_MIME_PREFIX_7 = "text/x-dd-client9.0"; // NOI18N private static final String REQUIRED_MIME_PREFIX_8 = "text/x-dd-client10.0"; // NOI18N + private static final String REQUIRED_MIME_PREFIX_9 = "text/x-dd-client11.0"; // NOI18N public ClientDataLoader() { super("org.netbeans.modules.j2ee.ddloaders.client.ClientDataObject"); // NOI18N @@ -68,6 +69,7 @@ protected void initialize() { getExtensions().addMimeType(REQUIRED_MIME_PREFIX_6); getExtensions().addMimeType(REQUIRED_MIME_PREFIX_7); getExtensions().addMimeType(REQUIRED_MIME_PREFIX_8); + getExtensions().addMimeType(REQUIRED_MIME_PREFIX_9); } @Override diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/dd-loaders-mime-resolver.xml b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/dd-loaders-mime-resolver.xml index 35deb028adaa..c1ae1b7aca7d 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/dd-loaders-mime-resolver.xml +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/dd-loaders-mime-resolver.xml @@ -95,6 +95,16 @@
    + + + + + + + + + + @@ -145,6 +155,16 @@ + + + + + + + + + + @@ -281,6 +301,16 @@ + + + + + + + + + + @@ -351,4 +381,14 @@ + + + + + + + + + + diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/layer.xml b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/layer.xml index 52c09ec79e46..2707d1bc15c6 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/layer.xml +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/layer.xml @@ -24,6 +24,9 @@ + + + @@ -45,6 +48,9 @@ + + + @@ -114,6 +120,9 @@ + + + @@ -129,6 +138,9 @@ + + + @@ -153,6 +165,8 @@ + + @@ -637,6 +651,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1047,6 +1143,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1346,6 +1524,18 @@ + + + + + + + + + + + + @@ -1406,6 +1596,18 @@ + + + + + + + + + + + + @@ -1526,6 +1728,18 @@ + + + + + + + + + + + + @@ -1610,6 +1824,18 @@ + + + + + + + + + + + + diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDDataObject.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDDataObject.java index fb6e01d5f21b..53ce8a87bf8e 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDDataObject.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDDataObject.java @@ -129,7 +129,8 @@ protected int associateLookup() { DDWeb30DataLoader.REQUIRED_MIME_31, DDWebFragment30DataLoader.REQUIRED_MIME_31, DDWeb40DataLoader.REQUIRED_MIME_40, DDWebFragment40DataLoader.REQUIRED_MIME_40, DDWeb50DataLoader.REQUIRED_MIME_50, DDWebFragment50DataLoader.REQUIRED_MIME_50, - DDWeb60DataLoader.REQUIRED_MIME_60, DDWebFragment60DataLoader.REQUIRED_MIME_60}, + DDWeb60DataLoader.REQUIRED_MIME_60, DDWebFragment60DataLoader.REQUIRED_MIME_60, + DDWeb60DataLoader.REQUIRED_MIME_61, DDWebFragment60DataLoader.REQUIRED_MIME_61}, iconBase="org/netbeans/modules/j2ee/ddloaders/web/resources/DDDataIcon.gif", persistenceType=TopComponent.PERSISTENCE_ONLY_OPENED, preferredID="multiview_xml", diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWeb60DataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWeb60DataLoader.java index e8623d2f886d..4e3f612484c4 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWeb60DataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWeb60DataLoader.java @@ -27,12 +27,14 @@ * A data loader for web.xml version 6.0. Required for providing * a different action context than for older versions - see #85570. * + * @author Jose Contreras */ public class DDWeb60DataLoader extends DDDataLoader { private static final long serialVersionUID = 1L; public static final String REQUIRED_MIME_60 = "text/x-dd-servlet6.0"; // NOI18N + public static final String REQUIRED_MIME_61 = "text/x-dd-servlet6.1"; // NOI18N public DDWeb60DataLoader() { super("org.netbeans.modules.j2ee.ddloaders.web.DDDataObject"); // NOI18N @@ -45,7 +47,7 @@ protected String actionsContext() { @Override protected String[] getSupportedMimeTypes() { - return new String[]{REQUIRED_MIME_60}; + return new String[]{REQUIRED_MIME_60, REQUIRED_MIME_61}; } @Override diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWebFragment60DataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWebFragment60DataLoader.java index e3bed5a27601..0ccbdecc0157 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWebFragment60DataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWebFragment60DataLoader.java @@ -27,13 +27,14 @@ * A data loader for web-fragment.xml version 6.0. Required for providing * a different action context than for older versions - see #85570. * - * @author pepness + * @author Jose Contreras */ public class DDWebFragment60DataLoader extends DDDataLoader { private static final long serialVersionUID = 1L; public static final String REQUIRED_MIME_60 = "text/x-dd-servlet-fragment6.0"; // NOI18N + public static final String REQUIRED_MIME_61 = "text/x-dd-servlet-fragment6.1"; // NOI18N public DDWebFragment60DataLoader() { super("org.netbeans.modules.j2ee.ddloaders.web.DDFragmentDataObject"); // NOI18N @@ -46,7 +47,7 @@ protected String actionsContext() { @Override protected String[] getSupportedMimeTypes() { - return new String[]{REQUIRED_MIME_60}; + return new String[]{REQUIRED_MIME_60, REQUIRED_MIME_61}; } @Override diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/multiview/DDUtils.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/multiview/DDUtils.java index c99a3d622744..07af1f872a50 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/multiview/DDUtils.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/multiview/DDUtils.java @@ -176,7 +176,7 @@ public static FilterMapping[] getFilterMappings(WebApp webApp, Servlet servlet) maps.add(fm); } } - return (FilterMapping[]) maps.toArray(new FilterMapping[maps.size()]); + return (FilterMapping[]) maps.toArray(new FilterMapping[0]); } private static List getServletMappingList(WebApp webApp, Servlet servlet) { diff --git a/enterprise/j2ee.earproject/manifest.mf b/enterprise/j2ee.earproject/manifest.mf index 84dc2f673024..2f7ef38ea9cd 100644 --- a/enterprise/j2ee.earproject/manifest.mf +++ b/enterprise/j2ee.earproject/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.earproject OpenIDE-Module-Layer: org/netbeans/modules/j2ee/earproject/ui/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/earproject/Bundle.properties -OpenIDE-Module-Specification-Version: 1.74 +OpenIDE-Module-Specification-Version: 1.76 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java b/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java index 75220aa6e4a8..e56eed9d0a3c 100644 --- a/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java +++ b/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java @@ -321,7 +321,7 @@ private void addUserModules(EarProject p, final Map user assert false : "Unknown module type: " + type; } } - Project[] webAndCarsArray = webAndCars.toArray(new Project[webAndCars.size()]); + Project[] webAndCarsArray = webAndCars.toArray(new Project[0]); for (Project ejb : ejbs) { addEJBToClassPaths(ejb, webAndCarsArray); // #74123 } diff --git a/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java b/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java index af662456c255..6db2395ed80f 100644 --- a/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java +++ b/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java @@ -310,7 +310,9 @@ public String getModuleVersion () { if (p == null) { p = Profile.JAVA_EE_7_FULL; } - if (Profile.JAKARTA_EE_10_FULL.equals(p) || Profile.JAKARTA_EE_10_FULL.equals(p)) { + if (Profile.JAKARTA_EE_11_FULL.equals(p)) { + return Application.VERSION_11; + } else if (Profile.JAKARTA_EE_10_FULL.equals(p)) { return Application.VERSION_10; } else if (Profile.JAKARTA_EE_9_1_FULL.equals(p) || Profile.JAKARTA_EE_9_FULL.equals(p)) { return Application.VERSION_9; diff --git a/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ui/actions/AddModuleAction.java b/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ui/actions/AddModuleAction.java index a837c96193e8..d8a24c59eab9 100644 --- a/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ui/actions/AddModuleAction.java +++ b/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ui/actions/AddModuleAction.java @@ -108,7 +108,7 @@ private Project[] getSelectedProjects(FileObject projDir) throws UserCancelExcep } } Children.Array children = new Children.Array(); - children.add(moduleProjectNodes.toArray(new Node[moduleProjectNodes.size()])); + children.add(moduleProjectNodes.toArray(new Node[0])); final AbstractNode root = new AbstractNode(children); String moduleSelector = NbBundle.getMessage(AddModuleAction.class, "LBL_ModuleSelectorTitle"); diff --git a/enterprise/j2ee.ejbcore/manifest.mf b/enterprise/j2ee.ejbcore/manifest.mf index d9577477f3e6..945b5d294ddf 100644 --- a/enterprise/j2ee.ejbcore/manifest.mf +++ b/enterprise/j2ee.ejbcore/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.j2ee.ejbcore OpenIDE-Module-Layer: org/netbeans/modules/j2ee/ejbcore/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/ejbcore/Bundle.properties OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.74 +OpenIDE-Module-Specification-Version: 1.76 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.ejbcore/nbproject/org-netbeans-modules-j2ee-ejbcore.sig b/enterprise/j2ee.ejbcore/nbproject/org-netbeans-modules-j2ee-ejbcore.sig index e5b798fefe9b..e84a03877d6b 100644 --- a/enterprise/j2ee.ejbcore/nbproject/org-netbeans-modules-j2ee-ejbcore.sig +++ b/enterprise/j2ee.ejbcore/nbproject/org-netbeans-modules-j2ee-ejbcore.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.73 +#Version 1.74 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/EjbGenerationUtil.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/EjbGenerationUtil.java index 45bb44a84253..371c885659c5 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/EjbGenerationUtil.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/EjbGenerationUtil.java @@ -62,7 +62,7 @@ public static String[] getPackages(Project project) { for (int i = 0; i < groups.length; i++) { findPackages(groups[i].getRootFolder(),"", pkgs); } - return pkgs.toArray(new String[pkgs.size()]); + return pkgs.toArray(new String[0]); } private static void findPackages (FileObject root, String curPkg, Set pkgs) { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java index b3ca3d2f905b..e73d072a8989 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java @@ -241,8 +241,8 @@ public void run(WorkingCopy workingCopy) throws IOException { // call ejb should not make this check, all should be handled in EnterpriseReferenceContainer boolean isCallerFreeform = enterpriseProject.getClass().getName().equals("org.netbeans.modules.ant.freeform.FreeformProject"); - boolean isCallerEE6WebProject = isEE6WebProject(enterpriseProject); - boolean isCallerEE10WebProject = isEE10WebProject(enterpriseProject); + final boolean isEjb31LiteSupported = isEjb31LiteSupported(enterpriseProject); + final boolean isEjb40LiteSupported = isEjb40LiteSupported(enterpriseProject); List filteredResults = new ArrayList(allProjects.length); for (int i = 0; i < allProjects.length; i++) { @@ -253,14 +253,8 @@ public void run(WorkingCopy workingCopy) throws IOException { EjbJar[] ejbJars = EjbJar.getEjbJars(allProjects[i]); Profile profile = ejbJars.length > 0 ? ejbJars[0].getJ2eeProfile() : null; - if (J2eeModule.Type.EJB.equals(type) || (J2eeModule.Type.WAR.equals(type) - && (Profile.JAVA_EE_6_WEB.equals(profile) || Profile.JAVA_EE_6_FULL.equals(profile) - || Profile.JAVA_EE_7_WEB.equals(profile) || Profile.JAVA_EE_7_FULL.equals(profile) - || Profile.JAVA_EE_8_WEB.equals(profile) || Profile.JAVA_EE_8_FULL.equals(profile) - || Profile.JAKARTA_EE_8_WEB.equals(profile) || Profile.JAKARTA_EE_8_FULL.equals(profile) - || Profile.JAKARTA_EE_9_WEB.equals(profile) || Profile.JAKARTA_EE_9_FULL.equals(profile) - || Profile.JAKARTA_EE_9_1_WEB.equals(profile) || Profile.JAKARTA_EE_9_1_FULL.equals(profile) - || Profile.JAKARTA_EE_10_WEB.equals(profile) || Profile.JAKARTA_EE_10_FULL.equals(profile)))) { + if (J2eeModule.Type.EJB.equals(type) || + (J2eeModule.Type.WAR.equals(type) && profile.isAtLeast(Profile.JAVA_EE_6_WEB))) { isEJBModule = true; } } @@ -269,18 +263,18 @@ public void run(WorkingCopy workingCopy) throws IOException { // If the caller project is a freeform project, include caller itself only // If the caller project is a Java EE 6 web project, include itself in the list if ((isEJBModule && !isCallerFreeform) || - (enterpriseProject.equals(allProjects[i]) && (isCallerFreeform || isCallerEE6WebProject || isCallerEE10WebProject) ) ) { + (enterpriseProject.equals(allProjects[i]) && (isCallerFreeform || isEjb31LiteSupported || isEjb40LiteSupported) ) ) { filteredResults.add(allProjects[i]); } } return filteredResults.toArray(new Project[0]); } - public static boolean isEE6WebProject(Project enterpriseProject) { + public static boolean isEjb31LiteSupported(Project enterpriseProject) { return J2eeProjectCapabilities.forProject(enterpriseProject).isEjb31LiteSupported(); } - public static boolean isEE10WebProject(Project enterpriseProject) { + public static boolean isEjb40LiteSupported(Project enterpriseProject) { return J2eeProjectCapabilities.forProject(enterpriseProject).isEjb40LiteSupported(); } diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/dd/EjbJarXmlWizardIterator.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/dd/EjbJarXmlWizardIterator.java index a0bf95e329be..b443e325d4c3 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/dd/EjbJarXmlWizardIterator.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/dd/EjbJarXmlWizardIterator.java @@ -94,11 +94,11 @@ public Set instantiate() throws IOException { String resource; // see #213631 - caused by fact that EJB DD schemas have different numbering than WEB DD schemas // (so Java EE6 Web-DD is of the version 3.0, but Ejb-DD is of the version 3.1) - if (j2eeProfile == Profile.JAKARTA_EE_9_WEB || j2eeProfile == Profile.JAKARTA_EE_9_1_WEB || j2eeProfile == Profile.JAKARTA_EE_10_WEB) { + if (j2eeProfile.isAtLeast(Profile.JAKARTA_EE_9_WEB)) { resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-4.0.xml"; - } else if (j2eeProfile == Profile.JAVA_EE_7_WEB || j2eeProfile == Profile.JAVA_EE_8_WEB || j2eeProfile == Profile.JAKARTA_EE_8_WEB) { + } else if (j2eeProfile.isAtLeast(Profile.JAVA_EE_7_WEB)) { resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-3.2.xml"; - } else if (j2eeProfile == Profile.JAVA_EE_6_WEB) { + } else if (j2eeProfile.isAtLeast(Profile.JAVA_EE_6_WEB)) { // ee6 web module is of the version 3.0 but the ee6 deployment descriptor schema should be of version 3.1 resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-3.1.xml"; } else { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/AppServerValidationPanel.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/AppServerValidationPanel.java index e6ff0b5e7272..8939f597c6a1 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/AppServerValidationPanel.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/AppServerValidationPanel.java @@ -89,10 +89,10 @@ private static boolean isSessionBeanCodeGenerationAlowed(Project project) { ClassPath classpath = ClassPath.getClassPath(project.getProjectDirectory(), ClassPath.COMPILE); return !(classpath.findResource("jakarta/ejb/Stateless.class") == null //NOI18N || classpath.findResource("jakarta/ejb/Stateful.class") == null //NOI18N - || classpath.findResource("jakarta/ejb/Singleton.class") == null //NOI18N + || classpath.findResource("jakarta/ejb/Singleton.class") == null) //NOI18N || //NOI18N !(classpath.findResource("javax/ejb/Stateless.class") == null //NOI18N || classpath.findResource("javax/ejb/Stateful.class") == null //NOI18N - || classpath.findResource("javax/ejb/Singleton.class") == null)); //NOI18N + || classpath.findResource("javax/ejb/Singleton.class") == null); //NOI18N } } diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeVisualPanel2.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeVisualPanel2.java index e5adb1dfc6f3..31bc8d64c4c3 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeVisualPanel2.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeVisualPanel2.java @@ -76,7 +76,8 @@ public EjbFacadeVisualPanel2(Project project, WizardDescriptor wizard) { ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_8_FULL); boolean serverSupportsEJB40 = ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_9_FULL) || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_9_1_FULL) - || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_10_FULL); + || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_10_FULL) + || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_11_FULL); if (!projectCap.isEjb31Supported() && !serverSupportsEJB31 && !projectCap.isEjb40Supported()&& !serverSupportsEJB40){ remoteCheckBox.setVisible(false); @@ -98,7 +99,7 @@ private void updateInProjectCombo(boolean show) { inProjectCombo.setVisible(show); if (show && projectsList == null) { List projects = SessionEJBWizardPanel.getProjectsList(project); - projectsList = new DefaultComboBoxModel(projects.toArray(new Project[projects.size()])); + projectsList = new DefaultComboBoxModel(projects.toArray(new Project[0])); final ListCellRenderer defaultRenderer = inProjectCombo.getRenderer(); if (!projects.isEmpty()){ inProjectCombo.setRenderer(new ListCellRenderer() { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeWizardIterator.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeWizardIterator.java index 0758eaf6dbb1..85d87cf97cb8 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeWizardIterator.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeWizardIterator.java @@ -117,8 +117,11 @@ public final class EjbFacadeWizardIterator implements WizardDescriptor.ProgressI private static final String FACADE_REMOTE_SUFFIX = FACADE_SUFFIX + "Remote"; //NOI18N private static final String FACADE_LOCAL_SUFFIX = FACADE_SUFFIX + "Local"; //NOI18N private static final String EJB_LOCAL = "javax.ejb.Local"; //NOI18N + private static final String EJB_LOCAL_JAKARTA = "jakarta.ejb.Local"; //NOI18N private static final String EJB_REMOTE = "javax.ejb.Remote"; //NOI18N + private static final String EJB_REMOTE_JAKARTA = "jakarta.ejb.Remote"; //NOI18N protected static final String EJB_STATELESS = "javax.ejb.Stateless"; //NOI18N + protected static final String EJB_STATELESS_JAKARTA = "jakarta.ejb.Stateless"; //NOI18N private int index; private WizardDescriptor wizard; @@ -232,6 +235,16 @@ Set generate(final Project project, final FileObject targetFolder, f final String entitySimpleName = JavaIdentifiers.unqualify(entityFQN); final String variableName = entitySimpleName.toLowerCase().charAt(0) + entitySimpleName.substring(1); + final boolean jakartaVariant; + final ClassPath targetClassPath = ClassPath.getClassPath(targetFolder, ClassPath.COMPILE); + if (targetClassPath != null) { + final FileObject javaxStatelessFo = targetClassPath.findResource(EJB_STATELESS.replace(".", "/") + ".class"); + final FileObject jakartaStatelessFo = targetClassPath.findResource(EJB_STATELESS_JAKARTA.replace(".", "/") + ".class"); + jakartaVariant = javaxStatelessFo == null || jakartaStatelessFo != null; + } else { + jakartaVariant = true; + } + //create the abstract facade class Task waiter = null; final String afName = pkg.isEmpty() ? FACADE_ABSTRACT : pkg + "." + FACADE_ABSTRACT; //NOI18N @@ -253,7 +266,7 @@ public void run(WorkingCopy workingCopy) throws Exception { TypeElement classElement = (TypeElement)workingCopy.getTrees().getElement(classTreePath); String genericsTypeName = "T"; //NOI18N - List methodOptions = getAbstractFacadeMethodOptions(genericsTypeName, "entity"); //NOI18N + List methodOptions = getAbstractFacadeMethodOptions(genericsTypeName, "entity", jakartaVariant); //NOI18N List members = new ArrayList(); String entityClassVar = "entityClass"; //NOI18N Tree classObjectTree = genUtils.createType("java.lang.Class<" + genericsTypeName + ">", classElement); //NOI18N @@ -333,7 +346,7 @@ public void run(CompilationController cc) throws Exception { // generate methods for the facade EntityManagerGenerator generator = new EntityManagerGenerator(facade, entityFQN); - List methodOptions = getMethodOptions(entityFQN, variableName); + List methodOptions = getMethodOptions(entityFQN, variableName, jakartaVariant); for (GenerationOptions each : methodOptions){ generator.generate(each, strategyClass); } @@ -342,12 +355,12 @@ public void run(CompilationController cc) throws Exception { final String localInterfaceFQN = pkg + "." + getUniqueClassName(entitySimpleName + FACADE_LOCAL_SUFFIX, targetFolder); final String remoteInterfaceFQN = pkg + "." + getUniqueClassName(entitySimpleName + FACADE_REMOTE_SUFFIX, targetFolder); - List intfOptions = getAbstractFacadeMethodOptions(entityFQN, variableName); + List intfOptions = getAbstractFacadeMethodOptions(entityFQN, variableName, jakartaVariant); if (hasLocal) { final SourceGroup[] groups = ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); String simpleName = JavaIdentifiers.unqualify(localInterfaceFQN); if (!interfaceExists(groups, pkg, simpleName)) { - FileObject local = createInterface(simpleName, EJB_LOCAL, targetFolder); + FileObject local = createInterface(simpleName, jakartaVariant ? EJB_LOCAL_JAKARTA : EJB_LOCAL, targetFolder); addMethodToInterface(intfOptions, local); createdFiles.add(local); } @@ -357,7 +370,7 @@ public void run(CompilationController cc) throws Exception { String simpleName = JavaIdentifiers.unqualify(remoteInterfaceFQN); if (!interfaceExists(groups, pkg, simpleName)) { FileObject remotePackage = SessionGenerator.createRemoteInterfacePackage(remoteProject, pkg, targetFolder); - FileObject remote = createInterface(simpleName, EJB_REMOTE, remotePackage); + FileObject remote = createInterface(simpleName, jakartaVariant ? EJB_REMOTE_JAKARTA : EJB_REMOTE, remotePackage); addMethodToInterface(intfOptions, remote); createdFiles.add(remote); if (entityProject != null && !entityProject.getProjectDirectory().equals(remoteProject.getProjectDirectory())) { @@ -434,7 +447,7 @@ public void run(WorkingCopy wc) throws Exception { DeclaredType declaredType = wc.getTypes().getDeclaredType(abstactFacadeElement, entityElement.asType()); Tree extendsClause = maker.Type(declaredType); ClassTree newClassTree = maker.Class( - maker.addModifiersAnnotation(classTree.getModifiers(), genUtils.createAnnotation(EJB_STATELESS)), + maker.addModifiersAnnotation(classTree.getModifiers(), genUtils.createAnnotation(jakartaVariant ? EJB_STATELESS_JAKARTA : EJB_STATELESS)), classTree.getSimpleName(), classTree.getTypeParameters(), extendsClause, @@ -476,24 +489,24 @@ public void run(WorkingCopy wc) throws Exception { * @return the options representing the methods for a facade, i.e. create/edit/ * find/remove/findAll. */ - private List getMethodOptions(String entityFQN, String variableName){ + private List getMethodOptions(String entityFQN, String variableName, boolean jakartaVariant){ GenerationOptions getEMOptions = new GenerationOptions(); getEMOptions.setAnnotation("java.lang.Override"); //NOI18N getEMOptions.setMethodName("getEntityManager"); //NOI18N getEMOptions.setOperation(GenerationOptions.Operation.GET_EM); - getEMOptions.setReturnType("javax.persistence.EntityManager");//NOI18N + getEMOptions.setReturnType(jakartaVariant ? "jakarta.persistence.EntityManager" : "javax.persistence.EntityManager");//NOI18N getEMOptions.setModifiers(EnumSet.of(Modifier.PROTECTED)); return Arrays.asList(getEMOptions); } - private List getAbstractFacadeMethodOptions(String entityFQN, String variableName){ + private List getAbstractFacadeMethodOptions(String entityFQN, String variableName, boolean jakartaVariant){ //abstract methods GenerationOptions getEMOptions = new GenerationOptions(); getEMOptions.setMethodName("getEntityManager"); //NOI18N - getEMOptions.setReturnType("javax.persistence.EntityManager");//NOI18N + getEMOptions.setReturnType(jakartaVariant ? "jakarta.persistence.EntityManager" : "javax.persistence.EntityManager");//NOI18N getEMOptions.setModifiers(EnumSet.of(Modifier.PROTECTED, Modifier.ABSTRACT)); //implemented methods diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeWizardPanel2.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeWizardPanel2.java index 4cd7cda32307..0d178cda0c6b 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeWizardPanel2.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeWizardPanel2.java @@ -45,6 +45,9 @@ import org.openide.util.NbBundle; import org.openide.util.Utilities; +import static org.netbeans.modules.j2ee.ejbcore.ejb.wizard.jpa.dao.EjbFacadeWizardIterator.EJB_STATELESS; +import static org.netbeans.modules.j2ee.ejbcore.ejb.wizard.jpa.dao.EjbFacadeWizardIterator.EJB_STATELESS_JAKARTA; + public class EjbFacadeWizardPanel2 implements WizardDescriptor.Panel, ChangeListener { /** @@ -120,8 +123,11 @@ public boolean isValid() { } if (!statelessIfaceOnProjectCP()) { wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, - NbBundle.getMessage(EjbFacadeWizardPanel2.class, "ERR_SessionIfaceNotOnProjectClasspath", //NOI18N - EjbFacadeWizardIterator.EJB_STATELESS)); + NbBundle.getMessage( + EjbFacadeWizardPanel2.class, + "ERR_SessionIfaceNotOnProjectClasspath", //NOI18N + EJB_STATELESS_JAKARTA + "/" + EJB_STATELESS_JAKARTA //NOI18N + )); return false; } @@ -231,13 +237,12 @@ public Project getEntityProject() { private boolean statelessIfaceOnProjectCP() { ClassPath cp = ClassPath.getClassPath(project.getProjectDirectory(), ClassPath.COMPILE); - ClassLoader cl = cp.getClassLoader(true); - try { - Class.forName(EjbFacadeWizardIterator.EJB_STATELESS, false, cl); - } catch (ClassNotFoundException cnfe) { + if(cp == null) { return false; } - return true; + FileObject javaxStatelessFo = cp.findResource(EJB_STATELESS.replace(".", "/") + ".class"); + FileObject jakartaStatelessFo = cp.findResource(EJB_STATELESS_JAKARTA.replace(".", "/") + ".class"); + return javaxStatelessFo != null || jakartaStatelessFo != null; } private static boolean isValidPackageName(String str) { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MdbWizard.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MdbWizard.java index fa47cd849830..7d6b1599861a 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MdbWizard.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MdbWizard.java @@ -75,6 +75,7 @@ public final class MdbWizard implements WizardDescriptor.InstantiatingIterator { "jakarta.jakartaee-web-api-9.0.0", //NOI18N "jakarta.jakartaee-web-api-9.1.0", //NOI18N "jakarta.jakartaee-web-api-10.0.0", //NOI18N + "jakarta.jakartaee-web-api-11.0.0" //NOI18N }; private static final String[] SESSION_STEPS = new String[]{ NbBundle.getMessage(MdbWizard.class, "LBL_SpecifyEJBInfo"), //NOI18N @@ -89,6 +90,7 @@ public final class MdbWizard implements WizardDescriptor.InstantiatingIterator { MAVEN_JAVAEE_API_LIBS.put(Profile.JAKARTA_EE_9_FULL, "jakarta.jakartaee-api-9.0.0"); //NOI18N MAVEN_JAVAEE_API_LIBS.put(Profile.JAKARTA_EE_9_1_FULL, "jakarta.jakartaee-api-9.1.0"); //NOI18N MAVEN_JAVAEE_API_LIBS.put(Profile.JAKARTA_EE_10_FULL, "jakarta.jakartaee-api-10.0.0"); //NOI18N + MAVEN_JAVAEE_API_LIBS.put(Profile.JAKARTA_EE_11_FULL, "jakarta.jakartaee-api-11.0.0"); //NOI18N } @Override @@ -186,7 +188,9 @@ private boolean isJmsOnClasspath() throws IOException { private Profile getTargetFullProfile() { Profile profile = JavaEEProjectSettings.getProfile(Templates.getProject(wiz)); if (profile != null) { - if (profile.isAtLeast(Profile.JAKARTA_EE_10_WEB)) { + if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) { + return Profile.JAKARTA_EE_11_FULL; + } else if (profile.isAtLeast(Profile.JAKARTA_EE_10_WEB)) { return Profile.JAKARTA_EE_10_FULL; } else if (profile.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)) { return Profile.JAKARTA_EE_9_1_FULL; @@ -217,7 +221,7 @@ private boolean removeWebApiJarsFromClasspath() throws IOException { toRemove.add(library); } } - return Utils.removeLibraryFromClasspath(Templates.getProject(wiz), toRemove.toArray(new Library[toRemove.size()])); + return Utils.removeLibraryFromClasspath(Templates.getProject(wiz), toRemove.toArray(new Library[0])); } private void enhanceProjectClasspath(Profile targetProfile) throws IOException { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MessageDestinationUiSupport.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MessageDestinationUiSupport.java index bc3642ec5160..61db0f69f5af 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MessageDestinationUiSupport.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MessageDestinationUiSupport.java @@ -121,7 +121,7 @@ public static void populateDestinations(final Set destinatio comboBox.setRenderer(new MessageDestinationListCellRenderer()); List sortedDestinations = new ArrayList(destinations); - Collections.sort(sortedDestinations, new MessageDestinationComparator()); + sortedDestinations.sort(new MessageDestinationComparator()); comboBox.removeAllItems(); for (MessageDestination d : sortedDestinations) { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizardPanel.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizardPanel.java index ff2bc2f95802..8e5c85c5727f 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizardPanel.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizardPanel.java @@ -153,7 +153,7 @@ private void updateInProjectCombo(boolean show) { inProjectCombo.setVisible(show); if (show && projectsList == null) { List projects = SessionEJBWizardPanel.getProjectsList(project); - projectsList = new DefaultComboBoxModel(projects.toArray(new Project[projects.size()])); + projectsList = new DefaultComboBoxModel(projects.toArray(new Project[0])); final ListCellRenderer defaultRenderer = inProjectCombo.getRenderer(); if (!projects.isEmpty()){ inProjectCombo.setRenderer(new ListCellRenderer() { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/TimerOptions.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/TimerOptions.java index 6d1f2be0f578..b0a78c5a01da 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/TimerOptions.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/TimerOptions.java @@ -116,7 +116,7 @@ private static String[] splitScheduleSections(String scheduleValue) { if (!"".equals(sb.toString())) { finalSections.add(sb.toString()); } - return finalSections.toArray(new String[finalSections.size()]); + return finalSections.toArray(new String[0]); } private static int getCountOfQuotes(String string) { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AbstractAddMethodStrategy.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AbstractAddMethodStrategy.java index 75a810fdd759..e04a4dc86a10 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AbstractAddMethodStrategy.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AbstractAddMethodStrategy.java @@ -21,6 +21,7 @@ import java.io.IOException; import javax.lang.model.element.TypeElement; +import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.source.CompilationController; import org.netbeans.api.java.source.ui.ScanDialog; import org.netbeans.modules.j2ee.api.ejbjar.EjbJar; @@ -49,7 +50,7 @@ public AbstractAddMethodStrategy(String name) { this.name = name; } - protected abstract MethodModel getPrototypeMethod(); + protected abstract MethodModel getPrototypeMethod(boolean jakartaVariant); /** Describes method type handled by this action. */ public abstract MethodType.Kind getPrototypeMethodKind(); @@ -69,7 +70,14 @@ public void addMethod(final FileObject fileObject, final String className) throw if (className == null) { return; } - final MethodModel methodModel = getPrototypeMethod(); + + boolean jakartaVariant = true; + ClassPath cp = ClassPath.getClassPath(fileObject, ClassPath.COMPILE); + if (cp != null) { + jakartaVariant = cp.findResource("javax/ejb/Stateless.class") == null // NOI18N + || cp.findResource("jakarta/ejb/Stateless.class") != null; // NOI18N + } + final MethodModel methodModel = getPrototypeMethod(jakartaVariant); ScanDialog.runWhenScanFinished(new Runnable() { @Override public void run() { @@ -106,18 +114,16 @@ protected static MethodsNode getMethodsNode() { * Gets whether the type of given {@code TypeElement} is Entity bean. * @param compilationController compilationController * @param typeElement examined element - * @return {@code true} if the element is subtype of {@code javax.ejb.EntityBean}, {@code false} otherwise + * @return {@code true} if the element is subtype of {@code jakarta.ejb.EntityBean} or {@code javax.ejb.EntityBean}, {@code false} otherwise */ protected static boolean isEntity(CompilationController compilationController, TypeElement typeElement) { Parameters.notNull("compilationController", compilationController); Parameters.notNull("typeElement", typeElement); TypeElement entity = compilationController.getElements().getTypeElement("javax.ejb.EntityBean"); - if (entity != null) { - typeElement.getKind().getDeclaringClass().isAssignableFrom(entity.getKind().getDeclaringClass()); - return (compilationController.getTypes().isSubtype(typeElement.asType(), entity.asType())); - } - return false; + TypeElement entityJakarta = compilationController.getElements().getTypeElement("jakarta.ejb.EntityBean"); + return (entity != null && (compilationController.getTypes().isSubtype(typeElement.asType(), entity.asType()))) + || (entityJakarta != null && (compilationController.getTypes().isSubtype(typeElement.asType(), entityJakarta.asType()))); } /** @@ -134,12 +140,15 @@ protected static boolean isSession(CompilationController compilationController, TypeElement stateless = compilationController.getElements().getTypeElement("javax.ejb.Stateless"); TypeElement stateful = compilationController.getElements().getTypeElement("javax.ejb.Stateful"); TypeElement singleton = compilationController.getElements().getTypeElement("javax.ejb.Singleton"); - if (stateful != null && stateless != null && singleton != null) { - return (compilationController.getTypes().isSubtype(typeElement.asType(), stateless.asType()) - || compilationController.getTypes().isSubtype(typeElement.asType(), stateful.asType()) - || compilationController.getTypes().isSubtype(typeElement.asType(), singleton.asType())); - } - return false; + TypeElement statelessJakarta = compilationController.getElements().getTypeElement("jakarta.ejb.Stateless"); + TypeElement statefulJakarta = compilationController.getElements().getTypeElement("jakarta.ejb.Stateful"); + TypeElement singletonJakarta = compilationController.getElements().getTypeElement("jakarta.ejb.Singleton"); + return (stateless != null && compilationController.getTypes().isSubtype(typeElement.asType(), stateless.asType())) + || (stateful != null && compilationController.getTypes().isSubtype(typeElement.asType(), stateful.asType())) + || (singleton != null && compilationController.getTypes().isSubtype(typeElement.asType(), singleton.asType())) + || (statelessJakarta != null && compilationController.getTypes().isSubtype(typeElement.asType(), statelessJakarta.asType())) + || (statefulJakarta != null && compilationController.getTypes().isSubtype(typeElement.asType(), statefulJakarta.asType())) + || (singletonJakarta != null && compilationController.getTypes().isSubtype(typeElement.asType(), singletonJakarta.asType())); } /** @@ -153,10 +162,9 @@ protected static boolean isStateful(CompilationController compilationController, Parameters.notNull("typeElement", typeElement); TypeElement stateful = compilationController.getElements().getTypeElement("javax.ejb.Stateful"); - if (stateful != null) { - return (compilationController.getTypes().isSubtype(typeElement.asType(), stateful.asType())); - } - return false; + TypeElement statefulJakarta = compilationController.getElements().getTypeElement("jakarta.ejb.Stateful"); + return (stateful != null && compilationController.getTypes().isSubtype(typeElement.asType(), stateful.asType())) + || (statefulJakarta != null && compilationController.getTypes().isSubtype(typeElement.asType(), statefulJakarta.asType())); } } diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddBusinessMethodStrategy.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddBusinessMethodStrategy.java index 9768b57269e4..a1c56997b439 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddBusinessMethodStrategy.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddBusinessMethodStrategy.java @@ -65,7 +65,7 @@ public AddBusinessMethodStrategy() { super(NbBundle.getMessage(AddBusinessMethodStrategy.class, "LBL_AddBusinessMethodAction")); } - protected MethodModel getPrototypeMethod() { + protected MethodModel getPrototypeMethod(boolean jakartaVariant) { return MethodModel.create( "businessMethod", "void", diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddCreateMethodStrategy.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddCreateMethodStrategy.java index 5ca03870f358..2e582dfbcee5 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddCreateMethodStrategy.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddCreateMethodStrategy.java @@ -64,13 +64,13 @@ public AddCreateMethodStrategy() { super(NbBundle.getMessage(AddCreateMethodStrategy.class, "LBL_AddCreateMethodAction")); } - protected MethodModel getPrototypeMethod() { + protected MethodModel getPrototypeMethod(boolean jakartaVariant) { return MethodModel.create( "create", "void", "", Collections.emptyList(), - Collections.singletonList("javax.ejb.CreateException"), + Collections.singletonList(jakartaVariant ? "jakarta.ejb.CreateException" : "javax.ejb.CreateException"), Collections.emptySet() ); } diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddFinderMethodStrategy.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddFinderMethodStrategy.java index 28e67efd7b4a..2bfedd3b76a2 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddFinderMethodStrategy.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddFinderMethodStrategy.java @@ -62,8 +62,8 @@ public AddFinderMethodStrategy () { super (NbBundle.getMessage(AddFinderMethodStrategy.class, "LBL_AddFinderMethodAction")); } - protected MethodModel getPrototypeMethod() { - return getFinderPrototypeMethod(); + protected MethodModel getPrototypeMethod(boolean jakartaVariant) { + return getFinderPrototypeMethod(jakartaVariant); } protected MethodCustomizer createDialog(FileObject fileObject, final MethodModel methodModel) throws IOException { @@ -127,13 +127,13 @@ public void run(CompilationController cc) throws Exception { return isEntity.get(); } - private static MethodModel getFinderPrototypeMethod() { + private static MethodModel getFinderPrototypeMethod(boolean jakartaVariant) { return MethodModel.create( "findBy", "void", "", Collections.emptyList(), - Collections.singletonList("javax.ejb.FinderException"), + Collections.singletonList(jakartaVariant ? "jakarta.ejb.FinderException" : "javax.ejb.FinderException"), Collections.emptySet() ); } diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddHomeMethodStrategy.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddHomeMethodStrategy.java index a9f0edb03779..919dac90239a 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddHomeMethodStrategy.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddHomeMethodStrategy.java @@ -63,7 +63,7 @@ public AddHomeMethodStrategy () { super(NbBundle.getMessage(AddHomeMethodStrategy.class, "LBL_AddHomeMethodAction")); } - protected MethodModel getPrototypeMethod() { + protected MethodModel getPrototypeMethod(boolean jakartaVariant) { return MethodModel.create( "homeMethod", "void", diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddSelectMethodStrategy.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddSelectMethodStrategy.java index 26bfd414a3f0..bee3d175862b 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddSelectMethodStrategy.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/AddSelectMethodStrategy.java @@ -65,14 +65,14 @@ public AddSelectMethodStrategy(String name) { } @Override - public MethodModel getPrototypeMethod() { + public MethodModel getPrototypeMethod(boolean jakartaVariant) { Set modifiers = EnumSet.of(Modifier.PUBLIC, Modifier.ABSTRACT); return MethodModel.create( "ejbSelectBy", "int", "", Collections.emptyList(), - Collections.singletonList("javax.ejb.FinderException"), + Collections.singletonList(jakartaVariant ? "jakarta.ejb.FinderException" : "javax.ejb.FinderException"), modifiers ); } diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/GoToSourceActionGroup.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/GoToSourceActionGroup.java index 7916fada6c56..60171c3bf5a2 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/GoToSourceActionGroup.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/action/GoToSourceActionGroup.java @@ -121,7 +121,7 @@ public Void run(EjbJarMetadata metadata) { actions.add(new GoToSourceAction(results[LOCAL_HOME], NbBundle.getMessage(GoToSourceActionGroup.class, "LBL_GoTo_LocalHomeInterface"))); } - return actions.toArray(new Action[actions.size()]); + return actions.toArray(new Action[0]); } public HelpCtx getHelpCtx() { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/session/SessionNode.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/session/SessionNode.java index 613d7bbe129b..fad215c2e706 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/session/SessionNode.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/session/SessionNode.java @@ -126,7 +126,7 @@ public Action[] getActions(boolean context) { list.add(null); list.add(SystemAction.get(GoToSourceActionGroup.class)); } - return list.toArray(new SystemAction[list.size()]); + return list.toArray(new SystemAction[0]); } public HelpCtx getHelpCtx() { diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/ComponentMethodModel.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/ComponentMethodModel.java index 02811af3e0fe..4f9be5145a1b 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/ComponentMethodModel.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/ComponentMethodModel.java @@ -121,7 +121,8 @@ public boolean accept(Element e, TypeMirror type) { TypeElement parent = elementUtilities.enclosingTypeElement(e); boolean isInInterface = ElementKind.INTERFACE == parent.getKind(); boolean isFromJavaxEjb = parent.getQualifiedName().toString().startsWith("javax.ejb."); // NOI18N - return isInInterface && !isFromJavaxEjb && ElementKind.METHOD == e.getKind(); + boolean isFromJakartaEjb = parent.getQualifiedName().toString().startsWith("jakarta.ejb."); // NOI18N + return isInInterface && !isFromJavaxEjb && !isFromJakartaEjb && ElementKind.METHOD == e.getKind(); } }); for (Element method : methods) { @@ -164,7 +165,8 @@ public Boolean run(EjbJarMetadata metadata) throws Exception { String ifaceFqn = typeMirror.toString(); if (!ifaceFqn.equals("java.io.Serializable") //NOI18N && !ifaceFqn.equals("java.io.Externalizable") //NOI18N - && !ifaceFqn.startsWith("javax.ejb.")) { //NOI18N + && !ifaceFqn.startsWith("javax.ejb.") //NOI18N + && !ifaceFqn.startsWith("jakarta.ejb.")) { //NOI18N return false; } } diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/MethodNode.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/MethodNode.java index 70be43e2f927..c6d3464a6078 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/MethodNode.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/MethodNode.java @@ -152,9 +152,13 @@ public void run(CompilationController controller) throws IOException { controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); Elements elements = controller.getElements(); TypeElement entityBean = elements.getTypeElement("javax.ejb.EntityBean"); // NOI18N + TypeElement entityBeanJakarta = elements.getTypeElement("jakarta.ejb.EntityBean"); // NOI18N TypeElement implBeanElement = elements.getTypeElement(implBean); if (implBeanElement != null && entityBean != null) { - result[0] = controller.getTypes().isSubtype(implBeanElement.asType(), entityBean.asType()); + result[0] |= controller.getTypes().isSubtype(implBeanElement.asType(), entityBean.asType()); + } + if (implBeanElement != null && entityBeanJakarta != null) { + result[0] |= controller.getTypes().isSubtype(implBeanElement.asType(), entityBeanJakarta.asType()); } } }, true); diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/entries/CallEjbDialog.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/entries/CallEjbDialog.java index a9119a06f490..fbc306876a58 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/entries/CallEjbDialog.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/entries/CallEjbDialog.java @@ -78,7 +78,7 @@ public Action[] getActions(boolean context) { } Children.Array children = new Children.Array(); - children.add(ejbProjectNodes.toArray(new Node[ejbProjectNodes.size()])); + children.add(ejbProjectNodes.toArray(new Node[0])); Node root = new AbstractNode(children); root.setDisplayName(NbBundle.getMessage(CallEjbDialog.class, "LBL_EJBModules")); EnterpriseReferenceContainer erc = enterpriseProject.getLookup().lookup(EnterpriseReferenceContainer.class); diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/entries/DataSourceReferencePanel.form b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/entries/DataSourceReferencePanel.form index 487b3e3897e4..42eda6660b68 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/entries/DataSourceReferencePanel.form +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/entries/DataSourceReferencePanel.form @@ -1,4 +1,4 @@ - + + + Builds, tests, and runs the project org.netbeans.modules.jakartaee11.api + + diff --git a/enterprise/jakartaee11.api/external/binaries-list b/enterprise/jakartaee11.api/external/binaries-list new file mode 100644 index 000000000000..52ecb1598e03 --- /dev/null +++ b/enterprise/jakartaee11.api/external/binaries-list @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +3D3471C64C8500880D0C0C6DA265F19194CE8304 jakarta.platform:jakarta.jakartaee-api:11.0.0-M1 +F0117F7D79657E795020A64CE01359962452694A jakarta.platform:jakarta.jakartaee-web-api:11.0.0-M1 \ No newline at end of file diff --git a/enterprise/jakartaee11.api/external/jakarta.jakartaee-api-11.0.0-license.txt b/enterprise/jakartaee11.api/external/jakarta.jakartaee-api-11.0.0-license.txt new file mode 100644 index 000000000000..57178c4f03d3 --- /dev/null +++ b/enterprise/jakartaee11.api/external/jakarta.jakartaee-api-11.0.0-license.txt @@ -0,0 +1,93 @@ +Name: JakartaEE API 11.0.0 +Version: 11.0.0 +License: EPL-v20 +Description: JakartaEE API 11.0.0 +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api/11.0.0-M1) +Files: jakarta.jakartaee-api-11.0.0-M1.jar + +Eclipse Public License - v 2.0 +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. Definitions +“Contribution” means: + +a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and +b) in the case of each subsequent Contributor: +i) changes to the Program, and +ii) additions to the Program; where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. + +2. Grant of Rights +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. Requirements +3.1 If a Contributor Distributes the Program in any form, then: + +a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + +b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + +i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; +ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; +iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and +iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. +3.2 When the Program is Distributed as Source Code: + +a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and +b) a copy of this Agreement must be included with each copy of the Program. +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. + +4. Commercial Distribution +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. No Warranty +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. Disclaimer of Liability +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. General +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + +Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/enterprise/jakartaee11.api/external/jakarta.jakartaee-web-api-11.0.0-license.txt b/enterprise/jakartaee11.api/external/jakarta.jakartaee-web-api-11.0.0-license.txt new file mode 100644 index 000000000000..62b3c3cee0b4 --- /dev/null +++ b/enterprise/jakartaee11.api/external/jakarta.jakartaee-web-api-11.0.0-license.txt @@ -0,0 +1,93 @@ +Name: JakartaEE Web API 11.0.0 +Version: 11.0.0 +License: EPL-v20 +Description: JakartaEE Web API 11.0.0 +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-web-api/11.0.0-M1) +Files: jakarta.jakartaee-web-api-11.0.0-M1.jar + +Eclipse Public License - v 2.0 +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. Definitions +“Contribution” means: + +a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and +b) in the case of each subsequent Contributor: +i) changes to the Program, and +ii) additions to the Program; where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. + +2. Grant of Rights +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. Requirements +3.1 If a Contributor Distributes the Program in any form, then: + +a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + +b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + +i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; +ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; +iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and +iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. +3.2 When the Program is Distributed as Source Code: + +a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and +b) a copy of this Agreement must be included with each copy of the Program. +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. + +4. Commercial Distribution +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. No Warranty +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. Disclaimer of Liability +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. General +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + +Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/enterprise/jakartaee11.api/manifest.mf b/enterprise/jakartaee11.api/manifest.mf new file mode 100644 index 000000000000..0eb45622633b --- /dev/null +++ b/enterprise/jakartaee11.api/manifest.mf @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.netbeans.modules.jakartaee11.api +OpenIDE-Module-Layer: org/netbeans/modules/jakartaee11/api/layer.xml +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee11/api/Bundle.properties +OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Java-Dependencies: Java > 11 +OpenIDE-Module-Provides: jakartaee11.api diff --git a/enterprise/jakartaee11.api/nbproject/project.properties b/enterprise/jakartaee11.api/nbproject/project.properties new file mode 100644 index 000000000000..b5953f675824 --- /dev/null +++ b/enterprise/jakartaee11.api/nbproject/project.properties @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +is.autoload=true +javac.source=1.8 +release.external/jakarta.jakartaee-api-11.0.0-M1.jar=modules/ext/jakarta.jakartaee-api-11.0.0.jar +release.external/jakarta.jakartaee-web-api-11.0.0-M1.jar=modules/ext/jakarta.jakartaee-web-api-11.0.0.jar diff --git a/enterprise/jakartaee11.api/nbproject/project.xml b/enterprise/jakartaee11.api/nbproject/project.xml new file mode 100644 index 000000000000..c1991274e907 --- /dev/null +++ b/enterprise/jakartaee11.api/nbproject/project.xml @@ -0,0 +1,31 @@ + + + + org.netbeans.modules.apisupport.project + + + org.netbeans.modules.jakartaee11.api + + + + + diff --git a/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/Bundle.properties b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/Bundle.properties new file mode 100644 index 000000000000..651b2584897b --- /dev/null +++ b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/Bundle.properties @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +OpenIDE-Module-Display-Category=Jakarta EE +OpenIDE-Module-Long-Description=\ + Library wrapper which provides JakartaEE 11 API (full API and web profile API) +OpenIDE-Module-Name=Jakarta EE 11 API Library +OpenIDE-Module-Short-Description=Jakarta EE 11 API Library + +#library display name +jakartaee-api-11.0=Jakarta EE 11 API Library +jakartaee-web-api-11.0=Jakarta EE Web 11 API Library diff --git a/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-api-11.0.xml b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-api-11.0.xml new file mode 100644 index 000000000000..d148946875ba --- /dev/null +++ b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-api-11.0.xml @@ -0,0 +1,41 @@ + + + + + jakartaee-api-11.0 + j2se + org/netbeans/modules/jakartaee11/api/Bundle + + classpath + jar:nbinst://org.netbeans.modules.jakartaee11.api/modules/ext/jakarta.jakartaee-api-11.0.0.jar!/ + + + javadoc + jar:nbinst://org.netbeans.modules.jakartaee11.platform/docs/jakartaee11-doc-api.jar!/ + + + + maven-dependencies + jakarta.platform:jakarta.jakartaee-api:11.0.0-M1:jar + + + diff --git a/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-web-api-11.0.xml b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-web-api-11.0.xml new file mode 100644 index 000000000000..2d7da18fa36c --- /dev/null +++ b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-web-api-11.0.xml @@ -0,0 +1,41 @@ + + + + + jakartaee-web-api-11.0 + j2se + org/netbeans/modules/jakartaee11/api/Bundle + + classpath + jar:nbinst://org.netbeans.modules.jakartaee11.api/modules/ext/jakarta.jakartaee-web-api-11.0.0.jar!/ + + + javadoc + jar:nbinst://org.netbeans.modules.jakartaee11.platform/docs/jakartaee11-doc-api.jar!/ + + + + maven-dependencies + jakarta.platform:jakarta.jakartaee-web-api:11.0.0-M1:jar + + + diff --git a/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/layer.xml b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/layer.xml new file mode 100644 index 000000000000..10d26d377bab --- /dev/null +++ b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/layer.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/enterprise/jakartaee11.platform/arch.xml b/enterprise/jakartaee11.platform/arch.xml new file mode 100644 index 000000000000..067007a2456f --- /dev/null +++ b/enterprise/jakartaee11.platform/arch.xml @@ -0,0 +1,908 @@ + + + +]> + + + + &api-questions; + + + + +

    + This module is an empty module, it only contains javahelp documentation for jakartaee functionality. +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + Done. +

    +
    + + + + + +

    + No usecases. +

    +
    + + + + + +

    + Container for javahelp docs for jakartaee. +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + 1.8 +

    +
    + + + + + +

    + JRE +

    +
    + + + + + +

    + None. +

    +
    + + + + + +

    + None. +

    +
    + + + + + +

    + Runs everywhere. +

    +
    + + + + +

    + N/A +

    +
    + + + + + +

    + docs/jakartaee11-doc-api.jar, modules/docs/org-netbeans-modules-jakartaee11-platform.jar +

    +
    + + + + + +

    + Yes. +

    +
    + + + + + +

    + Yes. +

    +
    + + + + + +

    + Anywhere. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + N/A +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + javahelp helpse registration +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + + + + + +

    + No. +

    +
    + +
    diff --git a/enterprise/jakartaee11.platform/build.xml b/enterprise/jakartaee11.platform/build.xml new file mode 100644 index 000000000000..57ecf544f309 --- /dev/null +++ b/enterprise/jakartaee11.platform/build.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/enterprise/jakartaee11.platform/external/binaries-list b/enterprise/jakartaee11.platform/external/binaries-list new file mode 100644 index 000000000000..5fbe81d7f9ea --- /dev/null +++ b/enterprise/jakartaee11.platform/external/binaries-list @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +4165DFDD7B817AF41113E8A5C5DB80A348DB21CA jakarta.platform:jakarta.jakartaee-api:11.0.0-M1:javadoc diff --git a/enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc-license.txt b/enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc-license.txt new file mode 100644 index 000000000000..5d03fc5d2739 --- /dev/null +++ b/enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc-license.txt @@ -0,0 +1,93 @@ +Name: JakartaEE API 11.0.0 Documentation +Version: 11.0.0 +License: EPL-v20 +Description: JakartaEE API 11.0.0 Documentation +Origin: Generated from jakarta.jakartaee-api-11.0.0-M1-javadoc.jar +Type: generated + +Eclipse Public License - v 2.0 +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. Definitions +“Contribution” means: + +a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and +b) in the case of each subsequent Contributor: +i) changes to the Program, and +ii) additions to the Program; where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. + +2. Grant of Rights +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. Requirements +3.1 If a Contributor Distributes the Program in any form, then: + +a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + +b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + +i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; +ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; +iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and +iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. +3.2 When the Program is Distributed as Source Code: + +a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and +b) a copy of this Agreement must be included with each copy of the Program. +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. + +4. Commercial Distribution +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. No Warranty +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. Disclaimer of Liability +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. General +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + +Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc-license.txt b/enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc-license.txt new file mode 100644 index 000000000000..6c205499e823 --- /dev/null +++ b/enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc-license.txt @@ -0,0 +1,93 @@ +Name: JakartaEE API 11.0.0 Documentation +Version: 11.0.0 +License: EPL-v20 +Description: JakartaEE API 11.0.0 Documentation +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api/11.0.0-M1) +Files: jakarta.jakartaee-api-11.0.0-M1-javadoc.jar + +Eclipse Public License - v 2.0 +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. Definitions +“Contribution” means: + +a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and +b) in the case of each subsequent Contributor: +i) changes to the Program, and +ii) additions to the Program; where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. + +2. Grant of Rights +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. Requirements +3.1 If a Contributor Distributes the Program in any form, then: + +a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + +b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + +i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; +ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; +iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and +iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. +3.2 When the Program is Distributed as Source Code: + +a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and +b) a copy of this Agreement must be included with each copy of the Program. +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. + +4. Commercial Distribution +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. No Warranty +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. Disclaimer of Liability +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. General +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + +Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/enterprise/jakartaee11.platform/manifest.mf b/enterprise/jakartaee11.platform/manifest.mf new file mode 100644 index 000000000000..bd8cc2a4fcaa --- /dev/null +++ b/enterprise/jakartaee11.platform/manifest.mf @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +OpenIDE-Module: org.netbeans.modules.jakartaee11.platform/1 +OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee11/platform/Bundle.properties +AutoUpdate-Show-In-Client: false +OpenIDE-Module-Java-Dependencies: Java > 11 +OpenIDE-Module-Provides: jakartaee11.platform diff --git a/enterprise/jakartaee11.platform/nbproject/project.properties b/enterprise/jakartaee11.platform/nbproject/project.properties new file mode 100644 index 000000000000..9888b7c58d0a --- /dev/null +++ b/enterprise/jakartaee11.platform/nbproject/project.properties @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +is.autoload=true +javac.compilerargs=-Xlint:all -Xlint:-serial +javac.source=1.8 +release.external/generated-jakarta.jakartaee-api-11.0.0-javadoc.jar=docs/jakartaee11-doc-api.jar + +javadoc.arch=${basedir}/arch.xml diff --git a/enterprise/jakartaee11.platform/nbproject/project.xml b/enterprise/jakartaee11.platform/nbproject/project.xml new file mode 100644 index 000000000000..dedfb5387837 --- /dev/null +++ b/enterprise/jakartaee11.platform/nbproject/project.xml @@ -0,0 +1,32 @@ + + + + org.netbeans.modules.apisupport.project + + + org.netbeans.modules.jakartaee11.platform + + + + + + diff --git a/enterprise/jakartaee11.platform/src/org/netbeans/modules/jakartaee11/platform/Bundle.properties b/enterprise/jakartaee11.platform/src/org/netbeans/modules/jakartaee11/platform/Bundle.properties new file mode 100644 index 000000000000..2824262415fd --- /dev/null +++ b/enterprise/jakartaee11.platform/src/org/netbeans/modules/jakartaee11/platform/Bundle.properties @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# module description +OpenIDE-Module-Name=Jakarta EE 11 Documentation +OpenIDE-Module-Display-Category=Jakarta EE +OpenIDE-Module-Short-Description=Jakarta EE 11 Documentation +OpenIDE-Module-Long-Description=\ + Documentation for the NetBeans Jakarta EE 11 support and Jakarta EE 11 Javadoc diff --git a/enterprise/jakartaee8.api/manifest.mf b/enterprise/jakartaee8.api/manifest.mf index 9f524eb40f46..401e2977680e 100644 --- a/enterprise/jakartaee8.api/manifest.mf +++ b/enterprise/jakartaee8.api/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.jakartaee8.api OpenIDE-Module-Layer: org/netbeans/modules/jakartaee8/api/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee8/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/enterprise/jakartaee8.platform/manifest.mf b/enterprise/jakartaee8.platform/manifest.mf index 9bc722834215..f9a02e4a98f8 100644 --- a/enterprise/jakartaee8.platform/manifest.mf +++ b/enterprise/jakartaee8.platform/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jakartaee8.platform/1 -OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Specification-Version: 1.26 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee8/platform/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/enterprise/jakartaee9.api/manifest.mf b/enterprise/jakartaee9.api/manifest.mf index 95f85350b7e7..1c6ffa565695 100644 --- a/enterprise/jakartaee9.api/manifest.mf +++ b/enterprise/jakartaee9.api/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.jakartaee9.api OpenIDE-Module-Layer: org/netbeans/modules/jakartaee9/api/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee9/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.23 +OpenIDE-Module-Specification-Version: 1.25 diff --git a/enterprise/jakartaee9.platform/manifest.mf b/enterprise/jakartaee9.platform/manifest.mf index 7f1890ca00dd..0b4465385092 100644 --- a/enterprise/jakartaee9.platform/manifest.mf +++ b/enterprise/jakartaee9.platform/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jakartaee9.platform/1 -OpenIDE-Module-Specification-Version: 1.23 +OpenIDE-Module-Specification-Version: 1.25 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee9/platform/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/enterprise/javaee.api/manifest.mf b/enterprise/javaee.api/manifest.mf index 7b8fdadbbfc7..5d54cb8b7514 100644 --- a/enterprise/javaee.api/manifest.mf +++ b/enterprise/javaee.api/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javaee.api OpenIDE-Module-Layer: org/netbeans/modules/javaee/api/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.43 +OpenIDE-Module-Specification-Version: 1.45 diff --git a/enterprise/javaee.beanvalidation/manifest.mf b/enterprise/javaee.beanvalidation/manifest.mf index 7b9f7350128c..ebac9270e182 100644 --- a/enterprise/javaee.beanvalidation/manifest.mf +++ b/enterprise/javaee.beanvalidation/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javaee.beanvalidation OpenIDE-Module-Layer: org/netbeans/modules/javaee/beanvalidation/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee/beanvalidation/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.44 diff --git a/enterprise/javaee.project/manifest.mf b/enterprise/javaee.project/manifest.mf index dfc1537e766a..d7d36456bacc 100644 --- a/enterprise/javaee.project/manifest.mf +++ b/enterprise/javaee.project/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javaee.project OpenIDE-Module-Layer: org/netbeans/modules/javaee/project/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee/project/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.44 AutoUpdate-Show-In-Client: false diff --git a/enterprise/javaee.project/nbproject/org-netbeans-modules-javaee-project.sig b/enterprise/javaee.project/nbproject/org-netbeans-modules-javaee-project.sig index a5c056fcb90c..76e32640352a 100644 --- a/enterprise/javaee.project/nbproject/org-netbeans-modules-javaee-project.sig +++ b/enterprise/javaee.project/nbproject/org-netbeans-modules-javaee-project.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.41 +#Version 1.42 CLSS public abstract interface java.awt.event.ActionListener intf java.util.EventListener diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/PersistenceProviderSupplierImpl.java b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/PersistenceProviderSupplierImpl.java index 66626693e292..cd26eaec77aa 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/PersistenceProviderSupplierImpl.java +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/PersistenceProviderSupplierImpl.java @@ -20,7 +20,6 @@ package org.netbeans.modules.javaee.project.api; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -72,7 +71,7 @@ public List getSupportedProviders() { return findPersistenceProviders(null); } } - + private List findPersistenceProviders(J2eePlatform platform) { final List providers = new ArrayList(); boolean lessEE7 = true;//we may not know platform @@ -80,13 +79,13 @@ private List findPersistenceProviders(J2eePlatform platform) { final Map jpaProviderMap = createProviderMap(platform); boolean defaultFound = false; // see issue #225071 - - lessEE7 = !platform.getSupportedProfiles().contains(Profile.JAKARTA_EE_10_WEB) && !platform.getSupportedProfiles().contains(Profile.JAKARTA_EE_10_FULL) - && !platform.getSupportedProfiles().contains(Profile.JAKARTA_EE_9_1_WEB) && !platform.getSupportedProfiles().contains(Profile.JAKARTA_EE_9_1_FULL) - && !platform.getSupportedProfiles().contains(Profile.JAKARTA_EE_9_WEB) && !platform.getSupportedProfiles().contains(Profile.JAKARTA_EE_9_FULL) - && !platform.getSupportedProfiles().contains(Profile.JAKARTA_EE_8_WEB) && !platform.getSupportedProfiles().contains(Profile.JAKARTA_EE_8_FULL) - && !platform.getSupportedProfiles().contains(Profile.JAVA_EE_8_WEB) && !platform.getSupportedProfiles().contains(Profile.JAVA_EE_8_FULL) - && !platform.getSupportedProfiles().contains(Profile.JAVA_EE_7_WEB) && !platform.getSupportedProfiles().contains(Profile.JAVA_EE_7_FULL);//we know gf4 do not support old providers, #233726 + for (Profile profile: platform.getSupportedProfiles()) { + if (profile.isAtLeast(Profile.JAVA_EE_7_WEB)) { + lessEE7 = false; //we know gf4 do not support old providers, #233726 + break; + } + } + // Here we are mapping the JpaProvider to the correct Provider for (Provider provider : ProviderUtil.getAllProviders()) { @@ -95,6 +94,7 @@ private List findPersistenceProviders(J2eePlatform platform) { if (jpa != null) { String version = ProviderUtil.getVersion(provider); if (version == null + || (version.equals(Persistence.VERSION_3_2) && jpa.isJpa32Supported()) || (version.equals(Persistence.VERSION_3_1) && jpa.isJpa31Supported()) || (version.equals(Persistence.VERSION_3_0) && jpa.isJpa30Supported()) || (version.equals(Persistence.VERSION_2_2) && jpa.isJpa22Supported()) @@ -123,11 +123,13 @@ private List findPersistenceProviders(J2eePlatform platform) { } if (!found){ String version = ProviderUtil.getVersion(each); + // we know gf4 do not support old providers, #233726, todo, we need to get supported from gf plugin instead if(lessEE7 || version == null || version.equals(Persistence.VERSION_2_1) || version.equals(Persistence.VERSION_2_2) || version.equals(Persistence.VERSION_3_0) - || version.equals(Persistence.VERSION_3_1)) {//we know gf4 do not support old providers, #233726, todo, we need to get supported from gf plugin instead + || version.equals(Persistence.VERSION_3_1) + || version.equals(Persistence.VERSION_3_2)) { providers.add(each); } } diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/J2EEProjectProperties.java b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/J2EEProjectProperties.java index eddb92fd5695..1315cffc3659 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/J2EEProjectProperties.java +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/J2EEProjectProperties.java @@ -514,7 +514,7 @@ private static String toClasspathString(URL[] classpathEntries, MapNote: JDK 11 will be used for Jakarta EE 9.1 an MSG_RecommendationSetSourceLevel11=Note: Source Level 11 will be set for Jakarta EE 9.1 and Jakarta EE 10 project. MSG_RecommendationJDK11=Recommendation: JDK 11 should be used for Jakarta EE 9.1 and Jakarta EE 10 projects. +MSG_RecommendationSetJdk21=Note: JDK 21 will be used for Jakarta EE 11 projects. +MSG_RecommendationSetSourceLevel21=Note: Source Level 21 will be set for Jakarta EE 11 project. +MSG_RecommendationJDK21=Recommendation: JDK 21 should be used for Jakarta EE 11 projects. + #Import wizard - existing sources LBL_IW_ImportTitle=Add Existing Sources LBL_IW_LocationSrcDesc=Select the folder that contains all the sources for your application. diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/J2eeVersionWarningPanel.java b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/J2eeVersionWarningPanel.java index eb71051e61c4..8ed5611bc056 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/J2eeVersionWarningPanel.java +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/J2eeVersionWarningPanel.java @@ -42,17 +42,20 @@ final class J2eeVersionWarningPanel extends javax.swing.JPanel { public static final String WARN_SET_JDK_7 = "warnSetJdk7"; // NOI18N public static final String WARN_SET_JDK_8 = "warnSetJdk8"; // NOI18N public static final String WARN_SET_JDK_11 = "warnSetJdk11"; // NOI18N + public static final String WARN_SET_JDK_21 = "warnSetJdk21"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_15 = "warnSetSourceLevel15"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_6 = "warnSetSourceLevel6"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_7 = "warnSetSourceLevel7"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_8 = "warnSetSourceLevel8"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_11 = "warnSetSourceLevel11"; // NOI18N + public static final String WARN_SET_SOURCE_LEVEL_21 = "warnSetSourceLevel21"; // NOI18N public static final String WARN_JDK_6_REQUIRED = "warnJdk6Required"; // NOI18N public static final String WARN_JDK_7_REQUIRED = "warnJdk7Required"; // NOI18N public static final String WARN_JDK_8_REQUIRED = "warnJdk8Required"; // NOI18N public static final String WARN_JDK_11_REQUIRED = "warnJdk11Required"; // NOI18N + public static final String WARN_JDK_21_REQUIRED = "warnJdk21Required"; // NOI18N private String warningType; @@ -85,6 +88,9 @@ public void setWarningType(String warningType) { case WARN_SET_JDK_11: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetJdk11"); break; + case WARN_SET_JDK_21: + labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetJdk21"); + break; case WARN_SET_SOURCE_LEVEL_15: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetSourceLevel15"); break; @@ -100,6 +106,9 @@ public void setWarningType(String warningType) { case WARN_SET_SOURCE_LEVEL_11: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetSourceLevel11"); break; + case WARN_SET_SOURCE_LEVEL_21: + labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetSourceLevel21"); + break; case WARN_JDK_6_REQUIRED: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationJDK6"); break; @@ -112,6 +121,9 @@ public void setWarningType(String warningType) { case WARN_JDK_11_REQUIRED: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationJDK11"); break; + case WARN_JDK_21_REQUIRED: + labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationJDK21"); + break; default: break; } @@ -145,6 +157,10 @@ public String getSuggestedJavaPlatformName() { JavaPlatform[] javaPlatforms = getJavaPlatforms("11"); return getPreferredPlatform(javaPlatforms).getDisplayName(); } + case WARN_SET_JDK_21: { + JavaPlatform[] javaPlatforms = getJavaPlatforms("21"); + return getPreferredPlatform(javaPlatforms).getDisplayName(); + } default: return JavaPlatform.getDefault().getDisplayName(); } @@ -177,6 +193,10 @@ public Specification getSuggestedJavaPlatformSpecification() { JavaPlatform[] javaPlatforms = getJavaPlatforms("11"); return getPreferredPlatform(javaPlatforms).getSpecification(); } + case WARN_SET_JDK_21: { + JavaPlatform[] javaPlatforms = getJavaPlatforms("21"); + return getPreferredPlatform(javaPlatforms).getSpecification(); + } default: return JavaPlatform.getDefault().getSpecification(); } @@ -241,6 +261,12 @@ public static String findWarningType(Profile j2eeProfile, Set acceptableSourceLe return null; } + // no warning if 21 is the default for jakartaee11 + if ((j2eeProfile == Profile.JAKARTA_EE_11_FULL || j2eeProfile == Profile.JAKARTA_EE_11_WEB) && + isAcceptableSourceLevel("21", sourceLevel, acceptableSourceLevels)) { // NOI18N + return null; + } + if (j2eeProfile == Profile.JAVA_EE_5) { JavaPlatform[] java15Platforms = getJavaPlatforms("1.5"); //NOI18N if (java15Platforms.length > 0) { @@ -295,6 +321,17 @@ public static String findWarningType(Profile j2eeProfile, Set acceptableSourceLe return WARN_JDK_11_REQUIRED; } } + } else if (j2eeProfile == Profile.JAKARTA_EE_11_FULL || j2eeProfile == Profile.JAKARTA_EE_11_WEB) { + JavaPlatform[] java21Platforms = getJavaPlatforms("21"); //NOI18N + if (java21Platforms.length > 0) { + return WARN_SET_JDK_21; + } else { + if (canSetSourceLevel("21")) { + return WARN_SET_SOURCE_LEVEL_21; + } else { + return WARN_JDK_21_REQUIRED; + } + } } else { return null; } diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/ProjectServerPanel.java b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/ProjectServerPanel.java index 971bd510a141..bcfbf5dd9f7a 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/ProjectServerPanel.java +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/ProjectServerPanel.java @@ -426,23 +426,17 @@ private void serverInstanceComboBoxActionPerformed(java.awt.event.ActionEvent ev Set profiles = new TreeSet<>(Profile.UI_COMPARATOR); profiles.addAll(j2eePlatform.getSupportedProfiles(j2eeModuleType)); for (Profile profile : profiles) { - // j2ee 1.3 and 1.4 is not supported anymore + // j2ee 1.3 and 1.4 are not supported anymore if (Profile.J2EE_13.equals(profile) || Profile.J2EE_14.equals(profile)) { continue; } if (j2eeModuleType == J2eeModule.Type.WAR) { - if (Profile.JAVA_EE_6_FULL.equals(profile) || Profile.JAVA_EE_7_FULL.equals(profile) - || Profile.JAVA_EE_8_FULL.equals(profile) || Profile.JAKARTA_EE_8_FULL.equals(profile) - || Profile.JAKARTA_EE_9_FULL.equals(profile) || Profile.JAKARTA_EE_9_1_FULL.equals(profile) - || Profile.JAKARTA_EE_10_FULL.equals(profile)) { + if (profile.isFullProfile() && profile.isAtLeast(Profile.JAVA_EE_6_FULL)) { // for web apps always offer only JAVA_EE_6_WEB profile and skip full one continue; } } else { - if (Profile.JAVA_EE_6_WEB.equals(profile) || Profile.JAVA_EE_7_WEB.equals(profile) - || Profile.JAVA_EE_8_WEB.equals(profile) || Profile.JAKARTA_EE_8_WEB.equals(profile) - || Profile.JAKARTA_EE_9_WEB.equals(profile) || Profile.JAKARTA_EE_9_1_WEB.equals(profile) - || Profile.JAKARTA_EE_10_WEB.equals(profile)) { + if (profile.isWebProfile() && profile.isAtLeast(Profile.JAVA_EE_6_WEB)) { // for EE apps always skip web profile continue; } @@ -617,7 +611,9 @@ private String getSourceLevel(WizardDescriptor d, String serverInstanceId, Profi Set jdks = j2eePlatform.getSupportedJavaPlatformVersions(); // make sure that chosen source level is suported by server: if (jdks != null && !jdks.contains(sourceLevel)) { // workaround for #212146 when jdks == null - if ("11".equals(sourceLevel) && jdks.contains("1.8")) { + if ("21".equals(sourceLevel) && jdks.contains("11")) { + sourceLevel = "11"; + } else if ("11".equals(sourceLevel) && jdks.contains("1.8")) { sourceLevel = "1.8"; } else if ("1.8".equals(sourceLevel) && jdks.contains("1.7")) { sourceLevel = "1.7"; @@ -638,6 +634,9 @@ private String getSourceLevel(WizardDescriptor d, String serverInstanceId, Profi String warningType = warningPanel.getWarningType(); if (warningType != null) { switch (warningType) { + case J2eeVersionWarningPanel.WARN_SET_SOURCE_LEVEL_21: + sourceLevel = "21"; //NOI18N + break; case J2eeVersionWarningPanel.WARN_SET_SOURCE_LEVEL_11: sourceLevel = "11"; //NOI18N break; @@ -987,6 +986,8 @@ private void checkACXmlJ2eeVersion(FileObject appClientXML) { j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_9_FULL)); } else if(new BigDecimal(org.netbeans.modules.j2ee.dd.api.client.AppClient.VERSION_10_0).equals(version)) { j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_10_FULL)); + } else if(new BigDecimal(org.netbeans.modules.j2ee.dd.api.client.AppClient.VERSION_11_0).equals(version)) { + j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_11_FULL)); } } catch (IOException e) { String message = NbBundle.getMessage(ProjectServerPanel.class, "MSG_AppClientXmlCorrupted"); // NOI18N diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ui/utils/J2eePlatformUiSupport.java b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ui/utils/J2eePlatformUiSupport.java index f015653a7cb7..16b429fb3b53 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ui/utils/J2eePlatformUiSupport.java +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ui/utils/J2eePlatformUiSupport.java @@ -132,7 +132,7 @@ private synchronized J2eePlatformAdapter[] getJ2eePlatforms(J2eeModule.Type modu } } } - j2eePlatforms = orderedNames.toArray(new J2eePlatformAdapter[orderedNames.size()]); + j2eePlatforms = orderedNames.toArray(new J2eePlatformAdapter[0]); } return j2eePlatforms; } @@ -187,7 +187,7 @@ public J2eeSpecVersionComboBoxModel(Profile j2eeProfile) { orderedListItems.add(0, new J2eePlatformComboBoxItem(Profile.J2EE_13)); } - j2eeSpecVersions = orderedListItems.toArray(new J2eePlatformComboBoxItem[orderedListItems.size()]); + j2eeSpecVersions = orderedListItems.toArray(new J2eePlatformComboBoxItem[0]); selectedJ2eeSpecVersion = initialJ2eeSpecVersion; } diff --git a/enterprise/javaee.resources/manifest.mf b/enterprise/javaee.resources/manifest.mf index 52b93c16ab89..75449bc30e29 100644 --- a/enterprise/javaee.resources/manifest.mf +++ b/enterprise/javaee.resources/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javaee.resources OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee/resources/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.35 diff --git a/enterprise/javaee.resources/nbproject/org-netbeans-modules-javaee-resources.sig b/enterprise/javaee.resources/nbproject/org-netbeans-modules-javaee-resources.sig index 84884095f99a..8e80fc9ecafb 100644 --- a/enterprise/javaee.resources/nbproject/org-netbeans-modules-javaee-resources.sig +++ b/enterprise/javaee.resources/nbproject/org-netbeans-modules-javaee-resources.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.32 +#Version 1.33 CLSS public abstract interface java.io.Serializable diff --git a/enterprise/javaee.specs.support/manifest.mf b/enterprise/javaee.specs.support/manifest.mf index 1ac654973ea6..d79222ae578f 100644 --- a/enterprise/javaee.specs.support/manifest.mf +++ b/enterprise/javaee.specs.support/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javaee.specs.support/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee/specs/support/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.48 +OpenIDE-Module-Specification-Version: 1.50 diff --git a/enterprise/javaee.specs.support/nbproject/org-netbeans-modules-javaee-specs-support.sig b/enterprise/javaee.specs.support/nbproject/org-netbeans-modules-javaee-specs-support.sig index 9515932eabf9..405c0ac97d7a 100644 --- a/enterprise/javaee.specs.support/nbproject/org-netbeans-modules-javaee-specs-support.sig +++ b/enterprise/javaee.specs.support/nbproject/org-netbeans-modules-javaee-specs-support.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.47 +#Version 1.49 CLSS public abstract interface java.io.Serializable @@ -169,6 +169,7 @@ meth public boolean isJpa22Supported() meth public boolean isJpa2Supported() meth public boolean isJpa30Supported() meth public boolean isJpa31Supported() +meth public boolean isJpa32Supported() meth public java.lang.String getClassName() supr java.lang.Object hfds impl @@ -221,7 +222,7 @@ meth public abstract java.lang.String activationConfigProperty() CLSS public final org.netbeans.modules.javaee.specs.support.spi.JpaProviderFactory cons public init() innr public abstract static Accessor -meth public static org.netbeans.modules.javaee.specs.support.api.JpaProvider createJpaProvider(java.lang.String,boolean,boolean,boolean,boolean,boolean,boolean,boolean) +meth public static org.netbeans.modules.javaee.specs.support.api.JpaProvider createJpaProvider(java.lang.String,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean) meth public static org.netbeans.modules.javaee.specs.support.api.JpaProvider createJpaProvider(org.netbeans.modules.javaee.specs.support.spi.JpaProviderImplementation) supr java.lang.Object @@ -242,6 +243,7 @@ meth public abstract boolean isJpa22Supported() meth public abstract boolean isJpa2Supported() meth public abstract boolean isJpa30Supported() meth public abstract boolean isJpa31Supported() +meth public abstract boolean isJpa32Supported() meth public abstract java.lang.String getClassName() CLSS public abstract interface org.netbeans.modules.javaee.specs.support.spi.JpaSupportImplementation diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/api/JpaProvider.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/api/JpaProvider.java index 46e2fe616625..b2b37eaf8238 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/api/JpaProvider.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/api/JpaProvider.java @@ -66,6 +66,10 @@ public boolean isJpa30Supported() { public boolean isJpa31Supported() { return impl.isJpa31Supported(); } + + public boolean isJpa32Supported() { + return impl.isJpa32Supported(); + } public boolean isDefault() { return impl.isDefault(); diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/BridgingJpaSupportImpl.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/BridgingJpaSupportImpl.java index d2b6ad9a7f62..5cabb0e6bcea 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/BridgingJpaSupportImpl.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/BridgingJpaSupportImpl.java @@ -69,30 +69,41 @@ public Set getProviders() { || platform.isToolSupported(JPAModuleInfo.JPAVERSIONPREFIX + Persistence.VERSION_3_0); boolean jpa31 = !check || platform.isToolSupported(JPAModuleInfo.JPAVERSIONPREFIX + Persistence.VERSION_3_1); + boolean jpa32 = !check + || platform.isToolSupported(JPAModuleInfo.JPAVERSIONPREFIX + Persistence.VERSION_3_2); for (Map.Entry entry : getPossibleContainerProviders().entrySet()) { Provider provider = entry.getKey(); if (platform.isToolSupported(provider.getProviderClass())) { JpaProvider jpaProvider = JpaProviderFactory.createJpaProvider( - provider.getProviderClass(), platform.isToolSupported(entry.getValue()), jpa1, jpa2, jpa21, jpa22, jpa30, jpa31); + provider.getProviderClass(), + platform.isToolSupported(entry.getValue()), + jpa1, jpa2, jpa21, jpa22, jpa30, jpa31, jpa32); result.add(jpaProvider); } } return result; } + // TODO: Add missing JPA 3.x providers private static Map getPossibleContainerProviders() { - Map candidates = new HashMap(); + Map candidates = new HashMap<>(); candidates.put(ProviderUtil.HIBERNATE_PROVIDER1_0, "hibernatePersistenceProviderIsDefault1.0"); // NOI18N candidates.put(ProviderUtil.HIBERNATE_PROVIDER2_0, "hibernatePersistenceProviderIsDefault2.0"); // NOI18N candidates.put(ProviderUtil.HIBERNATE_PROVIDER2_1, "hibernatePersistenceProviderIsDefault2.1"); // NOI18N candidates.put(ProviderUtil.HIBERNATE_PROVIDER2_2, "hibernatePersistenceProviderIsDefault2.2"); // NOI18N + candidates.put(ProviderUtil.HIBERNATE_PROVIDER3_0, "hibernatePersistenceProviderIsDefault3.0"); // NOI18N + candidates.put(ProviderUtil.HIBERNATE_PROVIDER3_1, "hibernatePersistenceProviderIsDefault3.1"); // NOI18N + candidates.put(ProviderUtil.HIBERNATE_PROVIDER3_2, "hibernatePersistenceProviderIsDefault3.2"); // NOI18N candidates.put(ProviderUtil.TOPLINK_PROVIDER1_0, "toplinkPersistenceProviderIsDefault"); // NOI18N candidates.put(ProviderUtil.KODO_PROVIDER, "kodoPersistenceProviderIsDefault"); // NOI18N - candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER2_2, "dataNucleusPersistenceProviderIsDefault2.2"); // NOI18N - candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER2_1, "dataNucleusPersistenceProviderIsDefault2.1"); // NOI18N - candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER2_0, "dataNucleusPersistenceProviderIsDefault2.0"); // NOI18N candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER1_0, "dataNucleusPersistenceProviderIsDefault1.0"); // NOI18N + candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER2_0, "dataNucleusPersistenceProviderIsDefault2.0"); // NOI18N + candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER2_1, "dataNucleusPersistenceProviderIsDefault2.1"); // NOI18N + candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER2_2, "dataNucleusPersistenceProviderIsDefault2.2"); // NOI18N + candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER3_0, "dataNucleusPersistenceProviderIsDefault3.0"); // NOI18N + candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER3_1, "dataNucleusPersistenceProviderIsDefault3.1"); // NOI18N + candidates.put(ProviderUtil.DATANUCLEUS_PROVIDER3_2, "dataNucleusPersistenceProviderIsDefault3.2"); // NOI18N candidates.put(ProviderUtil.OPENJPA_PROVIDER1_0, "openJpaPersistenceProviderIsDefault1.0"); // NOI18N candidates.put(ProviderUtil.OPENJPA_PROVIDER2_0, "openJpaPersistenceProviderIsDefault2.0"); // NOI18N candidates.put(ProviderUtil.OPENJPA_PROVIDER2_1, "openJpaPersistenceProviderIsDefault2.1"); // NOI18N @@ -103,6 +114,7 @@ private static Map getPossibleContainerProviders() { candidates.put(ProviderUtil.ECLIPSELINK_PROVIDER2_2, "eclipseLinkPersistenceProviderIsDefault2.2"); // NOI18N candidates.put(ProviderUtil.ECLIPSELINK_PROVIDER3_0, "eclipseLinkPersistenceProviderIsDefault3.0"); // NOI18N candidates.put(ProviderUtil.ECLIPSELINK_PROVIDER3_1, "eclipseLinkPersistenceProviderIsDefault3.1"); // NOI18N + candidates.put(ProviderUtil.ECLIPSELINK_PROVIDER3_2, "eclipseLinkPersistenceProviderIsDefault3.2"); // NOI18N return candidates; } } diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/IdeJaxRsSupportImpl.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/IdeJaxRsSupportImpl.java index 460a8a5fdb78..2461b70905fe 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/IdeJaxRsSupportImpl.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/IdeJaxRsSupportImpl.java @@ -23,11 +23,9 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -import org.netbeans.api.j2ee.core.Profile; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.project.JavaProjectConstants; import org.netbeans.api.java.project.classpath.ProjectClassPathModifier; @@ -103,8 +101,7 @@ public void removeJaxRsLibraries( Project project ) { String[] classPathTypes = new String[]{ ClassPath.COMPILE , ClassPath.EXECUTE }; for (String type : classPathTypes) { try { - ProjectClassPathModifier.removeLibraries(libraries.toArray( - new Library[ libraries.size()]), sourceRoot, type); + ProjectClassPathModifier.removeLibraries(libraries.toArray(new Library[0]), sourceRoot, type); } catch(UnsupportedOperationException ex) { Logger.getLogger( IdeJaxRsSupportImpl.class.getName() ).log( diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderFactory.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderFactory.java index fa139fb5912f..4610185dcd34 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderFactory.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderFactory.java @@ -33,7 +33,8 @@ public static JpaProvider createJpaProvider(JpaProviderImplementation impl) { public static JpaProvider createJpaProvider(final String className, final boolean isDefault, final boolean isJpa1Supported, final boolean isJpa2Supported, final boolean isJpa21Supported, - final boolean isJpa22Supported, final boolean isJpa30Supported, final boolean isJpa31Supported) { + final boolean isJpa22Supported, final boolean isJpa30Supported, final boolean isJpa31Supported, + final boolean isJpa32Supported) { return Accessor.getDefault().createJpaProvider(new JpaProviderImplementation() { @Override @@ -66,6 +67,11 @@ public boolean isJpa31Supported() { return isJpa31Supported; } + @Override + public boolean isJpa32Supported() { + return isJpa32Supported; + } + @Override public boolean isDefault() { return isDefault; diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderImplementation.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderImplementation.java index ddb0cdb6086f..87208738f972 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderImplementation.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderImplementation.java @@ -36,6 +36,8 @@ public interface JpaProviderImplementation { boolean isJpa31Supported(); + boolean isJpa32Supported(); + boolean isDefault(); String getClassName(); diff --git a/enterprise/javaee.wildfly/manifest.mf b/enterprise/javaee.wildfly/manifest.mf index 8318ac44a1eb..58ceea6df0be 100644 --- a/enterprise/javaee.wildfly/manifest.mf +++ b/enterprise/javaee.wildfly/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module: org.netbeans.modules.javaee.wildfly/1 OpenIDE-Module-Layer: org/netbeans/modules/javaee/wildfly/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee/wildfly/resources/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.serverplugins.javaee -OpenIDE-Module-Specification-Version: 2.15 +OpenIDE-Module-Specification-Version: 2.17 diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentManager.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentManager.java index 5cac76b37c54..9236f6f52881 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentManager.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentManager.java @@ -23,11 +23,11 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.WeakHashMap; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; import java.util.logging.Level; import java.util.logging.Logger; import javax.enterprise.deploy.model.DeployableObject; @@ -83,8 +83,8 @@ public class WildflyDeploymentManager implements DeploymentManager2 { * server instance bcs instance properties are also removed along with * instance. */ - private static final ConcurrentMap PROPERTIES_TO_IS_RUNNING - = new ConcurrentHashMap(new WeakHashMap()); + private static final Map PROPERTIES_TO_IS_RUNNING + = Collections.synchronizedMap(new WeakHashMap()); private final DeploymentFactory df; @@ -233,7 +233,7 @@ public TargetModuleID[] getRunningModules(ModuleType mt, Target[] targets) throw LOGGER.log(Level.INFO, null, ex); return new TargetModuleID[]{}; } - return result.toArray(new TargetModuleID[result.size()]); + return result.toArray(new TargetModuleID[0]); } @Override @@ -274,7 +274,7 @@ public TargetModuleID[] getAvailableModules(ModuleType mt, Target[] targets) thr LOGGER.log(Level.INFO, null, ex); return new TargetModuleID[]{}; } - return result.toArray(new TargetModuleID[result.size()]); + return result.toArray(new TargetModuleID[0]); } @Override diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyTargetModuleID.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyTargetModuleID.java index d03ae2304c53..c883952bcccc 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyTargetModuleID.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyTargetModuleID.java @@ -112,7 +112,7 @@ public void addChild(WildflyTargetModuleID child) { @Override public TargetModuleID[] getChildTargetModuleID() { - return (TargetModuleID[]) childs.toArray(new TargetModuleID[childs.size()]); + return (TargetModuleID[]) childs.toArray(new TargetModuleID[0]); } //Retrieve a list of identifiers of the children of this deployed module. diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/JpaSupportImpl.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/JpaSupportImpl.java index fdd0cf2b9777..863f9166545a 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/JpaSupportImpl.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/JpaSupportImpl.java @@ -38,7 +38,7 @@ public JpaSupportImpl(WildflyJ2eePlatformFactory.J2eePlatformImplImpl platformIm @Override public JpaProvider getDefaultProvider() { String defaultProvider = platformImpl.getDefaultJpaProvider(); - return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, true, true, true, true, true); + return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, true, true, true, true, true, true); } @Override @@ -47,13 +47,16 @@ public Set getProviders() { boolean jpa2 = true; Set providers = new HashSet(); if (platformImpl.containsPersistenceProvider(WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER, WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), true, jpa2, true, true, true, true)); + providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER, + WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), true, jpa2, true, true, true, true, true)); } if (platformImpl.containsPersistenceProvider(WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER, WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false)); + providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER, + WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); } if (platformImpl.containsPersistenceProvider(WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER, WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false)); + providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER, + WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); } return providers; } diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyJ2eePlatformFactory.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyJ2eePlatformFactory.java index c2bef086c7fe..be40e1ece72e 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyJ2eePlatformFactory.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyJ2eePlatformFactory.java @@ -72,7 +72,7 @@ public class WildflyJ2eePlatformFactory extends J2eePlatformFactory { static final String KODO_JPA_PROVIDER = "kodo.persistence.PersistenceProviderImpl"; - private static final WeakHashMap instanceCache = new WeakHashMap(); + private static final WeakHashMap instanceCache = new WeakHashMap<>(); @Override public synchronized J2eePlatformImpl getJ2eePlatformImpl(DeploymentManager dm) { @@ -91,7 +91,7 @@ public synchronized J2eePlatformImpl getJ2eePlatformImpl(DeploymentManager dm) { public static class J2eePlatformImplImpl extends J2eePlatformImpl2 { - private static final Set MODULE_TYPES = new HashSet(8); + private static final Set MODULE_TYPES = new HashSet<>(8); static { MODULE_TYPES.add(Type.EAR); @@ -101,7 +101,7 @@ public static class J2eePlatformImplImpl extends J2eePlatformImpl2 { MODULE_TYPES.add(Type.CAR); } - private static final Set WILDFLY_PROFILES = new HashSet(16); + private static final Set WILDFLY_PROFILES = new HashSet<>(16); static { WILDFLY_PROFILES.add(Profile.JAVA_EE_6_WEB); @@ -112,21 +112,22 @@ public static class J2eePlatformImplImpl extends J2eePlatformImpl2 { WILDFLY_PROFILES.add(Profile.JAVA_EE_8_FULL); WILDFLY_PROFILES.add(Profile.JAKARTA_EE_8_FULL); } - private static final Set JAKARTAEE_FULL_PROFILES = new HashSet(8); + private static final Set JAKARTAEE_FULL_PROFILES = new HashSet<>(8); static { JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_9_FULL); JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_9_1_FULL); JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_10_FULL); + JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_11_FULL); } - private static final Set EAP6_PROFILES = new HashSet(4); + private static final Set EAP6_PROFILES = new HashSet<>(4); static { EAP6_PROFILES.add(Profile.JAVA_EE_6_WEB); EAP6_PROFILES.add(Profile.JAVA_EE_6_FULL); } - private static final Set WILDFLY_WEB_PROFILES = new HashSet(16); + private static final Set WILDFLY_WEB_PROFILES = new HashSet<>(16); static { WILDFLY_WEB_PROFILES.add(Profile.JAVA_EE_6_WEB); @@ -136,14 +137,16 @@ public static class J2eePlatformImplImpl extends J2eePlatformImpl2 { WILDFLY_WEB_PROFILES.add(Profile.JAKARTA_EE_9_WEB); WILDFLY_WEB_PROFILES.add(Profile.JAKARTA_EE_9_1_WEB); WILDFLY_WEB_PROFILES.add(Profile.JAKARTA_EE_10_WEB); + WILDFLY_WEB_PROFILES.add(Profile.JAKARTA_EE_11_WEB); } - private static final Set JAKARTAEE_WEB_PROFILES = new HashSet(8); + private static final Set JAKARTAEE_WEB_PROFILES = new HashSet<>(8); static { JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_9_WEB); JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_9_1_WEB); JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_10_WEB); + JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_11_WEB); } private LibraryImplementation[] libraries; @@ -189,7 +192,7 @@ public Set getSupportedTypes() { @Override public Set getSupportedJavaPlatformVersions() { - Set versions = new HashSet(); + Set versions = new HashSet<>(); versions.add("1.7"); // NOI18N versions.add("1.8"); // NOI18N versions.add("1.8"); // NOI18N @@ -334,21 +337,13 @@ String getDefaultJpaProvider() { } private boolean containsJaxWsLibraries() { - File[] jaxWsAPILib = new File(properties.getModulePath("org/jboss/ws/api/main")).listFiles(new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.startsWith("jbossws-api") && name.endsWith("jar"); - } - }); // NOI18N + File[] jaxWsAPILib = new File(properties.getModulePath("org/jboss/ws/api/main")) // NOI18N + .listFiles((File dir, String name) -> name.startsWith("jbossws-api") && name.endsWith("jar")); // NOI18N if (jaxWsAPILib != null && jaxWsAPILib.length == 1 && jaxWsAPILib[0].exists()) { return true; } - jaxWsAPILib = new File(properties.getModulePath("javax/xml/ws/api/main")).listFiles(new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.startsWith("jboss-jaxws-api") && name.endsWith("jar"); - } - }); // NOI18N + jaxWsAPILib = new File(properties.getModulePath("javax/xml/ws/api/main")) // NOI18N + .listFiles((File dir, String name) -> name.startsWith("jboss-jaxws-api") && name.endsWith("jar")); // NOI18N if (jaxWsAPILib != null && jaxWsAPILib.length == 1 && jaxWsAPILib[0].exists()) { return true; } @@ -385,6 +380,7 @@ private static boolean containsService(LibraryImplementation library, String ser return false; } + @SuppressWarnings("NestedAssignment") private static boolean containsService(FileObject serviceFO, String serviceName, String serviceImplName) { try (BufferedReader br = new BufferedReader(new InputStreamReader(serviceFO.getInputStream()))) { String line; @@ -522,7 +518,7 @@ public Lookup getLookup() { private class JaxRsStackSupportImpl implements JaxRsStackSupportImplementation { private static final String JAX_RS_APPLICATION_CLASS = "javax.ws.rs.core.Application"; //NOI18N - private J2eePlatformImplImpl j2eePlatform; + private final J2eePlatformImplImpl j2eePlatform; JaxRsStackSupportImpl(J2eePlatformImplImpl j2eePlatform) { this.j2eePlatform = j2eePlatform; diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyStartRunnable.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyStartRunnable.java index 58d9ea5d67b3..de4dc79037d1 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyStartRunnable.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyStartRunnable.java @@ -27,6 +27,7 @@ import java.io.FileWriter; import java.io.IOException; import java.io.StringReader; +import java.nio.file.Files; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -452,11 +453,11 @@ String getRunFileName() { boolean needChangeConf = matcherConf != null && matcherConf.matches(); try { if (needChangeRun || needChangeConf) { - File startBat = File.createTempFile(RUN_FILE_NAME, ".bat"); // NOI18N + File startBat = Files.createTempFile(RUN_FILE_NAME, ".bat").toFile(); // NOI18N File confBat = null; if (contentConf != null) { - confBat = File.createTempFile(CONF_FILE_NAME, ".bat", // NOI18N - startBat.getParentFile()); // NOI18N + confBat = Files.createTempFile(// NOI18N + startBat.getParentFile().toPath(), CONF_FILE_NAME, ".bat").toFile(); // NOI18N } startBat.deleteOnExit(); contentRun = replaceJavaOpts(contentRun, matcherRun); diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/commands/WildflyClient.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/commands/WildflyClient.java index c963e52d921d..9bd8eb9665f2 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/commands/WildflyClient.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/commands/WildflyClient.java @@ -205,7 +205,7 @@ private String resolvePath(WildflyClassLoader cl, LinkedHashMap return modelNodeAsString(cl, readResult(cl, response)); } return ""; - } catch (InvocationTargetException | ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -272,7 +272,7 @@ public synchronized void shutdownServer(int timeout) throws IOException, Interru throw new IOException(ex); } close(); - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -304,7 +304,7 @@ public synchronized boolean isServerRunning(String homeDir, String configFile) { LOGGER.log(Level.FINE, null, ex.getTargetException()); close(); return false; - } catch (IllegalAccessException | ClassNotFoundException | InstantiationException | NoSuchMethodException | IOException | InterruptedException | ExecutionException ex) { + } catch (ReflectiveOperationException | IOException | InterruptedException | ExecutionException ex) { LOGGER.log(Level.FINE, null, ex); close(); return false; @@ -375,7 +375,7 @@ public Collection listAvailableModules() throws IOException { } } return modules; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -410,7 +410,7 @@ public Collection listWebModules(Lookup lookup) throws IOE } } return modules; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -452,7 +452,7 @@ public String getWebModuleURL(String webModuleName) throws IOException { } } return ""; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -487,7 +487,7 @@ public Collection listEJBModules(Lookup lookup) throws IOE } } return modules; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -505,7 +505,7 @@ public boolean startModule(WildflyTargetModuleID tmid) throws IOException { return true; } return false; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -519,7 +519,7 @@ public boolean startModule(String moduleName) throws IOException { Object enableDeployment = createOperation(cl, DEPLOYMENT_REDEPLOY_OPERATION, deploymentAddressModelNode); Object result = executeOnModelNode(cl, enableDeployment); return isSuccessfulOutcome(cl, result); - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -532,7 +532,7 @@ public boolean stopModule(String moduleName) throws IOException { // ModelNode Object enableDeployment = createOperation(cl, DEPLOYMENT_UNDEPLOY_OPERATION, deploymentAddressModelNode); return isSuccessfulOutcome(cl, executeOnModelNode(cl, enableDeployment)); - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -552,7 +552,7 @@ public boolean undeploy(String fileName) throws IOException { addModelNodeChild(cl, steps, createOperation(cl, DEPLOYMENT_UNDEPLOY_OPERATION, deploymentAddressModelNode)); addModelNodeChild(cl, steps, createRemoveOperation(cl, deploymentAddressModelNode)); return isSuccessfulOutcome(cl, executeOnModelNode(cl, undeploy)); - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -586,7 +586,7 @@ public boolean deploy(DeploymentContext deployment) throws IOException { // ModelNode Object result = executeOnModelNode(cl, deploy); return isSuccessfulOutcome(cl, result); - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -626,7 +626,7 @@ private Set listDatasources() throws IOException { } } return listedDatasources; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -655,7 +655,7 @@ private WildflyDatasource getDatasource(WildflyClassLoader cl, String name) thro modelNodeAsString(cl, getModelNodeChild(cl, datasource, "driver-class"))); } return null; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -672,7 +672,7 @@ public boolean removeDatasource(String name) throws IOException { // ModelNode Object response = executeOnModelNode(cl, operation); return (isSuccessfulOutcome(cl, response)); - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -703,7 +703,7 @@ private Pair getServerPaths(WildflyClassLoader cl) { } } return null; - } catch (IOException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (IOException | ReflectiveOperationException ex) { return null; } } @@ -755,7 +755,7 @@ public List listDestinationForDeployment(String deplo } } return destinations; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -788,7 +788,7 @@ public List listDestinations() throws IOException { } } return destinations; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -834,7 +834,7 @@ private List getJMSDestinationForServerDeployment(Str } } return listedDestinations; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -878,7 +878,7 @@ private List getJMSDestinationForServer(String server } } return listedDestinations; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -915,7 +915,7 @@ public boolean addMessageDestination(WildflyMessageDestination destination) thro } Object response = executeOnModelNode(cl, operation); return (isSuccessfulOutcome(cl, response)); - } catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ex) { + } catch (ReflectiveOperationException ex) { return false; } } @@ -935,7 +935,7 @@ public boolean removeMessageDestination(WildflyMessageDestination destination) t Object operation = createRemoveOperation(cl, address); Object response = executeOnModelNode(cl, operation); return (isSuccessfulOutcome(cl, response)); - } catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ex) { + } catch (ReflectiveOperationException ex) { return false; } } @@ -984,7 +984,7 @@ private Collection listJaxrsResources(String deployment) t } } return jaxrsResources.values(); - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -1014,7 +1014,7 @@ public Collection listMailSessions() throws IOExcept } } return modules; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -1037,7 +1037,7 @@ public Collection listEarApplications(Lookup lookup) throws IOException { } } return modules; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -1080,7 +1080,7 @@ public Collection listEarSubModules(Lookup lookup, String jeeApplicationName) th } } return modules; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -1107,14 +1107,13 @@ public Collection listEJBForDeployment(Lookup lookup, String applicationName) th } return modules; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } private List listEJBs(WildflyClassLoader cl, - Object deployment, WildflyEjbComponentNode.Type type) throws IllegalAccessException, NoSuchMethodException, - InvocationTargetException { + Object deployment, WildflyEjbComponentNode.Type type) throws ReflectiveOperationException { List modules = new ArrayList<>(); if (modelNodeHasDefinedChild(cl, deployment, type.getPropertyName())) { List ejbs = modelNodeAsList(cl, getModelNodeChild(cl, deployment, type.getPropertyName())); @@ -1125,9 +1124,7 @@ private List listEJBs(WildflyClassLoader cl, return modules; } - private WildflySocket fillSocket(String name, boolean outBound) throws - ClassNotFoundException, NoSuchMethodException, - InvocationTargetException, IllegalAccessException, InstantiationException, IOException { + private WildflySocket fillSocket(String name, boolean outBound) throws ReflectiveOperationException, IOException { WildflyClassLoader cl = WildflyDeploymentFactory.getInstance().getWildFlyClassLoader(ip); WildflySocket socket = new WildflySocket(); LinkedHashMap values = new LinkedHashMap<>(); @@ -1187,7 +1184,7 @@ public Collection listConnectionFactories() throws IOE } } return connectionFactories; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -1224,14 +1221,12 @@ private Collection getConnectionFactoriesFor } } return listedConnectionFactories; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } - private WildflyConnectionFactory fillConnectionFactory(String name, Object configuration) throws - ClassNotFoundException, NoSuchMethodException, - InvocationTargetException, IllegalAccessException, InstantiationException, IOException { + private WildflyConnectionFactory fillConnectionFactory(String name, Object configuration) throws ReflectiveOperationException, IOException { WildflyClassLoader cl = WildflyDeploymentFactory.getInstance().getWildFlyClassLoader(ip); List properties = modelNodeAsPropertyList(cl, configuration); Map attributes = new HashMap<>(properties.size()); @@ -1245,9 +1240,7 @@ private WildflyConnectionFactory fillConnectionFactory(String name, Object confi return new WildflyConnectionFactory(attributes, name); } - private WildflyMailSessionResource fillMailSession(String name, Object mailSession) throws - ClassNotFoundException, NoSuchMethodException, - InvocationTargetException, IllegalAccessException, InstantiationException, IOException { + private WildflyMailSessionResource fillMailSession(String name, Object mailSession) throws ReflectiveOperationException, IOException { WildflyClassLoader cl = WildflyDeploymentFactory.getInstance().getWildFlyClassLoader(ip); Object configuration = modelNodeAsPropertyForValue(cl, mailSession); @@ -1307,7 +1300,7 @@ private String resolveExpression(String unresolvedString) throws IOException { return modelNodeAsString(cl, resolvedExpression); } return unresolvedString; - } catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } @@ -1351,7 +1344,7 @@ public Collection listResourceAdapters() throws IOExcept } } return resourceAdapters; - } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException ex) { + } catch (ReflectiveOperationException ex) { throw new IOException(ex); } } diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/commands/WildflyManagementAPI.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/commands/WildflyManagementAPI.java index 40e7a1df5094..7db923e80d65 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/commands/WildflyManagementAPI.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/commands/WildflyManagementAPI.java @@ -49,8 +49,7 @@ public class WildflyManagementAPI { private static final int TIMEOUT = 1000; static Object createClient(WildflyClassLoader cl, Version version, final String serverAddress, final int serverPort, - final CallbackHandler handler) throws ClassNotFoundException, NoSuchMethodException, - IllegalAccessException, InvocationTargetException, NoSuchAlgorithmException, InstantiationException { + final CallbackHandler handler) throws ReflectiveOperationException, NoSuchAlgorithmException { Class clazz = cl.loadClass("org.jboss.as.controller.client.ModelControllerClient$Factory"); // NOI18N if (version.compareTo(WildflyPluginUtils.WILDFLY_26_0_0) >= 0) { Class configurationBuilderClazz = cl.loadClass("org.jboss.as.controller.client.ModelControllerClientConfiguration$Builder"); @@ -71,15 +70,13 @@ static Object createClient(WildflyClassLoader cl, Version version, final String return method.invoke(null, serverAddress, serverPort, handler, SSLContext.getDefault(), TIMEOUT); } - static void closeClient(WildflyClassLoader cl, Object client) throws ClassNotFoundException, NoSuchMethodException, - IllegalAccessException, InvocationTargetException { + static void closeClient(WildflyClassLoader cl, Object client) throws ReflectiveOperationException { Method method = client.getClass().getMethod("close", new Class[]{}); method.invoke(client, (Object[]) null); } // ModelNode - static Object createDeploymentPathAddressAsModelNode(WildflyClassLoader cl, String name) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + static Object createDeploymentPathAddressAsModelNode(WildflyClassLoader cl, String name) throws ReflectiveOperationException { Class paClazz = cl.loadClass("org.jboss.as.controller.PathAddress"); // NOI18N Class peClazz = cl.loadClass("org.jboss.as.controller.PathElement"); // NOI18N @@ -98,8 +95,7 @@ static Object createDeploymentPathAddressAsModelNode(WildflyClassLoader cl, Stri } // ModelNode - static Object createPathAddressAsModelNode(WildflyClassLoader cl, LinkedHashMap elements) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + static Object createPathAddressAsModelNode(WildflyClassLoader cl, LinkedHashMap elements) throws ReflectiveOperationException { Class paClazz = cl.loadClass("org.jboss.as.controller.PathAddress"); // NOI18N Class peClazz = cl.loadClass("org.jboss.as.controller.PathElement"); // NOI18N @@ -119,8 +115,7 @@ static Object createPathAddressAsModelNode(WildflyClassLoader cl, LinkedHashMap< } // ModelNode - static Object createOperation(WildflyClassLoader cl, Object name, Object modelNode) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + static Object createOperation(WildflyClassLoader cl, Object name, Object modelNode) throws ReflectiveOperationException { Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N Method method = clazz.getDeclaredMethod("createOperation", new Class[]{String.class, modelClazz}); @@ -128,8 +123,7 @@ static Object createOperation(WildflyClassLoader cl, Object name, Object modelNo } // ModelNode - static Object createReadResourceOperation(WildflyClassLoader cl, Object modelNode, boolean recursive, boolean runtime) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { + static Object createReadResourceOperation(WildflyClassLoader cl, Object modelNode, boolean recursive, boolean runtime) throws ReflectiveOperationException { Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N Method method = clazz.getDeclaredMethod("createReadResourceOperation", new Class[]{modelClazz, boolean.class}); @@ -139,8 +133,7 @@ static Object createReadResourceOperation(WildflyClassLoader cl, Object modelNod } // ModelNode - static Object createRemoveOperation(WildflyClassLoader cl, Object modelNode) throws ClassNotFoundException, - NoSuchMethodException, IllegalAccessException, InvocationTargetException { + static Object createRemoveOperation(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N Method method = clazz.getDeclaredMethod("createRemoveOperation", new Class[]{modelClazz}); @@ -148,8 +141,7 @@ static Object createRemoveOperation(WildflyClassLoader cl, Object modelNode) thr } // ModelNode - static Object createAddOperation(WildflyClassLoader cl, Object modelNode) throws ClassNotFoundException, - NoSuchMethodException, IllegalAccessException, InvocationTargetException { + static Object createAddOperation(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N Method method = clazz.getDeclaredMethod("createAddOperation", new Class[]{modelClazz}); @@ -157,8 +149,7 @@ static Object createAddOperation(WildflyClassLoader cl, Object modelNode) throws } // ModelNode - static Object readResult(WildflyClassLoader cl, Object modelNode) throws ClassNotFoundException, - NoSuchMethodException, IllegalAccessException, InvocationTargetException { + static Object readResult(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N Method method = clazz.getDeclaredMethod("readResult", new Class[]{modelClazz}); @@ -166,22 +157,19 @@ static Object readResult(WildflyClassLoader cl, Object modelNode) throws ClassNo } // ModelNode - static Object getModelNodeChild(WildflyClassLoader cl, Object modelNode, Object name) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static Object getModelNodeChild(WildflyClassLoader cl, Object modelNode, Object name) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("get", String.class); return method.invoke(modelNode, name); } // ModelNode - static Object getModelNodeChildAtIndex(WildflyClassLoader cl, Object modelNode, int index) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static Object getModelNodeChildAtIndex(WildflyClassLoader cl, Object modelNode, int index) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("get", int.class); return method.invoke(modelNode, index); } // ModelNode - static Object getModelNodeChildAtPath(WildflyClassLoader cl, Object modelNode, Object[] path) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static Object getModelNodeChildAtPath(WildflyClassLoader cl, Object modelNode, Object[] path) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("get", String[].class); Object array = Array.newInstance(String.class, path.length); for (int i = 0; i < path.length; i++) { @@ -191,36 +179,32 @@ static Object getModelNodeChildAtPath(WildflyClassLoader cl, Object modelNode, O } // ModelNode - static boolean modelNodeHasChild(WildflyClassLoader cl, Object modelNode, String child) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static boolean modelNodeHasChild(WildflyClassLoader cl, Object modelNode, String child) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("has", String.class); return (Boolean) method.invoke(modelNode, child); } // ModelNode - static boolean modelNodeHasDefinedChild(WildflyClassLoader cl, Object modelNode, String child) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static boolean modelNodeHasDefinedChild(WildflyClassLoader cl, Object modelNode, String child) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("hasDefined", String.class); return (Boolean) method.invoke(modelNode, child); } // ModelNode - static Object createModelNode(WildflyClassLoader cl) throws IllegalAccessException, ClassNotFoundException, InstantiationException { + static Object createModelNode(WildflyClassLoader cl) throws ReflectiveOperationException { Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N - return modelClazz.newInstance(); + return modelClazz.getDeclaredConstructor().newInstance(); } // ModelNode - static Object setModelNodeChildString(WildflyClassLoader cl, Object modelNode, Object value) throws IllegalAccessException, - ClassNotFoundException, InstantiationException, NoSuchMethodException, InvocationTargetException { + static Object setModelNodeChildString(WildflyClassLoader cl, Object modelNode, Object value) throws ReflectiveOperationException { assert value != null; Method method = modelNode.getClass().getMethod("set", String.class); return method.invoke(modelNode, value); } // ModelNode - static Object setModelNodeChild(WildflyClassLoader cl, Object modelNode, Object value) throws IllegalAccessException, - ClassNotFoundException, InstantiationException, NoSuchMethodException, InvocationTargetException { + static Object setModelNodeChild(WildflyClassLoader cl, Object modelNode, Object value) throws ReflectiveOperationException { assert value != null; Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N Method method = modelNode.getClass().getMethod("set", modelClazz); @@ -228,51 +212,44 @@ static Object setModelNodeChild(WildflyClassLoader cl, Object modelNode, Object } // ModelNode - static Object setModelNodeChild(WildflyClassLoader cl, Object modelNode, int value) throws IllegalAccessException, - ClassNotFoundException, InstantiationException, NoSuchMethodException, InvocationTargetException { + static Object setModelNodeChild(WildflyClassLoader cl, Object modelNode, int value) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("set", int.class); return method.invoke(modelNode, value); } // ModelNode - static Object setModelNodeChild(WildflyClassLoader cl, Object modelNode, boolean value) throws IllegalAccessException, - ClassNotFoundException, InstantiationException, NoSuchMethodException, InvocationTargetException { + static Object setModelNodeChild(WildflyClassLoader cl, Object modelNode, boolean value) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("set", boolean.class); return method.invoke(modelNode, value); } // ModelNode - static Object setModelNodeChildEmptyList(WildflyClassLoader cl, Object modelNode) throws IllegalAccessException, - ClassNotFoundException, InstantiationException, NoSuchMethodException, InvocationTargetException { + static Object setModelNodeChildEmptyList(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("setEmptyList", (Class[]) null); return method.invoke(modelNode, (Object[]) null); } // ModelNode - static Object setModelNodeChildBytes(WildflyClassLoader cl, Object modelNode, byte[] value) throws IllegalAccessException, - ClassNotFoundException, InstantiationException, NoSuchMethodException, InvocationTargetException { + static Object setModelNodeChildBytes(WildflyClassLoader cl, Object modelNode, byte[] value) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("set", byte[].class); return method.invoke(modelNode, value); } // ModelNode - static Object addModelNodeChild(WildflyClassLoader cl, Object modelNode, Object toAddModelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException, ClassNotFoundException { + static Object addModelNodeChild(WildflyClassLoader cl, Object modelNode, Object toAddModelNode) throws ReflectiveOperationException { Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N Method method = modelNode.getClass().getMethod("add", modelClazz); return method.invoke(modelNode, toAddModelNode); } - static Object addModelNodeChildString(WildflyClassLoader cl, Object modelNode, String toAddModelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException, ClassNotFoundException { + static Object addModelNodeChildString(WildflyClassLoader cl, Object modelNode, String toAddModelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("add", String.class); return method.invoke(modelNode, toAddModelNode); } - static boolean modelNodeIsDefined(WildflyClassLoader cl, Object modelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static boolean modelNodeIsDefined(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("isDefined", (Class[]) null); return (Boolean) method.invoke(modelNode, (Object[]) null); } @@ -283,60 +260,51 @@ static String modelNodeAsString(WildflyClassLoader cl, Object modelNode) throws return (String) method.invoke(modelNode, (Object[]) null); } - static String modelNodeAsPropertyForName(WildflyClassLoader cl, Object modelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static String modelNodeAsPropertyForName(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("asProperty", (Class[]) null); Object property = method.invoke(modelNode, (Object[]) null); return getPropertyName(cl, property); } - static Object modelNodeAsPropertyForValue(WildflyClassLoader cl, Object modelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static Object modelNodeAsPropertyForValue(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("asProperty", (Class[]) null); Object property = method.invoke(modelNode, (Object[]) null); return getPropertyValue(cl, property); } - static String getPropertyName(WildflyClassLoader cl, Object property) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static String getPropertyName(WildflyClassLoader cl, Object property) throws ReflectiveOperationException { Method method = property.getClass().getMethod("getName", (Class[]) null); return (String) method.invoke(property, (Object[]) null); } - static Object getPropertyValue(WildflyClassLoader cl, Object property) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static Object getPropertyValue(WildflyClassLoader cl, Object property) throws ReflectiveOperationException { Method method = property.getClass().getMethod("getValue", (Class[]) null); return method.invoke(property, (Object[]) null); } // List - static List modelNodeAsList(WildflyClassLoader cl, Object modelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static List modelNodeAsList(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("asList", (Class[]) null); return (List) method.invoke(modelNode, (Object[]) null); } - static List modelNodeAsPropertyList(WildflyClassLoader cl, Object modelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static List modelNodeAsPropertyList(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("asPropertyList", (Class[]) null); return (List) method.invoke(modelNode, (Object[]) null); } - static boolean modelNodeAsBoolean(WildflyClassLoader cl, Object modelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static boolean modelNodeAsBoolean(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("asBoolean", (Class[]) null); return (boolean) method.invoke(modelNode, (Object[]) null); } - static int modelNodeAsInt(WildflyClassLoader cl, Object modelNode) throws IllegalAccessException, - NoSuchMethodException, InvocationTargetException { + static int modelNodeAsInt(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Method method = modelNode.getClass().getMethod("asInt", (Class[]) null); return (int) method.invoke(modelNode, (Object[]) null); } - static boolean isSuccessfulOutcome(WildflyClassLoader cl, Object modelNode) throws ClassNotFoundException, - NoSuchMethodException, IllegalAccessException, InvocationTargetException { + static boolean isSuccessfulOutcome(WildflyClassLoader cl, Object modelNode) throws ReflectiveOperationException { Class clazz = cl.loadClass("org.jboss.as.controller.client.helpers.Operations"); // NOI18N Class modelClazz = cl.loadClass("org.jboss.dmr.ModelNode"); // NOI18N Method method = clazz.getDeclaredMethod("isSuccessfulOutcome", modelClazz); diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationPanel.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationPanel.java index f9d795ca6e22..dde9575fea85 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationPanel.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationPanel.java @@ -20,8 +20,7 @@ import java.awt.Component; import java.io.File; -import java.util.HashSet; -import java.util.Iterator; +import java.util.ArrayList; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import javax.swing.event.ChangeEvent; @@ -44,7 +43,7 @@ public class AddServerLocationPanel implements WizardDescriptor.FinishablePanel, private AddServerLocationVisualPanel component; private WizardDescriptor wizard; - private final transient Set listeners = ConcurrentHashMap.newKeySet(2); + private final transient Set listeners = ConcurrentHashMap.newKeySet(2); public AddServerLocationPanel(WildflyInstantiatingIterator instantiatingIterator) { this.instantiatingIterator = instantiatingIterator; @@ -52,17 +51,7 @@ public AddServerLocationPanel(WildflyInstantiatingIterator instantiatingIterator @Override public void stateChanged(ChangeEvent ev) { - fireChangeEvent(ev); - } - - private void fireChangeEvent(ChangeEvent ev) { - Iterator it; - synchronized (listeners) { - it = new HashSet(listeners).iterator(); - } - while (it.hasNext()) { - ((ChangeListener) it.next()).stateChanged(ev); - } + new ArrayList<>(listeners).forEach(l -> l.stateChanged(ev)); } @Override diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationVisualPanel.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationVisualPanel.java index def1ddcebe77..c23a25421036 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationVisualPanel.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationVisualPanel.java @@ -19,8 +19,7 @@ package org.netbeans.modules.javaee.wildfly.ide.ui; import java.io.File; -import java.util.HashSet; -import java.util.Iterator; +import java.util.ArrayList; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import javax.swing.JFileChooser; @@ -30,7 +29,9 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.filechooser.FileFilter; + import static org.netbeans.modules.javaee.wildfly.ide.ui.WildflyPluginUtils.getDefaultConfigurationFile; + import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.util.NbBundle; @@ -42,7 +43,7 @@ */ public class AddServerLocationVisualPanel extends javax.swing.JPanel { - private final Set listeners = ConcurrentHashMap.newKeySet(); + private final Set listeners = ConcurrentHashMap.newKeySet(); /** * Creates new form AddServerLocationVisualPanel @@ -101,14 +102,8 @@ public void removeChangeListener(ChangeListener l) { } private void fireChangeEvent() { - Iterator it; - synchronized (listeners) { - it = new HashSet(listeners).iterator(); - } ChangeEvent ev = new ChangeEvent(this); - while (it.hasNext()) { - ((ChangeListener) it.next()).stateChanged(ev); - } + new ArrayList<>(listeners).forEach(l -> l.stateChanged(ev)); } private void locationChanged() { diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerPropertiesPanel.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerPropertiesPanel.java index d93471d2a25e..463fb4a84c21 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerPropertiesPanel.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerPropertiesPanel.java @@ -20,8 +20,7 @@ import java.awt.Component; import java.io.File; -import java.util.HashSet; -import java.util.Iterator; +import java.util.ArrayList; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import javax.swing.event.ChangeEvent; @@ -169,20 +168,10 @@ public Component getComponent() { @Override public void stateChanged(ChangeEvent ev) { - fireChangeEvent(ev); + new ArrayList<>(listeners).forEach(l -> l.stateChanged(ev)); } - private void fireChangeEvent(ChangeEvent ev) { - Iterator it; - synchronized (listeners) { - it = new HashSet(listeners).iterator(); - } - while (it.hasNext()) { - ((ChangeListener)it.next()).stateChanged(ev); - } - } - - private final transient Set listeners = ConcurrentHashMap.newKeySet(2); + private final transient Set listeners = ConcurrentHashMap.newKeySet(2); @Override public void removeChangeListener(ChangeListener l) { listeners.remove(l); diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerPropertiesVisualPanel.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerPropertiesVisualPanel.java index bfb9f21c28a5..0cd1fdb32f13 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerPropertiesVisualPanel.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerPropertiesVisualPanel.java @@ -20,19 +20,16 @@ import java.awt.GridBagConstraints; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.File; -import java.util.HashSet; -import java.util.Iterator; +import java.util.ArrayList; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import javax.swing.AbstractListModel; import javax.swing.ComboBoxModel; import javax.swing.JComboBox; -import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JPasswordField; @@ -48,7 +45,7 @@ */ public class AddServerPropertiesVisualPanel extends JPanel { - private final Set listeners = ConcurrentHashMap.newKeySet(); + private final Set listeners = ConcurrentHashMap.newKeySet(); private javax.swing.JComboBox domainField; // Domain name (list of registered domains) can be edited private javax.swing.JTextField domainPathField; // @@ -90,14 +87,8 @@ private void somethingChanged() { } private void fireChangeEvent() { - Iterator it; - synchronized (listeners) { - it = new HashSet(listeners).iterator(); - } ChangeEvent ev = new ChangeEvent(this); - while (it.hasNext()) { - ((ChangeListener)it.next()).stateChanged(ev); - } + new ArrayList<>(listeners).forEach(l -> l.stateChanged(ev)); } public boolean isLocalServer(){ @@ -197,12 +188,7 @@ private void init(){ label1 = new JLabel(NbBundle.getMessage(AddServerPropertiesVisualPanel.class, "TXT_PROPERTY_TEXT")); //NOI18N serverType = new JComboBox(new String[]{"Local","Remote"});//NOI18N - serverType.addActionListener(new ActionListener(){ - @Override - public void actionPerformed(ActionEvent e) { - serverTypeChanged(); - } - }); + serverType.addActionListener((ActionEvent e) -> serverTypeChanged()); domainPathLabel = new JLabel(NbBundle.getMessage(AddServerPropertiesVisualPanel.class, "LBL_DomainPath"));//NOI18N @@ -221,11 +207,7 @@ public void actionPerformed(ActionEvent e) { domainField.getAccessibleContext().setAccessibleName(NbBundle.getMessage(AddServerPropertiesVisualPanel.class, "LBL_Domain")); domainField.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(AddServerPropertiesVisualPanel.class, "LBL_Domain")); - domainField.addActionListener(new ActionListener(){ - public void actionPerformed(ActionEvent e) { - domainChanged(); - } - }); + domainField.addActionListener((ActionEvent e) -> domainChanged()); domainLabel.setLabelFor(domainField); org.openide.awt.Mnemonics.setLocalizedText(domainLabel, org.openide.util.NbBundle.getMessage(AddServerPropertiesVisualPanel.class, "LBL_Domain")); // NOI18N @@ -465,7 +447,7 @@ public void actionPerformed(ActionEvent e) { } - class SomeChangesListener implements KeyListener{ + private class SomeChangesListener implements KeyListener{ @Override public void keyTyped(KeyEvent e){} @@ -478,54 +460,6 @@ public void keyPressed(KeyEvent e){} } - private String browseDomainLocation(){ - String insLocation = null; - JFileChooser chooser = getJFileChooser(); - int returnValue = chooser.showDialog(this, NbBundle.getMessage(AddServerPropertiesVisualPanel.class, "LBL_ChooseButton")); //NOI18N - - if(returnValue == JFileChooser.APPROVE_OPTION){ - insLocation = chooser.getSelectedFile().getAbsolutePath(); - } - return insLocation; - } - - private JFileChooser getJFileChooser(){ - JFileChooser chooser = new JFileChooser(); - - chooser.setDialogTitle("LBL_Chooser_Name"); //NOI18N - chooser.setDialogType(JFileChooser.CUSTOM_DIALOG); - - chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - chooser.setApproveButtonMnemonic("Choose_Button_Mnemonic".charAt(0)); //NOI18N - chooser.setMultiSelectionEnabled(false); - chooser.addChoosableFileFilter(new dirFilter()); - chooser.setAcceptAllFileFilterUsed(false); - chooser.setApproveButtonToolTipText("LBL_Chooser_Name"); //NOI18N - - chooser.getAccessibleContext().setAccessibleName("LBL_Chooser_Name"); //NOI18N - chooser.getAccessibleContext().setAccessibleDescription("LBL_Chooser_Name"); //NOI18N - - return chooser; - } - - private static class dirFilter extends javax.swing.filechooser.FileFilter { - - @Override - public boolean accept(File f) { - if(!f.exists() || !f.canRead() || !f.isDirectory() ) { - return false; - }else{ - return true; - } - } - - @Override - public String getDescription() { - return NbBundle.getMessage(AddServerPropertiesVisualPanel.class, "LBL_DirType"); //NOI18N - } - - } - } diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/WildflyInstantiatingIterator.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/WildflyInstantiatingIterator.java index 6404213224f6..bc53c80f9032 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/WildflyInstantiatingIterator.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/WildflyInstantiatingIterator.java @@ -20,9 +20,9 @@ import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; @@ -66,7 +66,7 @@ public class WildflyInstantiatingIterator implements WizardDescriptor.Instantiat // private InstallPanel panel; - private final transient Set listeners = ConcurrentHashMap.newKeySet(2); + private final transient Set listeners = ConcurrentHashMap.newKeySet(2); @Override public void removeChangeListener(ChangeListener l) { listeners.remove(l); @@ -103,13 +103,10 @@ public String name() { } public static void showInformation(final String msg, final String title) { - Runnable info = new Runnable() { - @Override - public void run() { - NotifyDescriptor d = new NotifyDescriptor.Message(msg, NotifyDescriptor.INFORMATION_MESSAGE); - d.setTitle(title); - DialogDisplayer.getDefault().notify(d); - } + Runnable info = () -> { + NotifyDescriptor d = new NotifyDescriptor.Message(msg, NotifyDescriptor.INFORMATION_MESSAGE); + d.setTitle(title); + DialogDisplayer.getDefault().notify(d); }; if (SwingUtilities.isEventDispatchThread()) { @@ -136,7 +133,7 @@ public Set instantiate() throws IOException { url += "&"+ installLocation; // NOI18N try { - Map initialProperties = new HashMap(); + Map initialProperties = new HashMap<>(); initialProperties.put(WildflyPluginProperties.PROPERTY_SERVER, server); initialProperties.put(WildflyPluginProperties.PROPERTY_DEPLOY_DIR, deployDir); initialProperties.put(WildflyPluginProperties.PROPERTY_SERVER_DIR, serverPath); @@ -246,14 +243,8 @@ public void stateChanged(javax.swing.event.ChangeEvent changeEvent) { } protected final void fireChangeEvent() { - Iterator it; - synchronized (listeners) { - it = new HashSet(listeners).iterator(); - } ChangeEvent ev = new ChangeEvent(this); - while (it.hasNext()) { - ((ChangeListener) it.next()).stateChanged(ev); - } + new ArrayList<>(listeners).forEach(l -> l.stateChanged(ev)); } private String host; diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/WildflyPluginUtils.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/WildflyPluginUtils.java index 354182784811..137ab3b9e2be 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/WildflyPluginUtils.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/WildflyPluginUtils.java @@ -111,6 +111,8 @@ public class WildflyPluginUtils { public static final Version WILDFLY_30_0_0 = new Version("30.0.0", true); // NOI18N + public static final Version WILDFLY_31_0_0 = new Version("31.0.0", true); // NOI18N + private static final Logger LOGGER = Logger.getLogger(WildflyPluginUtils.class.getName()); public static final String LIB = "lib" + separatorChar; @@ -325,15 +327,13 @@ public static Version getProductVersion(File serverPath) { props.load(reader); String slot = props.getProperty("slot"); if (slot != null) { - File manifestFile = new File(serverPath, getModulesBase(serverPath.getAbsolutePath()) + "org.jboss.as.product".replace('.', separatorChar) + separatorChar + slot + separatorChar + "dir" + separatorChar + "META-INF" + separatorChar + "MANIFEST.MF"); - InputStream stream = new FileInputStream(manifestFile); - Manifest manifest = new Manifest(stream); - String productName = manifest.getMainAttributes().getValue("JBoss-Product-Release-Name"); + Attributes manifestAttributes = findManifestAttributes(serverPath, slot); + String productName = manifestAttributes.getValue("JBoss-Product-Release-Name"); if(productName == null || productName.isEmpty()) { - productName = manifest.getMainAttributes().getValue("JBoss-Project-Release-Name"); + productName = manifestAttributes.getValue("JBoss-Project-Release-Name"); } boolean wildfly = productName == null || !productName.toLowerCase().contains("eap"); - return new Version(manifest.getMainAttributes().getValue("JBoss-Product-Release-Version"), wildfly); + return new Version(manifestAttributes.getValue("JBoss-Product-Release-Version"), wildfly); } } catch (Exception e) { // Don't care @@ -368,12 +368,10 @@ public static boolean isWildFly(File serverPath) { props.load(reader); String slot = props.getProperty("slot"); if (slot != null) { - File manifestFile = new File(serverPath, getModulesBase(serverPath.getAbsolutePath()) + "org.jboss.as.product".replace('.', separatorChar) + separatorChar + slot + separatorChar + "dir" + separatorChar + "META-INF" + separatorChar + "MANIFEST.MF"); - InputStream stream = new FileInputStream(manifestFile); - Manifest manifest = new Manifest(stream); - String productName = manifest.getMainAttributes().getValue("JBoss-Product-Release-Name"); + Attributes manifestAttributes = findManifestAttributes(serverPath, slot); + String productName = manifestAttributes.getValue("JBoss-Product-Release-Name"); if(productName == null || productName.isEmpty()) { - productName = manifest.getMainAttributes().getValue("JBoss-Project-Release-Name"); + productName = manifestAttributes.getValue("JBoss-Project-Release-Name"); } return productName == null || !productName.toLowerCase().contains("eap"); } @@ -403,12 +401,10 @@ public static boolean isWildFlyServlet(File serverPath) { props.load(reader); String slot = props.getProperty("slot"); if (slot != null) { - File manifestFile = new File(serverPath, getModulesBase(serverPath.getAbsolutePath()) + "org.jboss.as.product".replace('.', separatorChar) + separatorChar + slot + separatorChar + "dir" + separatorChar + "META-INF" + separatorChar + "MANIFEST.MF"); - InputStream stream = new FileInputStream(manifestFile); - Manifest manifest = new Manifest(stream); - String productName = manifest.getMainAttributes().getValue("JBoss-Product-Release-Name"); + Attributes manifestAttributes = findManifestAttributes(serverPath, slot); + String productName = manifestAttributes.getValue("JBoss-Product-Release-Name"); if(productName == null || productName.isEmpty()) { - productName = manifest.getMainAttributes().getValue("JBoss-Project-Release-Name"); + productName = manifestAttributes.getValue("JBoss-Project-Release-Name"); } return productName != null && (productName.contains("WildFly Web Lite") || productName.contains("WildFly Servlet")); } @@ -435,6 +431,29 @@ public static boolean isWildFlyJakartaEE(File serverPath) { return jakartaDir.exists(); } + private static Attributes findManifestAttributes(File serverPath, String slot) { + File productDir = new File(serverPath, getModulesBase(serverPath.getAbsolutePath()) + "org.jboss.as.product".replace('.', separatorChar) + separatorChar + slot); + File[] files = productDir.listFiles(); + for (File file : files) { + try { + if (file.getName().startsWith("wildfly-feature-pack-product-conf") && file.getName().endsWith(".jar")) { + JarFileSystem featurePackProductConfJar = new JarFileSystem(file); + return featurePackProductConfJar.getManifest().getMainAttributes(); + } + } catch (Exception ignore) { + } + } + File manifestFile = new File(productDir, "dir" + separatorChar + "META-INF" + separatorChar + "MANIFEST.MF"); + if (manifestFile.exists()) { + try (InputStream stream = new FileInputStream(manifestFile)) { + Manifest manifest = new Manifest(stream); + return manifest.getMainAttributes(); + } catch (Exception ignore) { + } + } + return null; + } + private static class VersionJarFileFilter implements FilenameFilter { @Override diff --git a/enterprise/javaee7.api/manifest.mf b/enterprise/javaee7.api/manifest.mf index 73e261568432..fbc0ecf5c1cc 100644 --- a/enterprise/javaee7.api/manifest.mf +++ b/enterprise/javaee7.api/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javaee7.api OpenIDE-Module-Layer: org/netbeans/modules/javaee7/api/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee7/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.27 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/enterprise/javaee8.api/manifest.mf b/enterprise/javaee8.api/manifest.mf index a1a91c892724..0362b233fcc9 100644 --- a/enterprise/javaee8.api/manifest.mf +++ b/enterprise/javaee8.api/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javaee8.api OpenIDE-Module-Layer: org/netbeans/modules/javaee8/api/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee8/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.26 +OpenIDE-Module-Specification-Version: 1.28 diff --git a/enterprise/jellytools.enterprise/manifest.mf b/enterprise/jellytools.enterprise/manifest.mf index 9aab3ec17666..a3524e6a80c3 100644 --- a/enterprise/jellytools.enterprise/manifest.mf +++ b/enterprise/jellytools.enterprise/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jellytools.enterprise/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jellytools/enterprise/Bundle.properties -OpenIDE-Module-Specification-Version: 3.49 +OpenIDE-Module-Specification-Version: 3.51 diff --git a/enterprise/jellytools.enterprise/nbproject/org-netbeans-modules-jellytools-enterprise.sig b/enterprise/jellytools.enterprise/nbproject/org-netbeans-modules-jellytools-enterprise.sig index 8d49f1e3d19a..8cca93379313 100644 --- a/enterprise/jellytools.enterprise/nbproject/org-netbeans-modules-jellytools-enterprise.sig +++ b/enterprise/jellytools.enterprise/nbproject/org-netbeans-modules-jellytools-enterprise.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 3.48 +#Version 3.49 CLSS public abstract interface java.io.Serializable diff --git a/enterprise/jellytools.enterprise/src/org/netbeans/jellytools/modules/j2ee/J2eeTestCase.java b/enterprise/jellytools.enterprise/src/org/netbeans/jellytools/modules/j2ee/J2eeTestCase.java index 2ae83a8145c6..fa9b1b8388c2 100644 --- a/enterprise/jellytools.enterprise/src/org/netbeans/jellytools/modules/j2ee/J2eeTestCase.java +++ b/enterprise/jellytools.enterprise/src/org/netbeans/jellytools/modules/j2ee/J2eeTestCase.java @@ -497,7 +497,7 @@ private static URLClassLoader getLoader(Server server) throws MalformedURLExcept for(File file : getJars(server)) { urls.add(file.toURI().toURL()); } - URLClassLoader loader = new URLClassLoader(urls.toArray(new URL[urls.size()])); + URLClassLoader loader = new URLClassLoader(urls.toArray(new URL[0])); return loader; } @@ -628,6 +628,6 @@ private static String[] tokenizePath(String path) { //Fix for issue #57304 l.add(Character.toString(dosHack)); } - return l.toArray(new String[l.size()]); + return l.toArray(new String[0]); } } diff --git a/enterprise/jsp.lexer/manifest.mf b/enterprise/jsp.lexer/manifest.mf index 49f89d87264e..78d4d6574803 100644 --- a/enterprise/jsp.lexer/manifest.mf +++ b/enterprise/jsp.lexer/manifest.mf @@ -1,5 +1,5 @@ OpenIDE-Module: org.netbeans.modules.jsp.lexer/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/jsp/lexer/Bundle.properties -OpenIDE-Module-Specification-Version: 1.48 +OpenIDE-Module-Specification-Version: 1.50 OpenIDE-Module-Layer: org/netbeans/lib/jsp/lexer/layer.xml diff --git a/enterprise/jsp.lexer/nbproject/org-netbeans-modules-jsp-lexer.sig b/enterprise/jsp.lexer/nbproject/org-netbeans-modules-jsp-lexer.sig index 227d920dc382..60545b5f3f74 100644 --- a/enterprise/jsp.lexer/nbproject/org-netbeans-modules-jsp-lexer.sig +++ b/enterprise/jsp.lexer/nbproject/org-netbeans-modules-jsp-lexer.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.47 +#Version 1.48 CLSS public abstract interface java.io.Serializable diff --git a/enterprise/libs.amazon/manifest.mf b/enterprise/libs.amazon/manifest.mf index c279046d32e6..367f0b3dacf4 100644 --- a/enterprise/libs.amazon/manifest.mf +++ b/enterprise/libs.amazon/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.amazon/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/amazon/Bundle.properties -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.35 diff --git a/enterprise/libs.amazon/nbproject/org-netbeans-libs-amazon.sig b/enterprise/libs.amazon/nbproject/org-netbeans-libs-amazon.sig index 1cc9360b2bda..7313734d4b1c 100644 --- a/enterprise/libs.amazon/nbproject/org-netbeans-libs-amazon.sig +++ b/enterprise/libs.amazon/nbproject/org-netbeans-libs-amazon.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.32 +#Version 1.33 CLSS public com.amazonaws.AbortedException cons public init() diff --git a/enterprise/libs.commons_fileupload/manifest.mf b/enterprise/libs.commons_fileupload/manifest.mf index bac7c334dda5..5f86004023f5 100644 --- a/enterprise/libs.commons_fileupload/manifest.mf +++ b/enterprise/libs.commons_fileupload/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.commons_fileupload/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/commons_fileupload/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.51 diff --git a/enterprise/libs.elimpl/nbproject/org-netbeans-libs-elimpl.sig b/enterprise/libs.elimpl/nbproject/org-netbeans-libs-elimpl.sig index c965c671ae16..7f642d0d2716 100644 --- a/enterprise/libs.elimpl/nbproject/org-netbeans-libs-elimpl.sig +++ b/enterprise/libs.elimpl/nbproject/org-netbeans-libs-elimpl.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.41.0 +#Version 1.42.0 CLSS public com.sun.el.ExpressionFactoryImpl cons public init() diff --git a/enterprise/libs.elimpl/nbproject/project.properties b/enterprise/libs.elimpl/nbproject/project.properties index 4eb504e3de09..bc53ce059a28 100644 --- a/enterprise/libs.elimpl/nbproject/project.properties +++ b/enterprise/libs.elimpl/nbproject/project.properties @@ -20,6 +20,6 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 javadoc.arch=${basedir}/arch.xml release.external/el-impl-3.0-b07.jar=modules/ext/el-impl.jar -spec.version.base=1.42.0 +spec.version.base=1.44.0 sigtest.gen.fail.on.error=false diff --git a/enterprise/libs.glassfish_logging/nbproject/org-netbeans-libs-glassfish_logging.sig b/enterprise/libs.glassfish_logging/nbproject/org-netbeans-libs-glassfish_logging.sig index 51aa2909b3e1..aa621f8a6d31 100644 --- a/enterprise/libs.glassfish_logging/nbproject/org-netbeans-libs-glassfish_logging.sig +++ b/enterprise/libs.glassfish_logging/nbproject/org-netbeans-libs-glassfish_logging.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.47.0 +#Version 1.48.0 CLSS public abstract interface com.sun.org.apache.commons.logging.Log meth public abstract boolean isDebugEnabled() diff --git a/enterprise/libs.glassfish_logging/nbproject/project.properties b/enterprise/libs.glassfish_logging/nbproject/project.properties index fddf639590e9..0899613a556c 100644 --- a/enterprise/libs.glassfish_logging/nbproject/project.properties +++ b/enterprise/libs.glassfish_logging/nbproject/project.properties @@ -19,4 +19,4 @@ is.autoload=true javac.source=1.8 release.external/logging-api-1.0.4.jar=modules/ext/logging-api-1.0.4.jar -spec.version.base=1.48.0 +spec.version.base=1.50.0 diff --git a/enterprise/libs.glassfish_logging/nbproject/project.xml b/enterprise/libs.glassfish_logging/nbproject/project.xml index ff5540f63b05..2a982b38d256 100644 --- a/enterprise/libs.glassfish_logging/nbproject/project.xml +++ b/enterprise/libs.glassfish_logging/nbproject/project.xml @@ -28,7 +28,6 @@ org.netbeans.modules.visualweb.j2ee14classloaderprovider org.netbeans.modules.visualweb.j2ee15classloaderprovider - org.netbeans.modules.web.jsf12ri org.netbeans.modules.web.jspparser com.sun.org.apache.commons.logging com.sun.org.apache.commons.logging.impl diff --git a/enterprise/libs.jackson/external/binaries-list b/enterprise/libs.jackson/external/binaries-list index fcbc266045cb..073162777d51 100644 --- a/enterprise/libs.jackson/external/binaries-list +++ b/enterprise/libs.jackson/external/binaries-list @@ -15,9 +15,9 @@ # specific language governing permissions and limitations # under the License. -FD441D574A71E7D10A4F73DE6609F881D8CDFEEC com.fasterxml.jackson.core:jackson-annotations:2.16.1 -9456BB3CDD0F79F91A5F730A1B1BB041A380C91F com.fasterxml.jackson.core:jackson-core:2.16.1 -02A16EFEB840C45AF1E2F31753DFE76795278B73 com.fasterxml.jackson.core:jackson-databind:2.16.1 -1BE7098DCCC079171464DCA7E386BD8DF623B031 com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.16.1 -36A418325C618E440E5CCB80B75C705D894F50BD com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1 -E9DF364A2695E66EB8D2803D6725424842760125 com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.16.1 +880A742337010DA4C851F843D8CAC150E22DFF9F com.fasterxml.jackson.core:jackson-annotations:2.17.0 +A6E5058EF9720623C517252D17162F845306FF3A com.fasterxml.jackson.core:jackson-core:2.17.0 +7173E9E1D4BC6D7CA03BC4EEEDCD548B8B580B34 com.fasterxml.jackson.core:jackson-databind:2.17.0 +6833C8573452D583E4AF650A7424D547606B2501 com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.17.0 +3FAB507BBA9D477E52ED2302DC3DDBD23CBAE339 com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0 +E07032CE170277213AC4835169CA79FA0340C7B5 com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.17.0 diff --git a/enterprise/libs.jackson/external/jackson-2.16.1-license.txt b/enterprise/libs.jackson/external/jackson-2.16.1-license.txt deleted file mode 100644 index 849065bc9a2d..000000000000 --- a/enterprise/libs.jackson/external/jackson-2.16.1-license.txt +++ /dev/null @@ -1,210 +0,0 @@ -Name: Jackson -Description: Jackson is a high-performance JSON processor for Java. -License: Apache-2.0 -Origin: https://github.com/FasterXML/jackson -Version: 2.16.1 -Files: jackson-annotations-2.16.1.jar, jackson-core-2.16.1.jar, jackson-databind-2.16.1.jar, jackson-dataformat-cbor-2.16.1.jar, jackson-datatype-jsr310-2.16.1.jar, jackson-module-jaxb-annotations-2.16.1.jar - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/enterprise/libs.jackson/external/jackson-2.17.0-license.txt b/enterprise/libs.jackson/external/jackson-2.17.0-license.txt new file mode 100644 index 000000000000..991f005e790b --- /dev/null +++ b/enterprise/libs.jackson/external/jackson-2.17.0-license.txt @@ -0,0 +1,210 @@ +Name: Jackson +Description: Jackson is a high-performance JSON processor for Java. +License: Apache-2.0 +Origin: https://github.com/FasterXML/jackson +Version: 2.17.0 +Files: jackson-annotations-2.17.0.jar, jackson-core-2.17.0.jar, jackson-databind-2.17.0.jar, jackson-dataformat-cbor-2.17.0.jar, jackson-datatype-jsr310-2.17.0.jar, jackson-module-jaxb-annotations-2.17.0.jar + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/enterprise/libs.jackson/manifest.mf b/enterprise/libs.jackson/manifest.mf index f65ff12416bc..5a221440bb8e 100644 --- a/enterprise/libs.jackson/manifest.mf +++ b/enterprise/libs.jackson/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.jackson/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jackson/Bundle.properties -OpenIDE-Module-Specification-Version: 2.21 +OpenIDE-Module-Specification-Version: 2.23 diff --git a/enterprise/libs.jackson/nbproject/org-netbeans-libs-jackson.sig b/enterprise/libs.jackson/nbproject/org-netbeans-libs-jackson.sig index 4d7316f07f27..50b3288f2fa5 100644 --- a/enterprise/libs.jackson/nbproject/org-netbeans-libs-jackson.sig +++ b/enterprise/libs.jackson/nbproject/org-netbeans-libs-jackson.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.21 +#Version 2.22 CLSS public abstract interface !annotation com.fasterxml.jackson.annotation.JacksonAnnotation anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) @@ -61,7 +61,7 @@ meth public abstract !hasdefault boolean enabled() CLSS public abstract interface !annotation com.fasterxml.jackson.annotation.JsonAnySetter anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) - anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE, METHOD, FIELD]) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE, METHOD, FIELD, PARAMETER]) intf java.lang.annotation.Annotation meth public abstract !hasdefault boolean enabled() @@ -988,10 +988,10 @@ fld protected com.fasterxml.jackson.core.StreamWriteConstraints _streamWriteCons fld protected com.fasterxml.jackson.core.io.CharacterEscapes _characterEscapes fld protected com.fasterxml.jackson.core.io.InputDecorator _inputDecorator fld protected com.fasterxml.jackson.core.io.OutputDecorator _outputDecorator +fld protected com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer _rootCharSymbols fld protected com.fasterxml.jackson.core.util.RecyclerPool _recyclerPool fld protected final char _quoteChar fld protected final com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer _byteSymbolCanonicalizer -fld protected final com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer _rootCharSymbols fld protected final java.util.List _generatorDecorators fld protected final static int DEFAULT_FACTORY_FEATURE_FLAGS fld protected final static int DEFAULT_GENERATOR_FEATURE_FLAGS @@ -1004,7 +1004,6 @@ fld public final static char DEFAULT_QUOTE_CHAR = '\u0022' fld public final static com.fasterxml.jackson.core.SerializableString DEFAULT_ROOT_VALUE_SEPARATOR fld public final static java.lang.String FORMAT_NAME_JSON = "JSON" innr public final static !enum Feature -intf com.fasterxml.jackson.core.Versioned intf java.io.Serializable meth protected com.fasterxml.jackson.core.JsonGenerator _createGenerator(java.io.Writer,com.fasterxml.jackson.core.io.IOContext) throws java.io.IOException meth protected com.fasterxml.jackson.core.JsonGenerator _createUTF8Generator(java.io.OutputStream,com.fasterxml.jackson.core.io.IOContext) throws java.io.IOException @@ -1198,6 +1197,10 @@ innr public final static !enum Feature intf com.fasterxml.jackson.core.Versioned intf java.io.Closeable intf java.io.Flushable +meth protected com.fasterxml.jackson.core.exc.StreamWriteException _constructWriteException(java.lang.String) +meth protected com.fasterxml.jackson.core.exc.StreamWriteException _constructWriteException(java.lang.String,java.lang.Object) +meth protected com.fasterxml.jackson.core.exc.StreamWriteException _constructWriteException(java.lang.String,java.lang.Object,java.lang.Object) +meth protected com.fasterxml.jackson.core.exc.StreamWriteException _constructWriteException(java.lang.String,java.lang.Throwable) meth protected final void _throwInternal() meth protected final void _verifyOffsets(int,int,int) meth protected void _copyCurrentContents(com.fasterxml.jackson.core.JsonParser) throws java.io.IOException @@ -1207,6 +1210,7 @@ meth protected void _copyCurrentIntValue(com.fasterxml.jackson.core.JsonParser) meth protected void _copyCurrentStringValue(com.fasterxml.jackson.core.JsonParser) throws java.io.IOException meth protected void _reportError(java.lang.String) throws com.fasterxml.jackson.core.JsonGenerationException meth protected void _reportUnsupportedOperation() +meth protected void _reportUnsupportedOperation(java.lang.String) meth protected void _writeSimpleObject(java.lang.Object) throws java.io.IOException meth public abstract boolean isClosed() meth public abstract boolean isEnabled(com.fasterxml.jackson.core.JsonGenerator$Feature) @@ -1280,12 +1284,14 @@ meth public int getOutputBuffered() meth public int writeBinary(java.io.InputStream,int) throws java.io.IOException meth public java.lang.Object currentValue() meth public java.lang.Object getCurrentValue() + anno 0 java.lang.Deprecated() meth public java.lang.Object getOutputTarget() meth public void assignCurrentValue(java.lang.Object) meth public void copyCurrentEvent(com.fasterxml.jackson.core.JsonParser) throws java.io.IOException meth public void copyCurrentEventExact(com.fasterxml.jackson.core.JsonParser) throws java.io.IOException meth public void copyCurrentStructure(com.fasterxml.jackson.core.JsonParser) throws java.io.IOException meth public void setCurrentValue(java.lang.Object) + anno 0 java.lang.Deprecated() meth public void setSchema(com.fasterxml.jackson.core.FormatSchema) meth public void writeArray(double[],int,int) throws java.io.IOException meth public void writeArray(int[],int,int) throws java.io.IOException @@ -1332,6 +1338,7 @@ CLSS public final static !enum com.fasterxml.jackson.core.JsonGenerator$Feature outer com.fasterxml.jackson.core.JsonGenerator fld public final static com.fasterxml.jackson.core.JsonGenerator$Feature AUTO_CLOSE_JSON_CONTENT fld public final static com.fasterxml.jackson.core.JsonGenerator$Feature AUTO_CLOSE_TARGET +fld public final static com.fasterxml.jackson.core.JsonGenerator$Feature ESCAPE_FORWARD_SLASHES fld public final static com.fasterxml.jackson.core.JsonGenerator$Feature ESCAPE_NON_ASCII anno 0 java.lang.Deprecated() fld public final static com.fasterxml.jackson.core.JsonGenerator$Feature FLUSH_PASSED_TO_STREAM @@ -1418,10 +1425,12 @@ fld protected final static com.fasterxml.jackson.core.util.JacksonFeatureSet +CLSS public final static !enum com.fasterxml.jackson.core.JsonParser$NumberTypeFP + outer com.fasterxml.jackson.core.JsonParser +fld public final static com.fasterxml.jackson.core.JsonParser$NumberTypeFP BIG_DECIMAL +fld public final static com.fasterxml.jackson.core.JsonParser$NumberTypeFP DOUBLE64 +fld public final static com.fasterxml.jackson.core.JsonParser$NumberTypeFP FLOAT16 +fld public final static com.fasterxml.jackson.core.JsonParser$NumberTypeFP FLOAT32 +fld public final static com.fasterxml.jackson.core.JsonParser$NumberTypeFP UNKNOWN +meth public static com.fasterxml.jackson.core.JsonParser$NumberTypeFP valueOf(java.lang.String) +meth public static com.fasterxml.jackson.core.JsonParser$NumberTypeFP[] values() +supr java.lang.Enum + CLSS public com.fasterxml.jackson.core.JsonPointer cons protected init() cons protected init(java.lang.String,int,java.lang.String,com.fasterxml.jackson.core.JsonPointer) @@ -1603,10 +1629,14 @@ fld protected final java.lang.String _matchingPropertyName fld protected final static com.fasterxml.jackson.core.JsonPointer EMPTY fld protected int _hashCode fld protected volatile com.fasterxml.jackson.core.JsonPointer _head +fld public final static char ESC = '~' fld public final static char SEPARATOR = '/' +fld public final static java.lang.String ESC_SLASH = "~1" +fld public final static java.lang.String ESC_TILDE = "~0" intf java.io.Serializable meth protected com.fasterxml.jackson.core.JsonPointer _constructHead() meth protected com.fasterxml.jackson.core.JsonPointer _constructHead(int,com.fasterxml.jackson.core.JsonPointer) +meth protected java.lang.StringBuilder toStringBuilder(int) meth protected static com.fasterxml.jackson.core.JsonPointer _parseTail(java.lang.String) meth protected static int _extractEscapedSegment(java.lang.String,int,int,java.lang.StringBuilder) meth public boolean equals(java.lang.Object) @@ -2163,12 +2193,13 @@ meth public com.fasterxml.jackson.core.JsonGenerator useDefaultPrettyPrinter() meth public com.fasterxml.jackson.core.JsonStreamContext getOutputContext() meth public com.fasterxml.jackson.core.ObjectCodec getCodec() meth public com.fasterxml.jackson.core.Version version() +meth public com.fasterxml.jackson.core.io.IOContext ioContext() meth public final boolean isEnabled(com.fasterxml.jackson.core.JsonGenerator$Feature) meth public int getFeatureMask() meth public int writeBinary(com.fasterxml.jackson.core.Base64Variant,java.io.InputStream,int) throws java.io.IOException -meth public java.lang.Object getCurrentValue() +meth public java.lang.Object currentValue() +meth public void assignCurrentValue(java.lang.Object) meth public void close() throws java.io.IOException -meth public void setCurrentValue(java.lang.Object) meth public void writeFieldName(com.fasterxml.jackson.core.SerializableString) throws java.io.IOException meth public void writeObject(java.lang.Object) throws java.io.IOException meth public void writeRawValue(char[],int,int) throws java.io.IOException @@ -2184,6 +2215,7 @@ CLSS public abstract com.fasterxml.jackson.core.base.ParserBase cons protected init(com.fasterxml.jackson.core.io.IOContext,int) fld protected boolean _closed fld protected boolean _nameCopied +fld protected boolean _numberIsNaN fld protected boolean _numberNegative fld protected byte[] _binaryValue fld protected char[] _nameCopyBuffer @@ -2265,7 +2297,9 @@ meth public boolean isClosed() meth public boolean isNaN() throws java.io.IOException meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser$Feature) meth public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser$Feature) meth public com.fasterxml.jackson.core.JsonParser overrideStdFeatures(int,int) @@ -2283,16 +2317,17 @@ meth public int getTokenColumnNr() meth public int getTokenLineNr() meth public java.lang.Number getNumberValue() throws java.io.IOException meth public java.lang.Number getNumberValueExact() throws java.io.IOException -meth public java.lang.Object getCurrentValue() +meth public java.lang.Object currentValue() meth public java.lang.Object getNumberValueDeferred() throws java.io.IOException meth public java.lang.String getCurrentName() throws java.io.IOException + anno 0 java.lang.Deprecated() meth public java.math.BigDecimal getDecimalValue() throws java.io.IOException meth public java.math.BigInteger getBigIntegerValue() throws java.io.IOException meth public long getLongValue() throws java.io.IOException meth public long getTokenCharacterOffset() +meth public void assignCurrentValue(java.lang.Object) meth public void close() throws java.io.IOException meth public void overrideCurrentName(java.lang.String) -meth public void setCurrentValue(java.lang.Object) supr com.fasterxml.jackson.core.base.ParserMinimalBase CLSS public abstract com.fasterxml.jackson.core.base.ParserMinimalBase @@ -2352,6 +2387,8 @@ fld protected final static long MIN_INT_L = -2147483648 meth protected <%0 extends java.lang.Object> {%%0} _reportUnexpectedNumberChar(int,java.lang.String) throws com.fasterxml.jackson.core.JsonParseException meth protected abstract void _handleEOF() throws com.fasterxml.jackson.core.JsonParseException meth protected boolean _hasTextualNull(java.lang.String) +meth protected com.fasterxml.jackson.core.JsonLocation _currentLocationMinusOne() +meth protected final <%0 extends java.lang.Object> {%%0} _throwInternalReturnAny() meth protected final com.fasterxml.jackson.core.JsonParseException _constructError(java.lang.String,java.lang.Throwable) meth protected final static java.lang.String _getCharDesc(int) meth protected final void _reportError(java.lang.String) throws com.fasterxml.jackson.core.JsonParseException @@ -2368,11 +2405,7 @@ meth protected static java.lang.String _ascii(byte[]) meth protected void _decodeBase64(java.lang.String,com.fasterxml.jackson.core.util.ByteArrayBuilder,com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth protected void _reportInputCoercion(java.lang.String,com.fasterxml.jackson.core.JsonToken,java.lang.Class) throws com.fasterxml.jackson.core.exc.InputCoercionException meth protected void _reportInvalidEOF() throws com.fasterxml.jackson.core.JsonParseException -meth protected void _reportInvalidEOF(java.lang.String) throws com.fasterxml.jackson.core.JsonParseException - anno 0 java.lang.Deprecated() meth protected void _reportInvalidEOF(java.lang.String,com.fasterxml.jackson.core.JsonToken) throws com.fasterxml.jackson.core.JsonParseException -meth protected void _reportInvalidEOFInValue() throws com.fasterxml.jackson.core.JsonParseException - anno 0 java.lang.Deprecated() meth protected void _reportInvalidEOFInValue(com.fasterxml.jackson.core.JsonToken) throws com.fasterxml.jackson.core.JsonParseException meth protected void _reportMissingRootWS(int) throws com.fasterxml.jackson.core.JsonParseException meth protected void _reportUnexpectedChar(int,java.lang.String) throws com.fasterxml.jackson.core.JsonParseException @@ -2395,6 +2428,7 @@ meth public abstract com.fasterxml.jackson.core.JsonToken nextToken() throws jav meth public abstract int getTextLength() throws java.io.IOException meth public abstract int getTextOffset() throws java.io.IOException meth public abstract java.lang.String getCurrentName() throws java.io.IOException + anno 0 java.lang.Deprecated() meth public abstract java.lang.String getText() throws java.io.IOException meth public abstract void close() throws java.io.IOException meth public abstract void overrideCurrentName(java.lang.String) @@ -2451,6 +2485,7 @@ cons protected init(java.lang.String) cons protected init(java.lang.String,com.fasterxml.jackson.core.JsonLocation,java.lang.Throwable) fld protected com.fasterxml.jackson.core.JsonParser _processor fld protected com.fasterxml.jackson.core.util.RequestPayload _requestPayload +meth protected static com.fasterxml.jackson.core.JsonLocation _currentLocation(com.fasterxml.jackson.core.JsonParser) meth public abstract com.fasterxml.jackson.core.exc.StreamReadException withParser(com.fasterxml.jackson.core.JsonParser) meth public abstract com.fasterxml.jackson.core.exc.StreamReadException withRequestPayload(com.fasterxml.jackson.core.util.RequestPayload) meth public com.fasterxml.jackson.core.JsonParser getProcessor() @@ -2563,13 +2598,18 @@ meth public boolean isExpectedStartObjectToken() meth public byte getByteValue() throws java.io.IOException meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth public char[] getTextCharacters() throws java.io.IOException +meth public com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonParser skipChildren() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonParser$NumberType getNumberType() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonStreamContext getParsingContext() meth public com.fasterxml.jackson.core.JsonToken currentToken() meth public com.fasterxml.jackson.core.JsonToken getCurrentToken() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonToken getLastClearedToken() meth public com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonToken nextValue() throws java.io.IOException @@ -2593,6 +2633,7 @@ meth public java.lang.Number getNumberValue() throws java.io.IOException meth public java.lang.Object getEmbeddedObject() throws java.io.IOException meth public java.lang.String currentName() throws java.io.IOException meth public java.lang.String getCurrentName() throws java.io.IOException + anno 0 java.lang.Deprecated() meth public java.lang.String getText() throws java.io.IOException meth public java.lang.String getValueAsString() throws java.io.IOException meth public java.lang.String getValueAsString(java.lang.String) throws java.io.IOException @@ -2789,6 +2830,7 @@ fld protected final static int[] sInputCodesUTF8 fld protected final static int[] sInputCodesUtf8JsNames fld protected final static int[] sInputCodesWS fld protected final static int[] sOutputEscapes128 +fld protected final static int[] sOutputEscapes128WithSlash meth public static byte[] copyHexBytes() anno 0 java.lang.Deprecated() meth public static byte[] copyHexBytes(boolean) @@ -2799,6 +2841,7 @@ meth public static char[] copyHexChars(boolean) meth public static int charToHex(int) meth public static int[] get7BitOutputEscapes() meth public static int[] get7BitOutputEscapes(int) +meth public static int[] get7BitOutputEscapes(int,boolean) meth public static int[] getInputCodeComment() meth public static int[] getInputCodeLatin1() meth public static int[] getInputCodeLatin1JsNames() @@ -2882,6 +2925,7 @@ cons public init(com.fasterxml.jackson.core.util.BufferRecycler,com.fasterxml.ja anno 0 java.lang.Deprecated() cons public init(com.fasterxml.jackson.core.util.BufferRecycler,java.lang.Object,boolean) anno 0 java.lang.Deprecated() +fld protected boolean _releaseRecycler fld protected byte[] _base64Buffer fld protected byte[] _readIOBuffer fld protected byte[] _writeEncodingBuffer @@ -2917,7 +2961,9 @@ meth public com.fasterxml.jackson.core.JsonEncoding getEncoding() meth public com.fasterxml.jackson.core.StreamReadConstraints streamReadConstraints() meth public com.fasterxml.jackson.core.StreamWriteConstraints streamWriteConstraints() meth public com.fasterxml.jackson.core.io.ContentReference contentReference() +meth public com.fasterxml.jackson.core.io.IOContext markBufferRecyclerReleased() meth public com.fasterxml.jackson.core.io.IOContext withEncoding(com.fasterxml.jackson.core.JsonEncoding) +meth public com.fasterxml.jackson.core.util.BufferRecycler bufferRecycler() meth public com.fasterxml.jackson.core.util.TextBuffer constructReadConstrainedTextBuffer() meth public com.fasterxml.jackson.core.util.TextBuffer constructTextBuffer() meth public java.lang.Object getSourceReference() @@ -2982,22 +3028,29 @@ fld public final static java.lang.String NASTY_SMALL_DOUBLE = "2.225073858507201 anno 0 java.lang.Deprecated() meth public static boolean inLongRange(char[],int,int,boolean) meth public static boolean inLongRange(java.lang.String,boolean) +meth public static boolean looksLikeValidNumber(java.lang.String) meth public static double parseAsDouble(java.lang.String,double) meth public static double parseAsDouble(java.lang.String,double,boolean) meth public static double parseDouble(java.lang.String) + anno 0 java.lang.Deprecated() meth public static double parseDouble(java.lang.String,boolean) meth public static float parseFloat(java.lang.String) + anno 0 java.lang.Deprecated() meth public static float parseFloat(java.lang.String,boolean) meth public static int parseAsInt(java.lang.String,int) meth public static int parseInt(char[],int,int) meth public static int parseInt(java.lang.String) meth public static java.math.BigDecimal parseBigDecimal(char[]) + anno 0 java.lang.Deprecated() meth public static java.math.BigDecimal parseBigDecimal(char[],boolean) meth public static java.math.BigDecimal parseBigDecimal(char[],int,int) + anno 0 java.lang.Deprecated() meth public static java.math.BigDecimal parseBigDecimal(char[],int,int,boolean) meth public static java.math.BigDecimal parseBigDecimal(java.lang.String) + anno 0 java.lang.Deprecated() meth public static java.math.BigDecimal parseBigDecimal(java.lang.String,boolean) meth public static java.math.BigInteger parseBigInteger(java.lang.String) + anno 0 java.lang.Deprecated() meth public static java.math.BigInteger parseBigInteger(java.lang.String,boolean) meth public static java.math.BigInteger parseBigIntegerWithRadix(java.lang.String,int,boolean) meth public static long parseAsLong(java.lang.String,long) @@ -3005,7 +3058,7 @@ meth public static long parseLong(char[],int,int) meth public static long parseLong(java.lang.String) meth public static long parseLong19(char[],int,boolean) supr java.lang.Object -hfds L_BILLION,MAX_LONG_STR,MIN_LONG_STR_NO_SIGN +hfds L_BILLION,MAX_LONG_STR,MIN_LONG_STR_NO_SIGN,PATTERN_FLOAT CLSS public final com.fasterxml.jackson.core.io.NumberOutput cons public init() @@ -3033,6 +3086,8 @@ supr java.lang.Object CLSS public final com.fasterxml.jackson.core.io.SegmentedStringWriter cons public init(com.fasterxml.jackson.core.util.BufferRecycler) +intf com.fasterxml.jackson.core.util.BufferRecycler$Gettable +meth public com.fasterxml.jackson.core.util.BufferRecycler bufferRecycler() meth public java.io.Writer append(char) throws java.io.IOException meth public java.io.Writer append(java.lang.CharSequence) throws java.io.IOException meth public java.io.Writer append(java.lang.CharSequence,int,int) throws java.io.IOException @@ -3098,6 +3153,7 @@ supr java.io.Reader CLSS public final com.fasterxml.jackson.core.io.UTF8Writer cons public init(com.fasterxml.jackson.core.io.IOContext,java.io.OutputStream) +fld public final static int SURROGATE_BASE = -56613888 meth protected int convertSurrogate(int) throws java.io.IOException meth protected static java.lang.String illegalSurrogateDesc(int) meth protected static void illegalSurrogate(int) throws java.io.IOException @@ -3163,11 +3219,36 @@ meth public com.fasterxml.jackson.core.JsonGenerator setRootValueSeparator(com.f meth public com.fasterxml.jackson.core.StreamWriteConstraints streamWriteConstraints() meth public com.fasterxml.jackson.core.Version version() meth public com.fasterxml.jackson.core.io.CharacterEscapes getCharacterEscapes() -meth public com.fasterxml.jackson.core.io.IOContext ioContext() meth public com.fasterxml.jackson.core.util.JacksonFeatureSet getWriteCapabilities() meth public int getHighestEscapedChar() supr com.fasterxml.jackson.core.base.GeneratorBase +CLSS public abstract com.fasterxml.jackson.core.json.JsonParserBase +cons protected init(com.fasterxml.jackson.core.io.IOContext,int,com.fasterxml.jackson.core.ObjectCodec) +fld protected com.fasterxml.jackson.core.ObjectCodec _objectCodec +fld protected final static int FEAT_MASK_ALLOW_JAVA_COMMENTS +fld protected final static int FEAT_MASK_ALLOW_MISSING +fld protected final static int FEAT_MASK_ALLOW_SINGLE_QUOTES +fld protected final static int FEAT_MASK_ALLOW_UNQUOTED_NAMES +fld protected final static int FEAT_MASK_ALLOW_YAML_COMMENTS +fld protected final static int FEAT_MASK_LEADING_ZEROS +fld protected final static int FEAT_MASK_NON_NUM_NUMBERS +fld protected final static int FEAT_MASK_TRAILING_COMMA +fld protected final static int[] INPUT_CODES_LATIN1 +fld protected final static int[] INPUT_CODES_UTF8 +meth protected abstract com.fasterxml.jackson.core.JsonLocation _currentLocationMinusOne() +meth public abstract com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public abstract com.fasterxml.jackson.core.JsonLocation currentTokenLocation() +meth public com.fasterxml.jackson.core.JsonParser$NumberTypeFP getNumberTypeFP() throws java.io.IOException +meth public com.fasterxml.jackson.core.ObjectCodec getCodec() +meth public final com.fasterxml.jackson.core.JsonLocation getCurrentLocation() + anno 0 java.lang.Deprecated() +meth public final com.fasterxml.jackson.core.JsonLocation getTokenLocation() + anno 0 java.lang.Deprecated() +meth public final com.fasterxml.jackson.core.util.JacksonFeatureSet getReadCapabilities() +meth public void setCodec(com.fasterxml.jackson.core.ObjectCodec) +supr com.fasterxml.jackson.core.base.ParserBase + CLSS public final com.fasterxml.jackson.core.json.JsonReadContext cons public init(com.fasterxml.jackson.core.json.JsonReadContext,com.fasterxml.jackson.core.json.DupDetector,int,int,int) anno 0 java.lang.Deprecated() @@ -3261,6 +3342,7 @@ meth public void setCurrentValue(java.lang.Object) supr com.fasterxml.jackson.core.JsonStreamContext CLSS public final !enum com.fasterxml.jackson.core.json.JsonWriteFeature +fld public final static com.fasterxml.jackson.core.json.JsonWriteFeature ESCAPE_FORWARD_SLASHES fld public final static com.fasterxml.jackson.core.json.JsonWriteFeature ESCAPE_NON_ASCII fld public final static com.fasterxml.jackson.core.json.JsonWriteFeature QUOTE_FIELD_NAMES fld public final static com.fasterxml.jackson.core.json.JsonWriteFeature WRITE_HEX_UPPER_CASE @@ -3293,7 +3375,6 @@ fld protected char[] _inputBuffer fld protected com.fasterxml.jackson.core.ObjectCodec _objectCodec fld protected final com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer _symbols fld protected final int _hashSeed -fld protected final static int[] _icLatin1 fld protected int _nameStartCol fld protected int _nameStartRow fld protected java.io.Reader _reader @@ -3305,6 +3386,7 @@ meth protected char _decodeEscaped() throws java.io.IOException meth protected char getNextChar(java.lang.String) throws java.io.IOException anno 0 java.lang.Deprecated() meth protected char getNextChar(java.lang.String,com.fasterxml.jackson.core.JsonToken) throws java.io.IOException +meth protected com.fasterxml.jackson.core.JsonLocation _currentLocationMinusOne() meth protected com.fasterxml.jackson.core.JsonToken _handleApos() throws java.io.IOException meth protected com.fasterxml.jackson.core.JsonToken _handleInvalidNumberStart(int,boolean) throws java.io.IOException meth protected com.fasterxml.jackson.core.JsonToken _handleInvalidNumberStart(int,boolean,boolean) throws java.io.IOException @@ -3330,10 +3412,8 @@ meth protected void _reportInvalidToken(java.lang.String) throws java.io.IOExcep meth protected void _reportInvalidToken(java.lang.String,java.lang.String) throws java.io.IOException meth public boolean nextFieldName(com.fasterxml.jackson.core.SerializableString) throws java.io.IOException meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException -meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() -meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() -meth public com.fasterxml.jackson.core.ObjectCodec getCodec() -meth public com.fasterxml.jackson.core.util.JacksonFeatureSet getReadCapabilities() +meth public com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public final char[] getTextCharacters() throws java.io.IOException meth public final com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException meth public final int getTextLength() throws java.io.IOException @@ -3351,20 +3431,17 @@ meth public int releaseBuffered(java.io.Writer) throws java.io.IOException meth public java.lang.Object getInputSource() meth public java.lang.String nextFieldName() throws java.io.IOException meth public void finishToken() throws java.io.IOException -meth public void setCodec(com.fasterxml.jackson.core.ObjectCodec) -supr com.fasterxml.jackson.core.base.ParserBase -hfds FEAT_MASK_ALLOW_JAVA_COMMENTS,FEAT_MASK_ALLOW_MISSING,FEAT_MASK_ALLOW_SINGLE_QUOTES,FEAT_MASK_ALLOW_UNQUOTED_NAMES,FEAT_MASK_ALLOW_YAML_COMMENTS,FEAT_MASK_LEADING_ZEROS,FEAT_MASK_NON_NUM_NUMBERS,FEAT_MASK_TRAILING_COMMA +supr com.fasterxml.jackson.core.json.JsonParserBase CLSS public com.fasterxml.jackson.core.json.UTF8DataInputJsonParser cons public init(com.fasterxml.jackson.core.io.IOContext,int,java.io.DataInput,com.fasterxml.jackson.core.ObjectCodec,com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer,int) fld protected boolean _tokenIncomplete -fld protected com.fasterxml.jackson.core.ObjectCodec _objectCodec fld protected final com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer _symbols -fld protected final static int[] _icLatin1 fld protected int _nextByte fld protected int[] _quadBuffer fld protected java.io.DataInput _inputData meth protected char _decodeEscaped() throws java.io.IOException +meth protected com.fasterxml.jackson.core.JsonLocation _currentLocationMinusOne() meth protected com.fasterxml.jackson.core.JsonToken _handleApos() throws java.io.IOException meth protected com.fasterxml.jackson.core.JsonToken _handleInvalidNumberStart(int,boolean) throws java.io.IOException meth protected com.fasterxml.jackson.core.JsonToken _handleInvalidNumberStart(int,boolean,boolean) throws java.io.IOException @@ -3394,11 +3471,9 @@ meth protected void _reportInvalidToken(int,java.lang.String,java.lang.String) t meth protected void _skipString() throws java.io.IOException meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth public char[] getTextCharacters() throws java.io.IOException -meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() -meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException -meth public com.fasterxml.jackson.core.ObjectCodec getCodec() -meth public com.fasterxml.jackson.core.util.JacksonFeatureSet getReadCapabilities() meth public int getText(java.io.Writer) throws java.io.IOException meth public int getTextLength() throws java.io.IOException meth public int getTextOffset() throws java.io.IOException @@ -3416,9 +3491,8 @@ meth public java.lang.String nextFieldName() throws java.io.IOException meth public java.lang.String nextTextValue() throws java.io.IOException meth public long nextLongValue(long) throws java.io.IOException meth public void finishToken() throws java.io.IOException -meth public void setCodec(com.fasterxml.jackson.core.ObjectCodec) -supr com.fasterxml.jackson.core.base.ParserBase -hfds FEAT_MASK_ALLOW_JAVA_COMMENTS,FEAT_MASK_ALLOW_MISSING,FEAT_MASK_ALLOW_SINGLE_QUOTES,FEAT_MASK_ALLOW_UNQUOTED_NAMES,FEAT_MASK_ALLOW_YAML_COMMENTS,FEAT_MASK_LEADING_ZEROS,FEAT_MASK_NON_NUM_NUMBERS,FEAT_MASK_TRAILING_COMMA,_icUTF8,_quad1 +supr com.fasterxml.jackson.core.json.JsonParserBase +hfds _quad1 CLSS public com.fasterxml.jackson.core.json.UTF8JsonGenerator cons public init(com.fasterxml.jackson.core.io.IOContext,int,com.fasterxml.jackson.core.ObjectCodec,java.io.OutputStream) @@ -3495,15 +3569,15 @@ cons public init(com.fasterxml.jackson.core.io.IOContext,int,java.io.InputStream fld protected boolean _bufferRecyclable fld protected boolean _tokenIncomplete fld protected byte[] _inputBuffer -fld protected com.fasterxml.jackson.core.ObjectCodec _objectCodec fld protected final com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer _symbols -fld protected final static int[] _icLatin1 +fld protected final static byte BYTE_LF = 10 fld protected int _nameStartCol fld protected int _nameStartOffset fld protected int _nameStartRow fld protected int[] _quadBuffer fld protected java.io.InputStream _inputStream meth protected char _decodeEscaped() throws java.io.IOException +meth protected com.fasterxml.jackson.core.JsonLocation _currentLocationMinusOne() meth protected com.fasterxml.jackson.core.JsonToken _handleApos() throws java.io.IOException meth protected com.fasterxml.jackson.core.JsonToken _handleInvalidNumberStart(int,boolean) throws java.io.IOException meth protected com.fasterxml.jackson.core.JsonToken _handleInvalidNumberStart(int,boolean,boolean) throws java.io.IOException @@ -3546,11 +3620,9 @@ meth protected void _skipString() throws java.io.IOException meth public boolean nextFieldName(com.fasterxml.jackson.core.SerializableString) throws java.io.IOException meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth public char[] getTextCharacters() throws java.io.IOException -meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() -meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException -meth public com.fasterxml.jackson.core.ObjectCodec getCodec() -meth public com.fasterxml.jackson.core.util.JacksonFeatureSet getReadCapabilities() meth public int getText(java.io.Writer) throws java.io.IOException meth public int getTextLength() throws java.io.IOException meth public int getTextOffset() throws java.io.IOException @@ -3568,9 +3640,8 @@ meth public java.lang.String nextFieldName() throws java.io.IOException meth public java.lang.String nextTextValue() throws java.io.IOException meth public long nextLongValue(long) throws java.io.IOException meth public void finishToken() throws java.io.IOException -meth public void setCodec(com.fasterxml.jackson.core.ObjectCodec) -supr com.fasterxml.jackson.core.base.ParserBase -hfds BYTE_LF,FEAT_MASK_ALLOW_JAVA_COMMENTS,FEAT_MASK_ALLOW_MISSING,FEAT_MASK_ALLOW_SINGLE_QUOTES,FEAT_MASK_ALLOW_UNQUOTED_NAMES,FEAT_MASK_ALLOW_YAML_COMMENTS,FEAT_MASK_LEADING_ZEROS,FEAT_MASK_NON_NUM_NUMBERS,FEAT_MASK_TRAILING_COMMA,_icUTF8,_quad1 +supr com.fasterxml.jackson.core.json.JsonParserBase +hfds _quad1 CLSS public com.fasterxml.jackson.core.json.WriterBasedJsonGenerator cons public init(com.fasterxml.jackson.core.io.IOContext,int,com.fasterxml.jackson.core.ObjectCodec,java.io.Writer) @@ -3732,6 +3803,7 @@ fld protected int _quadLength fld protected int _quoted32 fld protected int _quotedDigits fld protected int[] _quadBuffer +meth protected com.fasterxml.jackson.core.JsonLocation _currentLocationMinusOne() meth protected com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer symbolTableForTests() meth protected final com.fasterxml.jackson.core.JsonToken _closeArrayScope() throws java.io.IOException meth protected final com.fasterxml.jackson.core.JsonToken _closeObjectScope() throws java.io.IOException @@ -3761,10 +3833,8 @@ meth public boolean canParseAsync() meth public boolean hasTextCharacters() meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth public char[] getTextCharacters() throws java.io.IOException -meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() -meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() -meth public com.fasterxml.jackson.core.ObjectCodec getCodec() -meth public com.fasterxml.jackson.core.util.JacksonFeatureSet getReadCapabilities() +meth public com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public int getText(java.io.Writer) throws java.io.IOException meth public int getTextLength() throws java.io.IOException meth public int getTextOffset() throws java.io.IOException @@ -3775,7 +3845,7 @@ meth public java.lang.String getText() throws java.io.IOException meth public java.lang.String getValueAsString() throws java.io.IOException meth public java.lang.String getValueAsString(java.lang.String) throws java.io.IOException meth public void setCodec(com.fasterxml.jackson.core.ObjectCodec) -supr com.fasterxml.jackson.core.base.ParserBase +supr com.fasterxml.jackson.core.json.JsonParserBase CLSS public abstract com.fasterxml.jackson.core.json.async.NonBlockingUtf8JsonParserBase cons protected init(com.fasterxml.jackson.core.io.IOContext,int,com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer) @@ -4050,11 +4120,13 @@ fld public final static int CHAR_CONCAT_BUFFER = 1 fld public final static int CHAR_NAME_COPY_BUFFER = 3 fld public final static int CHAR_TEXT_BUFFER = 2 fld public final static int CHAR_TOKEN_BUFFER = 0 +innr public abstract interface static Gettable intf com.fasterxml.jackson.core.util.RecyclerPool$WithPool meth protected byte[] balloc(int) meth protected char[] calloc(int) meth protected int byteBufferLength(int) meth protected int charBufferLength(int) +meth public boolean isLinkedWithPool() meth public byte[] allocByteBuffer(int,int) meth public char[] allocCharBuffer(int,int) meth public com.fasterxml.jackson.core.util.BufferRecycler withPool(com.fasterxml.jackson.core.util.RecyclerPool) @@ -4066,6 +4138,10 @@ meth public void releaseToPool() supr java.lang.Object hfds BYTE_BUFFER_LENGTHS,CHAR_BUFFER_LENGTHS,_pool +CLSS public abstract interface static com.fasterxml.jackson.core.util.BufferRecycler$Gettable + outer com.fasterxml.jackson.core.util.BufferRecycler +meth public abstract com.fasterxml.jackson.core.util.BufferRecycler bufferRecycler() + CLSS public com.fasterxml.jackson.core.util.BufferRecyclers anno 0 java.lang.Deprecated() cons public init() @@ -4093,11 +4169,14 @@ cons public init(com.fasterxml.jackson.core.util.BufferRecycler) cons public init(com.fasterxml.jackson.core.util.BufferRecycler,int) cons public init(int) fld public final static byte[] NO_BYTES +intf com.fasterxml.jackson.core.util.BufferRecycler$Gettable meth public byte[] completeAndCoalesce(int) meth public byte[] finishCurrentSegment() +meth public byte[] getClearAndRelease() meth public byte[] getCurrentSegment() meth public byte[] resetAndGetFirstSegment() meth public byte[] toByteArray() +meth public com.fasterxml.jackson.core.util.BufferRecycler bufferRecycler() meth public int getCurrentSegmentLength() meth public int size() meth public static com.fasterxml.jackson.core.util.ByteArrayBuilder fromInitial(byte[],int) @@ -4147,7 +4226,9 @@ fld protected com.fasterxml.jackson.core.util.DefaultPrettyPrinter$Indenter _arr fld protected com.fasterxml.jackson.core.util.DefaultPrettyPrinter$Indenter _objectIndenter fld protected com.fasterxml.jackson.core.util.Separators _separators fld protected int _nesting +fld protected java.lang.String _arrayEmptySeparator fld protected java.lang.String _arrayValueSeparator +fld protected java.lang.String _objectEmptySeparator fld protected java.lang.String _objectEntrySeparator fld protected java.lang.String _objectFieldValueSeparatorWithSpaces fld public final static com.fasterxml.jackson.core.io.SerializedString DEFAULT_ROOT_VALUE_SEPARATOR @@ -4283,6 +4364,7 @@ meth public int getOutputBuffered() meth public int writeBinary(com.fasterxml.jackson.core.Base64Variant,java.io.InputStream,int) throws java.io.IOException meth public java.lang.Object currentValue() meth public java.lang.Object getCurrentValue() + anno 0 java.lang.Deprecated() meth public java.lang.Object getOutputTarget() meth public void assignCurrentValue(java.lang.Object) meth public void close() throws java.io.IOException @@ -4290,6 +4372,7 @@ meth public void copyCurrentEvent(com.fasterxml.jackson.core.JsonParser) throws meth public void copyCurrentStructure(com.fasterxml.jackson.core.JsonParser) throws java.io.IOException meth public void flush() throws java.io.IOException meth public void setCurrentValue(java.lang.Object) + anno 0 java.lang.Deprecated() meth public void setSchema(com.fasterxml.jackson.core.FormatSchema) meth public void writeArray(double[],int,int) throws java.io.IOException meth public void writeArray(int[],int,int) throws java.io.IOException @@ -4371,7 +4454,9 @@ meth public com.fasterxml.jackson.core.FormatSchema getSchema() meth public com.fasterxml.jackson.core.JsonLocation currentLocation() meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonParser delegate() meth public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser$Feature) meth public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser$Feature) @@ -4381,9 +4466,11 @@ meth public com.fasterxml.jackson.core.JsonParser setFeatureMask(int) anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonParser skipChildren() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonParser$NumberType getNumberType() throws java.io.IOException +meth public com.fasterxml.jackson.core.JsonParser$NumberTypeFP getNumberTypeFP() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonStreamContext getParsingContext() meth public com.fasterxml.jackson.core.JsonToken currentToken() meth public com.fasterxml.jackson.core.JsonToken getCurrentToken() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonToken getLastClearedToken() meth public com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonToken nextValue() throws java.io.IOException @@ -4411,6 +4498,7 @@ meth public java.lang.Number getNumberValue() throws java.io.IOException meth public java.lang.Number getNumberValueExact() throws java.io.IOException meth public java.lang.Object currentValue() meth public java.lang.Object getCurrentValue() + anno 0 java.lang.Deprecated() meth public java.lang.Object getEmbeddedObject() throws java.io.IOException meth public java.lang.Object getInputSource() meth public java.lang.Object getNumberValueDeferred() throws java.io.IOException @@ -4418,6 +4506,7 @@ meth public java.lang.Object getObjectId() throws java.io.IOException meth public java.lang.Object getTypeId() throws java.io.IOException meth public java.lang.String currentName() throws java.io.IOException meth public java.lang.String getCurrentName() throws java.io.IOException + anno 0 java.lang.Deprecated() meth public java.lang.String getText() throws java.io.IOException meth public java.lang.String getValueAsString() throws java.io.IOException meth public java.lang.String getValueAsString(java.lang.String) throws java.io.IOException @@ -4434,6 +4523,7 @@ meth public void finishToken() throws java.io.IOException meth public void overrideCurrentName(java.lang.String) meth public void setCodec(com.fasterxml.jackson.core.ObjectCodec) meth public void setCurrentValue(java.lang.Object) + anno 0 java.lang.Deprecated() meth public void setSchema(com.fasterxml.jackson.core.FormatSchema) supr com.fasterxml.jackson.core.JsonParser @@ -4561,12 +4651,14 @@ innr public abstract static ThreadLocalPoolBase intf java.io.Serializable meth public abstract void releasePooled({com.fasterxml.jackson.core.util.RecyclerPool%0}) meth public abstract {com.fasterxml.jackson.core.util.RecyclerPool%0} acquirePooled() +meth public boolean clear() meth public {com.fasterxml.jackson.core.util.RecyclerPool%0} acquireAndLinkPooled() CLSS public abstract static com.fasterxml.jackson.core.util.RecyclerPool$BoundedPoolBase<%0 extends com.fasterxml.jackson.core.util.RecyclerPool$WithPool<{com.fasterxml.jackson.core.util.RecyclerPool$BoundedPoolBase%0}>> outer com.fasterxml.jackson.core.util.RecyclerPool cons protected init(int) fld public final static int DEFAULT_CAPACITY = 100 +meth public boolean clear() meth public int capacity() meth public void releasePooled({com.fasterxml.jackson.core.util.RecyclerPool$BoundedPoolBase%0}) meth public {com.fasterxml.jackson.core.util.RecyclerPool$BoundedPoolBase%0} acquirePooled() @@ -4577,6 +4669,7 @@ CLSS public abstract static com.fasterxml.jackson.core.util.RecyclerPool$Concurr outer com.fasterxml.jackson.core.util.RecyclerPool cons protected init(int) fld protected final java.util.Deque<{com.fasterxml.jackson.core.util.RecyclerPool$ConcurrentDequePoolBase%0}> pool +meth public boolean clear() meth public void releasePooled({com.fasterxml.jackson.core.util.RecyclerPool$ConcurrentDequePoolBase%0}) meth public {com.fasterxml.jackson.core.util.RecyclerPool$ConcurrentDequePoolBase%0} acquirePooled() supr com.fasterxml.jackson.core.util.RecyclerPool$StatefulImplBase<{com.fasterxml.jackson.core.util.RecyclerPool$ConcurrentDequePoolBase%0}> @@ -4586,6 +4679,7 @@ CLSS public abstract static com.fasterxml.jackson.core.util.RecyclerPool$LockFre outer com.fasterxml.jackson.core.util.RecyclerPool cons protected init(int) innr protected static Node +meth public boolean clear() meth public void releasePooled({com.fasterxml.jackson.core.util.RecyclerPool$LockFreePoolBase%0}) meth public {com.fasterxml.jackson.core.util.RecyclerPool$LockFreePoolBase%0} acquirePooled() supr com.fasterxml.jackson.core.util.RecyclerPool$StatefulImplBase<{com.fasterxml.jackson.core.util.RecyclerPool$LockFreePoolBase%0}> @@ -4601,6 +4695,7 @@ CLSS public abstract static com.fasterxml.jackson.core.util.RecyclerPool$NonRecy cons public init() intf com.fasterxml.jackson.core.util.RecyclerPool<{com.fasterxml.jackson.core.util.RecyclerPool$NonRecyclingPoolBase%0}> meth public abstract {com.fasterxml.jackson.core.util.RecyclerPool$NonRecyclingPoolBase%0} acquirePooled() +meth public boolean clear() meth public void releasePooled({com.fasterxml.jackson.core.util.RecyclerPool$NonRecyclingPoolBase%0}) meth public {com.fasterxml.jackson.core.util.RecyclerPool$NonRecyclingPoolBase%0} acquireAndLinkPooled() supr java.lang.Object @@ -4623,6 +4718,7 @@ CLSS public abstract static com.fasterxml.jackson.core.util.RecyclerPool$ThreadL cons protected init() intf com.fasterxml.jackson.core.util.RecyclerPool<{com.fasterxml.jackson.core.util.RecyclerPool$ThreadLocalPoolBase%0}> meth public abstract {com.fasterxml.jackson.core.util.RecyclerPool$ThreadLocalPoolBase%0} acquirePooled() +meth public boolean clear() meth public void releasePooled({com.fasterxml.jackson.core.util.RecyclerPool$ThreadLocalPoolBase%0}) meth public {com.fasterxml.jackson.core.util.RecyclerPool$ThreadLocalPoolBase%0} acquireAndLinkPooled() supr java.lang.Object @@ -4649,14 +4745,20 @@ CLSS public com.fasterxml.jackson.core.util.Separators cons public init() cons public init(char,char,char) cons public init(java.lang.String,char,com.fasterxml.jackson.core.util.Separators$Spacing,char,com.fasterxml.jackson.core.util.Separators$Spacing,char,com.fasterxml.jackson.core.util.Separators$Spacing) + anno 0 java.lang.Deprecated() +cons public init(java.lang.String,char,com.fasterxml.jackson.core.util.Separators$Spacing,char,com.fasterxml.jackson.core.util.Separators$Spacing,java.lang.String,char,com.fasterxml.jackson.core.util.Separators$Spacing,java.lang.String) +fld public final static java.lang.String DEFAULT_ARRAY_EMPTY_SEPARATOR = " " +fld public final static java.lang.String DEFAULT_OBJECT_EMPTY_SEPARATOR = " " fld public final static java.lang.String DEFAULT_ROOT_VALUE_SEPARATOR = " " innr public final static !enum Spacing intf java.io.Serializable meth public char getArrayValueSeparator() meth public char getObjectEntrySeparator() meth public char getObjectFieldValueSeparator() +meth public com.fasterxml.jackson.core.util.Separators withArrayEmptySeparator(java.lang.String) meth public com.fasterxml.jackson.core.util.Separators withArrayValueSeparator(char) meth public com.fasterxml.jackson.core.util.Separators withArrayValueSpacing(com.fasterxml.jackson.core.util.Separators$Spacing) +meth public com.fasterxml.jackson.core.util.Separators withObjectEmptySeparator(java.lang.String) meth public com.fasterxml.jackson.core.util.Separators withObjectEntrySeparator(char) meth public com.fasterxml.jackson.core.util.Separators withObjectEntrySpacing(com.fasterxml.jackson.core.util.Separators$Spacing) meth public com.fasterxml.jackson.core.util.Separators withObjectFieldValueSeparator(char) @@ -4665,10 +4767,12 @@ meth public com.fasterxml.jackson.core.util.Separators withRootSeparator(java.la meth public com.fasterxml.jackson.core.util.Separators$Spacing getArrayValueSpacing() meth public com.fasterxml.jackson.core.util.Separators$Spacing getObjectEntrySpacing() meth public com.fasterxml.jackson.core.util.Separators$Spacing getObjectFieldValueSpacing() +meth public java.lang.String getArrayEmptySeparator() +meth public java.lang.String getObjectEmptySeparator() meth public java.lang.String getRootSeparator() meth public static com.fasterxml.jackson.core.util.Separators createDefaultInstance() supr java.lang.Object -hfds arrayValueSeparator,arrayValueSpacing,objectEntrySeparator,objectEntrySpacing,objectFieldValueSeparator,objectFieldValueSpacing,rootSeparator,serialVersionUID +hfds arrayEmptySeparator,arrayValueSeparator,arrayValueSpacing,objectEmptySeparator,objectEntrySeparator,objectEntrySpacing,objectFieldValueSeparator,objectFieldValueSpacing,rootSeparator,serialVersionUID CLSS public final static !enum com.fasterxml.jackson.core.util.Separators$Spacing outer com.fasterxml.jackson.core.util.Separators @@ -4698,6 +4802,7 @@ meth public char[] finishCurrentSegment() throws java.io.IOException meth public char[] getBufferWithoutReset() meth public char[] getCurrentSegment() meth public char[] getTextBuffer() throws java.io.IOException +meth public com.fasterxml.jackson.core.util.BufferRecycler bufferRecycler() meth public double contentsAsDouble() anno 0 java.lang.Deprecated() meth public double contentsAsDouble(boolean) @@ -4809,8 +4914,6 @@ meth public com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder findP meth public com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder findPropertyTypeResolver(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedMember,com.fasterxml.jackson.databind.JavaType) meth public com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder findTypeResolver(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedClass,com.fasterxml.jackson.databind.JavaType) meth public com.fasterxml.jackson.databind.util.NameTransformer findUnwrappingNameTransformer(com.fasterxml.jackson.databind.introspect.AnnotatedMember) -meth public java.lang.Boolean findIgnoreUnknownProperties(com.fasterxml.jackson.databind.introspect.AnnotatedClass) - anno 0 java.lang.Deprecated() meth public java.lang.Boolean findMergeInfo(com.fasterxml.jackson.databind.introspect.Annotated) meth public java.lang.Boolean findSerializationSortAlphabetically(com.fasterxml.jackson.databind.introspect.Annotated) meth public java.lang.Boolean hasAnyGetter(com.fasterxml.jackson.databind.introspect.Annotated) @@ -4853,8 +4956,6 @@ meth public java.lang.String findTypeName(com.fasterxml.jackson.databind.introsp meth public java.lang.String[] findEnumValues(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedClass,java.lang.Enum[],java.lang.String[]) meth public java.lang.String[] findEnumValues(java.lang.Class,java.lang.Enum[],java.lang.String[]) anno 0 java.lang.Deprecated() -meth public java.lang.String[] findPropertiesToIgnore(com.fasterxml.jackson.databind.introspect.Annotated,boolean) - anno 0 java.lang.Deprecated() meth public java.lang.String[] findSerializationPropertyOrder(com.fasterxml.jackson.databind.introspect.AnnotatedClass) meth public java.util.Collection allIntrospectors() meth public java.util.Collection allIntrospectors(java.util.Collection) @@ -4904,7 +5005,7 @@ meth public abstract !varargs java.lang.reflect.Constructor findSingleArgCons meth public abstract !varargs java.lang.reflect.Method findFactoryMethod(java.lang.Class[]) anno 0 java.lang.Deprecated() meth public abstract boolean hasKnownClassAnnotations() -meth public abstract com.fasterxml.jackson.annotation.JsonFormat$Value findExpectedFormat(com.fasterxml.jackson.annotation.JsonFormat$Value) +meth public abstract com.fasterxml.jackson.annotation.JsonFormat$Value findExpectedFormat() meth public abstract com.fasterxml.jackson.annotation.JsonInclude$Value findPropertyInclusion(com.fasterxml.jackson.annotation.JsonInclude$Value) meth public abstract com.fasterxml.jackson.databind.JavaType resolveType(java.lang.reflect.Type) anno 0 java.lang.Deprecated() @@ -4938,6 +5039,8 @@ meth public abstract java.util.Map getIgnoredPropertyNames() meth public boolean isNonStaticInnerClass() meth public boolean isRecordType() +meth public com.fasterxml.jackson.annotation.JsonFormat$Value findExpectedFormat(com.fasterxml.jackson.annotation.JsonFormat$Value) + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.databind.JavaType getType() meth public com.fasterxml.jackson.databind.introspect.AnnotatedMember findAnySetterField() anno 0 java.lang.Deprecated() @@ -5276,6 +5379,7 @@ fld public final static com.fasterxml.jackson.databind.DeserializationFeature FA fld public final static com.fasterxml.jackson.databind.DeserializationFeature FAIL_ON_NUMBERS_FOR_ENUMS fld public final static com.fasterxml.jackson.databind.DeserializationFeature FAIL_ON_READING_DUP_TREE_KEY fld public final static com.fasterxml.jackson.databind.DeserializationFeature FAIL_ON_TRAILING_TOKENS +fld public final static com.fasterxml.jackson.databind.DeserializationFeature FAIL_ON_UNEXPECTED_VIEW_PROPERTIES fld public final static com.fasterxml.jackson.databind.DeserializationFeature FAIL_ON_UNKNOWN_PROPERTIES fld public final static com.fasterxml.jackson.databind.DeserializationFeature FAIL_ON_UNRESOLVED_OBJECT_IDS fld public final static com.fasterxml.jackson.databind.DeserializationFeature READ_DATE_TIMESTAMPS_AS_NANOSECONDS @@ -5591,6 +5695,7 @@ meth public int intValue() meth public int size() meth public java.lang.Number numberValue() meth public java.lang.String asText(java.lang.String) + anno 0 java.lang.Deprecated() meth public java.lang.String textValue() meth public java.lang.String toPrettyString() meth public java.math.BigDecimal decimalValue() @@ -6133,6 +6238,7 @@ hfds serialVersionUID CLSS public final static !enum com.fasterxml.jackson.databind.ObjectMapper$DefaultTyping outer com.fasterxml.jackson.databind.ObjectMapper fld public final static com.fasterxml.jackson.databind.ObjectMapper$DefaultTyping EVERYTHING + anno 0 java.lang.Deprecated() fld public final static com.fasterxml.jackson.databind.ObjectMapper$DefaultTyping JAVA_LANG_OBJECT fld public final static com.fasterxml.jackson.databind.ObjectMapper$DefaultTyping NON_CONCRETE_AND_ARRAYS fld public final static com.fasterxml.jackson.databind.ObjectMapper$DefaultTyping NON_FINAL @@ -6548,6 +6654,7 @@ meth public java.lang.String getSimpleName() meth public java.lang.String toString() meth public static com.fasterxml.jackson.databind.PropertyName construct(java.lang.String) meth public static com.fasterxml.jackson.databind.PropertyName construct(java.lang.String,java.lang.String) +meth public static com.fasterxml.jackson.databind.PropertyName merge(com.fasterxml.jackson.databind.PropertyName,com.fasterxml.jackson.databind.PropertyName) supr java.lang.Object hfds _NO_NAME,_USE_DEFAULT,serialVersionUID @@ -7438,6 +7545,7 @@ meth public java.lang.Object includeFilterInstance(com.fasterxml.jackson.databin supr java.lang.Object CLSS public final !enum com.fasterxml.jackson.databind.cfg.JsonNodeFeature +fld public final static com.fasterxml.jackson.databind.cfg.JsonNodeFeature FAIL_ON_NAN_TO_BIG_DECIMAL_COERCION fld public final static com.fasterxml.jackson.databind.cfg.JsonNodeFeature READ_NULL_PROPERTIES fld public final static com.fasterxml.jackson.databind.cfg.JsonNodeFeature STRIP_TRAILING_BIGDECIMAL_ZEROES fld public final static com.fasterxml.jackson.databind.cfg.JsonNodeFeature WRITE_NULL_PROPERTIES @@ -7968,6 +8076,7 @@ intf com.fasterxml.jackson.databind.deser.ContextualDeserializer intf com.fasterxml.jackson.databind.deser.ResolvableDeserializer intf com.fasterxml.jackson.databind.deser.ValueInstantiator$Gettable intf java.io.Serializable +meth protected <%0 extends java.lang.Object> {%%0} wrapInstantiationProblem(java.lang.Throwable,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase asArrayDeserializer() meth protected abstract java.lang.Object _deserializeUsingPropertyBased(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected com.fasterxml.jackson.databind.JsonDeserializer _findSubclassDeserializer(com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object,com.fasterxml.jackson.databind.util.TokenBuffer) throws java.io.IOException @@ -7989,12 +8098,12 @@ meth protected java.lang.Object handlePolymorphic(com.fasterxml.jackson.core.Jso meth protected java.lang.Object handlePolymorphic(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object,com.fasterxml.jackson.databind.util.TokenBuffer) throws java.io.IOException anno 0 java.lang.Deprecated() meth protected java.lang.Object handleUnknownProperties(com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object,com.fasterxml.jackson.databind.util.TokenBuffer) throws java.io.IOException -meth protected java.lang.Object wrapInstantiationProblem(java.lang.Throwable,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected void _replaceProperty(com.fasterxml.jackson.databind.deser.impl.BeanPropertyMap,com.fasterxml.jackson.databind.deser.SettableBeanProperty[],com.fasterxml.jackson.databind.deser.SettableBeanProperty,com.fasterxml.jackson.databind.deser.SettableBeanProperty) meth protected void handleIgnoredProperty(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object,java.lang.String) throws java.io.IOException meth protected void handleUnknownProperty(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object,java.lang.String) throws java.io.IOException meth protected void handleUnknownVanilla(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object,java.lang.String) throws java.io.IOException meth protected void injectValues(com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object) throws java.io.IOException +meth public <%0 extends java.lang.Object> {%%0} wrapAndThrow(java.lang.Throwable,java.lang.Object,java.lang.String,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth public abstract com.fasterxml.jackson.databind.JsonDeserializer unwrappingDeserializer(com.fasterxml.jackson.databind.util.NameTransformer) meth public abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase withByNameInclusion(java.util.Set,java.util.Set) meth public abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase withIgnoreAllUnknown(boolean) @@ -8037,7 +8146,6 @@ meth public java.util.Iterator properties() meth public void replaceProperty(com.fasterxml.jackson.databind.deser.SettableBeanProperty,com.fasterxml.jackson.databind.deser.SettableBeanProperty) meth public void resolve(com.fasterxml.jackson.databind.DeserializationContext) throws com.fasterxml.jackson.databind.JsonMappingException -meth public void wrapAndThrow(java.lang.Throwable,java.lang.Object,java.lang.String,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException supr com.fasterxml.jackson.databind.deser.std.StdDeserializer hfds serialVersionUID @@ -8125,6 +8233,7 @@ hfds INIT_CAUSE_PARAMS,serialVersionUID CLSS public abstract com.fasterxml.jackson.databind.deser.BeanDeserializerModifier cons public init() +intf java.io.Serializable meth public com.fasterxml.jackson.databind.JsonDeserializer modifyArrayDeserializer(com.fasterxml.jackson.databind.DeserializationConfig,com.fasterxml.jackson.databind.type.ArrayType,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.JsonDeserializer) meth public com.fasterxml.jackson.databind.JsonDeserializer modifyCollectionDeserializer(com.fasterxml.jackson.databind.DeserializationConfig,com.fasterxml.jackson.databind.type.CollectionType,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.JsonDeserializer) meth public com.fasterxml.jackson.databind.JsonDeserializer modifyCollectionLikeDeserializer(com.fasterxml.jackson.databind.DeserializationConfig,com.fasterxml.jackson.databind.type.CollectionLikeType,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.JsonDeserializer) @@ -8137,6 +8246,7 @@ meth public com.fasterxml.jackson.databind.KeyDeserializer modifyKeyDeserializer meth public com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder updateBuilder(com.fasterxml.jackson.databind.DeserializationConfig,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder) meth public java.util.List updateProperties(com.fasterxml.jackson.databind.DeserializationConfig,com.fasterxml.jackson.databind.BeanDescription,java.util.List) supr java.lang.Object +hfds serialVersionUID CLSS public com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer cons protected init(com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer) @@ -8938,7 +9048,7 @@ CLSS public abstract com.fasterxml.jackson.databind.deser.impl.JDKValueInstantia cons public init() meth public static com.fasterxml.jackson.databind.deser.ValueInstantiator findStdValueInstantiator(com.fasterxml.jackson.databind.DeserializationConfig,java.lang.Class) supr java.lang.Object -hcls ArrayListInstantiator,ConstantValueInstantiator,HashMapInstantiator,LinkedHashMapInstantiator +hcls ArrayListInstantiator,ConcurrentHashMapInstantiator,ConstantValueInstantiator,HashMapInstantiator,HashSetInstantiator,JDKValueInstantiator,LinkedHashMapInstantiator,LinkedListInstantiator,TreeMapInstantiator,TreeSetInstantiator CLSS public abstract com.fasterxml.jackson.databind.deser.impl.JavaUtilCollectionsDeserializers cons public init() @@ -9329,6 +9439,7 @@ meth protected java.util.Collection _deserializeFromArray(com. meth protected java.util.Collection _deserializeFromString(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.String) throws java.io.IOException meth protected java.util.Collection _deserializeWithObjectId(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.util.Collection) throws java.io.IOException meth protected java.util.Collection createDefaultInstance(com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException +meth protected void _tryToAddNull(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.util.Collection) throws java.io.IOException meth public boolean isCachable() meth public com.fasterxml.jackson.databind.JsonDeserializer getContentDeserializer() meth public com.fasterxml.jackson.databind.deser.ValueInstantiator getValueInstantiator() @@ -9540,10 +9651,13 @@ cons protected init(com.fasterxml.jackson.databind.deser.std.EnumSetDeserializer cons protected init(com.fasterxml.jackson.databind.deser.std.EnumSetDeserializer,com.fasterxml.jackson.databind.JsonDeserializer,java.lang.Boolean) anno 0 java.lang.Deprecated() cons public init(com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.JsonDeserializer) + anno 0 java.lang.Deprecated() +cons public init(com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.JsonDeserializer,com.fasterxml.jackson.databind.jsontype.TypeDeserializer) fld protected com.fasterxml.jackson.databind.JsonDeserializer> _enumDeserializer fld protected final boolean _skipNullValues fld protected final com.fasterxml.jackson.databind.JavaType _enumType fld protected final com.fasterxml.jackson.databind.deser.NullValueProvider _nullProvider +fld protected final com.fasterxml.jackson.databind.jsontype.TypeDeserializer _valueTypeDeserializer fld protected final java.lang.Boolean _unwrapSingle intf com.fasterxml.jackson.databind.deser.ContextualDeserializer meth protected final java.util.EnumSet _deserialize(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.util.EnumSet) throws java.io.IOException @@ -9552,8 +9666,8 @@ meth public boolean isCachable() meth public com.fasterxml.jackson.databind.JsonDeserializer createContextual(com.fasterxml.jackson.databind.DeserializationContext,com.fasterxml.jackson.databind.BeanProperty) throws com.fasterxml.jackson.databind.JsonMappingException meth public com.fasterxml.jackson.databind.deser.std.EnumSetDeserializer withDeserializer(com.fasterxml.jackson.databind.JsonDeserializer) meth public com.fasterxml.jackson.databind.deser.std.EnumSetDeserializer withResolved(com.fasterxml.jackson.databind.JsonDeserializer,com.fasterxml.jackson.databind.deser.NullValueProvider,java.lang.Boolean) -meth public com.fasterxml.jackson.databind.deser.std.EnumSetDeserializer withResolved(com.fasterxml.jackson.databind.JsonDeserializer,java.lang.Boolean) anno 0 java.lang.Deprecated() +meth public com.fasterxml.jackson.databind.deser.std.EnumSetDeserializer withResolved(com.fasterxml.jackson.databind.JsonDeserializer,com.fasterxml.jackson.databind.jsontype.TypeDeserializer,com.fasterxml.jackson.databind.deser.NullValueProvider,java.lang.Boolean) meth public com.fasterxml.jackson.databind.type.LogicalType logicalType() meth public com.fasterxml.jackson.databind.util.AccessPattern getEmptyAccessPattern() meth public java.lang.Boolean supportsUpdate(com.fasterxml.jackson.databind.DeserializationConfig) @@ -9867,7 +9981,7 @@ fld protected final java.lang.Class _elementClass fld protected final java.lang.Object[] _emptyValue intf com.fasterxml.jackson.databind.deser.ContextualDeserializer meth protected java.lang.Byte[] deserializeFromBase64(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException -meth protected java.lang.Object[] handleNonArray(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException +meth protected java.lang.Object handleNonArray(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth public boolean isCachable() meth public com.fasterxml.jackson.databind.JsonDeserializer createContextual(com.fasterxml.jackson.databind.DeserializationContext,com.fasterxml.jackson.databind.BeanProperty) throws com.fasterxml.jackson.databind.JsonMappingException meth public com.fasterxml.jackson.databind.JsonDeserializer getContentDeserializer() @@ -9875,11 +9989,11 @@ meth public com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer wit meth public com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer withResolved(com.fasterxml.jackson.databind.jsontype.TypeDeserializer,com.fasterxml.jackson.databind.JsonDeserializer,com.fasterxml.jackson.databind.deser.NullValueProvider,java.lang.Boolean) meth public com.fasterxml.jackson.databind.type.LogicalType logicalType() meth public com.fasterxml.jackson.databind.util.AccessPattern getEmptyAccessPattern() +meth public java.lang.Object deserialize(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException +meth public java.lang.Object deserialize(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object) throws java.io.IOException +meth public java.lang.Object deserializeWithType(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,com.fasterxml.jackson.databind.jsontype.TypeDeserializer) throws java.io.IOException meth public java.lang.Object getEmptyValue(com.fasterxml.jackson.databind.DeserializationContext) throws com.fasterxml.jackson.databind.JsonMappingException -meth public java.lang.Object[] deserialize(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException -meth public java.lang.Object[] deserialize(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.Object[]) throws java.io.IOException -meth public java.lang.Object[] deserializeWithType(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,com.fasterxml.jackson.databind.jsontype.TypeDeserializer) throws java.io.IOException -supr com.fasterxml.jackson.databind.deser.std.ContainerDeserializerBase +supr com.fasterxml.jackson.databind.deser.std.ContainerDeserializerBase hfds serialVersionUID CLSS public abstract com.fasterxml.jackson.databind.deser.std.PrimitiveArrayDeserializers<%0 extends java.lang.Object> @@ -10056,6 +10170,7 @@ meth protected final double _parseDoublePrimitive(com.fasterxml.jackson.databind meth protected final float _parseFloatPrimitive(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected final float _parseFloatPrimitive(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.String) throws java.io.IOException meth protected final float _parseFloatPrimitive(com.fasterxml.jackson.databind.DeserializationContext,java.lang.String) throws java.io.IOException + anno 0 java.lang.Deprecated() meth protected final int _parseIntPrimitive(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected final int _parseIntPrimitive(com.fasterxml.jackson.databind.DeserializationContext,java.lang.String) throws java.io.IOException meth protected final java.lang.Boolean _parseBoolean(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.lang.Class) throws java.io.IOException @@ -10372,6 +10487,7 @@ intf com.fasterxml.jackson.databind.deser.ContextualDeserializer intf com.fasterxml.jackson.databind.deser.ResolvableDeserializer meth protected com.fasterxml.jackson.databind.JsonDeserializer _clearIfStdImpl(com.fasterxml.jackson.databind.JsonDeserializer) meth protected com.fasterxml.jackson.databind.JsonDeserializer _findCustomDeser(com.fasterxml.jackson.databind.DeserializationContext,com.fasterxml.jackson.databind.JavaType) throws com.fasterxml.jackson.databind.JsonMappingException +meth protected java.lang.Object _deserializeFP(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected java.lang.Object _mapObjectWithDups(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.util.Map,java.lang.String,java.lang.Object,java.lang.Object,java.lang.String) throws java.io.IOException meth protected java.lang.Object mapArray(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected java.lang.Object mapArray(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.util.Collection) throws java.io.IOException @@ -10396,6 +10512,7 @@ cons protected init(boolean) cons public init() fld protected final boolean _nonMerging fld public final static com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla std +meth protected java.lang.Object _deserializeFP(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected java.lang.Object _mapObjectWithDups(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext,java.util.Map,java.lang.String,java.lang.Object,java.lang.Object,java.lang.String) throws java.io.IOException meth protected java.lang.Object mapArray(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException meth protected java.lang.Object mapObject(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException @@ -10702,6 +10819,7 @@ meth public abstract java.lang.String getName() meth public abstract java.lang.String toString() meth public abstract java.lang.reflect.AnnotatedElement getAnnotated() meth public boolean isPublic() +meth public boolean isStatic() supr java.lang.Object CLSS public com.fasterxml.jackson.databind.introspect.AnnotatedAndMetadata<%0 extends com.fasterxml.jackson.databind.introspect.Annotated, %1 extends java.lang.Object> @@ -11090,8 +11208,6 @@ meth public com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder findP meth public com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder findPropertyTypeResolver(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedMember,com.fasterxml.jackson.databind.JavaType) meth public com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder findTypeResolver(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedClass,com.fasterxml.jackson.databind.JavaType) meth public com.fasterxml.jackson.databind.util.NameTransformer findUnwrappingNameTransformer(com.fasterxml.jackson.databind.introspect.AnnotatedMember) -meth public java.lang.Boolean findIgnoreUnknownProperties(com.fasterxml.jackson.databind.introspect.AnnotatedClass) - anno 0 java.lang.Deprecated() meth public java.lang.Boolean findMergeInfo(com.fasterxml.jackson.databind.introspect.Annotated) meth public java.lang.Boolean findSerializationSortAlphabetically(com.fasterxml.jackson.databind.introspect.Annotated) meth public java.lang.Boolean hasAnyGetter(com.fasterxml.jackson.databind.introspect.Annotated) @@ -11134,8 +11250,6 @@ meth public java.lang.String findTypeName(com.fasterxml.jackson.databind.introsp meth public java.lang.String[] findEnumValues(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedClass,java.lang.Enum[],java.lang.String[]) meth public java.lang.String[] findEnumValues(java.lang.Class,java.lang.Enum[],java.lang.String[]) anno 0 java.lang.Deprecated() -meth public java.lang.String[] findPropertiesToIgnore(com.fasterxml.jackson.databind.introspect.Annotated,boolean) - anno 0 java.lang.Deprecated() meth public java.lang.String[] findSerializationPropertyOrder(com.fasterxml.jackson.databind.introspect.AnnotatedClass) meth public java.util.Collection allIntrospectors() meth public java.util.Collection allIntrospectors(java.util.Collection) @@ -11192,7 +11306,7 @@ meth public boolean addProperty(com.fasterxml.jackson.databind.introspect.BeanPr meth public boolean hasKnownClassAnnotations() meth public boolean hasProperty(com.fasterxml.jackson.databind.PropertyName) meth public boolean removeProperty(java.lang.String) -meth public com.fasterxml.jackson.annotation.JsonFormat$Value findExpectedFormat(com.fasterxml.jackson.annotation.JsonFormat$Value) +meth public com.fasterxml.jackson.annotation.JsonFormat$Value findExpectedFormat() meth public com.fasterxml.jackson.annotation.JsonInclude$Value findPropertyInclusion(com.fasterxml.jackson.annotation.JsonInclude$Value) meth public com.fasterxml.jackson.databind.JavaType resolveType(java.lang.reflect.Type) anno 0 java.lang.Deprecated() @@ -11307,6 +11421,7 @@ meth public com.fasterxml.jackson.databind.introspect.ObjectIdInfo findObjectIdI meth public java.lang.Class[] findViews() meth public java.lang.String findReferenceName() meth public java.util.Iterator getConstructorParameters() +meth public java.util.List findAliases() supr java.lang.Object CLSS public abstract com.fasterxml.jackson.databind.introspect.ClassIntrospector @@ -11574,6 +11689,7 @@ cons protected init(com.fasterxml.jackson.databind.cfg.MapperConfig,boolean,c cons protected init(com.fasterxml.jackson.databind.cfg.MapperConfig,boolean,com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.introspect.AnnotatedClass,java.lang.String) anno 0 java.lang.Deprecated() fld protected boolean _collected +fld protected com.fasterxml.jackson.annotation.JsonFormat$Value _formatOverrides fld protected final boolean _forSerialization fld protected final boolean _isRecordType fld protected final boolean _stdBeanNaming @@ -11623,6 +11739,7 @@ meth protected void _updateCreatorProperty(com.fasterxml.jackson.databind.intros anno 0 java.lang.Deprecated() meth protected void collectAll() meth public boolean isRecordType() +meth public com.fasterxml.jackson.annotation.JsonFormat$Value getFormatOverrides() meth public com.fasterxml.jackson.databind.AnnotationIntrospector getAnnotationIntrospector() meth public com.fasterxml.jackson.databind.JavaType getType() meth public com.fasterxml.jackson.databind.cfg.MapperConfig getConfig() @@ -11714,6 +11831,7 @@ meth public java.lang.String getName() meth public java.lang.String toString() meth public java.util.Collection explode(java.util.Collection) meth public java.util.Iterator getConstructorParameters() +meth public java.util.List findAliases() meth public java.util.Set findExplicitNames() meth public void addAll(com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder) meth public void addCtor(com.fasterxml.jackson.databind.introspect.AnnotatedParameter,com.fasterxml.jackson.databind.PropertyName,boolean,boolean,boolean) @@ -12501,6 +12619,7 @@ cons protected init(com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackso anno 0 java.lang.Deprecated() cons public init(com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.type.TypeFactory,com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator) fld protected final com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator _subTypeValidator +intf java.io.Serializable meth protected com.fasterxml.jackson.databind.JavaType _typeFromId(java.lang.String,com.fasterxml.jackson.databind.DatabindContext) throws java.io.IOException meth protected java.lang.String _idFrom(java.lang.Object,java.lang.Class,com.fasterxml.jackson.databind.type.TypeFactory) meth public com.fasterxml.jackson.annotation.JsonTypeInfo$Id getMechanism() @@ -12511,7 +12630,7 @@ meth public java.lang.String idFromValueAndType(java.lang.Object,java.lang.Class meth public static com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver construct(com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator) meth public void registerSubtype(java.lang.Class,java.lang.String) supr com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase -hfds JAVA_UTIL_PKG +hfds JAVA_UTIL_PKG,serialVersionUID CLSS public final com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator cons public init() @@ -12531,6 +12650,7 @@ meth public com.fasterxml.jackson.annotation.JsonTypeInfo$Id getMechanism() meth public java.lang.String idFromValue(java.lang.Object) meth public static com.fasterxml.jackson.databind.jsontype.impl.MinimalClassNameIdResolver construct(com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator) supr com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver +hfds serialVersionUID CLSS public com.fasterxml.jackson.databind.jsontype.impl.SimpleNameIdResolver cons protected init(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.JavaType,java.util.concurrent.ConcurrentHashMap,java.util.HashMap) @@ -12538,6 +12658,7 @@ fld protected final boolean _caseInsensitive fld protected final com.fasterxml.jackson.databind.cfg.MapperConfig _config fld protected final java.util.Map _idToType fld protected final java.util.concurrent.ConcurrentHashMap _typeToId +intf java.io.Serializable meth protected com.fasterxml.jackson.databind.JavaType _typeFromId(java.lang.String) meth protected java.lang.String idFromClass(java.lang.Class) meth protected static java.lang.String _defaultTypeId(java.lang.Class) @@ -12549,6 +12670,7 @@ meth public java.lang.String idFromValueAndType(java.lang.Object,java.lang.Class meth public java.lang.String toString() meth public static com.fasterxml.jackson.databind.jsontype.impl.SimpleNameIdResolver construct(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.JavaType,java.util.Collection,boolean,boolean) supr com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase +hfds serialVersionUID CLSS public com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver cons protected init(com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver) @@ -12589,7 +12711,7 @@ meth protected com.fasterxml.jackson.databind.JavaType defineDefaultImpl(com.fas meth protected com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator reportInvalidBaseType(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator) meth protected com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator verifyBaseTypeValidity(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.JavaType) meth protected com.fasterxml.jackson.databind.jsontype.TypeIdResolver idResolver(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator,java.util.Collection,boolean,boolean) -meth protected static java.lang.String _propName(java.lang.String,com.fasterxml.jackson.annotation.JsonTypeInfo$Id) +meth protected java.lang.String _propName(java.lang.String,com.fasterxml.jackson.annotation.JsonTypeInfo$Id) meth public boolean isTypeIdVisible() meth public com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator subTypeValidator(com.fasterxml.jackson.databind.cfg.MapperConfig) meth public com.fasterxml.jackson.databind.jsontype.TypeDeserializer buildTypeDeserializer(com.fasterxml.jackson.databind.DeserializationConfig,com.fasterxml.jackson.databind.JavaType,java.util.Collection) @@ -12667,6 +12789,7 @@ fld protected final boolean _caseInsensitive fld protected final com.fasterxml.jackson.databind.cfg.MapperConfig _config fld protected final java.util.Map _idToType fld protected final java.util.concurrent.ConcurrentHashMap _typeToId +intf java.io.Serializable meth protected com.fasterxml.jackson.databind.JavaType _typeFromId(java.lang.String) meth protected java.lang.String idFromClass(java.lang.Class) meth protected static java.lang.String _defaultTypeId(java.lang.Class) @@ -12678,6 +12801,7 @@ meth public java.lang.String idFromValueAndType(java.lang.Object,java.lang.Class meth public java.lang.String toString() meth public static com.fasterxml.jackson.databind.jsontype.impl.TypeNameIdResolver construct(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.JavaType,java.util.Collection,boolean,boolean) supr com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase +hfds serialVersionUID CLSS public abstract com.fasterxml.jackson.databind.jsontype.impl.TypeSerializerBase cons protected init(com.fasterxml.jackson.databind.jsontype.TypeIdResolver,com.fasterxml.jackson.databind.BeanProperty) @@ -13293,6 +13417,7 @@ meth public final void serialize(com.fasterxml.jackson.core.JsonGenerator,com.fa meth public int hashCode() meth public java.lang.String asText() meth public java.lang.String asText(java.lang.String) + anno 0 java.lang.Deprecated() meth public java.lang.String toPrettyString() meth public java.lang.String toString() meth public static com.fasterxml.jackson.databind.node.MissingNode getInstance() @@ -13312,6 +13437,7 @@ meth public final void serialize(com.fasterxml.jackson.core.JsonGenerator,com.fa meth public int hashCode() meth public java.lang.String asText() meth public java.lang.String asText(java.lang.String) + anno 0 java.lang.Deprecated() meth public static com.fasterxml.jackson.databind.node.NullNode getInstance() supr com.fasterxml.jackson.databind.node.ValueNode hfds serialVersionUID @@ -13443,6 +13569,7 @@ meth public int hashCode() meth public java.lang.Object getPojo() meth public java.lang.String asText() meth public java.lang.String asText(java.lang.String) + anno 0 java.lang.Deprecated() meth public long asLong(long) supr com.fasterxml.jackson.databind.node.ValueNode hfds serialVersionUID @@ -13489,6 +13616,7 @@ meth public int asInt(int) meth public int hashCode() meth public java.lang.String asText() meth public java.lang.String asText(java.lang.String) + anno 0 java.lang.Deprecated() meth public java.lang.String textValue() meth public long asLong(long) meth public static com.fasterxml.jackson.databind.node.TextNode valueOf(java.lang.String) @@ -13509,10 +13637,15 @@ meth public boolean isClosed() meth public boolean isNaN() meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth public char[] getTextCharacters() throws java.io.IOException +meth public com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonParser skipChildren() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonParser$NumberType getNumberType() throws java.io.IOException +meth public com.fasterxml.jackson.core.JsonParser$NumberTypeFP getNumberTypeFP() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonStreamContext getParsingContext() meth public com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException meth public com.fasterxml.jackson.core.ObjectCodec getCodec() @@ -13526,7 +13659,9 @@ meth public int getTextOffset() throws java.io.IOException meth public int readBinaryValue(com.fasterxml.jackson.core.Base64Variant,java.io.OutputStream) throws java.io.IOException meth public java.lang.Number getNumberValue() throws java.io.IOException meth public java.lang.Object getEmbeddedObject() +meth public java.lang.String currentName() meth public java.lang.String getCurrentName() + anno 0 java.lang.Deprecated() meth public java.lang.String getText() meth public java.math.BigDecimal getDecimalValue() throws java.io.IOException meth public java.math.BigInteger getBigIntegerValue() throws java.io.IOException @@ -13795,6 +13930,7 @@ hfds serialVersionUID CLSS public abstract com.fasterxml.jackson.databind.ser.BeanSerializerModifier cons public init() +intf java.io.Serializable meth public com.fasterxml.jackson.databind.JsonSerializer modifyArraySerializer(com.fasterxml.jackson.databind.SerializationConfig,com.fasterxml.jackson.databind.type.ArrayType,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.JsonSerializer) meth public com.fasterxml.jackson.databind.JsonSerializer modifyCollectionLikeSerializer(com.fasterxml.jackson.databind.SerializationConfig,com.fasterxml.jackson.databind.type.CollectionLikeType,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.JsonSerializer) meth public com.fasterxml.jackson.databind.JsonSerializer modifyCollectionSerializer(com.fasterxml.jackson.databind.SerializationConfig,com.fasterxml.jackson.databind.type.CollectionType,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.JsonSerializer) @@ -13807,6 +13943,7 @@ meth public com.fasterxml.jackson.databind.ser.BeanSerializerBuilder updateBuild meth public java.util.List changeProperties(com.fasterxml.jackson.databind.SerializationConfig,com.fasterxml.jackson.databind.BeanDescription,java.util.List) meth public java.util.List orderProperties(com.fasterxml.jackson.databind.SerializationConfig,com.fasterxml.jackson.databind.BeanDescription,java.util.List) supr java.lang.Object +hfds serialVersionUID CLSS public abstract com.fasterxml.jackson.databind.ser.ContainerSerializer<%0 extends java.lang.Object> cons protected init(com.fasterxml.jackson.databind.JavaType) @@ -15700,6 +15837,7 @@ meth public boolean hasUnbound(java.lang.String) meth public boolean isEmpty() meth public com.fasterxml.jackson.databind.JavaType findBoundType(java.lang.String) meth public com.fasterxml.jackson.databind.JavaType getBoundType(int) +meth public com.fasterxml.jackson.databind.JavaType getBoundTypeOrNull(int) meth public com.fasterxml.jackson.databind.type.TypeBindings withUnboundVariable(java.lang.String) meth public com.fasterxml.jackson.databind.type.TypeBindings withoutVariable(java.lang.String) meth public int hashCode() @@ -16404,6 +16542,7 @@ meth public java.lang.Class getRawPrimaryType() meth public java.lang.String getInternalName() meth public java.lang.String getName() meth public java.util.Iterator getConstructorParameters() +meth public java.util.List findAliases() meth public static com.fasterxml.jackson.databind.util.SimpleBeanPropertyDefinition construct(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedMember) meth public static com.fasterxml.jackson.databind.util.SimpleBeanPropertyDefinition construct(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedMember,com.fasterxml.jackson.databind.PropertyName) meth public static com.fasterxml.jackson.databind.util.SimpleBeanPropertyDefinition construct(com.fasterxml.jackson.databind.cfg.MapperConfig,com.fasterxml.jackson.databind.introspect.AnnotatedMember,com.fasterxml.jackson.databind.PropertyName,com.fasterxml.jackson.databind.PropertyMetadata,com.fasterxml.jackson.annotation.JsonInclude$Include) @@ -16614,9 +16753,14 @@ meth public boolean isClosed() meth public boolean isNaN() meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth public char[] getTextCharacters() +meth public com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonParser$NumberType getNumberType() throws java.io.IOException +meth public com.fasterxml.jackson.core.JsonParser$NumberTypeFP getNumberTypeFP() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonStreamContext getParsingContext() meth public com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonToken peekNextToken() throws java.io.IOException @@ -16637,6 +16781,7 @@ meth public java.lang.Object getObjectId() meth public java.lang.Object getTypeId() meth public java.lang.String currentName() meth public java.lang.String getCurrentName() + anno 0 java.lang.Deprecated() meth public java.lang.String getText() meth public java.lang.String nextFieldName() throws java.io.IOException meth public java.math.BigDecimal getDecimalValue() throws java.io.IOException @@ -16916,10 +17061,12 @@ meth public int writeBinary(com.fasterxml.jackson.core.Base64Variant,java.io.Inp meth public int writeBinary(java.io.InputStream,int) throws java.io.IOException meth public java.lang.Object currentValue() meth public java.lang.Object getCurrentValue() + anno 0 java.lang.Deprecated() meth public java.lang.Object getOutputTarget() meth public void assignCurrentValue(java.lang.Object) meth public void close() throws java.io.IOException meth public void setCurrentValue(java.lang.Object) + anno 0 java.lang.Deprecated() meth public void writeArray(double[],int,int) throws java.io.IOException meth public void writeArray(int[],int,int) throws java.io.IOException meth public void writeArray(long[],int,int) throws java.io.IOException @@ -16988,6 +17135,7 @@ fld protected com.fasterxml.jackson.dataformat.cbor.CBORParser$TagList _tagValue fld protected com.fasterxml.jackson.dataformat.cbor.CBORReadContext _streamReadContext fld protected double _numberDouble fld protected final boolean _symbolsCanonical +fld protected final com.fasterxml.jackson.core.StreamReadConstraints _streamReadConstraints fld protected final com.fasterxml.jackson.core.io.IOContext _ioContext fld protected final com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer _symbols fld protected final com.fasterxml.jackson.core.util.TextBuffer _textBuffer @@ -17018,6 +17166,7 @@ innr protected final static StringRefList innr protected final static StringRefListStack innr public final static !enum Feature innr public final static TagList +meth protected <%0 extends java.lang.Object> {%%0} _reportUnexpectedBreak() throws java.io.IOException meth protected boolean loadMore() throws java.io.IOException meth protected byte[] _finishBytes(int) throws java.io.IOException meth protected byte[] _finishChunkedBytes() throws java.io.IOException @@ -17043,11 +17192,9 @@ meth protected void _handleEOF() throws com.fasterxml.jackson.core.JsonParseExce meth protected void _invalidToken(int) throws com.fasterxml.jackson.core.JsonParseException meth protected void _releaseBuffers() throws java.io.IOException meth protected void _reportIncompleteBinaryRead(int,int) throws java.io.IOException -meth protected void _reportInvalidChar(int) throws com.fasterxml.jackson.core.JsonParseException meth protected void _reportInvalidInitial(int) throws com.fasterxml.jackson.core.JsonParseException meth protected void _reportInvalidOther(int) throws com.fasterxml.jackson.core.JsonParseException meth protected void _reportInvalidOther(int,int) throws com.fasterxml.jackson.core.JsonParseException -meth protected void _reportUnexpectedBreak() throws java.io.IOException meth protected void _skipBytes(int) throws java.io.IOException meth protected void _skipBytesL(long) throws java.io.IOException meth protected void _skipChunked(int) throws java.io.IOException @@ -17065,9 +17212,14 @@ meth public boolean isNaN() meth public boolean nextFieldName(com.fasterxml.jackson.core.SerializableString) throws java.io.IOException meth public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant) throws java.io.IOException meth public char[] getTextCharacters() throws java.io.IOException +meth public com.fasterxml.jackson.core.JsonLocation currentLocation() +meth public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() meth public com.fasterxml.jackson.core.JsonLocation getCurrentLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonLocation getTokenLocation() + anno 0 java.lang.Deprecated() meth public com.fasterxml.jackson.core.JsonParser$NumberType getNumberType() throws java.io.IOException +meth public com.fasterxml.jackson.core.JsonParser$NumberTypeFP getNumberTypeFP() throws java.io.IOException meth public com.fasterxml.jackson.core.JsonToken _decodeSimpleValue(int,int) throws java.io.IOException meth public com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException meth public com.fasterxml.jackson.core.ObjectCodec getCodec() @@ -17092,7 +17244,9 @@ meth public java.lang.Boolean nextBooleanValue() throws java.io.IOException meth public java.lang.Number getNumberValue() throws java.io.IOException meth public java.lang.Object getEmbeddedObject() throws java.io.IOException meth public java.lang.Object getInputSource() +meth public java.lang.String currentName() throws java.io.IOException meth public java.lang.String getCurrentName() throws java.io.IOException + anno 0 java.lang.Deprecated() meth public java.lang.String getText() throws java.io.IOException meth public java.lang.String getValueAsString() throws java.io.IOException meth public java.lang.String getValueAsString(java.lang.String) throws java.io.IOException @@ -17276,6 +17430,7 @@ hfds serialVersionUID CLSS public final !enum com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature fld public final static com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS fld public final static com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature NORMALIZE_DESERIALIZED_ZONE_ID +fld public final static com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature ONE_BASED_MONTHS intf com.fasterxml.jackson.core.util.JacksonFeature meth public boolean enabledByDefault() meth public boolean enabledIn(int) @@ -17447,6 +17602,12 @@ meth public java.lang.Object deserializeWithType(com.fasterxml.jackson.core.Json supr com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer hfds serialVersionUID +CLSS public com.fasterxml.jackson.datatype.jsr310.deser.JavaTimeDeserializerModifier +cons public init(boolean) +meth public com.fasterxml.jackson.databind.JsonDeserializer modifyEnumDeserializer(com.fasterxml.jackson.databind.DeserializationConfig,com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.JsonDeserializer) +supr com.fasterxml.jackson.databind.deser.BeanDeserializerModifier +hfds _oneBaseMonths,serialVersionUID + CLSS public com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer cons protected init() cons protected init(com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer,com.fasterxml.jackson.annotation.JsonFormat$Shape) @@ -17523,6 +17684,13 @@ meth public java.time.OffsetTime deserialize(com.fasterxml.jackson.core.JsonPars supr com.fasterxml.jackson.datatype.jsr310.deser.JSR310DateTimeDeserializerBase hfds serialVersionUID +CLSS public com.fasterxml.jackson.datatype.jsr310.deser.OneBasedMonthDeserializer +cons public init(com.fasterxml.jackson.databind.JsonDeserializer) +meth protected com.fasterxml.jackson.databind.JsonDeserializer newDelegatingInstance(com.fasterxml.jackson.databind.JsonDeserializer) +meth public java.lang.Object deserialize(com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.DeserializationContext) throws java.io.IOException +supr com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer +hfds HAS_ONE_OR_TWO_DIGITS,serialVersionUID + CLSS public com.fasterxml.jackson.datatype.jsr310.deser.YearDeserializer cons protected init(com.fasterxml.jackson.datatype.jsr310.deser.YearDeserializer,java.lang.Boolean) cons public init() @@ -17732,6 +17900,12 @@ meth public void serializeWithType({com.fasterxml.jackson.datatype.jsr310.ser.In supr com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase<{com.fasterxml.jackson.datatype.jsr310.ser.InstantSerializerBase%0}> hfds defaultFormat,getEpochMillis,getEpochSeconds,getNanoseconds +CLSS public com.fasterxml.jackson.datatype.jsr310.ser.JavaTimeSerializerModifier +cons public init(boolean) +meth public com.fasterxml.jackson.databind.JsonSerializer modifyEnumSerializer(com.fasterxml.jackson.databind.SerializationConfig,com.fasterxml.jackson.databind.JavaType,com.fasterxml.jackson.databind.BeanDescription,com.fasterxml.jackson.databind.JsonSerializer) +supr com.fasterxml.jackson.databind.ser.BeanSerializerModifier +hfds _oneBaseMonths,serialVersionUID + CLSS public com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer cons protected init() cons protected init(com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer,java.lang.Boolean,java.time.format.DateTimeFormatter,com.fasterxml.jackson.annotation.JsonFormat$Shape) @@ -17898,6 +18072,12 @@ meth public void serializeWithType(java.time.OffsetTime,com.fasterxml.jackson.co supr com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase hfds serialVersionUID +CLSS public com.fasterxml.jackson.datatype.jsr310.ser.OneBasedMonthSerializer +cons public init(com.fasterxml.jackson.databind.JsonSerializer) +meth public void serialize(java.time.Month,com.fasterxml.jackson.core.JsonGenerator,com.fasterxml.jackson.databind.SerializerProvider) throws java.io.IOException +supr com.fasterxml.jackson.databind.JsonSerializer +hfds _defaultSerializer + CLSS public com.fasterxml.jackson.datatype.jsr310.ser.YearMonthSerializer cons protected init() cons public init(java.time.format.DateTimeFormatter) diff --git a/enterprise/libs.jackson/nbproject/project.properties b/enterprise/libs.jackson/nbproject/project.properties index 3a1b8123a547..acdfd70b3111 100644 --- a/enterprise/libs.jackson/nbproject/project.properties +++ b/enterprise/libs.jackson/nbproject/project.properties @@ -19,9 +19,9 @@ is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 sigtest.gen.fail.on.error=false -release.external/jackson-annotations-2.16.1.jar=modules/ext/jackson/jackson-annotations-2.16.1.jar -release.external/jackson-core-2.16.1.jar=modules/ext/jackson/jackson-core-2.16.1.jar -release.external/jackson-databind-2.16.1.jar=modules/ext/jackson/jackson-databind-2.16.1.jar -release.external/jackson-dataformat-cbor-2.16.1.jar=modules/ext/jackson/jackson-dataformat-cbor-2.16.1.jar -release.external/jackson-datatype-jsr310-2.16.1.jar=modules/ext/jackson/jackson-datatype-jsr310-2.16.1.jar -release.external/jackson-module-jaxb-annotations-2.16.1.jar=modules/ext/jackson/jackson-module-jaxb-annotations-2.16.1.jar +release.external/jackson-annotations-2.17.0.jar=modules/ext/jackson/jackson-annotations-2.17.0.jar +release.external/jackson-core-2.17.0.jar=modules/ext/jackson/jackson-core-2.17.0.jar +release.external/jackson-databind-2.17.0.jar=modules/ext/jackson/jackson-databind-2.17.0.jar +release.external/jackson-dataformat-cbor-2.17.0.jar=modules/ext/jackson/jackson-dataformat-cbor-2.17.0.jar +release.external/jackson-datatype-jsr310-2.17.0.jar=modules/ext/jackson/jackson-datatype-jsr310-2.17.0.jar +release.external/jackson-module-jaxb-annotations-2.17.0.jar=modules/ext/jackson/jackson-module-jaxb-annotations-2.17.0.jar diff --git a/enterprise/libs.jackson/nbproject/project.xml b/enterprise/libs.jackson/nbproject/project.xml index 0f9a49af47b6..c12f13cacdcd 100644 --- a/enterprise/libs.jackson/nbproject/project.xml +++ b/enterprise/libs.jackson/nbproject/project.xml @@ -85,28 +85,28 @@ com.fasterxml.jackson.module.jaxb.ser - ext/jackson/jackson-annotations-2.16.1.jar - external/jackson-annotations-2.16.1.jar + ext/jackson/jackson-annotations-2.17.0.jar + external/jackson-annotations-2.17.0.jar - ext/jackson/jackson-core-2.16.1.jar - external/jackson-core-2.16.1.jar + ext/jackson/jackson-core-2.17.0.jar + external/jackson-core-2.17.0.jar - ext/jackson/jackson-databind-2.16.1.jar - external/jackson-databind-2.16.1.jar + ext/jackson/jackson-databind-2.17.0.jar + external/jackson-databind-2.17.0.jar - ext/jackson/jackson-dataformat-cbor-2.16.1.jar - external/jackson-dataformat-cbor-2.16.1.jar + ext/jackson/jackson-dataformat-cbor-2.17.0.jar + external/jackson-dataformat-cbor-2.17.0.jar - ext/jackson/jackson-datatype-jsr310-2.16.1.jar - external/jackson-datatype-jsr310-2.16.1.jar + ext/jackson/jackson-datatype-jsr310-2.17.0.jar + external/jackson-datatype-jsr310-2.17.0.jar - ext/jackson/jackson-module-jaxb-annotations-2.16.1.jar - external/jackson-module-jaxb-annotations-2.16.1.jar + ext/jackson/jackson-module-jaxb-annotations-2.17.0.jar + external/jackson-module-jaxb-annotations-2.17.0.jar diff --git a/enterprise/libs.jstl/nbproject/project.properties b/enterprise/libs.jstl/nbproject/project.properties index 4fe679bd62ca..3fbaa293107b 100644 --- a/enterprise/libs.jstl/nbproject/project.properties +++ b/enterprise/libs.jstl/nbproject/project.properties @@ -20,4 +20,4 @@ javac.source=1.8 release.external/jakarta.servlet.jsp.jstl-api-1.2.7.jar=modules/ext/jstl-api.jar release.external/jakarta.servlet.jsp.jstl-1.2.6.jar=modules/ext/jstl-impl.jar -spec.version.base=2.57.0 +spec.version.base=2.59.0 diff --git a/enterprise/maven.j2ee/manifest.mf b/enterprise/maven.j2ee/manifest.mf index 8f45dde20df9..a8afb4b6c03d 100644 --- a/enterprise/maven.j2ee/manifest.mf +++ b/enterprise/maven.j2ee/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module: org.netbeans.modules.maven.j2ee/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/j2ee/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/maven/j2ee/layer.xml AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.84 +OpenIDE-Module-Specification-Version: 1.86 diff --git a/enterprise/maven.j2ee/nbproject/org-netbeans-modules-maven-j2ee.sig b/enterprise/maven.j2ee/nbproject/org-netbeans-modules-maven-j2ee.sig index c69d4b92fe8f..44a52e00431c 100644 --- a/enterprise/maven.j2ee/nbproject/org-netbeans-modules-maven-j2ee.sig +++ b/enterprise/maven.j2ee/nbproject/org-netbeans-modules-maven-j2ee.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.83 +#Version 1.84 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/BaseEEModuleImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/BaseEEModuleImpl.java index 67a815cc75cf..20c323e8813a 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/BaseEEModuleImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/BaseEEModuleImpl.java @@ -108,7 +108,7 @@ public FileObject[] getJavaSources() { toRet.add(group.getRootFolder()); } } - return toRet.toArray(new FileObject[toRet.size()]); + return toRet.toArray(new FileObject[0]); } /** diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/J2eeMavenSourcesImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/J2eeMavenSourcesImpl.java index d29c677dfdfc..9579894fdaba 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/J2eeMavenSourcesImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/J2eeMavenSourcesImpl.java @@ -132,7 +132,7 @@ public SourceGroup[] getSourceGroups(String str) { if (webResourceRoots == null) { webResourceRoots = getWebSourceGroups(); } - return webResourceRoots.toArray(new SourceGroup[webResourceRoots.size()]); + return webResourceRoots.toArray(new SourceGroup[0]); } } return new SourceGroup[0]; diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/JPAStuffImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/JPAStuffImpl.java index e44f161900a9..b1e0031b24d7 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/JPAStuffImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/JPAStuffImpl.java @@ -105,7 +105,8 @@ public Boolean isJPAVersionSupported(String version) { JpaSupport support = JpaSupport.getInstance(platform); JpaProvider provider = support.getDefaultProvider(); if (provider != null) { - return (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported()) + return (Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported()) + || (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported()) || (Persistence.VERSION_3_0.equals(version) && provider.isJpa30Supported()) || (Persistence.VERSION_2_2.equals(version) && provider.isJpa22Supported()) || (Persistence.VERSION_2_1.equals(version) && provider.isJpa21Supported()) diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/MavenJsfReferenceImplementationProvider.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/MavenJsfReferenceImplementationProvider.java index 5288a6fb8fef..707819664363 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/MavenJsfReferenceImplementationProvider.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/MavenJsfReferenceImplementationProvider.java @@ -54,9 +54,10 @@ public class MavenJsfReferenceImplementationProvider implements JsfReferenceImpl map.put(JsfVersion.JSF_2_0, "com.sun.faces:jsf-impl:2.0.11"); map.put(JsfVersion.JSF_2_1, "com.sun.faces:jsf-impl:2.1.29"); map.put(JsfVersion.JSF_2_2, "com.sun.faces:jsf-impl:2.2.20"); - map.put(JsfVersion.JSF_2_3, "org.glassfish:jakarta.faces:2.3.19"); - map.put(JsfVersion.JSF_3_0, "org.glassfish:jakarta.faces:3.0.4"); - map.put(JsfVersion.JSF_4_0, "org.glassfish:jakarta.faces:4.0.2"); + map.put(JsfVersion.JSF_2_3, "org.glassfish:jakarta.faces:2.3.21"); + map.put(JsfVersion.JSF_3_0, "org.glassfish:jakarta.faces:3.0.5"); + map.put(JsfVersion.JSF_4_0, "org.glassfish:jakarta.faces:4.0.5"); + map.put(JsfVersion.JSF_4_1, "org.glassfish:jakarta.faces:4.1.0-M1"); JSF_VERSION_MAVEN_COORDINATES_MAPPING = Collections.unmodifiableMap(map); } diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/appclient/AppClientModuleProviderImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/appclient/AppClientModuleProviderImpl.java index e7aa9a5ab0cb..1cefb4b4a230 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/appclient/AppClientModuleProviderImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/appclient/AppClientModuleProviderImpl.java @@ -94,6 +94,6 @@ public File[] getRequiredLibraries() { } files.add(FileUtil.toFile(fo)); } - return files.toArray(new File[files.size()]); + return files.toArray(new File[0]); } } diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java index 95406d9d1f08..e6baefd668f2 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java @@ -258,6 +258,8 @@ public J2eeModule.Type getModuleType() { @Override public String getModuleVersion() { Profile prf = getJ2eeProfile(); + if (prf == Profile.JAKARTA_EE_11_FULL || prf == Profile.JAKARTA_EE_11_FULL) return Application.VERSION_11; + if (prf == Profile.JAKARTA_EE_10_FULL || prf == Profile.JAKARTA_EE_10_FULL) return Application.VERSION_10; if (prf == Profile.JAKARTA_EE_9_1_FULL || prf == Profile.JAKARTA_EE_9_FULL) return Application.VERSION_9; if (prf == Profile.JAKARTA_EE_8_FULL || prf == Profile.JAVA_EE_8_FULL) return Application.VERSION_8; if (prf == Profile.JAVA_EE_7_FULL) return Application.VERSION_7; @@ -441,7 +443,7 @@ public J2eeModule[] getModules() { } } } - return toRet.toArray(new J2eeModule[toRet.size()]); + return toRet.toArray(new J2eeModule[0]); } @Override diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ejb/EjbModuleProviderImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ejb/EjbModuleProviderImpl.java index b6f96a196168..dab6ec3f038e 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ejb/EjbModuleProviderImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ejb/EjbModuleProviderImpl.java @@ -132,6 +132,6 @@ public File[] getRequiredLibraries() { } files.add(FileUtil.toFile(fo)); } - return files.toArray(new File[files.size()]); + return files.toArray(new File[0]); } } diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/customizer/impl/CustomizerRunWeb.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/customizer/impl/CustomizerRunWeb.java index 193557655c54..935e59e856ca 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/customizer/impl/CustomizerRunWeb.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/customizer/impl/CustomizerRunWeb.java @@ -113,6 +113,7 @@ public class CustomizerRunWeb extends BaseRunCustomizer { WEB_PROFILES.add(Profile.JAKARTA_EE_9_WEB); WEB_PROFILES.add(Profile.JAKARTA_EE_9_1_WEB); WEB_PROFILES.add(Profile.JAKARTA_EE_10_WEB); + WEB_PROFILES.add(Profile.JAKARTA_EE_11_WEB); FULL_PROFILES = new TreeSet<>(Profile.UI_COMPARATOR); FULL_PROFILES.add(Profile.JAVA_EE_5); @@ -123,6 +124,7 @@ public class CustomizerRunWeb extends BaseRunCustomizer { FULL_PROFILES.add(Profile.JAKARTA_EE_9_FULL); FULL_PROFILES.add(Profile.JAKARTA_EE_9_1_FULL); FULL_PROFILES.add(Profile.JAKARTA_EE_10_FULL); + FULL_PROFILES.add(Profile.JAKARTA_EE_11_FULL); } @Messages({ diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/ServerSelectionHelper.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/ServerSelectionHelper.java index 4b4162a5cbee..7c632790f2cc 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/ServerSelectionHelper.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/ServerSelectionHelper.java @@ -155,6 +155,7 @@ private void updatePlatformVersionModel() { // If option was selected, show all supported profiles except Java EE 7 profiles if (ExecutionChecker.DEV_NULL.equals(serverInstance)) { if (J2eeModule.Type.WAR.equals(projectType)) { + profiles.add(Profile.JAKARTA_EE_11_WEB); profiles.add(Profile.JAKARTA_EE_10_WEB); profiles.add(Profile.JAKARTA_EE_9_1_WEB); profiles.add(Profile.JAKARTA_EE_9_WEB); @@ -163,6 +164,7 @@ private void updatePlatformVersionModel() { profiles.add(Profile.JAVA_EE_7_WEB); profiles.add(Profile.JAVA_EE_6_WEB); } else { + profiles.add(Profile.JAKARTA_EE_11_FULL); profiles.add(Profile.JAKARTA_EE_10_FULL); profiles.add(Profile.JAKARTA_EE_9_1_FULL); profiles.add(Profile.JAKARTA_EE_9_FULL); @@ -188,6 +190,7 @@ private void updatePlatformVersionModel() { // We want to have Java EE 6 Full profile for all project types except Web project if (J2eeModule.Type.WAR.equals(projectType)) { + profiles.remove(Profile.JAKARTA_EE_11_FULL); profiles.remove(Profile.JAKARTA_EE_10_FULL); profiles.remove(Profile.JAKARTA_EE_9_1_FULL); profiles.remove(Profile.JAKARTA_EE_9_FULL); @@ -196,6 +199,7 @@ private void updatePlatformVersionModel() { profiles.remove(Profile.JAVA_EE_7_FULL); profiles.remove(Profile.JAVA_EE_6_FULL); } else { + profiles.remove(Profile.JAKARTA_EE_11_WEB); profiles.remove(Profile.JAKARTA_EE_10_WEB); profiles.remove(Profile.JAKARTA_EE_9_1_WEB); profiles.remove(Profile.JAKARTA_EE_9_WEB); diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/BaseJ2eeArchetypeProvider.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/BaseJ2eeArchetypeProvider.java index 50fb87d29cd3..5f673b20898d 100755 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/BaseJ2eeArchetypeProvider.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/BaseJ2eeArchetypeProvider.java @@ -95,12 +95,17 @@ protected void addSameMojoArchetypeForAllProfiles(String version, String artifac Archetype jakartaEE9_1Archetype = createArchetype( NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeGroupId.JakartaEE9_1"), NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeVersion.JakartaEE9_1"), - NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeArtifactId.JakartaEE9_1")); + NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeArtifactId.JakartaEE9_1")); Archetype jakartaEE10_0Archetype = createArchetype( NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeGroupId.JakartaEE10_0"), NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeVersion.JakartaEE10_0"), - NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeArtifactId.JakartaEE10_0")); + NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeArtifactId.JakartaEE10_0")); + + Archetype jakartaEE11_0Archetype = createArchetype( + NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeGroupId.JakartaEE11_0"), + NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeVersion.JakartaEE11_0"), + NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeArtifactId.JakartaEE11_0")); map.put(Profile.JAVA_EE_8_FULL, javaEE8Archetype); map.put(Profile.JAVA_EE_8_WEB, javaEE8Archetype); @@ -112,6 +117,8 @@ protected void addSameMojoArchetypeForAllProfiles(String version, String artifac map.put(Profile.JAKARTA_EE_9_1_WEB, jakartaEE9_1Archetype); map.put(Profile.JAKARTA_EE_10_FULL, jakartaEE10_0Archetype); map.put(Profile.JAKARTA_EE_10_WEB, jakartaEE10_0Archetype); + map.put(Profile.JAKARTA_EE_11_FULL, jakartaEE11_0Archetype); + map.put(Profile.JAKARTA_EE_11_WEB, jakartaEE11_0Archetype); } private Archetype createMojoArchetype(String version, String artifactId) { diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/Bundle.properties b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/Bundle.properties index 676ef9d5c855..acdb31543fe2 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/Bundle.properties +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/Bundle.properties @@ -16,6 +16,9 @@ # under the License. # Maven Archetype Properties +mvn.archetypeGroupId.JakartaEE11_0=io.github.juneau001 +mvn.archetypeVersion.JakartaEE11_0=1.0.0 +mvn.archetypeArtifactId.JakartaEE11_0=webapp-jakartaee11 mvn.archetypeGroupId.JakartaEE10_0=io.github.juneau001 mvn.archetypeVersion.JakartaEE10_0=1.1.0 mvn.archetypeArtifactId.JakartaEE10_0=webapp-jakartaee10 diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/J2eeArchetypeFactory.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/J2eeArchetypeFactory.java index 6014fd35af02..60371de8a67d 100755 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/J2eeArchetypeFactory.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/J2eeArchetypeFactory.java @@ -90,6 +90,7 @@ public Map getArchetypeMap(J2eeModule.Type projectType) { private static class AppClientArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_FULL,"mvn.archetypeGroupId.JakartaEE9","mvn.archetypeVersion.JakartaEE9","mvn.archetypeArtifactId.JakartaEE9"); @@ -105,6 +106,7 @@ protected void setUpProjectArchetypes() { private static class EaArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_FULL,"mvn.archetypeGroupId.JakartaEE9","mvn.archetypeVersion.JakartaEE9","mvn.archetypeArtifactId.JakartaEE9"); @@ -118,6 +120,7 @@ protected void setUpProjectArchetypes() { private static class EarArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_FULL,"mvn.archetypeGroupId.JakartaEE9","mvn.archetypeVersion.JakartaEE9","mvn.archetypeArtifactId.JakartaEE9"); @@ -133,6 +136,7 @@ protected void setUpProjectArchetypes() { private static class EjbArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_FULL,"mvn.archetypeGroupId.JakartaEE9","mvn.archetypeVersion.JakartaEE9","mvn.archetypeArtifactId.JakartaEE9"); @@ -148,6 +152,7 @@ protected void setUpProjectArchetypes() { private static class WebArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_11_WEB,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_WEB,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_WEB,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_WEB,"mvn.archetypeGroupId.JakartaEE9","mvn.archetypeVersion.JakartaEE9","mvn.archetypeArtifactId.JakartaEE9"); @@ -162,6 +167,7 @@ protected void setUpProjectArchetypes() { // using Java EE 6 Full profile, then the same profile applies to Ejb, Web and Parent project creation - In that case // application is looking for Java EE 6 Full archetype to create the Web project with it, so we need to have it here // or otherwise Java EE project would not be created properly + addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_FULL,"mvn.archetypeGroupId.JakartaEE9","mvn.archetypeVersion.JakartaEE9","mvn.archetypeArtifactId.JakartaEE9"); diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebModuleImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebModuleImpl.java index d9afd9f39605..a2e7324cffe9 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebModuleImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebModuleImpl.java @@ -158,6 +158,9 @@ public Profile getJ2eeProfile() { if (Profile.JAKARTA_EE_10_FULL.equals(pomProfile)) { return Profile.JAKARTA_EE_10_WEB; } + if (Profile.JAKARTA_EE_11_FULL.equals(pomProfile)) { + return Profile.JAKARTA_EE_11_WEB; + } return pomProfile; } @@ -198,6 +201,9 @@ private Profile getProfileFromDescriptor() { if (WebApp.VERSION_6_0.equals(waVersion)) { return Profile.JAKARTA_EE_10_WEB; } + if (WebApp.VERSION_6_1.equals(waVersion)) { + return Profile.JAKARTA_EE_11_WEB; + } } catch (IOException exc) { ErrorManager.getDefault().notify(exc); } @@ -240,6 +246,8 @@ private Profile getProfileFromDescriptor() { List jakartaEE91Full = new ArrayList<>(); List jakartaEE10Web = new ArrayList<>(); List jakartaEE10Full = new ArrayList<>(); + List jakartaEE11Web = new ArrayList<>(); + List jakartaEE11Full = new ArrayList<>(); // Java EE specification javaEE5.add(new DependencyDesc("javaee", "javaee-api", "5.0")); @@ -258,6 +266,8 @@ private Profile getProfileFromDescriptor() { jakartaEE91Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.1.0")); jakartaEE10Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","10.0.0")); jakartaEE10Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","10.0.0")); + jakartaEE11Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","11.0.0-M1")); + jakartaEE11Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","11.0.0-M1")); // GlassFish implementations javaEE5.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "2")); @@ -276,8 +286,10 @@ private Profile getProfileFromDescriptor() { jakartaEE9Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "6.0.0")); jakartaEE91Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "6.2.5")); jakartaEE91Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "6.2.5")); - jakartaEE10Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "7.0.0-M4")); - jakartaEE10Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "7.0.0-M4")); + jakartaEE10Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "7.0.11")); + jakartaEE10Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "7.0.11")); + jakartaEE11Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0-M1")); + jakartaEE11Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0-M1")); // WebLogic implementations @@ -300,6 +312,8 @@ private Profile getProfileFromDescriptor() { jakartaEE8Full.add(new DependencyDesc("org.jboss.spec", "jboss-jakartaee-all-8.0", null)); jakartaEE8Web.add(new DependencyDesc("org.jboss.spec", "jboss-jakartaee-web-8.0", null)); + javaEEMap.put(Profile.JAKARTA_EE_11_FULL, jakartaEE11Full); + javaEEMap.put(Profile.JAKARTA_EE_11_WEB, jakartaEE11Web); javaEEMap.put(Profile.JAKARTA_EE_10_FULL, jakartaEE10Full); javaEEMap.put(Profile.JAKARTA_EE_10_WEB, jakartaEE10Web); javaEEMap.put(Profile.JAKARTA_EE_9_1_FULL, jakartaEE91Full); diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java index 0a8f6002c59c..8e0fb3a50170 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java @@ -194,10 +194,7 @@ private boolean isServerSupportingEJB31() { if (ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL) || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_7_FULL) || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_8_FULL) - || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_8_FULL) - || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_9_FULL) - || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_9_1_FULL) - || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_10_FULL)) { + || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_8_FULL)) { return true; } diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebReplaceTokenProvider.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebReplaceTokenProvider.java index b19d6a665bee..bfe1bc515883 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebReplaceTokenProvider.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebReplaceTokenProvider.java @@ -101,7 +101,7 @@ protected static FileObject[] extractFileObjectsfromLookup(Lookup lookup) { FileObject f = d.getPrimaryFile(); files.add(f); } - return files.toArray(new FileObject[files.size()]); + return files.toArray(new FileObject[0]); } @Override @@ -189,7 +189,7 @@ public static String[] getServletMappings(WebModule webModule, FileObject javaCl mappingList.addAll(si.getUrlPatterns()); } } - return mappingList.toArray(new String[mappingList.size()]); + return mappingList.toArray(new String[0]); } catch (java.io.IOException ex) { return null; } diff --git a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java index 8d5b2d80005d..6a786e9af48e 100644 --- a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java +++ b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java @@ -51,6 +51,8 @@ public void testJavaEEProjectSettingsInMavenProjects() throws Exception { } public void checkProjectForProfileChange(Project prj) { + JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_11_FULL); + assertEquals(Profile.JAKARTA_EE_11_FULL, JavaEEProjectSettings.getProfile(prj)); JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_10_FULL); assertEquals(Profile.JAKARTA_EE_10_FULL, JavaEEProjectSettings.getProfile(prj)); JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_9_1_FULL); diff --git a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java index 44c3f6a5d6f5..e70edf752d5a 100644 --- a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java +++ b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java @@ -149,6 +149,14 @@ public void testGetJ2eeProfile_warProject_jakartaEE10FullSpecification() throws public void testGetJ2eeProfile_jakartaEE10WebSpecification() throws IOException { checkJ2eeProfile(Profile.JAKARTA_EE_10_WEB, "jakarta.platform", "jakarta.jakartaee-web-api", "10.0.0"); //NOI18N } + + public void testGetJ2eeProfile_warProject_jakartaEE11FullSpecification() throws IOException { + checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-api", "11.0.0-M1"); //NOI18N + } + + public void testGetJ2eeProfile_jakartaEE11WebSpecification() throws IOException { + checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-web-api", "11.0.0-M1"); //NOI18N + } public void testGetJ2eeProfile_javaEE5Full_glassfish() throws IOException { checkJ2eeProfile(Profile.JAVA_EE_5, "org.glassfish.main.extras", "glassfish-embedded-all", "2"); //NOI18N @@ -207,11 +215,19 @@ public void testGetJ2eeProfile_jakartaEE91Web_glassfish() throws IOException { } public void testGetJ2eeProfile_warProject_jakartaEE10Full_glassfish() throws IOException { - checkJ2eeProfile(Profile.JAKARTA_EE_10_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "7.0.0-M4"); //NOI18N + checkJ2eeProfile(Profile.JAKARTA_EE_10_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "7.0.11"); //NOI18N } public void testGetJ2eeProfile_jakartaEE10Web_glassfish() throws IOException { - checkJ2eeProfile(Profile.JAKARTA_EE_10_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "7.0.0-M4"); //NOI18N + checkJ2eeProfile(Profile.JAKARTA_EE_10_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "7.0.11"); //NOI18N + } + + public void testGetJ2eeProfile_warProject_jakartaEE11Full_glassfish() throws IOException { + checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0-M1"); //NOI18N + } + + public void testGetJ2eeProfile_jakartaEE11Web_glassfish() throws IOException { + checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0-M1"); //NOI18N } public void testGetJ2eeProfile_javaEE5_weblogic() throws IOException { diff --git a/enterprise/maven.jaxws/manifest.mf b/enterprise/maven.jaxws/manifest.mf index e792910a80ce..8fc79818955b 100644 --- a/enterprise/maven.jaxws/manifest.mf +++ b/enterprise/maven.jaxws/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.jaxws OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/jaxws/Bundle.properties -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.53 diff --git a/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/actions/ClientExplorerPanel.java b/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/actions/ClientExplorerPanel.java index 483b63fcdfcc..6f6575875a3e 100644 --- a/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/actions/ClientExplorerPanel.java +++ b/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/actions/ClientExplorerPanel.java @@ -121,7 +121,7 @@ private Node[] getClientNodes(Project project) { for (WebService ws : wsData.getServiceConsumers()) { nodes.add(ws.createNode()); } - return nodes.toArray(new Node[nodes.size()]); + return nodes.toArray(new Node[0]); } return new Node[]{}; } diff --git a/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/nodes/JaxWsClientNode.java b/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/nodes/JaxWsClientNode.java index d7d9134d5da5..13147ffd55ea 100644 --- a/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/nodes/JaxWsClientNode.java +++ b/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/nodes/JaxWsClientNode.java @@ -257,7 +257,7 @@ public Action[] getActions(boolean context) { null, SystemAction.get(PropertiesAction.class))); addFromLayers(actions, "WebServices/Clients/Actions"); - return actions.toArray(new Action[actions.size()]); + return actions.toArray(new Action[0]); } private void addFromLayers(ArrayList actions, String path) { diff --git a/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/nodes/JaxWsNode.java b/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/nodes/JaxWsNode.java index e7776c7ee64b..410b62c412cc 100644 --- a/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/nodes/JaxWsNode.java +++ b/enterprise/maven.jaxws/src/org/netbeans/modules/maven/jaxws/nodes/JaxWsNode.java @@ -299,7 +299,7 @@ public Action[] getActions(boolean context) { null, SystemAction.get(PropertiesAction.class))); addFromLayers(actions, "WebServices/Services/Actions"); - return actions.toArray(new Action[actions.size()]); + return actions.toArray(new Action[0]); } private void addFromLayers(List actions, String path) { diff --git a/enterprise/micronaut/nbproject/project.properties b/enterprise/micronaut/nbproject/project.properties index 1b7c6be65aa7..fdee4fdc7950 100644 --- a/enterprise/micronaut/nbproject/project.properties +++ b/enterprise/micronaut/nbproject/project.properties @@ -19,7 +19,7 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial release.external/spring-boot-configuration-metadata-2.4.4.jar=modules/ext/spring-boot-configuration-metadata-2.4.4.jar release.external/android-json-0.0.20131108.vaadin1.jar=modules/ext/android-json-0.0.20131108.vaadin1.jar -spec.version.base=1.12.0 +spec.version.base=1.14.0 requires.nb.javac=true test-unit-sys-prop.test.netbeans.dest.dir=${netbeans.dest.dir} test.unit.cp.extra=${tools.jar} diff --git a/enterprise/micronaut/nbproject/project.xml b/enterprise/micronaut/nbproject/project.xml index 4454124894e4..9021e675fefb 100644 --- a/enterprise/micronaut/nbproject/project.xml +++ b/enterprise/micronaut/nbproject/project.xml @@ -273,7 +273,7 @@ - 2.49 + 2.68 diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/AbstractMicronautArtifacts.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/AbstractMicronautArtifacts.java index 3d1f7ec20de9..7a83f954e193 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/AbstractMicronautArtifacts.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/AbstractMicronautArtifacts.java @@ -157,7 +157,7 @@ protected void fireChanged() { if (listeners == null || listeners.isEmpty()) { return; } - ll = listeners.toArray(new ChangeListener[listeners.size()]); + ll = listeners.toArray(new ChangeListener[0]); } ChangeEvent e = new ChangeEvent(this); for (ChangeListener l : ll) { diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/MicronautConfigUtilities.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/MicronautConfigUtilities.java index 7617172bbbb0..029b05829c83 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/MicronautConfigUtilities.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/MicronautConfigUtilities.java @@ -69,7 +69,7 @@ */ public class MicronautConfigUtilities { - private static final Pattern REGEXP = Pattern.compile("^(application|bootstrap)(-\\w*)*\\.(yml|properties)$", Pattern.CASE_INSENSITIVE); + private static final Pattern REGEXP = Pattern.compile("^(application|bootstrap)(-\\w*)*\\.(yml|yaml|properties)$", Pattern.CASE_INSENSITIVE); public static final String YAML_MIME = "text/x-yaml"; public static final String PROPERTIES_MIME = "text/x-properties"; diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionCollector.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionCollector.java index c7429133135f..72b27b956a9d 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionCollector.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionCollector.java @@ -23,10 +23,12 @@ import com.sun.source.util.TreePath; import java.io.IOException; import java.util.ArrayList; +import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Optional; +import java.util.Set; import java.util.function.Consumer; +import java.util.stream.Collectors; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; @@ -36,7 +38,6 @@ import javax.lang.model.type.ExecutableType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.ElementFilter; import javax.swing.text.Document; import org.netbeans.api.editor.mimelookup.MimeRegistration; import org.netbeans.api.java.source.CompilationInfo; @@ -67,8 +68,9 @@ public class MicronautDataCompletionCollector implements CompletionCollector { public boolean collectCompletions(Document doc, int offset, Completion.Context context, Consumer consumer) { new MicronautDataCompletionTask().query(doc, offset, new MicronautDataCompletionTask.ItemFactory() { @Override - public Completion createControllerMethodItem(CompilationInfo info, VariableElement delegateRepository, ExecutableElement delegateMethod, String id, int offset) { - String methodName = Utils.getEndpointMethodName(delegateMethod.getSimpleName().toString(), id); + public Completion createControllerMethodItem(CompilationInfo info, VariableElement delegateRepository, ExecutableElement delegateMethod, String controllerId, String id, int offset) { + String delegateMethodName = delegateMethod.getSimpleName().toString(); + String methodName = Utils.getControllerDataEndpointMethodName(delegateMethodName, id); TypeMirror delegateRepositoryType = delegateRepository.asType(); if (delegateRepositoryType.getKind() == TypeKind.DECLARED) { ExecutableType type = (ExecutableType) info.getTypes().asMemberOf((DeclaredType) delegateRepositoryType, delegateMethod); @@ -85,7 +87,7 @@ public Completion createControllerMethodItem(CompilationInfo info, VariableEleme break; } cnt++; - String paramTypeName = MicronautDataCompletionTask.getTypeName(info, tm, false, delegateMethod.isVarArgs() && !tIt.hasNext()).toString(); + String paramTypeName = Utils.getTypeName(info, tm, false, delegateMethod.isVarArgs() && !tIt.hasNext()).toString(); String paramName = it.next().getSimpleName().toString(); labelDetail.append(paramTypeName).append(' ').append(paramName); sortParams.append(paramTypeName); @@ -96,21 +98,14 @@ public Completion createControllerMethodItem(CompilationInfo info, VariableEleme } sortParams.append(')'); labelDetail.append(')'); - TypeMirror returnType = type.getReturnType(); - if ("findAll".contentEquals(delegateMethod.getSimpleName()) && !delegateMethod.getParameters().isEmpty() && returnType.getKind() == TypeKind.DECLARED) { - TypeElement te = (TypeElement) ((DeclaredType) returnType).asElement(); - Optional getContentMethod = ElementFilter.methodsIn(te.getEnclosedElements()).stream().filter(m -> "getContent".contentEquals(m.getSimpleName()) && m.getParameters().isEmpty()).findAny(); - if (getContentMethod.isPresent()) { - returnType = (ExecutableType) info.getTypes().asMemberOf((DeclaredType) returnType, getContentMethod.get()); - } - } + TypeMirror returnType = Utils.getControllerDataEndpointReturnType(info, delegateMethodName, type); FileObject fo = info.getFileObject(); ElementHandle repositoryHandle = ElementHandle.create(delegateRepository); ElementHandle methodHandle = ElementHandle.create(delegateMethod); return CompletionCollector.newBuilder(methodName) .kind(Completion.Kind.Method) .labelDetail(String.format("%s - generate", labelDetail.toString())) - .labelDescription(MicronautDataCompletionTask.getTypeName(info, returnType, false, false).toString()) + .labelDescription(Utils.getTypeName(info, returnType, false, false).toString()) .sortText(String.format("%04d%s#%02d%s", 1500, methodName, cnt, sortParams.toString())) .insertTextFormat(Completion.TextFormat.PlainText) .textEdit(new TextEdit(offset, offset, "")) @@ -125,7 +120,7 @@ public Completion createControllerMethodItem(CompilationInfo info, VariableEleme if (repository != null && method != null) { TypeMirror repositoryType = repository.asType(); if (repositoryType.getKind() == TypeKind.DECLARED) { - MethodTree mt = Utils.createControllerDataEndpointMethod(wc, (DeclaredType) repositoryType, repository.getSimpleName().toString(), method, id); + MethodTree mt = Utils.createControllerDataEndpointMethod(wc, (DeclaredType) repositoryType, repository.getSimpleName().toString(), method, controllerId, id); wc.rewrite(clazz, GeneratorUtilities.get(wc).insertClassMember(clazz, mt, offset)); } } @@ -134,13 +129,14 @@ public Completion createControllerMethodItem(CompilationInfo info, VariableEleme } return null; } - @Override public Completion createFinderMethodItem(String name, String returnType, int offset) { Builder builder = CompletionCollector.newBuilder(name).kind(Completion.Kind.Method).sortText(String.format("%04d%s", 10, name)); if (returnType != null) { - builder.insertText(new StringBuilder("${1:").append(returnType).append("} ").append(name).append("$0()").toString()); - builder.insertTextFormat(Completion.TextFormat.Snippet); + builder.labelDetail("(...)") + .labelDescription(returnType) + .insertText(new StringBuilder("${1:").append(returnType).append("} ").append(name).append("$2($0);").toString()) + .insertTextFormat(Completion.TextFormat.Snippet); } return builder.build(); } @@ -149,6 +145,75 @@ public Completion createFinderMethodNameItem(String prefix, String name, int off return CompletionCollector.newBuilder(prefix + name).kind(Completion.Kind.Method).sortText(String.format("%04d%s", 10, name)).build(); } @Override + public Completion createFinderMethodParam(CompilationInfo info, VariableElement variableElement, int offset) { + String name = variableElement.getSimpleName().toString(); + TypeMirror type = variableElement.asType(); + String typeName = Utils.getTypeName(info, type, false, false).toString(); + Set> handles = new HashSet<>(); + StringBuilder sb = new StringBuilder(); + for (TypeElement ann : Utils.getRelevantAnnotations(variableElement)) { + sb.append('@').append(ann.getSimpleName()).append(' '); + handles.add(ElementHandle.create(ann)); + } + if (type.getKind() == TypeKind.DECLARED) { + handles.add(ElementHandle.create((TypeElement) ((DeclaredType) type).asElement())); + } + sb.append(typeName).append(' ').append(name); + Builder builder = CompletionCollector.newBuilder(name).kind(Completion.Kind.Property).sortText(String.format("%04d%s", 10, name)) + .insertText(sb.toString()).labelDescription(typeName); + if (!handles.isEmpty()) { + builder.additionalTextEdits(() -> modify2TextEdits(JavaSource.forFileObject(info.getFileObject()), copy -> { + copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); + Set toImport = handles.stream().map(handle -> handle.resolve(copy)).filter(te -> te != null).collect(Collectors.toSet()); + copy.rewrite(copy.getCompilationUnit(), GeneratorUtilities.get(copy).addImports(copy.getCompilationUnit(), toImport)); + })); + } + return builder.build(); + } + @Override + public Completion createFinderMethodParams(CompilationInfo info, List variableElements, int offset) { + StringBuilder label = new StringBuilder(); + StringBuilder insertText = new StringBuilder(); + StringBuilder sortParams = new StringBuilder(); + Set> handles = new HashSet<>(); + label.append('('); + int cnt = 0; + Iterator it = variableElements.iterator(); + while (it.hasNext()) { + cnt++; + VariableElement variableElement = it.next(); + String name = variableElement.getSimpleName().toString(); + TypeMirror type = variableElement.asType(); + String typeName = Utils.getTypeName(info, type, false, false).toString(); + for (TypeElement ann : Utils.getRelevantAnnotations(variableElement)) { + insertText.append('@').append(ann.getSimpleName()).append(' '); + handles.add(ElementHandle.create(ann)); + } + if (type.getKind() == TypeKind.DECLARED) { + handles.add(ElementHandle.create((TypeElement) ((DeclaredType) type).asElement())); + } + label.append(typeName).append(' ').append(name); + insertText.append(typeName).append(' ').append("${").append(cnt).append(":").append(name).append("}"); + sortParams.append(typeName); + if (it.hasNext()) { + label.append(", "); + insertText.append(", "); + sortParams.append(","); + } + } + label.append(')'); + Builder builder = CompletionCollector.newBuilder(label.toString()).kind(Completion.Kind.Property).sortText(String.format("%04d#%02d%s", 5, cnt, sortParams.toString())) + .insertText(insertText.toString()).insertTextFormat(Completion.TextFormat.Snippet); + if (!handles.isEmpty()) { + builder.additionalTextEdits(() -> modify2TextEdits(JavaSource.forFileObject(info.getFileObject()), copy -> { + copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); + Set toImport = handles.stream().map(handle -> handle.resolve(copy)).filter(te -> te != null).collect(Collectors.toSet()); + copy.rewrite(copy.getCompilationUnit(), GeneratorUtilities.get(copy).addImports(copy.getCompilationUnit(), toImport)); + })); + } + return builder.build(); + } + @Override public Completion createSQLItem(CompletionItem item) { return CompletionCollector.newBuilder(item.getInsertPrefix().toString()) .insertText(item.getInsertPrefix().toString().replace("\"", "\\\"")) @@ -188,7 +253,6 @@ public Completion createBeanPropertyItem(String name, String typeName, int offse .insertText(name) .build(); } - @Override public Completion createEnvPropertyItem(String name, String documentation, int anchorOffset, int offset) { return CompletionCollector.newBuilder(name) @@ -218,7 +282,7 @@ public Completion createJavaElementItem(CompilationInfo info, Element element, i break; } cnt++; - String paramTypeName = MicronautDataCompletionTask.getTypeName(info, tm, false, ((ExecutableElement)element).isVarArgs() && !tIt.hasNext()).toString(); + String paramTypeName = Utils.getTypeName(info, tm, false, ((ExecutableElement)element).isVarArgs() && !tIt.hasNext()).toString(); String paramName = it.next().getSimpleName().toString(); labelDetail.append(paramTypeName).append(' ').append(paramName); sortParams.append(paramTypeName); @@ -236,7 +300,7 @@ public Completion createJavaElementItem(CompilationInfo info, Element element, i return CompletionCollector.newBuilder(simpleName) .kind(Completion.Kind.Method) .labelDetail(labelDetail.toString()) - .labelDescription(MicronautDataCompletionTask.getTypeName(info, ((ExecutableElement)element).getReturnType(), false, false).toString()) + .labelDescription(Utils.getTypeName(info, ((ExecutableElement)element).getReturnType(), false, false).toString()) .sortText(String.format("%04d%s#%02d%s", 100, simpleName, cnt, sortParams.toString())) .insertText(insertText.toString()) .insertTextFormat(asTemplate ? Completion.TextFormat.Snippet : Completion.TextFormat.PlainText) @@ -245,6 +309,14 @@ public Completion createJavaElementItem(CompilationInfo info, Element element, i } Builder builder = CompletionCollector.newBuilder(simpleName); switch (element.getKind()) { + case PARAMETER: + builder.kind(Completion.Kind.Variable).sortText(String.format("%04d%s", 90, simpleName)) + .labelDescription(Utils.getTypeName(info, element.asType(), false, false).toString()); + break; + case RECORD_COMPONENT: + builder.kind(Completion.Kind.Field).sortText(String.format("%04d%s", 90, simpleName)) + .labelDescription(Utils.getTypeName(info, element.asType(), false, false).toString()); + break; case ENUM: builder.kind(Completion.Kind.Enum).sortText(String.format("%04d%s", 300, simpleName)); break; diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionProvider.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionProvider.java index 1ff9e0f4c0fa..aa61fa5beb83 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionProvider.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionProvider.java @@ -23,12 +23,16 @@ import com.sun.source.util.TreePath; import java.awt.Color; import java.io.CharConversionException; +import java.io.IOException; import java.net.URL; import java.util.Collections; +import java.util.HashSet; import java.util.Iterator; -import java.util.Optional; +import java.util.List; +import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; +import java.util.stream.Collectors; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; @@ -39,7 +43,6 @@ import javax.lang.model.type.ExecutableType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.ElementFilter; import javax.swing.Action; import javax.swing.text.BadLocationException; import javax.swing.text.Document; @@ -58,6 +61,7 @@ import org.netbeans.modules.parsing.api.ResultIterator; import org.netbeans.modules.parsing.api.Source; import org.netbeans.modules.parsing.api.UserTask; +import org.netbeans.modules.parsing.spi.ParseException; import org.netbeans.spi.editor.completion.CompletionDocumentation; import org.netbeans.spi.editor.completion.CompletionItem; import org.netbeans.spi.editor.completion.CompletionProvider; @@ -103,12 +107,17 @@ private static class MicronautDataCompletionQuery extends AsyncCompletionQuery { private static final String RECORD_ICON = "org/netbeans/modules/editor/resources/completion/record.png"; private static final String METHOD_PUBLIC = "org/netbeans/modules/editor/resources/completion/method_16.png"; //NOI18N private static final String METHOD_ST_PUBLIC = "org/netbeans/modules/editor/resources/completion/method_static_16.png"; + private static final String FIELD_PUBLIC = "org/netbeans/modules/editor/resources/completion/field_16.png"; //NOI18N + private static final String LOCAL_VARIABLE = "org/netbeans/modules/editor/resources/completion/localVariable.gif"; //NOI18N private static final String ATTRIBUTE_VALUE = "org/netbeans/modules/java/editor/resources/attribute_value_16.png"; // NOI18N private static final String PROPERTY = "org/netbeans/modules/beans/resources/propertyRO.gif"; private static final String KEYWORD_COLOR = getHTMLColor(64, 64, 217); private static final String PACKAGE_COLOR = getHTMLColor(64, 150, 64); private static final String CLASS_COLOR = getHTMLColor(150, 64, 64); private static final String INTERFACE_COLOR = getHTMLColor(128, 128, 128); + private static final String FIELD_COLOR = getHTMLColor(64, 198, 88); + private static final String PARAMETER_COLOR = getHTMLColor(64, 64, 188); + private static final String PARAMETERS_COLOR = getHTMLColor(192, 192, 192); private static final String PARAMETER_NAME_COLOR = getHTMLColor(224, 160, 65); private static final String ATTRIBUTE_VALUE_COLOR = getHTMLColor(128, 128, 128); private static final String PROPERTY_COLOR = getHTMLColor(64, 198, 88); @@ -119,8 +128,9 @@ protected void query(CompletionResultSet resultSet, Document doc, int caretOffse MicronautDataCompletionTask task = new MicronautDataCompletionTask(); resultSet.addAllItems(task.query(doc, caretOffset, new MicronautDataCompletionTask.ItemFactory() { @Override - public CompletionItem createControllerMethodItem(CompilationInfo info, VariableElement delegateRepository, ExecutableElement delegateMethod, String id, int offset) { - String methodName = Utils.getEndpointMethodName(delegateMethod.getSimpleName().toString(), id); + public CompletionItem createControllerMethodItem(CompilationInfo info, VariableElement delegateRepository, ExecutableElement delegateMethod, String controllerId, String id, int offset) { + String delegateMethodName = delegateMethod.getSimpleName().toString(); + String methodName = Utils.getControllerDataEndpointMethodName(delegateMethodName, id); TypeMirror delegateRepositoryType = delegateRepository.asType(); if (delegateRepositoryType.getKind() == TypeKind.DECLARED) { ExecutableType type = (ExecutableType) info.getTypes().asMemberOf((DeclaredType) delegateRepositoryType, delegateMethod); @@ -137,7 +147,7 @@ public CompletionItem createControllerMethodItem(CompilationInfo info, VariableE break; } cnt++; - String paramTypeName = MicronautDataCompletionTask.getTypeName(info, tm, false, delegateMethod.isVarArgs() && !tIt.hasNext()).toString(); + String paramTypeName = Utils.getTypeName(info, tm, false, delegateMethod.isVarArgs() && !tIt.hasNext()).toString(); String paramName = it.next().getSimpleName().toString(); label.append(escape(paramTypeName)).append(' ').append(PARAMETER_NAME_COLOR).append(paramName).append(COLOR_END); sortParams.append(paramTypeName); @@ -148,21 +158,14 @@ public CompletionItem createControllerMethodItem(CompilationInfo info, VariableE } label.append(')'); sortParams.append(')'); - TypeMirror returnType = type.getReturnType(); - if ("findAll".contentEquals(delegateMethod.getSimpleName()) && !delegateMethod.getParameters().isEmpty() && returnType.getKind() == TypeKind.DECLARED) { - TypeElement te = (TypeElement) ((DeclaredType) returnType).asElement(); - Optional getContentMethod = ElementFilter.methodsIn(te.getEnclosedElements()).stream().filter(m -> "getContent".contentEquals(m.getSimpleName()) && m.getParameters().isEmpty()).findAny(); - if (getContentMethod.isPresent()) { - returnType = (ExecutableType) info.getTypes().asMemberOf((DeclaredType) returnType, getContentMethod.get()); - } - } + TypeMirror returnType = Utils.getControllerDataEndpointReturnType(info, delegateMethodName, type); ElementHandle repositoryHandle = ElementHandle.create(delegateRepository); ElementHandle methodHandle = ElementHandle.create(delegateMethod); return CompletionUtilities.newCompletionItemBuilder(methodName) .startOffset(offset) .iconResource(METHOD_PUBLIC) .leftHtmlText(label.toString()) - .rightHtmlText(MicronautDataCompletionTask.getTypeName(info, returnType, false, false).toString()) + .rightHtmlText(Utils.getTypeName(info, returnType, false, false).toString()) .sortPriority(100) .sortText(String.format("%s#%02d%s", methodName, cnt, sortParams.toString())) .onSelect(ctx -> { @@ -187,7 +190,7 @@ public void run(ResultIterator resultIterator) throws Exception { if (repository != null && method != null) { TypeMirror repositoryType = repository.asType(); if (repositoryType.getKind() == TypeKind.DECLARED) { - MethodTree mt = Utils.createControllerDataEndpointMethod(copy, (DeclaredType) repositoryType, repository.getSimpleName().toString(), method, id); + MethodTree mt = Utils.createControllerDataEndpointMethod(copy, (DeclaredType) repositoryType, repository.getSimpleName().toString(), method, controllerId, id); copy.rewrite(clazz, GeneratorUtilities.get(copy).insertClassMember(clazz, mt, offset)); } } @@ -195,7 +198,7 @@ public void run(ResultIterator resultIterator) throws Exception { } }); mr.commit(); - } catch (Exception ex) { + } catch (IOException | ParseException ex) { Exceptions.printStackTrace(ex); } }).build(); @@ -207,7 +210,8 @@ public void run(ResultIterator resultIterator) throws Exception { public CompletionItem createFinderMethodItem(String name, String returnType, int offset) { CompletionUtilities.CompletionItemBuilder builder = CompletionUtilities.newCompletionItemBuilder(name) .iconResource(MICRONAUT_ICON) - .leftHtmlText("" + name + "") + .leftHtmlText("" + name + "(...)") + .rightHtmlText(returnType) .sortPriority(10); if (returnType != null) { builder.onSelect(ctx -> { @@ -217,7 +221,7 @@ public CompletionItem createFinderMethodItem(String name, String returnType, int } catch (BadLocationException ex) { Exceptions.printStackTrace(ex); } - String template = "${PAR#1 default=\"" + returnType + "\"} " + name + "${cursor completionInvoke}()"; + String template = "${PAR#1 default=\"" + returnType + "\"} " + name + "${PAR#2 default=\"\"}(${cursor completionInvoke})"; CodeTemplateManager.get(doc).createTemporary(template).insert(ctx.getComponent()); }); } else { @@ -237,6 +241,120 @@ public CompletionItem createFinderMethodNameItem(String prefix, String name, int .build(); } + @Override + public CompletionItem createFinderMethodParam(CompilationInfo info, VariableElement variableElement, int offset) { + String name = variableElement.getSimpleName().toString(); + TypeMirror type = variableElement.asType(); + String returnType = Utils.getTypeName(info, type, false, false).toString(); + Set> handles = new HashSet<>(); + StringBuilder sb = new StringBuilder(); + for (TypeElement ann : Utils.getRelevantAnnotations(variableElement)) { + sb.append('@').append(ann.getSimpleName()).append(' '); + handles.add(ElementHandle.create(ann)); + } + if (type.getKind() == TypeKind.DECLARED) { + handles.add(ElementHandle.create((TypeElement) ((DeclaredType) type).asElement())); + } + sb.append(returnType).append(' ').append(name); + return CompletionUtilities.newCompletionItemBuilder(name) + .startOffset(offset) + .iconResource(MICRONAUT_ICON) + .leftHtmlText(PARAMETER_NAME_COLOR + name + COLOR_END) + .rightHtmlText(returnType) + .sortPriority(10) + .sortText(name) + .onSelect(ctx -> { + final Document doc = ctx.getComponent().getDocument(); + try { + doc.remove(offset, ctx.getComponent().getCaretPosition() - offset); + doc.insertString(offset, sb.toString(), null); + } catch (BadLocationException ex) { + Exceptions.printStackTrace(ex); + } + try { + ModificationResult mr = ModificationResult.runModificationTask(Collections.singletonList(Source.create(doc)), new UserTask() { + @Override + public void run(ResultIterator resultIterator) throws Exception { + WorkingCopy copy = WorkingCopy.get(resultIterator.getParserResult()); + copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); + Set toImport = handles.stream().map(handle -> handle.resolve(copy)).filter(te -> te != null).collect(Collectors.toSet()); + copy.rewrite(copy.getCompilationUnit(), GeneratorUtilities.get(copy).addImports(copy.getCompilationUnit(), toImport)); + } + }); + mr.commit(); + } catch (IOException | ParseException ex) { + Exceptions.printStackTrace(ex); + } + }) + .build(); + } + + @Override + public CompletionItem createFinderMethodParams(CompilationInfo info, List variableElements, int offset) { + StringBuilder label = new StringBuilder(); + StringBuilder insertText = new StringBuilder(); + StringBuilder sortParams = new StringBuilder(); + Set> handles = new HashSet<>(); + label.append(PARAMETERS_COLOR).append('(').append(COLOR_END); + sortParams.append('('); + int cnt = 0; + Iterator it = variableElements.iterator(); + while (it.hasNext()) { + cnt++; + VariableElement variableElement = it.next(); + String name = variableElement.getSimpleName().toString(); + TypeMirror type = variableElement.asType(); + String typeName = Utils.getTypeName(info, type, false, false).toString(); + for (TypeElement ann : Utils.getRelevantAnnotations(variableElement)) { + insertText.append('@').append(ann.getSimpleName()).append(' '); + handles.add(ElementHandle.create(ann)); + } + if (type.getKind() == TypeKind.DECLARED) { + handles.add(ElementHandle.create((TypeElement) ((DeclaredType) type).asElement())); + } + label.append(typeName).append(' ').append(PARAMETER_NAME_COLOR).append(name).append(COLOR_END); + insertText.append(typeName).append(' ').append("${PAR#").append(cnt).append(" default=\"").append(name).append("\"}"); + sortParams.append(typeName); + if (it.hasNext()) { + label.append(", "); + insertText.append(", "); + sortParams.append(","); + } + } + label.append(PARAMETERS_COLOR).append(')').append(COLOR_END); + sortParams.append(')'); + return CompletionUtilities.newCompletionItemBuilder("(...)") + .startOffset(offset) + .iconResource(MICRONAUT_ICON) + .leftHtmlText(label.toString()) + .sortPriority(5) + .sortText(sortParams.toString()) + .onSelect(ctx -> { + final Document doc = ctx.getComponent().getDocument(); + try { + doc.remove(offset, ctx.getComponent().getCaretPosition() - offset); + } catch (BadLocationException ex) { + Exceptions.printStackTrace(ex); + } + CodeTemplateManager.get(doc).createTemporary(insertText.toString()).insert(ctx.getComponent());; + try { + ModificationResult mr = ModificationResult.runModificationTask(Collections.singletonList(Source.create(doc)), new UserTask() { + @Override + public void run(ResultIterator resultIterator) throws Exception { + WorkingCopy copy = WorkingCopy.get(resultIterator.getParserResult()); + copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); + Set toImport = handles.stream().map(handle -> handle.resolve(copy)).filter(te -> te != null).collect(Collectors.toSet()); + copy.rewrite(copy.getCompilationUnit(), GeneratorUtilities.get(copy).addImports(copy.getCompilationUnit(), toImport)); + } + }); + mr.commit(); + } catch (IOException | ParseException ex) { + Exceptions.printStackTrace(ex); + } + }) + .build(); + } + @Override public CompletionItem createSQLItem(CompletionItem item) { return item; @@ -341,7 +459,7 @@ public CompletionItem createJavaElementItem(CompilationInfo info, Element elemen break; } cnt++; - String paramTypeName = MicronautDataCompletionTask.getTypeName(info, tm, false, ((ExecutableElement)element).isVarArgs() && !tIt.hasNext()).toString(); + String paramTypeName = Utils.getTypeName(info, tm, false, ((ExecutableElement)element).isVarArgs() && !tIt.hasNext()).toString(); String paramName = it.next().getSimpleName().toString(); label.append(escape(paramTypeName)).append(' ').append(PARAMETER_NAME_COLOR).append(paramName).append(COLOR_END); sortParams.append(paramTypeName); @@ -360,7 +478,7 @@ public CompletionItem createJavaElementItem(CompilationInfo info, Element elemen .startOffset(offset) .iconResource(element.getModifiers().contains(Modifier.STATIC) ? METHOD_ST_PUBLIC : METHOD_PUBLIC) .leftHtmlText(label.toString()) - .rightHtmlText(MicronautDataCompletionTask.getTypeName(info, ((ExecutableElement)element).getReturnType(), false, false).toString()) + .rightHtmlText(Utils.getTypeName(info, ((ExecutableElement)element).getReturnType(), false, false).toString()) .sortPriority(100) .sortText(String.format("%s#%02d%s", simpleName, cnt, sortParams.toString())) .insertText(insertText.toString()); @@ -382,6 +500,14 @@ public CompletionItem createJavaElementItem(CompilationInfo info, Element elemen } CompletionUtilities.CompletionItemBuilder builder = CompletionUtilities.newCompletionItemBuilder(simpleName).startOffset(offset); switch (element.getKind()) { + case PARAMETER: + builder.iconResource(LOCAL_VARIABLE).leftHtmlText(PARAMETER_COLOR + simpleName + COLOR_END).sortPriority(90) + .rightHtmlText(Utils.getTypeName(info, element.asType(), false, false).toString()); + break; + case RECORD_COMPONENT: + builder.iconResource(FIELD_PUBLIC).leftHtmlText(FIELD_COLOR + simpleName + COLOR_END).sortPriority(90) + .rightHtmlText(Utils.getTypeName(info, element.asType(), false, false).toString()); + break; case ENUM: builder.iconResource(ENUM_ICON).leftHtmlText(CLASS_COLOR + simpleName + COLOR_END).sortPriority(300); break; diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionTask.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionTask.java index 44cf45ee4b62..c34ba3634ad0 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionTask.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionTask.java @@ -18,6 +18,7 @@ */ package org.netbeans.modules.micronaut.completion; +import com.sun.source.tree.ClassTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree; import com.sun.source.tree.VariableTree; @@ -27,18 +28,18 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; +import java.util.function.Consumer; import java.util.regex.Matcher; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; -import javax.lang.model.element.RecordComponentElement; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; import javax.lang.model.type.DeclaredType; @@ -84,13 +85,14 @@ public class MicronautDataCompletionTask { private static final String CONTROLLER_ANNOTATION_NAME = "io.micronaut.http.annotation.Controller"; private static final String QUERY_ANNOTATION_TYPE_NAME = "io.micronaut.data.annotation.Query"; private static final String GET = "get"; - private static final List QUERY_PATTERNS = new ArrayList<>(Arrays.asList("find", "get", "query", "read", "retrieve", "search")); - private static final List SPECIAL_QUERY_PATTERNS = new ArrayList<>(Arrays.asList("count", "countDistinct", "delete", "exists", "update")); - private static final List QUERY_PROJECTIONS = new ArrayList<>(Arrays.asList("", "Avg", "Distinct", "Max", "Min", "Sum")); - private static final List CRITERION_EXPRESSIONS = new ArrayList<>(Arrays.asList("", "After", "Before", "Contains", "StartingWith", "StartsWith", "EndingWith", "EndsWith", + private static final List QUERY_PATTERNS = Arrays.asList("find", "get", "query", "read", "retrieve", "search"); + private static final List SPECIAL_QUERY_PATTERNS = Arrays.asList("count", "countDistinct", "delete", "eliminate", "erase", "exists", "remove", "update"); + private static final List INSERT_QUERY_PATTERNS = Arrays.asList("insert", "persist", "save", "store"); + private static final List QUERY_PROJECTIONS = Arrays.asList("", "Avg", "Distinct", "Max", "Min", "Sum"); + private static final List CRITERION_EXPRESSIONS = Arrays.asList("", "After", "Before", "Contains", "StartingWith", "StartsWith", "EndingWith", "EndsWith", "Equal", "Equals", "NotEqual", "NotEquals", "GreaterThan", "GreaterThanEquals", "LessThan", "LessThanEquals", "Like", "Ilike", "In", "InList", "InRange", "Between", - "IsNull", "IsNotNull", "IsEmpty", "IsNotEmpty", "True", "False")); - private static final List COMPOSE_EXPRESSIONS = new ArrayList<>(Arrays.asList("And", "Or")); + "IsNull", "IsNotNull", "IsEmpty", "IsNotEmpty", "True", "False"); + private static final List COMPOSE_EXPRESSIONS = Arrays.asList("And", "Or"); private static final String BY = "By"; private static final String ORDER_BY = "OrderBy"; private static final String COUNT = "count"; @@ -100,9 +102,11 @@ public class MicronautDataCompletionTask { private int anchorOffset; public static interface ItemFactory extends MicronautExpressionLanguageCompletion.ItemFactory { - T createControllerMethodItem(CompilationInfo info, VariableElement delegateRepository, ExecutableElement delegateMethod, String id, int offset); + T createControllerMethodItem(CompilationInfo info, VariableElement delegateRepository, ExecutableElement delegateMethod, String controllerId, String id, int offset); T createFinderMethodItem(String name, String returnType, int offset); T createFinderMethodNameItem(String prefix, String name, int offset); + T createFinderMethodParam(CompilationInfo info, VariableElement variableElement, int offset); + T createFinderMethodParams(CompilationInfo info, List variableElements, int offset); T createSQLItem(CompletionItem item); } @@ -139,8 +143,10 @@ public void run(ResultIterator resultIterator) throws Exception { anchorOffset = ts.offset() + 3; } } - Consumer consumer = (namePrefix, name, type) -> { - items.add(type != null ? factory.createFinderMethodItem(name, type, anchorOffset) : factory.createFinderMethodNameItem(namePrefix, name, anchorOffset)); + Consumer consumer = item -> { + if (item != null) { + items.add(item); + } }; TreeUtilities treeUtilities = cc.getTreeUtilities(); SourcePositions sp = cc.getTrees().getSourcePositions(); @@ -148,13 +154,26 @@ public void run(ResultIterator resultIterator) throws Exception { switch (path.getLeaf().getKind()) { case CLASS: case INTERFACE: - resolveFinderMethods(cc, path, prefix, true, consumer); - items.addAll(resolveControllerMethods(cc, path, prefix, factory)); + int startPos = (int) sp.getEndPosition(cc.getCompilationUnit(), ((ClassTree) path.getLeaf()).getModifiers()); + if (startPos <= 0) { + startPos = (int) sp.getStartPosition(cc.getCompilationUnit(), path.getLeaf()); + } + String headerText = cc.getText().substring(startPos, anchorOffset); + int idx = headerText.indexOf('{'); //NOI18N + if (idx >= 0) { + resolveFinderMethods(cc, path, prefix, true, factory, consumer); + resolveControllerMethods(cc, path, prefix, factory, consumer); + } break; case METHOD: Tree returnType = ((MethodTree) path.getLeaf()).getReturnType(); - if (returnType != null && findLastNonWhitespaceToken(ts, (int) sp.getEndPosition(path.getCompilationUnit(), returnType), anchorOffset) == null) { - resolveFinderMethods(cc, path.getParentPath(), prefix, false, consumer); + if (returnType != null) { + TokenSequence last = findLastNonWhitespaceToken(ts, (int) sp.getEndPosition(path.getCompilationUnit(), returnType), anchorOffset); + if (last == null) { + resolveFinderMethods(cc, path.getParentPath(), prefix, false, factory, consumer); + } else if (last.token().id() == JavaTokenId.LPAREN || last.token().id() == JavaTokenId.COMMA) { + resolveFinderMethodParams(cc, path, prefix, factory, consumer); + } } break; case VARIABLE: @@ -162,16 +181,14 @@ public void run(ResultIterator resultIterator) throws Exception { if (type != null && findLastNonWhitespaceToken(ts, (int) sp.getEndPosition(path.getCompilationUnit(), type), anchorOffset) == null) { TreePath parentPath = path.getParentPath(); if (parentPath.getLeaf().getKind() == Tree.Kind.CLASS || parentPath.getLeaf().getKind() == Tree.Kind.INTERFACE) { - resolveFinderMethods(cc, parentPath, prefix, false, consumer); + resolveFinderMethods(cc, parentPath, prefix, false, factory, consumer); } } break; case STRING_LITERAL: if (path.getParentPath().getLeaf().getKind() == Tree.Kind.ASSIGNMENT && path.getParentPath().getParentPath().getLeaf().getKind() == Tree.Kind.ANNOTATION) { - items.addAll(resolveExpressionLanguage(cc, path.getParentPath(), prefix, caretOffset - anchorOffset, factory)); - for (CompletionItem item : resolveQueryAnnotation(cc, path.getParentPath().getParentPath(), prefix, caretOffset - anchorOffset)) { - items.add(factory.createSQLItem(item)); - } + resolveExpressionLanguage(cc, path.getParentPath(), prefix, caretOffset - anchorOffset, factory, consumer); + resolveQueryAnnotation(cc, path.getParentPath().getParentPath(), prefix, caretOffset - anchorOffset, factory, consumer); } break; } @@ -188,7 +205,7 @@ public int getAnchorOffset() { return anchorOffset; } - private List resolveExpressionLanguage(CompilationInfo info, TreePath path, String prefix, int off, MicronautExpressionLanguageCompletion.ItemFactory factory) { + private void resolveExpressionLanguage(CompilationInfo info, TreePath path, String prefix, int off, ItemFactory factory, Consumer consumer) { Matcher matcher = MicronautExpressionLanguageParser.MEXP_PATTERN.matcher(prefix); while (matcher.find() && matcher.groupCount() == 1) { if (off >= matcher.start(1) && off <= matcher.end(1)) { @@ -200,14 +217,15 @@ private List resolveExpressionLanguage(CompilationInfo info, TreePath pat if (newOffset >= 0) { this.anchorOffset = newOffset; } - return result.getItems(); + for (T item : result.getItems()) { + consumer.accept(item); + } } } } - return Collections.emptyList(); } - private List resolveQueryAnnotation(CompilationInfo info, TreePath path, String prefix, int off) { + private void resolveQueryAnnotation(CompilationInfo info, TreePath path, String prefix, int off, ItemFactory factory, Consumer consumer) { Element el = info.getTrees().getElement(path); if (el instanceof TypeElement) { if (QUERY_ANNOTATION_TYPE_NAME.contentEquals(((TypeElement) el).getQualifiedName())) { @@ -238,115 +256,181 @@ private List resolveQueryAnnotation(CompilationInfo info, TreePa if (newOffset >= 0) { this.anchorOffset = newOffset; } - return resultSet.getItems(); + for (CompletionItem item : resultSet.getItems()) { + consumer.accept(factory.createSQLItem(item)); + } } } } - return Collections.emptyList(); } - private List resolveControllerMethods(CompilationController cc, TreePath path, String prefix, ItemFactory factory) { - List items = new ArrayList<>(); - TypeElement te = (TypeElement) cc.getTrees().getElement(path); + private void resolveControllerMethods(CompilationInfo info, TreePath path, String prefix, ItemFactory factory, Consumer consumer) { + TypeElement te = (TypeElement) info.getTrees().getElement(path); AnnotationMirror controllerAnn = Utils.getAnnotation(te.getAnnotationMirrors(), CONTROLLER_ANNOTATION_NAME); if (controllerAnn != null) { - List repositories = Utils.getRepositoriesFor(cc, te); + List repositories = Utils.getRepositoriesFor(info, te); if (!repositories.isEmpty()) { - Utils.collectMissingDataEndpoints(cc, te, prefix, (repository, delegateMethod, id) -> { - T item = factory.createControllerMethodItem(cc, repository, delegateMethod, id, anchorOffset); - if (item != null) { - items.add(item); - } + Utils.collectMissingDataEndpoints(info, te, prefix, (repository, delegateMethod, controllerId, id) -> { + consumer.accept(factory.createControllerMethodItem(info, repository, delegateMethod, controllerId, id, anchorOffset)); }); } } - return items; } - private void resolveFinderMethods(CompilationInfo info, TreePath path, String prefix, boolean full, Consumer consumer) throws IOException { - TypeUtilities tu = info.getTypeUtilities(); + private void resolveFinderMethods(CompilationInfo info, TreePath path, String prefix, boolean full, ItemFactory factory, Consumer consumer) throws IOException { TypeElement entity = getEntityFor(info, path); if (entity != null) { - Map prop2Types = new HashMap<>(); - for (ExecutableElement method : ElementFilter.methodsIn(entity.getEnclosedElements())) { - String methodName = method.getSimpleName().toString(); - if (methodName.startsWith(GET) && methodName.length() > 3 && method.getParameters().isEmpty()) { - TypeMirror type = method.getReturnType(); - if (type.getKind() != TypeKind.ERROR) { - methodName = methodName.substring(GET.length()); - methodName = methodName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methodName.substring(1); - prop2Types.put(methodName, tu.getTypeName(type).toString()); - } - } - } - for (RecordComponentElement recordComponent : ElementFilter.recordComponentsIn(entity.getEnclosedElements())) { - TypeMirror type = recordComponent.asType(); + TypeUtilities tu = info.getTypeUtilities(); + Map prop2Types = new LinkedHashMap<>(); + for (VariableElement variableElement : ElementFilter.fieldsIn(entity.getEnclosedElements())) { + TypeMirror type = variableElement.asType(); if (type.getKind() != TypeKind.ERROR) { - String name = recordComponent.getSimpleName().toString(); - name = name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1); - prop2Types.put(name, tu.getTypeName(type).toString()); + String name = variableElement.getSimpleName().toString(); + prop2Types.put(name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1), tu.getTypeName(type).toString()); } } - addFindByCompletions(entity, prop2Types, prefix, full, consumer); - } - } - - private void addFindByCompletions(TypeElement entity, Map prop2Types, String prefix, boolean full, Consumer consumer) { - for (String pattern : QUERY_PATTERNS) { - String name = pattern + BY; - if (prefix.length() >= name.length() && prefix.startsWith(name)) { - addPropertyCriterionCompletions(prop2Types, name, prefix, consumer); - } else if (Utils.startsWith(name, prefix)) { - consumer.accept(EMPTY, name, full ? entity.getSimpleName().toString() : null); + for (String pattern : QUERY_PATTERNS) { + if (Utils.startsWith(pattern, prefix) && (full || pattern.length() > prefix.length())) { + consumer.accept(full ? factory.createFinderMethodItem(pattern, entity.getSimpleName().toString(), anchorOffset) + : factory.createFinderMethodNameItem(EMPTY, pattern, anchorOffset)); + } + String name = pattern + BY; + if (prefix.length() >= name.length() && prefix.startsWith(name)) { + addPropertyCriterionCompletions(prop2Types, name, prefix, full ? entity.getSimpleName().toString() : null, factory, consumer); + } else if (Utils.startsWith(name, prefix)) { + consumer.accept(full ? factory.createFinderMethodItem(name, entity.getSimpleName().toString(), anchorOffset) + : factory.createFinderMethodNameItem(EMPTY, name, anchorOffset)); + } + for (String projection : QUERY_PROJECTIONS) { + for (String propName : prop2Types.keySet()) { + name = pattern + projection + propName + BY; + if (prefix.length() >= name.length() && prefix.startsWith(name)) { + addPropertyCriterionCompletions(prop2Types, name, prefix, full ? prop2Types.get(propName) : null, factory, consumer); + } else if (Utils.startsWith(name, prefix)) { + consumer.accept(full ? factory.createFinderMethodItem(name, prop2Types.get(propName), anchorOffset) + : factory.createFinderMethodNameItem(EMPTY, name, anchorOffset)); + } + } + } } - for (String projection : QUERY_PROJECTIONS) { + for (String pattern : SPECIAL_QUERY_PATTERNS) { + if (Utils.startsWith(pattern, prefix) && (full || pattern.length() > prefix.length())) { + consumer.accept(full ? factory.createFinderMethodItem(pattern, pattern.startsWith(COUNT) ? "int" : pattern.startsWith(EXISTS) ? "boolean" : "void", anchorOffset) + : factory.createFinderMethodNameItem(EMPTY, pattern, anchorOffset)); + } for (String propName : prop2Types.keySet()) { - name = pattern + projection + propName + BY; + String name = pattern + BY + propName; if (prefix.length() >= name.length() && prefix.startsWith(name)) { - addPropertyCriterionCompletions(prop2Types, name, prefix, consumer); + addCriterionCompletions(prop2Types, name, prefix, full ? pattern.startsWith(COUNT) ? "int" : pattern.startsWith(EXISTS) ? "boolean" : "void" + : null, factory, consumer); } else if (Utils.startsWith(name, prefix)) { - consumer.accept(EMPTY, name, full ? prop2Types.get(propName) : null); + consumer.accept(full ? factory.createFinderMethodItem(name, name.startsWith(COUNT) ? "int" : name.startsWith(EXISTS) ? "boolean" : "void", anchorOffset) + : factory.createFinderMethodNameItem(EMPTY, name, anchorOffset)); } } } - } - for (String pattern : SPECIAL_QUERY_PATTERNS) { - for (String propName : prop2Types.keySet()) { - String name = pattern + propName + BY; - if (prefix.length() >= name.length() && prefix.startsWith(name)) { - addPropertyCriterionCompletions(prop2Types, name, prefix, consumer); - } else if (Utils.startsWith(name, prefix)) { - consumer.accept(EMPTY, name, full ? name.startsWith(COUNT) ? "int" : name.startsWith(EXISTS) ? "boolean" : "void" : null); + for (String pattern : INSERT_QUERY_PATTERNS) { + if (Utils.startsWith(pattern, prefix) && (full || pattern.length() > prefix.length())) { + consumer.accept(full ? factory.createFinderMethodItem(pattern, entity.getSimpleName().toString(), anchorOffset) + : factory.createFinderMethodNameItem(EMPTY, pattern, anchorOffset)); } } } } - private void addPropertyCriterionCompletions(Map prop2Types, String namePrefix, String prefix, Consumer consumer) { + private void addPropertyCriterionCompletions(Map prop2Types, String namePrefix, String prefix, String returnType, ItemFactory factory, Consumer consumer) { for (String propName : prop2Types.keySet()) { - for (String criterion : CRITERION_EXPRESSIONS) { - String name = propName + criterion; - if (prefix.length() >= namePrefix.length() + name.length() && prefix.startsWith(namePrefix + name)) { - addComposeAndOrderCompletions(prop2Types, namePrefix + name, prefix, consumer); - } else if (Utils.startsWith(namePrefix + name, prefix)) { - consumer.accept(namePrefix, name, null); - } + addCriterionCompletions(prop2Types, namePrefix + propName, prefix, returnType, factory, consumer); + } + } + + private void addCriterionCompletions(Map prop2Types, String namePrefix, String prefix, String returnType, ItemFactory factory, Consumer consumer) { + for (String criterion : CRITERION_EXPRESSIONS) { + if (prefix.length() >= namePrefix.length() + criterion.length() && prefix.startsWith(namePrefix + criterion)) { + addComposeAndOrderCompletions(prop2Types, namePrefix + criterion, prefix, returnType, factory, consumer); + } else if (Utils.startsWith(namePrefix + criterion, prefix)) { + consumer.accept(returnType != null ? factory.createFinderMethodItem(namePrefix + criterion, returnType, anchorOffset) + : factory.createFinderMethodNameItem(namePrefix, criterion, anchorOffset)); } } } - private void addComposeAndOrderCompletions(Map prop2Types, String namePrefix, String prefix, Consumer consumer) { + private void addComposeAndOrderCompletions(Map prop2Types, String namePrefix, String prefix, String returnType, ItemFactory factory, Consumer consumer) { for (String name : COMPOSE_EXPRESSIONS) { if (prefix.length() >= namePrefix.length() + name.length() && prefix.startsWith(namePrefix + name)) { - addPropertyCriterionCompletions(prop2Types, namePrefix + name, prefix, consumer); + addPropertyCriterionCompletions(prop2Types, namePrefix + name, prefix, returnType, factory, consumer); } else if (Utils.startsWith(namePrefix + name, prefix)) { - consumer.accept(namePrefix, name, null); + consumer.accept(returnType != null ? factory.createFinderMethodItem(namePrefix + name, returnType, anchorOffset) + : factory.createFinderMethodNameItem(namePrefix, name, anchorOffset)); } } for (String propName : prop2Types.keySet()) { String name = ORDER_BY + propName; if (prefix.length() < namePrefix.length() + name.length() && Utils.startsWith(namePrefix + name, prefix)) { - consumer.accept(namePrefix, name, null); + consumer.accept(returnType != null ? factory.createFinderMethodItem(namePrefix + name, returnType, anchorOffset) + : factory.createFinderMethodNameItem(namePrefix, name, anchorOffset)); + } + } + } + + private void resolveFinderMethodParams(CompilationInfo info, TreePath path, String prefix, ItemFactory factory, Consumer consumer) { + TypeElement entity = getEntityFor(info, path.getParentPath()); + if (entity != null) { + MethodTree method = (MethodTree) path.getLeaf(); + SourcePositions sp = info.getTrees().getSourcePositions(); + Set paramNames = new HashSet<>(); + for (VariableTree param : method.getParameters()) { + if (sp.getEndPosition(path.getCompilationUnit(), param) < anchorOffset) { + paramNames.add(param.getName().toString()); + } + } + Map prop2fields = new LinkedHashMap<>(); + for (VariableElement variableElement : ElementFilter.fieldsIn(entity.getEnclosedElements())) { + String name = variableElement.getSimpleName().toString(); + if (!paramNames.contains(name)) { + TypeMirror type = variableElement.asType(); + if (type.getKind() != TypeKind.ERROR) { + prop2fields.put(name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1), variableElement); + consumer.accept(factory.createFinderMethodParam(info, variableElement, anchorOffset)); + } + } + } + if (paramNames.isEmpty() && !prop2fields.isEmpty()) { + addParamsParsedFromFinderMethodName(info, prop2fields, method.getName().toString(), factory, consumer); + } + } + } + + private void addParamsParsedFromFinderMethodName(CompilationInfo info, Map prop2fields, String name, ItemFactory factory, Consumer consumer) { + for (String pattern : QUERY_PATTERNS) { + if (name.startsWith(pattern)) { + name = name.substring(pattern.length()); + int idx = name.indexOf("By"); + if (idx >= 0) { + name = name.substring(idx + 2); + List fields = new ArrayList<>(); + int lastLen = Integer.MAX_VALUE; + while (name.length() < lastLen) { + lastLen = name.length(); + for (Map.Entry entry : prop2fields.entrySet()) { + String propName = entry.getKey(); + if (name.startsWith(propName)) { + fields.add(entry.getValue()); + name = name.substring(propName.length()); + } + } + for (String criterion : CRITERION_EXPRESSIONS) { + for (String expr : COMPOSE_EXPRESSIONS) { + if (name.startsWith(criterion + expr)) { + name = name.substring(criterion.length() + expr.length()); + } + } + } + } + if (!fields.isEmpty()) { + consumer.accept(factory.createFinderMethodParams(info, fields, anchorOffset)); + } + } } } } @@ -396,20 +480,4 @@ private static TokenSequence previousNonWhitespaceToken(TokenSequen } return null; } - - static CharSequence getTypeName(CompilationInfo info, TypeMirror type, boolean fqn, boolean varArg) { - Set options = EnumSet.noneOf(TypeUtilities.TypeNameOptions.class); - if (fqn) { - options.add(TypeUtilities.TypeNameOptions.PRINT_FQN); - } - if (varArg) { - options.add(TypeUtilities.TypeNameOptions.PRINT_AS_VARARG); - } - return info.getTypeUtilities().getTypeName(type, options.toArray(new TypeUtilities.TypeNameOptions[0])); - } - - @FunctionalInterface - private static interface Consumer { - void accept(String namePrefix, String name, String type); - } } diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautExpressionLanguageCompletion.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautExpressionLanguageCompletion.java index d970ce5e2684..c7e69ad7a8b4 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautExpressionLanguageCompletion.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautExpressionLanguageCompletion.java @@ -30,6 +30,7 @@ import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; +import javax.lang.model.element.ModuleElement; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; import javax.lang.model.type.DeclaredType; @@ -87,7 +88,7 @@ public Result query(int offset, ItemFactory factory) { if (tree == null) { kws = ctx.getScope().getEnclosingMethod() != null ? Arrays.asList("true", "false", "null", "this", "empty", "not") : Arrays.asList("true", "false", "null", "empty", "not"); builtins = Arrays.asList("T", "()", "ctx", "[]", "env", "[]"); - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); anchorOffset = startOffset + offset; } else { String tokenText = ts.token().text().subSequence(0, offset - ts.offset()).toString().trim(); @@ -104,7 +105,7 @@ public Result query(int offset, ItemFactory factory) { if (offset <= tree.getStartPosition()) { kws = ctx.getScope().getEnclosingMethod() != null ? Arrays.asList("true", "false", "null", "this", "empty", "not") : Arrays.asList("true", "false", "null", "empty", "not"); builtins = Arrays.asList("T", "()", "ctx", "[]", "env", "[]"); - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); } else { ExpressionTree lastTree = tree; if (tree.getKind() == ExpressionTree.Kind.ERRONEOUS) { @@ -148,7 +149,7 @@ public Result query(int offset, ItemFactory factory) { case NONE: String prev = prevNonWSTokenText(prefix); if ("#".equals(prev)) { - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); } break; } @@ -213,7 +214,7 @@ public Result query(int offset, ItemFactory factory) { kws = Arrays.asList("this"); } builtins = Arrays.asList("T", "()", "ctx", "[]", "env", "[]"); - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); } break; case EQUAL_TO: @@ -224,7 +225,7 @@ public Result query(int offset, ItemFactory factory) { } else { kws = ctx.getScope().getEnclosingMethod() != null ? Arrays.asList("null", "this"): Arrays.asList("null"); builtins = Arrays.asList("T", "()", "ctx", "[]", "env", "[]"); - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); } break; case AND: @@ -237,11 +238,11 @@ public Result query(int offset, ItemFactory factory) { case NOT: kws = ctx.getScope().getEnclosingMethod() != null ? Arrays.asList("true", "false", "not", "empty", "this"): Arrays.asList("true", "false", "not", "empty"); builtins = Arrays.asList("T", "()", "ctx", "[]", "env", "[]"); - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); break; case EMPTY: builtins = Arrays.asList("T", "()", "ctx", "[]", "env", "[]"); - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); break; case INSTANCE_OF: ExpressionTree.InstanceOf instanceOf = (ExpressionTree.InstanceOf) path.getLeaf(); @@ -261,7 +262,7 @@ public Result query(int offset, ItemFactory factory) { if ("?". equals(prev) || ":".equals(prev)) { kws = ctx.getScope().getEnclosingMethod() != null ? Arrays.asList("true", "false", "null", "this", "empty", "not") : Arrays.asList("true", "false", "null", "empty", "not"); builtins = Arrays.asList("T", "()", "ctx", "[]", "env", "[]"); - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); } } break; @@ -273,12 +274,12 @@ public Result query(int offset, ItemFactory factory) { if (callee != null) { TypeMirror pacTM = callee.getTypeMirror(ctx); if (pacTM.getKind() == TypeKind.DECLARED) { - elements = ElementFilter.methodsIn(((DeclaredType) pacTM).asElement().getEnclosedElements()).stream() + elements = ((DeclaredType) pacTM).asElement().getEnclosedElements().stream() .filter(ee -> callee.getKind() != ExpressionTree.Kind.TYPE_REFERENCE || ee.getModifiers().contains(Modifier.STATIC)) .collect(Collectors.toList()); } } else { - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); } } break; @@ -295,12 +296,12 @@ public Result query(int offset, ItemFactory factory) { .collect(Collectors.toList()); } } else { - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); } } else if ("(".equals(prev) || ",".equals(prev)) { kws = ctx.getScope().getEnclosingMethod() != null ? Arrays.asList("true", "false", "null", "this", "empty", "not") : Arrays.asList("true", "false", "null", "empty", "not"); builtins = Arrays.asList("T", "()", "ctx", "[]", "env", "[]"); - elements = ctx.getContextMethods(); + elements = ctx.getContextElements(); } break; } @@ -376,11 +377,20 @@ public Result query(int offset, ItemFactory factory) { } String propertyName = element.getKind() == ElementKind.METHOD ? ExpressionTree.getPropertyName((ExecutableElement) element) : null; if (Utils.startsWith(propertyName, prefix) && info.getTrees().isAccessible(ctx.getScope(), element, (DeclaredType) enclType)) { - String returnType = MicronautDataCompletionTask.getTypeName(info, ((ExecutableElement)element).getReturnType(), false, false).toString(); + String returnType = Utils.getTypeName(info, ((ExecutableElement)element).getReturnType(), false, false).toString(); items.add(factory.createBeanPropertyItem(propertyName, returnType, anchorOffset)); } } - } else { + } else if (element.getKind() == ElementKind.RECORD_COMPONENT) { + TypeMirror enclType = element.getEnclosingElement().asType(); + if (enclType.getKind() == TypeKind.DECLARED && Utils.startsWith(name, prefix) && info.getTrees().isAccessible(ctx.getScope(), element, (DeclaredType) enclType)) { + items.add(factory.createJavaElementItem(info, element, anchorOffset)); + } + } else if (element.getKind() == ElementKind.PARAMETER) { + if (Utils.startsWith(name, prefix)) { + items.add(factory.createJavaElementItem(info, element, anchorOffset)); + } + } else if (element.getKind().isClass() || element.getKind().isInterface()) { if (Utils.startsWith(name, prefix) && info.getTrees().isAccessible(ctx.getScope(), (TypeElement) element)) { items.add(factory.createJavaElementItem(info, element, anchorOffset)); } @@ -396,8 +406,9 @@ public Result query(int offset, ItemFactory factory) { } if (pkgPrefix != null) { Set seenPkgs = new HashSet<>(); + ModuleElement module = info.getElements().getModuleOf(ctx.getScope().getEnclosingClass()); for (String pkgName : info.getClasspathInfo().getClassIndex().getPackageNames(pkgPrefix, false, EnumSet.allOf(ClassIndex.SearchScope.class))) { - if (Utils.startsWith(pkgName, pkgPrefix + prefix)) { + if (Utils.startsWith(pkgName, pkgPrefix + prefix) && (module != null ? info.getElements().getPackageElement(module, pkgName) : info.getElements().getPackageElement(pkgName)) != null) { String name = pkgName.substring(pkgPrefix.length()); int idx = name.indexOf('.'); if (idx > 0) { diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Bundle.properties b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Bundle.properties index 0f9d4ae7daa4..05ab7d9fec27 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Bundle.properties +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Bundle.properties @@ -16,7 +16,8 @@ # under the License. Templates/Micronaut=Micronaut -Templates/Micronaut/Controller=Micronaut Controller Classes (from Data Repositories) +Templates/Micronaut/Controller=Micronaut Controller Class +Templates/Micronaut/ControllerFromRepository=Micronaut Controller Classes from Data Repositories Templates/Micronaut/Entity=Micronaut Data Entity Classes from Database Templates/Micronaut/Repository=Micronaut Data Repository Interfaces from Entities @@ -56,6 +57,7 @@ LBL_Remove=< &Remove LBL_RemoveAll=<< Re&move All ERR_SelectEntities=Select at least one entity class +ERR_SelectRepositories=Select at least one repository interface # {0} = project name ERR_NoEntities=No entity class found in {0} # {0} = project name diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/ClassesSelectorPanel.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/ClassesSelectorPanel.java index 215c76451a00..8ab33865d091 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/ClassesSelectorPanel.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/ClassesSelectorPanel.java @@ -248,8 +248,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { private void removeAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeAllButtonActionPerformed available.addAll(selected); selected.clear(); - availableList.setListData(available.toArray(new String[available.size()])); - selectedList.setListData(selected.toArray(new String[selected.size()])); + availableList.setListData(available.toArray(new String[0])); + selectedList.setListData(selected.toArray(new String[0])); updateButtons(); changeSupport.fireChange(); }//GEN-LAST:event_removeAllButtonActionPerformed @@ -257,8 +257,8 @@ private void removeAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//G private void addAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addAllButtonActionPerformed selected.addAll(available); available.clear(); - availableList.setListData(available.toArray(new String[available.size()])); - selectedList.setListData(selected.toArray(new String[selected.size()])); + availableList.setListData(available.toArray(new String[0])); + selectedList.setListData(selected.toArray(new String[0])); updateButtons(); changeSupport.fireChange(); }//GEN-LAST:event_addAllButtonActionPerformed @@ -266,8 +266,8 @@ private void addAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN- private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed available.addAll(selectedList.getSelectedValuesList()); selected.removeAll(selectedList.getSelectedValuesList()); - availableList.setListData(available.toArray(new String[available.size()])); - selectedList.setListData(selected.toArray(new String[selected.size()])); + availableList.setListData(available.toArray(new String[0])); + selectedList.setListData(selected.toArray(new String[0])); updateButtons(); changeSupport.fireChange(); }//GEN-LAST:event_removeButtonActionPerformed @@ -275,8 +275,8 @@ private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN- private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed selected.addAll(availableList.getSelectedValuesList()); available.removeAll(availableList.getSelectedValuesList()); - availableList.setListData(available.toArray(new String[available.size()])); - selectedList.setListData(selected.toArray(new String[selected.size()])); + availableList.setListData(available.toArray(new String[0])); + selectedList.setListData(selected.toArray(new String[0])); updateButtons(); changeSupport.fireChange(); }//GEN-LAST:event_addButtonActionPerformed diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EndpointSelectorPanel.form b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EndpointSelectorPanel.form index 803680b0a418..12d694cd1e23 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EndpointSelectorPanel.form +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EndpointSelectorPanel.form @@ -87,7 +87,7 @@ - + diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EndpointSelectorPanel.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EndpointSelectorPanel.java index 7c7a0f32cdee..d5adf0113468 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EndpointSelectorPanel.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EndpointSelectorPanel.java @@ -18,8 +18,13 @@ */ package org.netbeans.modules.micronaut.db; +import java.awt.Component; import java.util.List; +import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; +import javax.swing.JLabel; +import javax.swing.JList; +import org.openide.NotifyDescriptor; /** * @@ -30,17 +35,28 @@ public class EndpointSelectorPanel extends javax.swing.JPanel { /** * Creates new form EndpointSelectorPanel */ - public EndpointSelectorPanel(List endpoints) { + public EndpointSelectorPanel(List endpoints) { initComponents(); selectorList.addListSelectionListener(evt -> { firePropertyChange("selection", null, null); }); - DefaultListModel model = new DefaultListModel<>(); + selectorList.setCellRenderer(new DefaultListCellRenderer() { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + JLabel renderer = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + if (value instanceof NotifyDescriptor.QuickPick.Item) { + NotifyDescriptor.QuickPick.Item item = (NotifyDescriptor.QuickPick.Item) value; + renderer.setText(item.getLabel() + " " + item.getDescription()); + } + return renderer; + } + }); + DefaultListModel model = new DefaultListModel<>(); model.addAll(endpoints); selectorList.setModel(model); } - public List getSelectedEndpoints() { + public List getSelectedEndpoints() { return selectorList.getSelectedValuesList(); } @@ -89,7 +105,7 @@ private void initComponents() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel selectorLabel; - private javax.swing.JList selectorList; + private javax.swing.JList selectorList; private javax.swing.JScrollPane selectorScrollPane; // End of variables declaration//GEN-END:variables } diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautController.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautController.java index caf617ad3a32..a9d978fbe06d 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautController.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautController.java @@ -78,107 +78,47 @@ public class MicronautController implements TemplateWizard.Iterator { public static TemplateWizard.Iterator create() { - return new MicronautController(); + return new MicronautController(false); + } + + public static TemplateWizard.Iterator createFromReposiory() { + return new MicronautController(true); } - @NbBundle.Messages({ - "MSG_SelectRepository=Select Data Repository Interfaces", - "MSG_SelectRepository_Prompt=Repositories to be called from Controllers", - "MSG_SelectControllerName=Controller Name" - }) public static CreateFromTemplateHandler handler() { - return new CreateFromTemplateHandler() { - @Override - protected boolean accept(CreateDescriptor desc) { - return true; - } + return handler(false); + } - @Override - protected List createFromTemplate(CreateDescriptor desc) throws IOException { - try { - final FileObject folder = desc.getTarget(); - final Project project = FileOwnerQuery.getOwner(folder); - if (project == null) { - DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(Bundle.MSG_NoProject(folder.getPath()), NotifyDescriptor.ERROR_MESSAGE)); - return Collections.emptyList(); - } - final SourceGroup sourceGroup = SourceGroups.getFolderSourceGroup(ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA), folder); - if (sourceGroup != null) { - Set> repositoryClasses = getRepositoryClasses(sourceGroup); - if (!repositoryClasses.isEmpty()) { - List items = repositoryClasses.stream().map(handle -> { - String fqn = handle.getQualifiedName(); - int idx = fqn.lastIndexOf('.'); - return idx < 0 ? new NotifyDescriptor.QuickPick.Item(fqn, null) : new NotifyDescriptor.QuickPick.Item(fqn.substring(idx + 1), fqn.substring(0, idx)); - }).collect(Collectors.toList()); - NotifyDescriptor.QuickPick qpt = new NotifyDescriptor.QuickPick(Bundle.MSG_SelectRepository(), Bundle.MSG_SelectRepository_Prompt(), items, true); - if (DialogDescriptor.OK_OPTION != DialogDisplayer.getDefault().notify(qpt)) { - return Collections.emptyList(); - } - List generated = new ArrayList<>(); - boolean hasSelectedItem = false; - for (NotifyDescriptor.QuickPick.Item item : qpt.getItems()) { - if (item.isSelected()) { - hasSelectedItem = true; - String label = item.getLabel(); - if (label.toLowerCase().endsWith(("repository"))) { //NOI18N - label = label.substring(0, label.length() - 10); - } - FileObject fo = generate(folder, label, item.getDescription() != null ? item.getDescription() + '.' + item.getLabel() : item.getLabel()); - if (fo != null) { - generated.add(fo); - } - } - } - if (hasSelectedItem) { - return generated; - } - } - } - NotifyDescriptor.InputLine inputLine = new NotifyDescriptor.InputLine(Bundle.MSG_SelectControllerName(), Bundle.MSG_SelectControllerName()); - if (DialogDescriptor.OK_OPTION == DialogDisplayer.getDefault().notify(inputLine)) { - List generated = new ArrayList<>(); - String name = inputLine.getInputText(); - if (!name.isEmpty()) { - if (name.toLowerCase().endsWith(("controller"))) { //NOI18N - name = name.substring(0, name.length() - 10); - } - FileObject fo = generate(desc.getTarget(), name, null); - if (fo != null) { - generated.add(fo); - } - } - return generated; - } - } catch (Exception ex) { - DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.ERROR_MESSAGE)); - } - return Collections.emptyList(); - } - }; + public static CreateFromTemplateHandler fromReposioryHandler() { + return handler(true); } - private WizardDescriptor.Panel[] panels; - private int index; + private WizardDescriptor.Panel panel; private WizardDescriptor wizardDescriptor; private FileObject targetFolder; + private final boolean fromRepository; + + private MicronautController(boolean fromRepository) { + this.fromRepository = fromRepository; + } @Override public Set instantiate(TemplateWizard wiz) throws IOException { Set generated = new HashSet<>(); - Map> selectedRepositories = (Map>) wiz.getProperty(ClassesSelectorPanel.PROP_SELECTED_CLASSES); - for (String fqn : selectedRepositories.keySet()) { - int idx = fqn.lastIndexOf('.'); - String label = idx < 0 ? fqn : fqn.substring(idx + 1); - if (label.toLowerCase().endsWith(("repository"))) { //NOI18N - label = label.substring(0, label.length() - 10); - } - FileObject fo = generate(targetFolder, label, fqn); - if (fo != null) { - generated.add(DataObject.find(fo)); + if (fromRepository) { + Map> selectedRepositories = (Map>) wiz.getProperty(ClassesSelectorPanel.PROP_SELECTED_CLASSES); + for (String fqn : selectedRepositories.keySet()) { + int idx = fqn.lastIndexOf('.'); + String label = idx < 0 ? fqn : fqn.substring(idx + 1); + if (label.toLowerCase().endsWith(("repository"))) { //NOI18N + label = label.substring(0, label.length() - 10); + } + FileObject fo = generate(targetFolder, label, fqn); + if (fo != null) { + generated.add(DataObject.find(fo)); + } } - } - if (generated.isEmpty()) { + } else { String targetName = Templates.getTargetName(wiz); if (targetName != null && !targetName.isEmpty()) { FileObject fo = generate(targetFolder, targetName, null); @@ -199,13 +139,10 @@ public void initialize(TemplateWizard wiz) { Sources sources = ProjectUtils.getSources(project); SourceGroup[] sourceGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); - if(sourceGroups.length == 0) { - sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC); - panels = new WizardDescriptor.Panel[] { - Templates.buildSimpleTargetChooser(project, sourceGroups).create() - }; - } else { - List p = new ArrayList<>(); + if (fromRepository) { + panel = new ClassesSelectorPanel.WizardPanel(NbBundle.getMessage(MicronautController.class, "Templates/Micronaut/Controller"), "Repositories", selectedRepositories -> { //NOI18N + return selectedRepositories.isEmpty() ? NbBundle.getMessage(MicronautController.class, "ERR_SelectRepositories") : null; + }); SourceGroup sourceGroup = SourceGroups.getFolderSourceGroup(sourceGroups, targetFolder); if (sourceGroup != null) { Set> repositoryClasses = getRepositoryClasses(sourceGroup); @@ -215,14 +152,16 @@ public void initialize(TemplateWizard wiz) { repositories.put(handle.getQualifiedName(), handle); } wiz.putProperty(ClassesSelectorPanel.PROP_CLASSES, repositories); - p.add(new ClassesSelectorPanel.WizardPanel(NbBundle.getMessage(MicronautController.class, "Templates/Micronaut/Controller"), "Repositories", s -> null)); //NOI18N } } - p.add(JavaTemplates.createPackageChooser(project, sourceGroups)); - panels = p.toArray(new WizardDescriptor.Panel[0]); + } else if (sourceGroups.length == 0) { + sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC); + panel = Templates.buildSimpleTargetChooser(project, sourceGroups).create(); + } else { + panel = JavaTemplates.createPackageChooser(project, sourceGroups); } - Wizards.mergeSteps(wiz, panels, null); + Wizards.mergeSteps(wiz, new WizardDescriptor.Panel[] {panel}, null); } @Override @@ -231,7 +170,7 @@ public void uninitialize(TemplateWizard wiz) { @Override public WizardDescriptor.Panel current() { - return panels[index]; + return panel; } @Override @@ -241,28 +180,22 @@ public String name() { @Override public boolean hasNext() { - return index < (panels.length - 1) && !(current() instanceof WizardDescriptor.FinishablePanel && ((WizardDescriptor.FinishablePanel) current()).isFinishPanel()); + return false; } @Override public boolean hasPrevious() { - return index > 0; + return false; } @Override public void nextPanel() { - if ((index + 1) == panels.length) { - throw new NoSuchElementException(); - } - index++; + throw new NoSuchElementException(); } @Override public void previousPanel() { - if (index == 0) { - throw new NoSuchElementException(); - } - index--; + throw new NoSuchElementException(); } @Override @@ -273,6 +206,86 @@ public void addChangeListener(ChangeListener l) { public void removeChangeListener(ChangeListener l) { } + @NbBundle.Messages({ + "MSG_NoRepositories=No repository interface found in {0}", + "MSG_SelectRepository=Select Data Repository Interfaces", + "MSG_SelectRepository_Prompt=Repositories to be called from Controllers", + "MSG_SelectControllerName=Controller Name" + }) + private static CreateFromTemplateHandler handler(boolean fromRepository) { + return new CreateFromTemplateHandler() { + @Override + protected boolean accept(CreateDescriptor desc) { + return true; + } + + @Override + protected List createFromTemplate(CreateDescriptor desc) throws IOException { + try { + final FileObject folder = desc.getTarget(); + final Project project = FileOwnerQuery.getOwner(folder); + if (project == null) { + DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(Bundle.MSG_NoProject(folder.getPath()), NotifyDescriptor.ERROR_MESSAGE)); + return Collections.emptyList(); + } + if (fromRepository) { + final SourceGroup sourceGroup = SourceGroups.getFolderSourceGroup(ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA), folder); + if (sourceGroup == null) { + DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(Bundle.MSG_NoSourceGroup(folder.getPath()), NotifyDescriptor.ERROR_MESSAGE)); + return Collections.emptyList(); + } + Set> repositoryClasses = getRepositoryClasses(sourceGroup); + if (repositoryClasses.isEmpty()) { + DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(Bundle.MSG_NoRepositories(sourceGroup.getRootFolder().getPath()), NotifyDescriptor.ERROR_MESSAGE)); + return Collections.emptyList(); + } + List items = repositoryClasses.stream().map(handle -> { + String fqn = handle.getQualifiedName(); + int idx = fqn.lastIndexOf('.'); + return idx < 0 ? new NotifyDescriptor.QuickPick.Item(fqn, null) : new NotifyDescriptor.QuickPick.Item(fqn.substring(idx + 1), fqn.substring(0, idx)); + }).collect(Collectors.toList()); + NotifyDescriptor.QuickPick qpt = new NotifyDescriptor.QuickPick(Bundle.MSG_SelectRepository(), Bundle.MSG_SelectRepository_Prompt(), items, true); + if (DialogDescriptor.OK_OPTION == DialogDisplayer.getDefault().notify(qpt)) { + List generated = new ArrayList<>(); + for (NotifyDescriptor.QuickPick.Item item : qpt.getItems()) { + if (item.isSelected()) { + String label = item.getLabel(); + if (label.toLowerCase().endsWith(("repository"))) { //NOI18N + label = label.substring(0, label.length() - 10); + } + FileObject fo = generate(folder, label, item.getDescription() != null ? item.getDescription() + '.' + item.getLabel() : item.getLabel()); + if (fo != null) { + generated.add(fo); + } + } + } + return generated; + } + } else { + NotifyDescriptor.InputLine inputLine = new NotifyDescriptor.InputLine(Bundle.MSG_SelectControllerName(), Bundle.MSG_SelectControllerName()); + if (DialogDescriptor.OK_OPTION == DialogDisplayer.getDefault().notify(inputLine)) { + List generated = new ArrayList<>(); + String name = inputLine.getInputText(); + if (!name.isEmpty()) { + if (name.toLowerCase().endsWith(("controller"))) { //NOI18N + name = name.substring(0, name.length() - 10); + } + FileObject fo = generate(desc.getTarget(), name, null); + if (fo != null) { + generated.add(fo); + } + } + return generated; + } + } + } catch (Exception ex) { + DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.ERROR_MESSAGE)); + } + return Collections.emptyList(); + } + }; + } + private static Set> getRepositoryClasses(final SourceGroup sourceGroup) throws IllegalArgumentException { ClasspathInfo cpInfo = ClasspathInfo.create(sourceGroup.getRootFolder()); Set> repositoryClasses = new HashSet<>(); @@ -304,15 +317,15 @@ private static FileObject generate(FileObject folder, String name, String reposi if (origTree.getKind() == Tree.Kind.CLASS) { GenerationUtils gu = GenerationUtils.newInstance(copy); TreeMaker tm = copy.getTreeMaker(); - List annArgs = Collections.singletonList(gu.createAnnotationArgument(null, "/" + name.toLowerCase())); //NOI18N - ClassTree cls = gu.addAnnotation((ClassTree) origTree, gu.createAnnotation("io.micronaut.http.annotation.Controller", annArgs)); //NOI18N + String controllerId = "/" + name.toLowerCase(); + ClassTree cls = gu.addAnnotation((ClassTree) origTree, gu.createAnnotation("io.micronaut.http.annotation.Controller", List.of(tm.Literal(controllerId)))); //NOI18N if (repositoryFQN != null) { String repositoryFieldName = name.substring(0, 1).toLowerCase() + name.substring(1) + "Repository"; //NOI18N VariableTree repositoryField = tm.Variable(tm.Modifiers(EnumSet.of(Modifier.PRIVATE, Modifier.FINAL)), repositoryFieldName, tm.QualIdent(repositoryFQN), null); cls = tm.addClassMember(cls, repositoryField); cls = tm.addClassMember(cls, GeneratorUtilities.get(copy).createConstructor(cls, Collections.singleton(repositoryField))); TypeElement te = copy.getElements().getTypeElement(repositoryFQN); - MethodTree mt = te != null ? Utils.createControllerDataEndpointMethod(copy, te, repositoryFieldName, "findAll", null) : null; + MethodTree mt = te != null ? Utils.createControllerFindAllDataEndpointMethod(copy, te, repositoryFieldName, controllerId, null) : null; if (mt != null) { cls = tm.addClassMember(cls, mt); } diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautDataEndpointGenerator.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautDataEndpointGenerator.java index 93c9a6694307..6180f82a82a5 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautDataEndpointGenerator.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/MicronautDataEndpointGenerator.java @@ -18,28 +18,45 @@ */ package org.netbeans.modules.micronaut.db; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.sun.source.tree.ClassTree; import com.sun.source.tree.Tree; import com.sun.source.util.TreePath; import java.awt.Dialog; import java.io.IOException; +import java.lang.reflect.Type; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; import javax.lang.model.type.DeclaredType; +import javax.lang.model.type.ExecutableType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; +import javax.lang.model.util.ElementFilter; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.text.Document; import javax.swing.text.JTextComponent; import org.netbeans.api.editor.mimelookup.MimeRegistration; import org.netbeans.api.java.source.CompilationController; -import org.netbeans.api.java.source.ElementHandle; +import org.netbeans.api.java.source.CompilationInfo; import org.netbeans.api.java.source.GeneratorUtilities; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.ModificationResult; @@ -47,7 +64,7 @@ import org.netbeans.api.java.source.TreeUtilities; import org.netbeans.api.java.source.WorkingCopy; import org.netbeans.api.lsp.CodeAction; -import org.netbeans.api.lsp.LazyCodeAction; +import org.netbeans.api.lsp.Command; import org.netbeans.api.lsp.Range; import org.netbeans.api.lsp.TextDocumentEdit; import org.netbeans.api.lsp.TextEdit; @@ -56,25 +73,44 @@ import org.netbeans.modules.parsing.spi.ParseException; import org.netbeans.spi.editor.codegen.CodeGenerator; import org.netbeans.spi.lsp.CodeActionProvider; +import org.netbeans.spi.lsp.CommandProvider; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.filesystems.FileObject; +import org.openide.filesystems.URLMapper; import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.NbBundle; +import org.openide.util.RequestProcessor; import org.openide.util.Union2; +import org.openide.util.lookup.ServiceProviders; import org.openide.util.lookup.ServiceProvider; /** * * @author Dusan Balek */ -@ServiceProvider(service = CodeActionProvider.class) -public class MicronautDataEndpointGenerator implements CodeActionProvider { +@ServiceProviders({ + @ServiceProvider(service = CodeActionProvider.class), + @ServiceProvider(service = CommandProvider.class) +}) +public class MicronautDataEndpointGenerator implements CodeActionProvider, CommandProvider { private static final String SOURCE = "source"; private static final String CONTROLLER_ANNOTATION_NAME = "io.micronaut.http.annotation.Controller"; + private static final String GENERATE_DATA_ENDPOINT = "nbls.micronaut.generate.data.endpoint"; + private static final String URI = "uri"; + private static final String OFFSET = "offset"; + private static final String REPOSITORIES = "repositories"; + private static final String ENDPOINTS = "endpoints"; + private static final String CONTROLLER_ID = "controllerId"; + + private final Gson gson = new GsonBuilder().registerTypeAdapter(NotifyDescriptor.QuickPick.Item.class, (JsonDeserializer) (JsonElement json, Type type, JsonDeserializationContext jdc) -> { + String label = json.getAsJsonObject().get("label").getAsString(); + String description = json.getAsJsonObject().get("description").getAsString();; + return new NotifyDescriptor.QuickPick.Item(label, description); + }).create(); @Override @NbBundle.Messages({ @@ -111,49 +147,32 @@ public List getCodeActions(Document doc, Range range, Lookup context if (repositories.isEmpty()) { return Collections.emptyList(); } - List endpoints = new ArrayList<>(); - Utils.collectMissingDataEndpoints(cc, te, null, (repository, delegateMethod, id) -> { - switch (delegateMethod.getSimpleName().toString()) { - case "findAll": - endpoints.add(id != null ? id + "/ -- GET" : "/ -- GET"); - break; - case "findById": - endpoints.add(id != null ? id + "/{id} -- GET" : "/{id} -- GET"); - break; - case "deleteById": - endpoints.add(id != null ? id + "/{id} -- DELETE" : "/{id} -- DELETE"); - break; + AtomicReference controllerId = new AtomicReference<>(); + List endpoints = new ArrayList<>(); + Utils.collectMissingDataEndpoints(cc, te, null, (repository, delegateMethod, cId, id) -> { + controllerId.set(cId); + ExecutableType delegateMethodType = (ExecutableType) cc.getTypes().asMemberOf((DeclaredType) repository.asType(), delegateMethod); + String value = Utils.getControllerDataEndpointAnnotationValue(delegateMethod, delegateMethodType, id); + String delegateMethodName = delegateMethod.getSimpleName().toString(); + String annotationTypeName = Utils.getControllerDataEndpointAnnotationTypeName(delegateMethodName); + if (annotationTypeName != null) { + int idx = annotationTypeName.lastIndexOf('.'); + String label = (value != null ? value : "/") + " -- " + (idx < 0 ? annotationTypeName.toUpperCase() : annotationTypeName.substring(idx + 1).toUpperCase()); + String signature = getMethodSignature(cc, delegateMethod, delegateMethodType, id); + endpoints.add(new NotifyDescriptor.QuickPick.Item(label, Utils.getControllerDataEndpointMethodName(delegateMethodName, id) + signature)); } }); if (!endpoints.isEmpty()) { - FileObject fo = cc.getFileObject(); - List> repositoryHandles = repositories.stream().map(repository -> ElementHandle.create(repository)).collect(Collectors.toList()); - return Collections.singletonList(new LazyCodeAction(Bundle.DN_GenerateDataEndpoint(), SOURCE, null, () -> { - try { - List items = endpoints.stream().map(endpoint -> new NotifyDescriptor.QuickPick.Item(endpoint, null)).collect(Collectors.toList()); - NotifyDescriptor.QuickPick pick = new NotifyDescriptor.QuickPick(Bundle.DN_GenerateDataEndpoint(), Bundle.DN_SelectEndpoints(), items, true); - if (DialogDescriptor.OK_OPTION != DialogDisplayer.getDefault().notify(pick)) { - return null; - } - List selectedIds = new ArrayList<>(); - for (NotifyDescriptor.QuickPick.Item item : pick.getItems()) { - if (item.isSelected()) { - selectedIds.add(item.getLabel()); - } - } - if (selectedIds.isEmpty()) { - return null; - } - JavaSource js = JavaSource.forFileObject(fo); - if (js == null) { - throw new IOException("Cannot get JavaSource for: " + fo.toURL().toString()); - } - return modify2Edit(js, getTask(offset, repositoryHandles, selectedIds)); - } catch (IOException ex) { - Exceptions.printStackTrace(ex); - } - return null; - })); + endpoints.sort((item1, item2) -> { + return item1.getDescription().compareTo(item2.getDescription()); + }); + Map data = new HashMap<>(); + data.put(URI, cc.getFileObject().toURI().toString()); + data.put(OFFSET, offset); + data.put(REPOSITORIES, repositories.stream().map(repository -> repository.getSimpleName().toString()).collect(Collectors.toList())); + data.put(CONTROLLER_ID, controllerId.get()); + data.put(ENDPOINTS, endpoints); + return Collections.singletonList(new CodeAction(Bundle.DN_GenerateDataEndpoint(), SOURCE, new Command(Bundle.DN_GenerateDataEndpoint(), "nbls.generate.code", Arrays.asList(GENERATE_DATA_ENDPOINT, data)), null)); } } catch (IOException | ParseException ex) { Exceptions.printStackTrace(ex); @@ -161,44 +180,103 @@ public List getCodeActions(Document doc, Range range, Lookup context return Collections.emptyList(); } - private static Task getTask(int offset, List> repositoryHandles, List endpointIds) { + @Override + public Set getCommands() { + return Collections.singleton(GENERATE_DATA_ENDPOINT); + } + + @Override + public CompletableFuture runCommand(String command, List arguments) { + if (arguments.isEmpty()) { + return CompletableFuture.completedFuture(null); + } + JsonObject data = (JsonObject) arguments.get(0); + CompletableFuture future = new CompletableFuture<>(); + RequestProcessor.getDefault().post(() -> { + try { + String uri = data.getAsJsonPrimitive(URI).getAsString(); + FileObject fo = URLMapper.findFileObject(java.net.URI.create(uri).toURL()); + JavaSource js = fo != null ? JavaSource.forFileObject(fo) : null; + if (js == null) { + throw new IOException("Cannot get JavaSource for: " + uri); + } + int offset = data.getAsJsonPrimitive(OFFSET).getAsInt(); + List items = Arrays.asList(gson.fromJson(data.get(ENDPOINTS), NotifyDescriptor.QuickPick.Item[].class)); + NotifyDescriptor.QuickPick pick = new NotifyDescriptor.QuickPick(Bundle.DN_GenerateDataEndpoint(), Bundle.DN_SelectEndpoints(), items, true); + if (DialogDescriptor.OK_OPTION != DialogDisplayer.getDefault().notify(pick)) { + future.complete(null); + } else { + List selected = pick.getItems().stream().filter(item -> item.isSelected()).collect(Collectors.toList()); + if (selected.isEmpty()) { + future.complete(null); + } else { + List repositoryNames = Arrays.asList(gson.fromJson(data.get(REPOSITORIES), String[].class)); + String controllerId = data.getAsJsonPrimitive(CONTROLLER_ID).getAsString(); + future.complete(modify2Edit(js, getTask(offset, repositoryNames, selected, controllerId))); + } + } + } catch (IOException ex) { + future.completeExceptionally(ex); + } + }); + return future; + } + + private static String getMethodSignature(CompilationInfo info, ExecutableElement method, ExecutableType methodType, String id) { + StringBuilder sb = new StringBuilder("("); + Iterator it = method.getParameters().iterator(); + Iterator tIt = methodType.getParameterTypes().iterator(); + while (it.hasNext() && tIt.hasNext()) { + String paramName = it.next().getSimpleName().toString(); + sb.append(Utils.getTypeName(info, tIt.next(), false, !it.hasNext() && method.isVarArgs())); + sb.append(' ').append(paramName); + if (it.hasNext()) { + sb.append(", "); + } + } + return sb.append(')').toString(); + } + + private static Task getTask(int offset, List repositoryNames, List items, String controllerId) { return copy -> { copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); TreePath tp = copy.getTreeUtilities().pathFor(offset); tp = copy.getTreeUtilities().getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, tp); if (tp != null) { ClassTree clazz = (ClassTree) tp.getLeaf(); - List members = new ArrayList<>(); - for (ElementHandle repositoryHandle : repositoryHandles) { - VariableElement repository = repositoryHandle.resolve(copy); - if (repository != null) { - TypeMirror repositoryType = repository.asType(); - if (repositoryType.getKind() == TypeKind.DECLARED) { - TypeElement repositoryTypeElement = (TypeElement) ((DeclaredType) repositoryType).asElement(); - String id = null; - if (repositoryHandles.size() > 1) { - id = '/' + repositoryTypeElement.getSimpleName().toString().toLowerCase(); - if (id.endsWith("repository")) { - id = id.substring(0, id.length() - 10); + TypeElement te = (TypeElement) copy.getTrees().getElement(tp); + if (te != null) { + List fields = ElementFilter.fieldsIn(te.getEnclosedElements()); + List members = new ArrayList<>(); + for (String repositoryName : repositoryNames) { + VariableElement repository = fields.stream().filter(ve -> repositoryName.contentEquals(ve.getSimpleName())).findFirst().orElse(null); + if (repository != null) { + TypeMirror repositoryType = repository.asType(); + if (repositoryType.getKind() == TypeKind.DECLARED) { + TypeElement repositoryTypeElement = (TypeElement) ((DeclaredType) repositoryType).asElement(); + String id = null; + if (repositoryNames.size() > 1) { + id = '/' + repositoryTypeElement.getSimpleName().toString().toLowerCase(); + if (id.endsWith("repository")) { + id = id.substring(0, id.length() - 10); + } } - } - for (String endpointId : endpointIds) { - String delegateMethodName = null; - if (endpointId.equals(id != null ? id + "/ -- GET" : "/ -- GET")) { - delegateMethodName = "findAll"; - } else if (endpointId.equals(id != null ? id + "/{id} -- GET" : "/{id} -- GET")) { - delegateMethodName = "findById"; - } else if (endpointId.equals(id != null ? id + "/{id} -- DELETE" : "/{id} -- DELETE")) { - delegateMethodName = "deleteById"; - } - if (delegateMethodName != null) { - members.add(Utils.createControllerDataEndpointMethod(copy, repositoryTypeElement, repository.getSimpleName().toString(), delegateMethodName, id)); + List repositoryMethods = ElementFilter.methodsIn(copy.getElements().getAllMembers(repositoryTypeElement)); + for (NotifyDescriptor.QuickPick.Item item : items) { + int idx = item.getDescription().indexOf('('); + String name = item.getDescription().substring(0, idx); + String signature = item.getDescription().substring(idx); + for (ExecutableElement method : repositoryMethods) { + if (name.equals(Utils.getControllerDataEndpointMethodName(method.getSimpleName().toString(), id)) && signature.equals(getMethodSignature(copy, method, (ExecutableType) copy.getTypes().asMemberOf((DeclaredType) repositoryType, method), id))) { + members.add(Utils.createControllerDataEndpointMethod(copy, (DeclaredType) repositoryType, repository.getSimpleName().toString(), method, controllerId, id)); + } + } } } } } + copy.rewrite(clazz, GeneratorUtilities.get(copy).insertClassMembers(clazz, members, offset)); } - copy.rewrite(clazz, GeneratorUtilities.get(copy).insertClassMembers(clazz, members, offset)); } }; } @@ -274,24 +352,28 @@ public List create(Lookup context) { if (repositories.isEmpty()) { return Collections.emptyList(); } - List endpoints = new ArrayList<>(); - Utils.collectMissingDataEndpoints(cc, te, null, (repository, delegateMethod, id) -> { - switch (delegateMethod.getSimpleName().toString()) { - case "findAll": - endpoints.add(id != null ? id + "/ -- GET" : "/ -- GET"); - break; - case "findById": - endpoints.add(id != null ? id + "/{id} -- GET" : "/{id} -- GET"); - break; - case "deleteById": - endpoints.add(id != null ? id + "/{id} -- DELETE" : "/{id} -- DELETE"); - break; + AtomicReference controllerId = new AtomicReference<>(); + List endpoints = new ArrayList<>(); + Utils.collectMissingDataEndpoints(cc, te, null, (repository, delegateMethod, cId, id) -> { + controllerId.set(cId); + ExecutableType delegateMethodType = (ExecutableType) cc.getTypes().asMemberOf((DeclaredType) repository.asType(), delegateMethod); + String value = Utils.getControllerDataEndpointAnnotationValue(delegateMethod, delegateMethodType, id); + String delegateMethodName = delegateMethod.getSimpleName().toString(); + String annotationTypeName = Utils.getControllerDataEndpointAnnotationTypeName(delegateMethodName); + if (annotationTypeName != null) { + int idx = annotationTypeName.lastIndexOf('.'); + String label = (value != null ? value : "/") + " -- " + (idx < 0 ? annotationTypeName.toUpperCase() : annotationTypeName.substring(idx + 1).toUpperCase()); + String signature = getMethodSignature(cc, delegateMethod, delegateMethodType, id); + endpoints.add(new NotifyDescriptor.QuickPick.Item(label, Utils.getControllerDataEndpointMethodName(delegateMethodName, id) + signature)); } }); if (!endpoints.isEmpty()) { + endpoints.sort((item1, item2) -> { + return item1.getDescription().compareTo(item2.getDescription()); + }); int offset = comp.getCaretPosition(); FileObject fo = cc.getFileObject(); - List> repositoryHandles = repositories.stream().map(repository -> ElementHandle.create(repository)).collect(Collectors.toList()); + List repositoryNames = repositories.stream().map(repository -> repository.getSimpleName().toString()).collect(Collectors.toList()); ret.add(new CodeGenerator() { @Override public String getDisplayName() { @@ -303,7 +385,7 @@ public void invoke() { EndpointSelectorPanel panel = new EndpointSelectorPanel(endpoints); DialogDescriptor dialogDescriptor = createDialogDescriptor(panel, Bundle.LBL_GenerateDataEndpoint()); panel.addPropertyChangeListener(evt -> { - List selected = panel.getSelectedEndpoints(); + List selected = panel.getSelectedEndpoints(); dialogDescriptor.setValid(selected != null && !selected.isEmpty()); }); Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor); @@ -311,8 +393,8 @@ public void invoke() { if (dialogDescriptor.getValue() != dialogDescriptor.getDefaultValue()) { return; } - List selectedEndpoints = panel.getSelectedEndpoints(); - if (selectedEndpoints.isEmpty()) { + List selected = panel.getSelectedEndpoints(); + if (selected.isEmpty()) { return; } try { @@ -320,8 +402,8 @@ public void invoke() { if (js == null) { throw new IOException("Cannot get JavaSource for: " + fo.toURL().toString()); } - js.runModificationTask(getTask(offset, repositoryHandles, selectedEndpoints)).commit(); - } catch (Exception ex) { + js.runModificationTask(getTask(offset, repositoryNames, selected, controllerId.get())).commit(); + } catch (IOException | IllegalArgumentException ex) { Exceptions.printStackTrace(ex); } } @@ -330,4 +412,4 @@ public void invoke() { return ret; } } -} + } diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Utils.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Utils.java index db1fc6749d55..bead572fb90d 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Utils.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Utils.java @@ -25,15 +25,17 @@ import com.sun.source.tree.TypeParameterTree; import com.sun.source.tree.VariableTree; import java.util.ArrayList; - -import java.util.Arrays; import java.util.Collections; + +import java.util.EnumSet; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.prefs.PreferenceChangeEvent; import java.util.prefs.PreferenceChangeListener; @@ -50,13 +52,16 @@ import javax.lang.model.type.ExecutableType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; +import javax.lang.model.type.TypeVariable; import javax.lang.model.util.ElementFilter; import org.netbeans.api.editor.mimelookup.MimeLookup; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.lexer.JavaTokenId; import org.netbeans.api.java.source.CompilationInfo; +import org.netbeans.api.java.source.GeneratorUtilities; import org.netbeans.api.java.source.TreeMaker; +import org.netbeans.api.java.source.TypeUtilities; import org.netbeans.api.java.source.WorkingCopy; import org.netbeans.api.project.SourceGroup; import org.netbeans.modules.j2ee.core.api.support.java.GenerationUtils; @@ -71,7 +76,14 @@ public final class Utils { private static final String CONTROLLER_ANNOTATION_NAME = "io.micronaut.http.annotation.Controller"; //NOI18N private static final String GET_ANNOTATION_NAME = "io.micronaut.http.annotation.Get"; //NOI18N private static final String DELETE_ANNOTATION_NAME = "io.micronaut.http.annotation.Delete"; //NOI18N + private static final String PUT_ANNOTATION_NAME = "io.micronaut.http.annotation.Put"; //NOI18N + private static final String POST_ANNOTATION_NAME = "io.micronaut.http.annotation.Post"; //NOI18N + private static final String BODY_ANNOTATION_NAME = "io.micronaut.http.annotation.Body"; //NOI18N + private static final String VALID_ANNOTATION_NAME = "jakarta.validation.Valid"; //NOI18N private static final String CRUD_REPOSITORY_TYPE_NAME = "io.micronaut.data.repository.CrudRepository"; //NOI18N + private static final String PAGEABLE_REPOSITORY_TYPE_NAME = "io.micronaut.data.repository.PageableRepository"; //NOI18N + private static final String PAGEABLE_TYPE_NAME = "io.micronaut.data.model.Pageable"; //NOI18N + private static final String HTTP_RESPONSE_TYPE_NAME = "io.micronaut.http.HttpResponse"; //NOI18N private static final String COMPLETION_CASE_SENSITIVE = "completion-case-sensitive"; //NOI18N private static final boolean COMPLETION_CASE_SENSITIVE_DEFAULT = true; private static final String JAVA_COMPLETION_SUBWORDS = "javaCompletionSubwords"; //NOI18N @@ -98,7 +110,7 @@ public void preferenceChange(PreferenceChangeEvent evt) { private static Pattern cachedSubwordsPattern = null; public static List collectMissingDataEndpoints(CompilationInfo info, TypeElement te, String prefix, DataEndpointConsumer consumer) { - AnnotationMirror controllerAnn = Utils.getAnnotation(te.getAnnotationMirrors(), CONTROLLER_ANNOTATION_NAME); + AnnotationMirror controllerAnn = getAnnotation(te.getAnnotationMirrors(), CONTROLLER_ANNOTATION_NAME); if (controllerAnn == null) { return Collections.emptyList(); } @@ -114,6 +126,8 @@ public static List collectMissingDataEndpoints(CompilationInfo for (VariableElement repository : repositories) { TypeMirror repositoryType = repository.asType(); if (repositoryType.getKind() == TypeKind.DECLARED) { + TypeMirror pageableRepositoryType = info.getTypes().erasure(info.getElements().getTypeElement(PAGEABLE_REPOSITORY_TYPE_NAME).asType()); + boolean isPageableRepository = info.getTypes().isSubtype(info.getTypes().erasure(repositoryType), pageableRepositoryType); TypeElement repositoryTypeElement = (TypeElement) ((DeclaredType) repositoryType).asElement(); String id = null; if (repositories.size() > 1) { @@ -125,37 +139,35 @@ public static List collectMissingDataEndpoints(CompilationInfo continue; } } - List repositoryMethods = ElementFilter.methodsIn(info.getElements().getAllMembers(repositoryTypeElement)); - String listMethodName = getEndpointMethodName("findAll", id); //NOI18N - if (Utils.startsWith(listMethodName, prefix) && Utils.getAnnotatedMethod(methods, listMethodName, GET_ANNOTATION_NAME, id) == null) { - ExecutableElement delegateMethod = null; - for (ExecutableElement method : repositoryMethods.stream().filter(el -> "findAll".contentEquals(el.getSimpleName())).collect(Collectors.toList())) { //NOI18N - List params = method.getParameters(); - if (delegateMethod == null && params.isEmpty()) { - delegateMethod = method; - } else if (params.size() == 1) { - TypeMirror paramType = params.get(0).asType(); - if (paramType.getKind() == TypeKind.DECLARED && "io.micronaut.data.model.Pageable".contentEquals(((TypeElement) ((DeclaredType) paramType).asElement()).getQualifiedName())) { //NOI18N - delegateMethod = method; - } + List repositoryMethods = ElementFilter.methodsIn(info.getElements().getAllMembers(repositoryTypeElement)).stream().filter(method -> { + String methodName = method.getSimpleName().toString(); + if ("findAll".equals(methodName)) { //NOI18N + if (isPageableRepository) { + TypeMirror paramType = method.getParameters().size() == 1 ? method.getParameters().get(0).asType() : null; + return paramType != null && paramType.getKind() == TypeKind.DECLARED && PAGEABLE_TYPE_NAME.contentEquals(((TypeElement) ((DeclaredType) paramType).asElement()).getQualifiedName()); } + return method.getParameters().isEmpty(); } - if (delegateMethod != null) { - consumer.accept(repository, delegateMethod, id); + if (methodName.endsWith("All")) { //NOI18N + return false; } - } - String getMethodName = getEndpointMethodName("findById", id); //NOI18N - if (Utils.startsWith(getMethodName, prefix) && Utils.getAnnotatedMethod(methods, getMethodName, GET_ANNOTATION_NAME, id != null ? id + "/{id}" : "/{id}") == null) { //NOI18N - Optional method = repositoryMethods.stream().filter(el -> "findById".contentEquals(el.getSimpleName()) && el.getParameters().size() == 1).findAny(); //NOI18N - if (method.isPresent()) { - consumer.accept(repository, method.get(), id); + if (methodName.startsWith("find")) { //NOI18N + return true; } - } - String deleteMethodName = getEndpointMethodName("deleteById", id); //NOI18N - if (Utils.startsWith(deleteMethodName, prefix) && Utils.getAnnotatedMethod(methods, deleteMethodName, DELETE_ANNOTATION_NAME, id != null ? id + "/{id}" : "/{id}") == null) { //NOI18N - Optional method = repositoryMethods.stream().filter(el -> "deleteById".contentEquals(el.getSimpleName()) && el.getParameters().size() == 1).findAny(); //NOI18N - if (method.isPresent()) { - consumer.accept(repository, method.get(), id); + if (methodName.startsWith("delete")) { //NOI18N + return true; + } + if (methodName.startsWith("save")) { //NOI18N + return true; + } + if (methodName.startsWith("update")) { //NOI18N + return true; + } + return false; + }).collect(Collectors.toList()); + for (ExecutableElement repositoryMethod : repositoryMethods) { + if (getEndpointMethodFor(info, methods, (DeclaredType) repository.asType(), repositoryMethod, id) == null) { + consumer.accept(repository, repositoryMethod, controllerId, id); } } } @@ -168,27 +180,6 @@ public static AnnotationMirror getAnnotation(List an return getAnnotation(annotations, annotationName, new HashSet<>()); } - public static ExecutableElement getAnnotatedMethod(List methods, String methodName, String annotationName, String value) { - for (ExecutableElement method : methods) { - if (startsWith(method.getSimpleName().toString(), methodName)) { - AnnotationMirror annotation = getAnnotation(method.getAnnotationMirrors(), annotationName, new HashSet<>()); - if (annotation != null) { - Map elementValues = annotation.getElementValues(); - Object val = null; - for (Map.Entry entry : elementValues.entrySet()) { - if ("value".contentEquals(entry.getKey().getSimpleName())) { //NOI18N - val = entry.getValue().getValue(); - } - } - if (Objects.equals(value, val)) { - return method; - } - } - } - } - return null; - } - public static List getRepositoriesFor(CompilationInfo info, TypeElement te) { List repositories = new ArrayList<>(); TypeMirror tm = info.getTypes().erasure(info.getElements().getTypeElement(CRUD_REPOSITORY_TYPE_NAME).asType()); @@ -200,46 +191,53 @@ public static List getRepositoriesFor(CompilationInfo info, Typ return repositories; } - public static MethodTree createControllerDataEndpointMethod(WorkingCopy copy, TypeElement repositoryTypeElement, String repositoryFieldName, String delegateMethodName, String idProefix) { + public static MethodTree createControllerFindAllDataEndpointMethod(WorkingCopy copy, TypeElement repositoryTypeElement, String repositoryFieldName, String controllerId, String idProefix) { TypeMirror repositoryType = repositoryTypeElement.asType(); if (repositoryType.getKind() == TypeKind.DECLARED) { - List repositoryMethods = ElementFilter.methodsIn(copy.getElements().getAllMembers(repositoryTypeElement)); - ExecutableElement delegateMethod = null; - if ("findAll".equals(delegateMethodName)) { //NOI18N - for (ExecutableElement method : repositoryMethods.stream().filter(el -> delegateMethodName.contentEquals(el.getSimpleName())).collect(Collectors.toList())) { - List params = method.getParameters(); - if (delegateMethod == null && params.isEmpty()) { - delegateMethod = method; - } else if (params.size() == 1) { - TypeMirror paramType = params.get(0).asType(); - if (paramType.getKind() == TypeKind.DECLARED && "io.micronaut.data.model.Pageable".contentEquals(((TypeElement) ((DeclaredType) paramType).asElement()).getQualifiedName())) { //NOI18N - delegateMethod = method; - } - } + TypeMirror pageableRepositoryType = copy.getTypes().erasure(copy.getElements().getTypeElement(PAGEABLE_REPOSITORY_TYPE_NAME).asType()); + boolean isPageableRepository = copy.getTypes().isSubtype(copy.getTypes().erasure(repositoryType), pageableRepositoryType); + ExecutableElement delegateMethod = ElementFilter.methodsIn(copy.getElements().getAllMembers(repositoryTypeElement)).stream().filter(method -> { + if (!"findAll".contentEquals(method.getSimpleName())) { //NOI18N + return false; } - } else { - delegateMethod = repositoryMethods.stream().filter(method -> delegateMethodName.contentEquals(method.getSimpleName()) && method.getParameters().size() == 1).findAny().orElse(null); - } + if (isPageableRepository) { + TypeMirror paramType = method.getParameters().size() == 1 ? method.getParameters().get(0).asType() : null; + return paramType != null && paramType.getKind() == TypeKind.DECLARED && PAGEABLE_TYPE_NAME.contentEquals(((TypeElement) ((DeclaredType) paramType).asElement()).getQualifiedName()); + } + return method.getParameters().isEmpty(); + }).findFirst().orElse(null); if (delegateMethod != null) { - return createControllerDataEndpointMethod(copy, (DeclaredType) repositoryType, repositoryFieldName, delegateMethod, idProefix); + return createControllerDataEndpointMethod(copy, (DeclaredType) repositoryType, repositoryFieldName, delegateMethod, controllerId, idProefix); } } return null; } - public static MethodTree createControllerDataEndpointMethod(WorkingCopy copy, DeclaredType repositoryType, String repositoryFieldName, ExecutableElement delegateMethod, String idPrefix) { - switch (delegateMethod.getSimpleName().toString()) { - case "findAll": //NOI18N - return createControllerListMethod(copy, repositoryType, repositoryFieldName, delegateMethod, idPrefix); - case "findById": //NOI18N - return createControllerGetMethod(copy, repositoryType, repositoryFieldName, delegateMethod, idPrefix); - case "deleteById": //NOI18N - return createControllerDeleteMethod(copy, repositoryType, repositoryFieldName, delegateMethod, idPrefix); + public static MethodTree createControllerDataEndpointMethod(WorkingCopy copy, DeclaredType repositoryType, String repositoryFieldName, ExecutableElement delegateMethod, String controllerId, String idPrefix) { + TreeMaker tm = copy.getTreeMaker(); + GenerationUtils gu = GenerationUtils.newInstance(copy); + ExecutableType delegateMethodType = (ExecutableType) copy.getTypes().asMemberOf(repositoryType, delegateMethod); + String delegateMethodName = delegateMethod.getSimpleName().toString(); + List annotations = new ArrayList<>(); + String annotationTypeName = getControllerDataEndpointAnnotationTypeName(delegateMethodName); + String value = getControllerDataEndpointAnnotationValue(delegateMethod, delegateMethodType, idPrefix); + annotations.add(value != null ? gu.createAnnotation(annotationTypeName, List.of(tm.Literal(value))) : gu.createAnnotation(annotationTypeName)); + if (DELETE_ANNOTATION_NAME.equals(annotationTypeName)) { + annotations.add(gu.createAnnotation("io.micronaut.http.annotation.Status", List.of(tm.MemberSelect(tm.QualIdent("io.micronaut.http.HttpStatus"), "NO_CONTENT")))); //NOI18N + }; + ModifiersTree mods = tm.Modifiers(Set.of(Modifier.PUBLIC), annotations); + String methodName = getControllerDataEndpointMethodName(delegateMethodName, idPrefix); + TypeMirror returnType = getControllerDataEndpointReturnType(copy, delegateMethodName, delegateMethodType); + List typeParams = new ArrayList<>(); + for (TypeVariable tv : delegateMethodType.getTypeVariables()) { + typeParams.add(tm.TypeParameter(tv.asElement().getSimpleName(), List.of((ExpressionTree) tm.Type(tv.getUpperBound())))); } - return null; + List params = getControllerDataEndpointParams(copy, delegateMethod, delegateMethodType); + String body = getControllerDataEndpointBody(copy, repositoryFieldName, delegateMethod, delegateMethodType, controllerId, idPrefix); + return tm.Method(mods, methodName, tm.Type(returnType), typeParams, params, List.of(), body, null); } - public static String getEndpointMethodName(String delegateMethodName, String postfix) { + public static String getControllerDataEndpointMethodName(String delegateMethodName, String postfix) { String name; switch (delegateMethodName) { case "findAll": //NOI18N @@ -265,6 +263,66 @@ public static String getEndpointMethodName(String delegateMethodName, String pos return name; } + public static TypeMirror getControllerDataEndpointReturnType(CompilationInfo info, String delegateMethodName, ExecutableType type) { + TypeMirror returnType = type.getReturnType(); + if (delegateMethodName.startsWith("update")) { //NOI18N + returnType = info.getTypes().getDeclaredType(info.getElements().getTypeElement(HTTP_RESPONSE_TYPE_NAME)); + } else if (delegateMethodName.startsWith("save")) { //NOI18N + returnType = info.getTypes().getDeclaredType(info.getElements().getTypeElement(HTTP_RESPONSE_TYPE_NAME), returnType); + } else if ("findAll".equals(delegateMethodName) && !type.getParameterTypes().isEmpty() && returnType.getKind() == TypeKind.DECLARED) { //NOI18N + TypeElement te = (TypeElement) ((DeclaredType) returnType).asElement(); + Optional getContentMethod = ElementFilter.methodsIn(info.getElements().getAllMembers(te)).stream().filter(m -> "getContent".contentEquals(m.getSimpleName()) && m.getParameters().isEmpty()).findAny(); //NOI18N + if (getContentMethod.isPresent()) { + returnType = ((ExecutableType) info.getTypes().asMemberOf((DeclaredType) returnType, getContentMethod.get())).getReturnType(); + } + } + return returnType; + } + + public static String getControllerDataEndpointAnnotationTypeName(String delegateMethodName) { + if (delegateMethodName.startsWith("find")) { //NOI18N + return GET_ANNOTATION_NAME; + } + if (delegateMethodName.startsWith("delete")) { //NOI18N + return DELETE_ANNOTATION_NAME; + } + if (delegateMethodName.startsWith("save")) { //NOI18N + return POST_ANNOTATION_NAME; + } + if (delegateMethodName.startsWith("update")) { //NOI18N + return PUT_ANNOTATION_NAME; + } + return null; + } + + public static String getControllerDataEndpointAnnotationValue(ExecutableElement delegateMethod, ExecutableType delegateMethodType, String idPrefix) { + String delegateMethodName = delegateMethod.getSimpleName().toString(); + if (delegateMethodName.endsWith("ById") && !delegateMethod.getParameters().isEmpty()) { //NOI18N + String id = delegateMethod.getParameters().get(0).getSimpleName().toString(); + return idPrefix != null ? idPrefix + "/{" + id + "}" : "/{" + id + "}"; //NOI18N + } + if (delegateMethodName.startsWith("update")) { //NOI18N + VariableElement idElement = getIdElement(delegateMethod.getParameters()); + if (idElement != null) { + String id = idElement.getSimpleName().toString(); + return idPrefix != null ? idPrefix + "/{" + id + "}" : "/{" + id + "}"; //NOI18N + } + } + return idPrefix; + } + + public static List getRelevantAnnotations(VariableElement variableElement) { + List annotations = new ArrayList<>(); + for (AnnotationMirror am : variableElement.getAnnotationMirrors()) { + TypeElement te = (TypeElement) am.getAnnotationType().asElement(); + String fqn = te.getQualifiedName().toString(); + if (fqn.equals("io.micronaut.data.annotation.Id") || fqn.startsWith("jakarta.validation.constraints.")) { //NOI18N + annotations.add(te); + } + } + return annotations; + } + public static boolean isJPASupported(SourceGroup sg) { return resolveClassName(sg, "io.micronaut.data.jpa.repository.JpaRepository"); //NOI18N } @@ -280,6 +338,125 @@ public static boolean startsWith(String theString, String prefix) { : startsWithPlain(theString, prefix); } + public static CharSequence getTypeName(CompilationInfo info, TypeMirror type, boolean fqn, boolean varArg) { + Set options = EnumSet.noneOf(TypeUtilities.TypeNameOptions.class); + if (fqn) { + options.add(TypeUtilities.TypeNameOptions.PRINT_FQN); + } + if (varArg) { + options.add(TypeUtilities.TypeNameOptions.PRINT_AS_VARARG); + } + return info.getTypeUtilities().getTypeName(type, options.toArray(new TypeUtilities.TypeNameOptions[0])); + } + + private static ExecutableElement getEndpointMethodFor(CompilationInfo info, List methods, DeclaredType repositoryType, ExecutableElement delegateMethod, String id) { + String delegateMethodName = delegateMethod.getSimpleName().toString(); + String annotationName = getControllerDataEndpointAnnotationTypeName(delegateMethodName); + if (annotationName != null) { + String methodName = getControllerDataEndpointMethodName(delegateMethodName, id); + ExecutableType delegateMethodType = (ExecutableType) info.getTypes().asMemberOf(repositoryType, delegateMethod); + String value = getControllerDataEndpointAnnotationValue(delegateMethod, delegateMethodType, id); + for (ExecutableElement method : methods) { + if (methodName.contentEquals(method.getSimpleName())) { + AnnotationMirror annotation = getAnnotation(method.getAnnotationMirrors(), annotationName, new HashSet<>()); + if (annotation != null) { + Map elementValues = annotation.getElementValues(); + Object val = null; + for (Map.Entry entry : elementValues.entrySet()) { + if ("value".contentEquals(entry.getKey().getSimpleName())) { //NOI18N + val = entry.getValue().getValue(); + } + } + if (Objects.equals(value, val)) { + return method; + } + } + } + } + } + return null; + } + + private static VariableElement getIdElement(List elements) { + for (VariableElement element : elements) { + for (AnnotationMirror annotation : element.getAnnotationMirrors()) { + TypeElement annotationElement = (TypeElement) annotation.getAnnotationType().asElement(); + if ("io.micronaut.data.annotation.Id".contentEquals(annotationElement.getQualifiedName()) || "javax.persistence.Id".contentEquals(annotationElement.getQualifiedName())) { //NOI18N + return element; + } + } + } + return null; + } + + private static List getControllerDataEndpointParams(WorkingCopy copy, ExecutableElement delegateMethod, ExecutableType type) { + TreeMaker tm = copy.getTreeMaker(); + GenerationUtils gu = GenerationUtils.newInstance(copy); + List params = new ArrayList<>(); + String delegateMethodName = delegateMethod.getSimpleName().toString(); + VariableElement idElem = getIdElement(delegateMethod.getParameters()); + if (idElem == null && delegateMethodName.endsWith("ById") && !delegateMethod.getParameters().isEmpty()) { //NOI18N + idElem = delegateMethod.getParameters().get(0); + } + Iterator it = delegateMethod.getParameters().iterator(); + Iterator tIt = type.getParameterTypes().iterator(); + while (it.hasNext() && tIt.hasNext()) { + VariableElement param = it.next(); + TypeMirror paramType = tIt.next(); + List annotations = new ArrayList<>(); + if ("findAll".equals(delegateMethodName)) { //NOI18N + annotations.add(gu.createAnnotation(VALID_ANNOTATION_NAME)); + } else if (idElem == null) { + annotations.add(gu.createAnnotation(BODY_ANNOTATION_NAME)); + annotations.add(gu.createAnnotation(VALID_ANNOTATION_NAME)); + } else if (idElem != param) { + annotations.add(gu.createAnnotation(BODY_ANNOTATION_NAME, List.of(tm.Literal(param.getSimpleName().toString())))); + for (AnnotationMirror am : param.getAnnotationMirrors()) { + annotations.add(gu.createAnnotation(((TypeElement) am.getAnnotationType().asElement()).getQualifiedName().toString())); + } + } + params.add(tm.Variable(tm.Modifiers(0, annotations), param.getSimpleName(), tm.Type(paramType), null)); + } + return params; + } + + private static String getControllerDataEndpointBody(WorkingCopy copy, String repositoryFieldName, ExecutableElement delegateMethod, ExecutableType delegateMethodType, String controllerId, String idPrefix) { + String delegateMethodName = delegateMethod.getSimpleName().toString(); + StringBuilder delegateMethodCall = new StringBuilder(); + delegateMethodCall.append(repositoryFieldName).append('.').append(delegateMethodName).append('('); + for (Iterator it = delegateMethod.getParameters().iterator(); it.hasNext();) { + VariableElement param = it.next(); + delegateMethodCall.append(param.getSimpleName()); + if (it.hasNext()) { + delegateMethodCall.append(','); + } + } + delegateMethodCall.append(')'); + if (delegateMethodName.equals("findAll") && !delegateMethod.getParameters().isEmpty()) { //NOI18N + return "{return " + delegateMethodCall.toString() + ".getContent();}"; //NOI18N + } + if (delegateMethodName.startsWith("find")) { //NOI18N + return "{return " + delegateMethodCall.toString() + ";}"; //NOI18N + } + if (delegateMethodName.startsWith("delete")) { //NOI18N + return "{" + delegateMethodCall.toString() + ";}"; //NOI18N + } + if (delegateMethodName.startsWith("save")) { //NOI18N + copy.rewrite(copy.getCompilationUnit(), GeneratorUtilities.get(copy).addImports(copy.getCompilationUnit(), Set.of(copy.getElements().getTypeElement("java.net.URI")))); //NOI18N + String idUri = getIdUri(delegateMethod, delegateMethodType, controllerId, idPrefix); + CharSequence typeName = getTypeName(copy, delegateMethodType.getReturnType(), false, false); + StringBuilder sb = new StringBuilder(typeName); + sb.setCharAt(0, Character.toLowerCase(sb.charAt(0))); + return "{" + typeName + " " + sb.toString() + " = " + delegateMethodCall.toString() + "return HttpResponse.created(" + sb.toString() + ").headers(headers -> headers.location(" + idUri + "));}"; //NOI18N + } + if (delegateMethodName.startsWith("update")) { //NOI18N + copy.rewrite(copy.getCompilationUnit(), GeneratorUtilities.get(copy).addImports(copy.getCompilationUnit(), Set.of(copy.getElements().getTypeElement("java.net.URI"), copy.getElements().getTypeElement("io.micronaut.http.HttpHeaders")))); //NOI18N + String idUri = getIdUri(delegateMethod, delegateMethodType, controllerId, idPrefix); + return "{" + delegateMethodCall.toString() + ";return HttpResponse.noContent().header(HttpHeaders.LOCATION, " + idUri+ ".getPath());}"; //NOI18N + } + return "{}"; //NOI18N + } + private static AnnotationMirror getAnnotation(List annotations, String annotationName, HashSet checked) { for (AnnotationMirror annotation : annotations) { TypeElement annotationElement = (TypeElement) annotation.getAnnotationType().asElement(); @@ -296,48 +473,48 @@ private static AnnotationMirror getAnnotation(List a return null; } - private static MethodTree createControllerGetMethod(WorkingCopy copy, DeclaredType repositoryType, String repositoryFieldName, ExecutableElement delegateMethod, String idPrefix) { - TreeMaker tm = copy.getTreeMaker(); - GenerationUtils gu = GenerationUtils.newInstance(copy); - ModifiersTree mods = tm.Modifiers(Collections.singleton(Modifier.PUBLIC), Collections.singletonList(gu.createAnnotation("io.micronaut.http.annotation.Get", Collections.singletonList(tm.Literal(idPrefix != null ? idPrefix + "/{id}" : "/{id}"))))); //NOI18N - ExecutableType type = (ExecutableType) copy.getTypes().asMemberOf(repositoryType, delegateMethod); - VariableTree param = tm.Variable(tm.Modifiers(Collections.emptySet()), "id", tm.Type(type.getParameterTypes().get(0)), null); //NOI18N - return tm.Method(mods, getEndpointMethodName(delegateMethod.getSimpleName().toString(), idPrefix), tm.Type(type.getReturnType()), Collections.emptyList(), Collections.singletonList(param), Collections.emptyList(), "{return " + repositoryFieldName + "." + delegateMethod.getSimpleName() + "(id);}", null); //NOI18N - } - - private static MethodTree createControllerDeleteMethod(WorkingCopy copy, DeclaredType repositoryType, String repositoryFieldName, ExecutableElement delegateMethod, String idPrefix) { - TreeMaker tm = copy.getTreeMaker(); - GenerationUtils gu = GenerationUtils.newInstance(copy); - ModifiersTree mods = tm.Modifiers(Collections.singleton(Modifier.PUBLIC), Arrays.asList(new AnnotationTree[] { - gu.createAnnotation("io.micronaut.http.annotation.Delete", Collections.singletonList(tm.Literal(idPrefix != null ? idPrefix + "/{id}" : "/{id}"))), //NOI18N - gu.createAnnotation("io.micronaut.http.annotation.Status", Collections.singletonList(tm.MemberSelect(tm.QualIdent("io.micronaut.http.HttpStatus"), "NO_CONTENT"))) //NOI18N - })); - ExecutableType type = (ExecutableType) copy.getTypes().asMemberOf(repositoryType, delegateMethod); - VariableTree param = tm.Variable(tm.Modifiers(Collections.emptySet()), "id", tm.Type(type.getParameterTypes().get(0)), null); //NOI18N - return tm.Method(mods, getEndpointMethodName(delegateMethod.getSimpleName().toString(), idPrefix), tm.Type(type.getReturnType()), Collections.emptyList(), Collections.singletonList(param), Collections.emptyList(), "{" + repositoryFieldName + "." + delegateMethod.getSimpleName() + "(id);}", null); //NOI18N - } - - private static MethodTree createControllerListMethod(WorkingCopy copy, DeclaredType repositoryType, String repositoryFieldName, ExecutableElement delegateMethod, String idPrefix) { - TreeMaker tm = copy.getTreeMaker(); - GenerationUtils gu = GenerationUtils.newInstance(copy); - ModifiersTree mods = tm.Modifiers(Collections.singleton(Modifier.PUBLIC), Collections.singletonList(gu.createAnnotation("io.micronaut.http.annotation.Get", idPrefix != null ? Collections.singletonList(tm.Literal(idPrefix)) : Collections.emptyList()))); //NOI18N - if (delegateMethod.getParameters().isEmpty()) { - TypeMirror returnType = ((ExecutableType) copy.getTypes().asMemberOf(repositoryType, delegateMethod)).getReturnType(); - return tm.Method(mods, getEndpointMethodName(delegateMethod.getSimpleName().toString(), idPrefix), tm.Type(returnType), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), "{return " + repositoryFieldName + "." + delegateMethod.getSimpleName() + "();}", null); //NOI18N + private static String getIdUri(ExecutableElement delegateMethod, ExecutableType delegateMethodType, String controllerId, String idPrefix) { + StringBuilder idGet = new StringBuilder(); + VariableElement idElem = getIdElement(delegateMethod.getParameters()); + if (idElem != null) { + idGet.append(idElem.getSimpleName()); } else { - ExecutableType type = (ExecutableType) copy.getTypes().asMemberOf(repositoryType, delegateMethod); - VariableTree param = tm.Variable(tm.Modifiers(0, Collections.singletonList(gu.createAnnotation("jakarta.validation.Valid"))), "pageable", tm.Type(type.getParameterTypes().get(0)), null); //NOI18N - TypeMirror returnType = type.getReturnType(); - if (returnType.getKind() == TypeKind.DECLARED) { - TypeElement te = (TypeElement) ((DeclaredType) returnType).asElement(); - Optional getContentMethod = ElementFilter.methodsIn(copy.getElements().getAllMembers(te)).stream().filter(m -> "getContent".contentEquals(m.getSimpleName()) && m.getParameters().isEmpty()).findAny(); - if (getContentMethod.isPresent()) { - returnType = ((ExecutableType) copy.getTypes().asMemberOf((DeclaredType) returnType, getContentMethod.get())).getReturnType(); - return tm.Method(mods, getEndpointMethodName(delegateMethod.getSimpleName().toString(), idPrefix), tm.Type(returnType), Collections.emptyList(), Collections.singletonList(param), Collections.emptyList(), "{return " + repositoryFieldName + "." + delegateMethod.getSimpleName() + "(pageable).getContent();}", null); //NOI18N + Iterator it = delegateMethod.getParameters().iterator(); + Iterator tIt = delegateMethodType.getParameterTypes().iterator(); + if (it.hasNext() && tIt.hasNext()) { + DeclaredType entityType = null; + TypeMirror tm = tIt.next(); + if (tm.getKind() == TypeKind.TYPEVAR) { + TypeMirror upperBound = ((TypeVariable) tm).getUpperBound(); + if (upperBound.getKind() == TypeKind.DECLARED) { + entityType = (DeclaredType) upperBound; + } + } else if (tm.getKind() == TypeKind.DECLARED) { + entityType = (DeclaredType) tm; + } + if (entityType != null) { + VariableElement idField = getIdElement(ElementFilter.fieldsIn(entityType.asElement().getEnclosedElements())); + if (idField != null) { + StringBuilder getter = new StringBuilder(idField.getSimpleName()); + getter.setCharAt(0, Character.toUpperCase(getter.charAt(0))); + getter.insert(0, "get").append("()"); //NOI18N + idGet.append(it.next().getSimpleName()).append('.').append(getter.toString()); + } } } } - return null; + StringBuilder sb = new StringBuilder("URI.create(\""); //NOI18N + if (controllerId != null) { + sb.append(controllerId); + } + if (idPrefix != null) { + sb.append(idPrefix); + } + sb.append("/\""); //NOI18N + if (idGet.length() > 0) { + sb.append(" + ").append(idGet); //NOI18N + } + return sb.append(')').toString(); } private static boolean isCamelCasePrefix(String prefix) { @@ -464,6 +641,6 @@ private static boolean resolveClassName(SourceGroup sg, String fqn) { @FunctionalInterface public static interface DataEndpointConsumer { - public void accept(VariableElement repository, ExecutableElement delegateMethod, String id); + public void accept(VariableElement repository, ExecutableElement delegateMethod, String controllerId, String id); } } diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/EvaluationContext.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/EvaluationContext.java index d9f659f618b6..17872cb31a9b 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/EvaluationContext.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/EvaluationContext.java @@ -107,15 +107,19 @@ public Scope getScope() { return scope; } - public List getContextMethods() { + public List getContextElements() { if (contextClasses == null) { initializeContextClasses(); } - List methods = new ArrayList<>(); + List elements = new ArrayList<>(); for (TypeElement contextClass : contextClasses) { - methods.addAll(ElementFilter.methodsIn(contextClass.getEnclosedElements())); + elements.addAll(ElementFilter.methodsIn(contextClass.getEnclosedElements())); } - return methods; + ExecutableElement enclosingMethod = scope.getEnclosingMethod(); + if (enclosingMethod != null && !enclosingMethod.getParameters().isEmpty()) { + elements.addAll(enclosingMethod.getParameters()); + } + return elements; } private void initializeContextClasses() { diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/ExpressionTree.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/ExpressionTree.java index 6e62b91f2126..da4b2db6eb48 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/ExpressionTree.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/ExpressionTree.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.stream.Collectors; import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; @@ -564,20 +565,20 @@ public R accept(Scanner scanner, D data) { @Override protected void resolve(EvaluationContext ctx) { - List methods = null; + List elements = null; DeclaredType dt = null; if (callee == null) { - methods = ctx.getContextMethods(); + elements = ctx.getContextElements(); } else { TypeMirror calleeTM = callee.getTypeMirror(ctx); if (calleeTM.getKind() == TypeKind.DECLARED) { dt = (DeclaredType) calleeTM; - methods = ElementFilter.methodsIn(((TypeElement) dt.asElement()).getEnclosedElements()); + elements = ((TypeElement) dt.asElement()).getEnclosedElements(); } } - if (methods != null && !methods.isEmpty()) { + if (elements != null && !elements.isEmpty()) { List argTypes = arguments.stream().map(arg -> arg.getTypeMirror(ctx)).collect(Collectors.toList()); - for (ExecutableElement ee : methods) { + for (ExecutableElement ee : ElementFilter.methodsIn(elements)) { TypeMirror enclType = dt != null ? dt : ee.getEnclosingElement().asType(); if (enclType.getKind() == TypeKind.DECLARED && identifier.contentEquals(ee.getSimpleName()) && ctx.getTrees().isAccessible(ctx.getScope(), ee, (DeclaredType) enclType)) { ExecutableType et = (ExecutableType) ctx.getTypes().asMemberOf((DeclaredType) enclType, ee); @@ -656,25 +657,40 @@ public R accept(Scanner scanner, D data) { @Override protected void resolve(EvaluationContext ctx) { - List methods = null; + List elements = null; DeclaredType dt = null; if (callee == null) { - methods = ctx.getContextMethods(); + elements = ctx.getContextElements(); } else { TypeMirror calleeTM = callee.getTypeMirror(ctx); if (calleeTM.getKind() == TypeKind.DECLARED) { dt = (DeclaredType) calleeTM; - methods = ElementFilter.methodsIn(((TypeElement) dt.asElement()).getEnclosedElements()); + elements = ((TypeElement) dt.asElement()).getEnclosedElements(); } } - if (methods != null && !methods.isEmpty()) { - for (ExecutableElement ee : methods) { - TypeMirror enclType = dt != null ? dt : ee.getEnclosingElement().asType(); - if (enclType.getKind() == TypeKind.DECLARED && identifier.equals(getPropertyName(ee)) && ctx.getTrees().isAccessible(ctx.getScope(), ee, (DeclaredType) enclType)) { - ExecutableType et = (ExecutableType) ctx.getTypes().asMemberOf((DeclaredType) enclType, ee); - element = ee; - typeMirror = et.getReturnType(); - return; + if (elements != null && !elements.isEmpty()) { + for (Element e : elements) { + if (e.getKind() == ElementKind.METHOD) { + TypeMirror enclType = dt != null ? dt : e.getEnclosingElement().asType(); + if (enclType.getKind() == TypeKind.DECLARED && identifier.equals(getPropertyName((ExecutableElement) e)) && ctx.getTrees().isAccessible(ctx.getScope(), e, (DeclaredType) enclType)) { + ExecutableType et = (ExecutableType) ctx.getTypes().asMemberOf((DeclaredType) enclType, e); + element = e; + typeMirror = et.getReturnType(); + return; + } + } else if (e.getKind() == ElementKind.RECORD_COMPONENT) { + TypeMirror enclType = dt != null ? dt : e.getEnclosingElement().asType(); + if (enclType.getKind() == TypeKind.DECLARED && identifier.contentEquals(e.getSimpleName()) && ctx.getTrees().isAccessible(ctx.getScope(), e, (DeclaredType) enclType)) { + element = e; + typeMirror = e.asType(); + return; + } + } else if (e.getKind() == ElementKind.PARAMETER) { + if (identifier.contentEquals(e.getSimpleName())) { + element = e; + typeMirror = e.asType(); + return; + } } } } diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/MicronautExpressionLanguageParser.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/MicronautExpressionLanguageParser.java index 85cd2df30434..519a84748d21 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/MicronautExpressionLanguageParser.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/MicronautExpressionLanguageParser.java @@ -182,9 +182,9 @@ private ExpressionTree relationalExpression() { /** * AdditiveExpression - * : PowExpression - * | AdditiveExpression '+' PowExpression - * | AdditiveExpression '-' PowExpression + * : MultiplicativeExpression + * | AdditiveExpression '+' MultiplicativeExpression + * | AdditiveExpression '-' MultiplicativeExpression * ; */ private ExpressionTree additiveExpression() { diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/Controller.html b/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/Controller.html index 07df97765d2e..8a890b1ae605 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/Controller.html +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/Controller.html @@ -24,7 +24,5 @@ -Creates Micronaut Controller classes with default GET endpoints based on -existing data repository interfaces or plain. This template creates a controller -class for each selected repository interface. +Creates a Micronaut Controller class with a default plain text GET endpoint. diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/ControllerFromRepository.html b/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/ControllerFromRepository.html new file mode 100644 index 000000000000..5bcb0388906a --- /dev/null +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/ControllerFromRepository.html @@ -0,0 +1,30 @@ + + + + + + + +Creates Micronaut Controller classes with default GET endpoints based on +existing data repository interfaces. This template creates a controller +class for each selected repository interface. + diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/helidon-actions-maven.xml b/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/helidon-actions-maven.xml new file mode 100644 index 000000000000..401201f546ba --- /dev/null +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/helidon-actions-maven.xml @@ -0,0 +1,33 @@ + + + + + + native-build + + * + + + compile + + + native-image + native:compile + + + diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/layer.xml b/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/layer.xml index d072a87350b8..8c556364e888 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/layer.xml +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/resources/layer.xml @@ -119,6 +119,21 @@ + + + + + + + + + + + + + + + @@ -138,18 +153,8 @@ - - - - - - - - - - - + @@ -159,7 +164,7 @@ - + @@ -168,6 +173,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautStructureProvider.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautStructureProvider.java index 5f5d324652f4..909f1cf29303 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautStructureProvider.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautStructureProvider.java @@ -48,7 +48,7 @@ public List getStructure(Document doc) { List elements = new ArrayList<>(); js.runUserActionTask(cc -> { cc.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); - for (MicronautSymbolFinder.SymbolLocation symbolLocation : MicronautSymbolFinder.scan(cc)) { + for (MicronautSymbolFinder.SymbolLocation symbolLocation : MicronautSymbolFinder.scan(cc, false)) { elements.add(StructureProvider.newBuilder(symbolLocation.getName(), StructureElement.Kind.Interface) .file(cc.getFileObject()) .expandedStartOffset(symbolLocation.getStart()) diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolErrorProvider.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolErrorProvider.java new file mode 100644 index 000000000000..9a6576c1e2c8 --- /dev/null +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolErrorProvider.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.modules.micronaut.symbol; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import org.netbeans.api.editor.mimelookup.MimeRegistration; +import org.netbeans.api.lsp.Diagnostic; +import org.netbeans.api.project.FileOwnerQuery; +import org.netbeans.api.project.Project; +import org.netbeans.modules.csl.api.OffsetRange; +import org.netbeans.spi.lsp.ErrorProvider; +import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; +import org.openide.util.NbBundle; + +/** + * + * @author Dusan Balek + */ +@MimeRegistration(mimeType = "text/x-java", service = ErrorProvider.class) +public final class MicronautSymbolErrorProvider implements ErrorProvider { + + @Override + public List computeErrors(Context context) { + if (context.errorKind() != ErrorProvider.Kind.ERRORS || context.isCancelled()) { + return Collections.emptyList(); + } + FileObject fo = context.file(); + Project project = fo != null ? FileOwnerQuery.getOwner(fo) : null; + if (project == null) { + return Collections.emptyList(); + } + try { + return MicronautSymbolSearcher.getSymbolsWithPathDuplicates(project, fo).stream() + .filter(descriptor -> descriptor.getFileObject() == fo) + .map(descriptor -> desc2diag(descriptor)) + .collect(Collectors.toList()); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + return Collections.emptyList(); + } + + @NbBundle.Messages({ + "# {0} - symbol name", + "ERR_Duplicated_URI_path=Duplicated endpoint URI path: {0}" + }) + private Diagnostic desc2diag(MicronautSymbolSearcher.SymbolDescriptor descriptor) { + OffsetRange offsetRange = descriptor.getOffsetRange(null); + return Diagnostic.Builder.create(() -> offsetRange.getStart(), () -> offsetRange.getEnd(), Bundle.ERR_Duplicated_URI_path(descriptor.getName())) + .setCode("WARN_Duplicated_MN_Data_Endpoint_Path " + offsetRange.getStart() + " - " + offsetRange.getEnd()) + .setSeverity(Diagnostic.Severity.Warning) + .build(); + } +} diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolFinder.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolFinder.java index af06fa22d212..d32f5d117916 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolFinder.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolFinder.java @@ -20,6 +20,7 @@ import com.sun.source.tree.ClassTree; import com.sun.source.tree.MethodTree; +import com.sun.source.tree.Tree; import com.sun.source.util.SourcePositions; import com.sun.source.util.TreePath; import com.sun.source.util.TreePathScanner; @@ -93,10 +94,7 @@ protected void index(Indexable indexable, Parser.Result parserResult, Context co if (initialize(cc)) { try { if (cc.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED).compareTo(JavaSource.Phase.ELEMENTS_RESOLVED) >= 0) { - List symbols = scan(cc); - if (!symbols.isEmpty()) { - store(context.getIndexFolder(), indexable.getURL(), indexable.getRelativePath(), symbols); - } + store(context.getIndexFolder(), indexable.getURL(), indexable.getRelativePath(), scan(cc, false)); } } catch (IOException ex) { Exceptions.printStackTrace(ex); @@ -126,7 +124,7 @@ private synchronized boolean initialize(CompilationController cc) { return ret; } - public static List scan(CompilationController cc) { + public static List scan(CompilationController cc, boolean selectEndpointAnnotation) { final List ret = new ArrayList<>(); SourcePositions sp = cc.getTrees().getSourcePositions(); TreePathScanner scanner = new TreePathScanner() { @@ -162,7 +160,8 @@ public Void visitMethod(MethodTree node, String path) { TreePath treePath = this.getCurrentPath(); MthIterator it = new MthIterator(cc.getTrees().getElement(treePath), cc.getElements(), cc.getTypes()); while (it.hasNext()) { - for (AnnotationMirror ann : it.next().getAnnotationMirrors()) { + ExecutableElement ee = it.next(); + for (AnnotationMirror ann : ee.getAnnotationMirrors()) { String method = getEndpointMethod((TypeElement) ann.getAnnotationType().asElement()); if (method != null) { List ids = new ArrayList<>(); @@ -183,6 +182,12 @@ public Void visitMethod(MethodTree node, String path) { for (Object id : ids) { String name = '@' + path + id + " -- " + method; int[] span = cc.getTreeUtilities().findNameSpan(node); + if (selectEndpointAnnotation) { + Tree tree = cc.getTrees().getTree(ee, ann); + if (tree != null) { + span = new int[] {(int) sp.getStartPosition(treePath.getCompilationUnit(), tree), (int) sp.getEndPosition(treePath.getCompilationUnit(), tree)}; + } + } ret.add(new SymbolLocation(name, (int) sp.getStartPosition(treePath.getCompilationUnit(), node), (int) sp.getEndPosition(treePath.getCompilationUnit(), node), span[0], span[1])); } return null; diff --git a/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolSearcher.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolSearcher.java index 9a2fcfb18baf..9436aecb9376 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolSearcher.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolSearcher.java @@ -26,11 +26,17 @@ import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.Enumeration; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; import javax.swing.Icon; +import javax.swing.text.StyledDocument; import org.netbeans.api.java.project.JavaProjectConstants; +import org.netbeans.api.java.source.JavaSource; +import org.netbeans.api.lsp.Diagnostic; import org.netbeans.api.project.FileOwnerQuery; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectUtils; @@ -43,10 +49,13 @@ import org.netbeans.modules.parsing.api.indexing.IndexingManager; import org.netbeans.modules.parsing.impl.indexing.CacheFolder; import org.netbeans.modules.parsing.spi.indexing.support.QuerySupport.Kind; +import org.openide.cookies.EditorCookie; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.filesystems.URLMapper; import org.openide.util.Exceptions; +import org.openide.util.Lookup; +import org.openide.util.RequestProcessor; import org.openide.util.lookup.ServiceProvider; /** @@ -66,11 +75,60 @@ public Set getSymbols(Project project, String textForQuery if (project == null || !textForQuery.startsWith("@") || IndexingManager.getDefault().isIndexing()) { return Collections.emptySet(); } - Set symbols = new HashSet<>(); + if (textForQuery.equals("@/")) { + RequestProcessor.getDefault().post(() -> { + try { + Set duplicates = getSymbolsWithPathDuplicates(project, null).stream().map(descriptor -> descriptor.getFileObject()).collect(Collectors.toSet()); + if (!duplicates.isEmpty()) { + Diagnostic.ReporterControl control = Diagnostic.findReporterControl(Lookup.getDefault(), project.getProjectDirectory()); + control.diagnosticChanged(duplicates, "text/x-java"); + } + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + }); + } + return getSymbols(project, textForQuery); + } + + static Set getSymbolsWithPathDuplicates(Project project, FileObject fo) throws IOException { + EditorCookie ec = fo != null ? fo.getLookup().lookup(EditorCookie.class) : null; + StyledDocument doc = ec != null ? ec.openDocument() : null; + Set duplicates = new HashSet<>(); + Map map = new HashMap<>(); + for (SymbolDescriptor symbol : getSymbols(project, "@/")) { + if (doc == null || symbol.getFileObject() != fo) { + SymbolDescriptor previous = map.put(symbol.getSimpleName().replaceAll("\\{.*}", "{}"), symbol); + if (previous != null) { + duplicates.add(symbol); + duplicates.add(previous); + } + } + } + JavaSource js = doc != null ? JavaSource.forDocument(doc) : null; + if (js != null) { + js.runUserActionTask(cc -> { + cc.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); + for (MicronautSymbolFinder.SymbolLocation sl : MicronautSymbolFinder.scan(cc, true)) { + SymbolDescriptor symbol = new SymbolDescriptor(sl.getName(), fo, sl.getSelectionStart(), sl.getSelectionEnd()); + SymbolDescriptor previous = map.put(symbol.getSimpleName().replaceAll("\\{.*}", "{}"), symbol); + if (previous != null) { + duplicates.add(symbol); + duplicates.add(previous); + } + } + }, true); + } + return duplicates; + } + + private static Set getSymbols(Project project, String textForQuery) { + Set symbols = new HashSet<>(); for (SourceGroup sg : ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA)) { try { FileObject cacheRoot = getCacheRoot(sg.getRootFolder().toURL()); if (cacheRoot != null) { + cacheRoot.refresh(); Enumeration children = cacheRoot.getChildren(true); while (children.hasMoreElements()) { FileObject child = children.nextElement(); @@ -79,12 +137,14 @@ public Set getSymbols(Project project, String textForQuery } } } - } catch (IOException ex) {} + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } } return symbols; } - private static void loadSymbols(FileObject input, String textForQuery, Set symbols) { + private static void loadSymbols(FileObject input, String textForQuery, Set symbols) { try (BufferedReader br = new BufferedReader(new InputStreamReader(input.getInputStream(), StandardCharsets.UTF_8))) { FileObject fo = null; String line; @@ -120,7 +180,7 @@ private static FileObject getCacheRoot(URL root) throws IOException { return dataFolder != null ? FileUtil.createFolder(dataFolder, MicronautSymbolFinder.NAME + "/" + MicronautSymbolFinder.VERSION) : null; //NOI18N } - private static class SymbolDescriptor extends IndexSearcher.Descriptor implements org.netbeans.modules.csl.api.ElementHandle { + static class SymbolDescriptor extends IndexSearcher.Descriptor implements org.netbeans.modules.csl.api.ElementHandle { private final String name; private final FileObject fo; diff --git a/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/NbSuiteTestBase.java b/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/NbSuiteTestBase.java new file mode 100644 index 000000000000..7f0ab2183c3c --- /dev/null +++ b/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/NbSuiteTestBase.java @@ -0,0 +1,94 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.modules.micronaut; + +import java.io.File; +import java.util.Collections; +import java.util.Set; +import javax.swing.text.Document; +import static junit.framework.TestCase.assertNotNull; +import org.netbeans.junit.NbTestCase; +import org.netbeans.modules.parsing.impl.indexing.implspi.ActiveDocumentProvider; +import org.openide.modules.DummyInstalledFileLocator; +import org.openide.util.lookup.ServiceProvider; +import org.openide.windows.IOProvider; + +/** + * + * @author sdedic + */ +public class NbSuiteTestBase extends NbTestCase { + + public NbSuiteTestBase(String name) { + super(name); + } + + @org.openide.util.lookup.ServiceProvider(service=org.openide.modules.InstalledFileLocator.class, position = 1000) + public static class InstalledFileLocator extends DummyInstalledFileLocator { + } + + // must register ADP: otherwise maven fails at the start and will not even run + // Prime command. + @ServiceProvider(service = ActiveDocumentProvider.class) + public static class ActiveDocumentProviderImpl implements ActiveDocumentProvider { + + @Override + public Document getActiveDocument() { + return null; + } + + @Override + public Set getActiveDocuments() { + return Collections.emptySet(); + } + + @Override + public void addActiveDocumentListener(ActiveDocumentProvider.ActiveDocumentListener listener) { + } + + @Override + public void removeActiveDocumentListener(ActiveDocumentProvider.ActiveDocumentListener listener) { + } + + } + + private static File getTestNBDestDir() throws Exception { + String destDir = System.getProperty("test.netbeans.dest.dir"); + // set in project.properties as test-unit-sys-prop.test.netbeans.dest.dir + assertNotNull("test.netbeans.dest.dir property has to be set when running within binary distribution", destDir); + return new File(destDir); + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + + // This is needed, otherwose the core window's startup code will redirect + // System.out/err to the IOProvider, and its Trivial implementation will redirect + // it back to System.err - loop is formed. Initialize IOProvider first, it gets + // the real System.err/out references. + IOProvider p = IOProvider.getDefault(); + + System.setProperty("test.reload.sync", "true"); + // Configure the DummyFilesLocator with NB harness dir + File destDirF = getTestNBDestDir(); + DummyInstalledFileLocator.registerDestDir(destDirF); + } + +} diff --git a/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/completion/MicronautExpressionLanguageCompletionTestBase.java b/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/completion/MicronautExpressionLanguageCompletionTestBase.java index 656965520b2f..4fe133fed5a3 100644 --- a/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/completion/MicronautExpressionLanguageCompletionTestBase.java +++ b/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/completion/MicronautExpressionLanguageCompletionTestBase.java @@ -26,11 +26,13 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import javax.swing.text.Document; +import org.netbeans.api.java.source.ClasspathInfo; +import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.lsp.Completion; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectManager; import org.netbeans.api.project.ui.OpenProjects; -import org.netbeans.junit.NbTestCase; +import org.netbeans.modules.micronaut.NbSuiteTestBase; import org.netbeans.spi.project.ActionProgress; import org.netbeans.spi.project.ActionProvider; import org.openide.cookies.EditorCookie; @@ -43,7 +45,7 @@ * * @author Dusan Balek */ -public class MicronautExpressionLanguageCompletionTestBase extends NbTestCase { +public class MicronautExpressionLanguageCompletionTestBase extends NbSuiteTestBase { private Project project; @@ -52,12 +54,11 @@ public MicronautExpressionLanguageCompletionTestBase(String name) { } protected @Override void setUp() throws Exception { + super.setUp(); clearWorkDir(); - System.setProperty("test.reload.sync", "true"); FileObject dataFO = FileUtil.toFileObject(getDataDir()); FileObject testApp = dataFO.getFileObject("maven/micronaut4/simple"); - FileObject prjCopy = FileUtil.copyFile(testApp, FileUtil.toFileObject(getWorkDir()), "mn4-cc"); - project = openAndPrimeProject(prjCopy); + project = openPrimeAndIndexProject(testApp); } protected void performTest(String text, int offset, String goldenFileName) throws Exception { @@ -76,6 +77,9 @@ protected void performTest(String text, int offset, String goldenFileName) throw new MicronautDataCompletionCollector().collectCompletions(doc, 175 + offset, null, completion -> { items.add(completion); }); + if (text.length() > 0) { + doc.remove(175, text.length()); + } items.sort((c1, c2) -> { return c1.getSortText().compareTo(c2.getSortText()); }); @@ -103,7 +107,7 @@ protected void performTest(String text, int offset, String goldenFileName) throw assertFile(output, goldenFile, diffFile); } - private Project openAndPrimeProject(FileObject prjCopy) throws Exception { + private Project openPrimeAndIndexProject(FileObject prjCopy) throws Exception { Project p = ProjectManager.getDefault().findProject(prjCopy); assertNotNull(p); OpenProjects.getDefault().open(new Project[] { p }, true); @@ -124,6 +128,13 @@ public void finished(boolean success) { }; ap.invokeAction(ActionProvider.COMMAND_PRIME, Lookups.fixed(progress)); primingLatch.await(10, TimeUnit.MINUTES); + + CountDownLatch indexingLatch = new CountDownLatch(1); + JavaSource.create(ClasspathInfo.create(prjCopy)).runWhenScanFinished(info -> { + indexingLatch.countDown(); + }, true); + indexingLatch.await(10, TimeUnit.MINUTES); + return p; } } diff --git a/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/maven/MicronautPackagingArtifactImplTest.java b/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/maven/MicronautPackagingArtifactImplTest.java index c0eb2d76bafc..aeb3a8568be6 100644 --- a/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/maven/MicronautPackagingArtifactImplTest.java +++ b/enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/maven/MicronautPackagingArtifactImplTest.java @@ -21,66 +21,34 @@ import java.io.File; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; -import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.logging.Logger; -import javax.swing.text.Document; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectActionContext; import org.netbeans.api.project.ProjectManager; import org.netbeans.api.project.ui.OpenProjects; -import org.netbeans.junit.NbTestCase; import org.netbeans.modules.maven.api.MavenConfiguration; -import org.netbeans.modules.parsing.impl.indexing.implspi.ActiveDocumentProvider; +import org.netbeans.modules.micronaut.NbSuiteTestBase; import org.netbeans.modules.project.dependency.ArtifactSpec; import org.netbeans.modules.project.dependency.ProjectArtifactsQuery; import org.netbeans.spi.project.ActionProgress; import org.netbeans.spi.project.ActionProvider; -import org.netbeans.spi.project.ProjectConfiguration; import org.netbeans.spi.project.ProjectConfigurationProvider; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.modules.DummyInstalledFileLocator; import org.openide.util.lookup.Lookups; -import org.openide.util.lookup.ServiceProvider; import org.openide.windows.IOProvider; /** * * @author sdedic */ -public class MicronautPackagingArtifactImplTest extends NbTestCase { - - // must register ADP: otherwise maven fails at the start and will not even run - // Prime command. - @ServiceProvider(service = ActiveDocumentProvider.class) - public static class ActiveDocumentProviderImpl implements ActiveDocumentProvider { - - @Override - public Document getActiveDocument() { - return null; - } - - @Override - public Set getActiveDocuments() { - return Collections.emptySet(); - } - - @Override - public void addActiveDocumentListener(ActiveDocumentListener listener) { - } - - @Override - public void removeActiveDocumentListener(ActiveDocumentListener listener) { - } - - } - +public class MicronautPackagingArtifactImplTest extends NbSuiteTestBase { public MicronautPackagingArtifactImplTest(String name) { super(name); } diff --git a/enterprise/payara.common/manifest.mf b/enterprise/payara.common/manifest.mf index 9d018d8eb2c3..4c96873e1fc8 100644 --- a/enterprise/payara.common/manifest.mf +++ b/enterprise/payara.common/manifest.mf @@ -4,6 +4,6 @@ OpenIDE-Module: org.netbeans.modules.payara.common/0 OpenIDE-Module-Install: org/netbeans/modules/payara/common/Installer.class OpenIDE-Module-Layer: org/netbeans/modules/payara/common/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/payara/common/Bundle.properties -OpenIDE-Module-Specification-Version: 2.18 +OpenIDE-Module-Specification-Version: 2.20 OpenIDE-Module-Provides: org.netbeans.modules.payara.common diff --git a/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig b/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig index e3c0d52b94ed..67b34a61d8ea 100644 --- a/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig +++ b/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.17 +#Version 2.18 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/CreateDomain.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/CreateDomain.java index a2f2e4fb877b..cc6554ac0b4d 100644 --- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/CreateDomain.java +++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/CreateDomain.java @@ -24,8 +24,11 @@ import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; +import java.nio.file.Files; import java.util.ArrayList; + import static java.util.Arrays.asList; + import java.util.Date; import java.util.HashMap; import java.util.List; @@ -277,7 +280,7 @@ private static File createTempPasswordFile(String password, String masterPasswor PrintWriter p = null; File retVal = null; try { - retVal = File.createTempFile("admin", null);//NOI18N + retVal = Files.createTempFile("admin", null).toFile();//NOI18N retVal.deleteOnExit(); output = new FileOutputStream(retVal); diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java index 877af17a3ac2..98fc991b6173 100644 --- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java +++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java @@ -1742,7 +1742,7 @@ private void updateFactories() { } if (!proxies.isEmpty()) { - full = new ProxyLookup(proxies.toArray(new Lookup[proxies.size()])); + full = new ProxyLookup(proxies.toArray(new Lookup[0])); } } diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java index 156829a3894b..33bfcca4c7cd 100644 --- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java +++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java @@ -169,7 +169,7 @@ public void operationStateChanged(TaskState newState, } } }); - this.stateListener = listeners.toArray(new TaskStateListener[listeners.size()]); + this.stateListener = listeners.toArray(new TaskStateListener[0]); this.support = support; this.recognizers = recognizers; this.jvmArgs = (jvmArgs != null) ? Arrays.asList(removeEscapes(jvmArgs)) : null; diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/nodes/Hk2ItemNode.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/nodes/Hk2ItemNode.java index 7ae60a29ae6f..4cf2bab69327 100644 --- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/nodes/Hk2ItemNode.java +++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/nodes/Hk2ItemNode.java @@ -324,7 +324,7 @@ public Action[] getActions(boolean context) { if (decorator.canEditDetails()) { actions.add(SystemAction.get(EditDetailsAction.class)); } - return actions.toArray(new Action[actions.size()]); + return actions.toArray(new Action[0]); } //////////////////////////////////////////////////////////////////////////// diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/nodes/Hk2ResourceNode.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/nodes/Hk2ResourceNode.java index 2a8c5ac24bc4..02acbbbf78e5 100644 --- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/nodes/Hk2ResourceNode.java +++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/nodes/Hk2ResourceNode.java @@ -84,6 +84,6 @@ public Action[] getActions(boolean context) { if (customizer == ConnectionPoolCustomizer.class) { actions.add(SystemAction.get(ConnectionPoolAdvancedAttributesAction.class)); } - return actions.toArray(new Action[actions.size()]); + return actions.toArray(new Action[0]); } } diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/BasePanel.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/BasePanel.java index 331ad353e3b7..d63023f0bd42 100644 --- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/BasePanel.java +++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/BasePanel.java @@ -230,7 +230,7 @@ public void run() { } } if (l.size() > 0) { - table.setModel(new AttributedPropertyTableModel(l.toArray(new String[l.size()][]), specComp, pushPrefix)); + table.setModel(new AttributedPropertyTableModel(l.toArray(new String[0][]), specComp, pushPrefix)); } else { // this data is from a post beta build... pattern = Pattern.compile(".*\\." + name + "\\." + specComp[0] + "\\..*"); @@ -251,7 +251,7 @@ public void run() { } } if (l.size() > 0) { - table.setModel(new NameValueTableModel(l.toArray(new String[l.size()][]), specComp, pushPrefix)); + table.setModel(new NameValueTableModel(l.toArray(new String[0][]), specComp, pushPrefix)); } } } diff --git a/enterprise/payara.eecommon/nbproject/org-netbeans-modules-payara-eecommon.sig b/enterprise/payara.eecommon/nbproject/org-netbeans-modules-payara-eecommon.sig index e92761d64451..4adad52e0810 100644 --- a/enterprise/payara.eecommon/nbproject/org-netbeans-modules-payara-eecommon.sig +++ b/enterprise/payara.eecommon/nbproject/org-netbeans-modules-payara-eecommon.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.18.0 +#Version 2.19.0 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/payara.eecommon/nbproject/project.properties b/enterprise/payara.eecommon/nbproject/project.properties index c7297bef4bd8..05c31404c977 100644 --- a/enterprise/payara.eecommon/nbproject/project.properties +++ b/enterprise/payara.eecommon/nbproject/project.properties @@ -17,7 +17,7 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=2.19.0 +spec.version.base=2.21.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/DomainEditor.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/DomainEditor.java index 0ec6dff781b6..04b5e9715266 100644 --- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/DomainEditor.java +++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/DomainEditor.java @@ -238,7 +238,7 @@ public String[] getHttpProxyOptions(){ Document domainDoc = getDomainDocument(); NodeList javaConfigNodeList = domainDoc.getElementsByTagName("java-config"); if (javaConfigNodeList == null || javaConfigNodeList.getLength() == 0) { - return httpProxyOptions.toArray(new String[httpProxyOptions.size()]); + return httpProxyOptions.toArray(new String[0]); } NodeList jvmOptionNodeList = domainDoc.getElementsByTagName(CONST_JVM_OPTIONS); diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/dd/loader/PayaraDDProvider.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/dd/loader/PayaraDDProvider.java index 5d26df031fb5..2fbaa2b370b4 100644 --- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/dd/loader/PayaraDDProvider.java +++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/dd/loader/PayaraDDProvider.java @@ -475,7 +475,7 @@ public RootInterface newGraph(Class rootType, String version) { try { // Formerly invoked static 'createGraph()' method, but that is merely a wrapper // for the default constructor so we'll call it directly. - graphRoot = (SunBaseBean) vInfo.getImplClass().newInstance(); + graphRoot = (SunBaseBean) vInfo.getImplClass().getDeclaredConstructor().newInstance(); graphRoot.graphManager().setDoctype(vInfo.getPublicId(), vInfo.getSystemId()); Class proxyClass = vInfo.getProxyClass(); diff --git a/enterprise/payara.jakartaee/manifest.mf b/enterprise/payara.jakartaee/manifest.mf index 5ed11a7c97eb..df778b295158 100644 --- a/enterprise/payara.jakartaee/manifest.mf +++ b/enterprise/payara.jakartaee/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module: org.netbeans.modules.payara.jakartaee/0 OpenIDE-Module-Layer: org/netbeans/modules/payara/jakartaee/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/payara/jakartaee/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.serverplugins.javaee -OpenIDE-Module-Specification-Version: 2.18 +OpenIDE-Module-Specification-Version: 2.20 diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2DeploymentManager.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2DeploymentManager.java index 1c6d2d9ad77b..49bcc977a816 100644 --- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2DeploymentManager.java +++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2DeploymentManager.java @@ -431,7 +431,7 @@ public boolean isLocaleSupported(java.util.Locale locale) { } } } - return moduleList.size() > 0 ? moduleList.toArray(new TargetModuleID[moduleList.size()]) : + return moduleList.size() > 0 ? moduleList.toArray(new TargetModuleID[0]) : new TargetModuleID[0]; } diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java index 2d1cd35ab8a3..23474d8dab64 100644 --- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java +++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java @@ -209,6 +209,10 @@ public static Profile[] nbJavaEEProfiles( break; case v10_0_0: profiles[index++] = Profile.JAKARTA_EE_10_FULL; break; + case v11_0_0_web: profiles[index++] = Profile.JAKARTA_EE_11_WEB; + break; + case v11_0_0: profiles[index++] = Profile.JAKARTA_EE_11_FULL; + break; } } else { profiles = new Profile[0]; @@ -505,7 +509,7 @@ public File[] getToolClasspathEntries(String toolName) { cPath.add(f); } } - return cPath.toArray(new File[cPath.size()]); + return cPath.toArray(new File[0]); } if (TOOL_WSCOMPILE.equals(toolName)) { @@ -518,7 +522,7 @@ public File[] getToolClasspathEntries(String toolName) { cPath.add(f); } } - return cPath.toArray(new File[cPath.size()]); + return cPath.toArray(new File[0]); } File domainDir; @@ -1004,8 +1008,7 @@ private boolean addJars(final Project project, Collection jars ){ else { classPathType = ClassPath.COMPILE; } - ProjectClassPathModifier.addRoots(urls.toArray( new URL[ urls.size()]), - sourceRoot, classPathType ); + ProjectClassPathModifier.addRoots(urls.toArray(new URL[0]), sourceRoot, classPathType); } catch (UnsupportedOperationException | IOException ex) { return false; diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java index 7801277ed1cc..8c86cf024229 100644 --- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java +++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java @@ -55,16 +55,18 @@ private static class JpaSupportVector { * @param jpa_2_2 JPA 2.2 supported. * @param jpa_3_0 JPA 3.0 supported. * @param jpa_3_1 JPA 3.1 supported. + * @param jpa_3_2 JPA 3.2 supported. */ JpaSupportVector(boolean jpa_1_0, boolean jpa_2_0, boolean jpa_2_1, boolean jpa_2_2, - boolean jpa_3_0, boolean jpa_3_1) { + boolean jpa_3_0, boolean jpa_3_1, boolean jpa_3_2) { _1_0 = jpa_1_0; _2_0 = jpa_2_0; _2_1 = jpa_2_1; _2_2 = jpa_2_2; _3_0 = jpa_3_0; _3_1 = jpa_3_1; + _3_2 = jpa_3_2; } /** JPA 1.0 supported. */ @@ -84,6 +86,8 @@ private static class JpaSupportVector { /** JPA 3.1 supported. */ boolean _3_1; + /** JPA 3.2 supported. */ + boolean _3_2; } //////////////////////////////////////////////////////////////////////////// @@ -105,7 +109,8 @@ private static class JpaSupportVector { new JpaSupportVector( true, true, version.isEE7Supported(), version.isEE8Supported(), - version.isEE9Supported(), version.isEE10Supported() + version.isEE9Supported(), version.isEE10Supported(), + false ) ); } @@ -181,7 +186,7 @@ public JpaProvider getDefaultProvider() { JPA_PROVIDER, true, instanceJpaSupport._1_0, instanceJpaSupport._2_0, instanceJpaSupport._2_1, instanceJpaSupport._2_2, instanceJpaSupport._3_0, - instanceJpaSupport._3_1); + instanceJpaSupport._3_1, instanceJpaSupport._3_2); } } return defaultProvider; diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java index ad3ae50bd840..ec7835f2f11f 100644 --- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java +++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java @@ -23,6 +23,7 @@ import java.beans.PropertyChangeListener; import java.io.File; import java.io.IOException; +import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Enumeration; import java.util.HashMap; @@ -44,6 +45,7 @@ import org.netbeans.modules.xml.catalog.spi.CatalogListener; import org.netbeans.modules.xml.catalog.spi.CatalogReader; import org.netbeans.spi.server.ServerInstanceProvider; +import org.openide.util.Utilities; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -57,10 +59,11 @@ * @author Ludo */ -public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogReader, CatalogDescriptor2,org.xml.sax.EntityResolver { - - private static final String XML_XSD="http://www.w3.org/2001/xml.xsd"; // NOI18N - private static final String XML_XSD_DEF="In due course, we should install the relevant ISO 2- and 3-letter codes as the enumerated possible values . . ."; // NOI18N +public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogReader, CatalogDescriptor2, org.xml.sax.EntityResolver { + + private static final Logger LOGGER = Logger.getLogger("payara-jakartaee"); + private static final String XML_XSD = "http://www.w3.org/2001/xml.xsd"; // NOI18N + private static final String XML_XSD_DEF = "In due course, we should install the relevant ISO 2- and 3-letter codes as the enumerated possible values . . ."; // NOI18N private static final String TypeToURLMap[] = { "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 J2EE Application 1.3//EN" , "sun-application_1_3-0.dtd" , "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 J2EE Application 1.4//EN" , "sun-application_1_4-0.dtd" , ///[THIS IS DEPRECATED] @@ -83,7 +86,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Servlet 2.3//EN" , "sun-web-app_2_3-0.dtd" , "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 Servlet 2.4//EN" , "sun-web-app_2_4-0.dtd" , ///[THIS IS DEPRECATED] "-//Sun Microsystems, Inc.//DTD Application Server 8.0 Servlet 2.4//EN" , "sun-web-app_2_4-0.dtd" , - "-//Sun Microsystems, Inc.//DTD Sun ONE Web Server 6.1 Servlet 2.3//EN" , "sun-web-app_2_3-1.dtd" , + "-//Sun Microsystems, Inc.//DTD Sun ONE Web Server 6.1 Servlet 2.3//EN" , "sun-web-app_2_3-1.dtd" , "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" , "sun-web-app_2_4-1.dtd" , "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" , "sun-web-app_2_5-0.dtd" , "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Application Client Container 1.0//EN" , "sun-application-client-container_1_0.dtd" , @@ -100,7 +103,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "-//Sun Microsystems Inc.//DTD GlassFish Communications Server 1.5 Domain//EN" ,"sun-domain_1_4.dtd", "-//Sun Microsystems Inc.//DTD GlassFish Communications Server 2.0 Domain//EN" ,"sun-domain_1_5.dtd", "-//Sun Microsystems, Inc.//DTD Application Server 9.0 SIP Servlet 1.1//EN" , "sun-sip-app_1_1-0.dtd", - + "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" , "application_1_3.dtd", "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" , "application_1_2.dtd", "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" , "ejb-jar_2_0.dtd", @@ -114,7 +117,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" , "web-jsptaglibrary_1_2.dtd", "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" , "web-jsptaglibrary_1_1.dtd", }; - + private static final String JavaEE6TypeToURLMap[] = { "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Java EE Application 6.0//EN" , "sun-application_6_0-0.dtd", "-//GlassFish.org//DTD GlassFish Application Server 3.1 Java EE Application 6.0//EN" , "glassfish-application_6_0-1.dtd", @@ -131,7 +134,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead /*******NetBeans 3.6 is NOT ready yet to support schemas for code completion... What a pity!: */ private static final String SchemaToURLMap[] = { - + "SCHEMA:http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" , "ejb-jar_2_1", "SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" , "ejb-jar_3_0", "SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" , "ejb-jar_3_1", @@ -151,6 +154,8 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_9.xsd" , "application_9", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_10.xsd" , "application-client_10", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_10.xsd" , "application_10", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_11.xsd" , "application-client_11", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_11.xsd" , "application_11", "SCHEMA:http://java.sun.com/xml/ns/j2ee/jax-rpc-ri-config.xsd" , "jax-rpc-ri-config", "SCHEMA:http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" , "connector_1_5", "SCHEMA:http://java.sun.com/xml/ns/javaee/connector_1_6.xsd" , "connector_1_6", @@ -179,13 +184,15 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/orm_2_2.xsd" , "orm_2_2", "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_0.xsd" , "orm_3_0", "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_1.xsd" , "orm_3_1", + "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_2.xsd" , "orm_3_2", "SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" , "persistence_1_0", "SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" , "persistence_2_0", "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" , "persistence_2_1", "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd" , "persistence_2_2", "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" , "persistence_3_0", + "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_2.xsd" , "persistence_3_2", }; - + private static final String JavaEE6SchemaToURLMap[] = { "SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" , "ejb-jar_3_1", @@ -196,8 +203,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:http://xmlns.oracle.com/weblogic/jdbc-data-source/1.0/jdbc-data-source.xsd", "jdbc-data-source", }; - private static Map ddCatalogMap = new HashMap<>(); -// private static RunTimeDDCatalog preludeDDCatalog; + private static final Map ddCatalogMap = new HashMap<>(); private static RunTimeDDCatalog defaultDDCatalog; private File platformRootDir=null; @@ -208,18 +214,28 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead /** Creates a new instance of RunTimeDDCatalog */ public RunTimeDDCatalog() { } - + public void setInstanceProvider(ServerInstanceProvider ip) { if (ddCatalogMap.get(ip) == null) { ddCatalogMap.put(ip, this); } } - /** Factory method providing catalog for XML completion of DD */ + /** + * Factory method providing catalog for XML completion of DD + * + * @param ip + * @return + */ public static RunTimeDDCatalog getRunTimeDDCatalog(ServerInstanceProvider ip){ return ddCatalogMap.get(ip); } - /** Factory method providing catalog for XML completion of DD */ + /** + * Factory method providing catalog for XML completion of DD + * + * @return + */ + @SuppressWarnings("AccessingNonPublicFieldOfAnotherObject") public static synchronized RunTimeDDCatalog getDefaultRunTimeDDCatalog(){ if (defaultDDCatalog==null) { defaultDDCatalog = new RunTimeDDCatalog(); @@ -242,35 +258,37 @@ public Iterator getPublicIDs() { if (!platformRootDir.exists()) { return null; } - - String installRoot = platformRootDir.getAbsolutePath(); + + String installRoot = platformRootDir.getAbsolutePath(); if (installRoot == null) { return null; } - + List list = new ArrayList<>(); - for (int i=0;i catalogListeners = new ArrayList<>(1); - + + private final List catalogListeners = new ArrayList<>(1); + /** * Optional operation allowing to listen at catalog for changes. - * @throws UnsupportedOpertaionException if not supported by the implementation. + * + * @param listener */ @Override - public void addCatalogListener(CatalogListener l) { - if (null == l) + public void addCatalogListener(CatalogListener listener) { + if (null == listener) return; - if (catalogListeners.contains(l)) + if (catalogListeners.contains(listener)) return; - catalogListeners.add(l); + catalogListeners.add(listener); } - + /** * Optional operation couled with addCatalogListener. - * @throws UnsupportedOpertaionException if not supported by the implementation. + * + * @param listener */ @Override - public void removeCatalogListener(CatalogListener l) { - if (null == l) + public void removeCatalogListener(CatalogListener listener) { + if (null == listener) return; - catalogListeners.remove(l); + catalogListeners.remove(listener); } - + public void fireCatalogListeners() { - Iterator iter = catalogListeners.iterator(); - while (iter.hasNext()) { - CatalogListener l = iter.next(); + for (CatalogListener l : catalogListeners) { l.notifyInvalidate(); } } - - /** Registers new listener. */ + + /** + * Registers new listener. + * + * @param propertyChangeListener + */ @Override - public void addPropertyChangeListener(PropertyChangeListener l) { + public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener) { } - + + /** + * Unregister the listener. + * + * @param propertyChangeListener + */ + @Override + public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener) { + } + /** * @return I18N display name */ @@ -410,7 +443,7 @@ public void addPropertyChangeListener(PropertyChangeListener l) { public String getDisplayName() { return NbBundle.getMessage(RunTimeDDCatalog.class, displayNameKey); } - + /** * Return visuaized state of given catalog. * @param type of icon defined by JavaBeans specs @@ -418,9 +451,9 @@ public String getDisplayName() { */ @Override public String getIconResource(int type) { - return "org/netbeans/modules/payara/javaee/resources/server.png"; // NOI18N + return "org/netbeans/modules/payara/jakartaee/resources/server.png"; // NOI18N } - + /** * @return I18N short description */ @@ -428,12 +461,7 @@ public String getIconResource(int type) { public String getShortDescription() { return NbBundle.getMessage(RunTimeDDCatalog.class, shortDescriptionKey); } - - /** Unregister the listener. */ - @Override - public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { - } - + public static final String J2EE_NS = "http://java.sun.com/xml/ns/j2ee"; // NOI18N public static final String JAVAEE_NS = "http://java.sun.com/xml/ns/javaee"; // NOI18N public static final String NEW_JAVAEE_NS = "http://xmlns.jcp.org/xml/ns/javaee"; // NOI18N @@ -442,80 +470,82 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { public static final String IBM_J2EE_NS = "http://www.ibm.com/webservices/xsd"; // NOI18N private static final String XMLNS_ATTR="xmlns"; //NOI18N - // public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException, java.io.IOException { - // return null; - // } + private static final String EJB_JAR_TAG="ejb-jar"; //NOI18N private static final String EJBJAR_2_1_XSD="ejb-jar_2_1.xsd"; // NOI18N private static final String EJBJAR_2_1 = J2EE_NS+"/"+EJBJAR_2_1_XSD; // NOI18N public static final String EJBJAR_2_1_ID = "SCHEMA:"+EJBJAR_2_1; // NOI18N - + private static final String EJBJAR_3_0_XSD="ejb-jar_3_0.xsd"; // NOI18N private static final String EJBJAR_3_0 = JAVAEE_NS+"/"+EJBJAR_3_0_XSD; // NOI18N public static final String EJBJAR_3_0_ID = "SCHEMA:"+EJBJAR_3_0; // NOI18N - + private static final String EJBJAR_3_1_XSD="ejb-jar_3_1.xsd"; // NOI18N private static final String EJBJAR_3_1 = JAVAEE_NS+"/"+EJBJAR_3_1_XSD; // NOI18N public static final String EJBJAR_3_1_ID = "SCHEMA:"+EJBJAR_3_1; // NOI18N - + private static final String EJBJAR_3_2_XSD="ejb-jar_3_2.xsd"; // NOI18N private static final String EJBJAR_3_2 = NEW_JAVAEE_NS+"/"+EJBJAR_3_2_XSD; // NOI18N public static final String EJBJAR_3_2_ID = "SCHEMA:"+EJBJAR_3_2; // NOI18N - + private static final String EJBJAR_4_0_XSD="ejb-jar_4_0.xsd"; // NOI18N private static final String EJBJAR_4_0 = JAKARTAEE_NS+"/"+EJBJAR_4_0_XSD; // NOI18N public static final String EJBJAR_4_0_ID = "SCHEMA:"+EJBJAR_4_0; // NOI18N - + private static final String APP_TAG="application"; //NOI18N private static final String APP_1_4_XSD="application_1_4.xsd"; // NOI18N private static final String APP_1_4= J2EE_NS+"/"+APP_1_4_XSD; // NOI18N public static final String APP_1_4_ID = "SCHEMA:"+APP_1_4; // NOI18N - + private static final String APP_5_XSD="application_5.xsd"; // NOI18N private static final String APP_5= JAVAEE_NS+"/"+APP_5_XSD; // NOI18N public static final String APP_5_ID = "SCHEMA:"+APP_5; // NOI18N - + private static final String APP_6_XSD="application_6.xsd"; // NOI18N private static final String APP_6= JAVAEE_NS+"/"+APP_6_XSD; // NOI18N public static final String APP_6_ID = "SCHEMA:"+APP_6; // NOI18N - + private static final String APP_7_XSD="application_7.xsd"; // NOI18N private static final String APP_7= NEW_JAVAEE_NS+"/"+APP_7_XSD; // NOI18N public static final String APP_7_ID = "SCHEMA:"+APP_7; // NOI18N - + private static final String APP_8_XSD="application_8.xsd"; // NOI18N private static final String APP_8= NEW_JAVAEE_NS+"/"+APP_8_XSD; // NOI18N public static final String APP_8_ID = "SCHEMA:"+APP_8; // NOI18N - + private static final String APP_9_XSD="application_9.xsd"; // NOI18N private static final String APP_9= JAKARTAEE_NS+"/"+APP_9_XSD; // NOI18N public static final String APP_9_ID = "SCHEMA:"+APP_9; // NOI18N - + private static final String APP_10_XSD="application_10.xsd"; // NOI18N private static final String APP_10= JAKARTAEE_NS+"/"+APP_10_XSD; // NOI18N public static final String APP_10_ID = "SCHEMA:"+APP_10; // NOI18N - + + private static final String APP_11_XSD="application_11.xsd"; // NOI18N + private static final String APP_11= JAKARTAEE_NS+"/"+APP_11_XSD; // NOI18N + public static final String APP_11_ID = "SCHEMA:"+APP_11; // NOI18N + private static final String APPCLIENT_TAG="application-client"; //NOI18N private static final String APPCLIENT_1_4_XSD="application-client_1_4.xsd"; // NOI18N private static final String APPCLIENT_1_4= J2EE_NS+"/"+APPCLIENT_1_4_XSD; // NOI18N public static final String APPCLIENT_1_4_ID = "SCHEMA:"+APPCLIENT_1_4; // NOI18N - + private static final String APPCLIENT_5_XSD="application-client_5.xsd"; // NOI18N private static final String APPCLIENT_5= JAVAEE_NS+"/"+APPCLIENT_5_XSD; // NOI18N public static final String APPCLIENT_5_ID = "SCHEMA:"+APPCLIENT_5; // NOI18N - + private static final String APPCLIENT_6_XSD="application-client_6.xsd"; // NOI18N private static final String APPCLIENT_6= JAVAEE_NS+"/"+APPCLIENT_6_XSD; // NOI18N public static final String APPCLIENT_6_ID = "SCHEMA:"+APPCLIENT_6; // NOI18N - + private static final String APPCLIENT_7_XSD="application-client_7.xsd"; // NOI18N private static final String APPCLIENT_7= NEW_JAVAEE_NS+"/"+APPCLIENT_7_XSD; // NOI18N public static final String APPCLIENT_7_ID = "SCHEMA:"+APPCLIENT_7; // NOI18N - + private static final String APPCLIENT_8_XSD="application-client_8.xsd"; // NOI18N private static final String APPCLIENT_8= NEW_JAVAEE_NS+"/"+APPCLIENT_8_XSD; // NOI18N public static final String APPCLIENT_8_ID = "SCHEMA:"+APPCLIENT_8; // NOI18N - + private static final String APPCLIENT_9_XSD="application-client_9.xsd"; // NOI18N private static final String APPCLIENT_9= JAKARTAEE_NS+"/"+APPCLIENT_9_XSD; // NOI18N public static final String APPCLIENT_9_ID = "SCHEMA:"+APPCLIENT_9; // NOI18N @@ -524,6 +554,10 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String APPCLIENT_10= JAKARTAEE_NS+"/"+APPCLIENT_10_XSD; // NOI18N public static final String APPCLIENT_10_ID = "SCHEMA:"+APPCLIENT_10; // NOI18N + private static final String APPCLIENT_11_XSD="application-client_11.xsd"; // NOI18N + private static final String APPCLIENT_11= JAKARTAEE_NS+"/"+APPCLIENT_11_XSD; // NOI18N + public static final String APPCLIENT_11_ID = "SCHEMA:"+APPCLIENT_11; // NOI18N + private static final String WEBSERVICES_TAG="webservices"; //NOI18N private static final String WEBSERVICES_1_1_XSD="j2ee_web_services_1_1.xsd"; // NOI18N private static final String WEBSERVICES_1_1= IBM_J2EE_NS+"/"+WEBSERVICES_1_1_XSD; // NOI18N @@ -540,11 +574,11 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBSERVICES_1_3_XSD="javaee_web_services_1_3.xsd"; // NOI18N private static final String WEBSERVICES_1_3= JAVAEE_NS+"/"+WEBSERVICES_1_3_XSD; // NOI18N public static final String WEBSERVICES_1_3_ID = "SCHEMA:"+WEBSERVICES_1_3; // NOI18N - + private static final String WEBSERVICES_1_4_XSD="javaee_web_services_1_4.xsd"; // NOI18N private static final String WEBSERVICES_1_4= NEW_JAVAEE_NS+"/"+WEBSERVICES_1_4_XSD; // NOI18N public static final String WEBSERVICES_1_4_ID = "SCHEMA:"+WEBSERVICES_1_4; // NOI18N - + private static final String WEBSERVICES_2_0_XSD="jakartaee_web_services_2_0.xsd"; // NOI18N private static final String WEBSERVICES_2_0= JAKARTAEE_NS+"/"+WEBSERVICES_2_0_XSD; // NOI18N public static final String WEBSERVICES_2_0_ID = "SCHEMA:"+WEBSERVICES_2_0; // NOI18N @@ -556,11 +590,11 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBSERVICES_CLIENT_1_3_XSD="javaee_web_services_client_1_3.xsd"; // NOI18N private static final String WEBSERVICES_CLIENT_1_3= JAVAEE_NS+"/"+WEBSERVICES_CLIENT_1_3_XSD; // NOI18N public static final String WEBSERVICES_CLIENT_1_3_ID = "SCHEMA:"+WEBSERVICES_CLIENT_1_3; // NOI18N - + private static final String WEBSERVICES_CLIENT_1_4_XSD="javaee_web_services_client_1_4.xsd"; // NOI18N private static final String WEBSERVICES_CLIENT_1_4= NEW_JAVAEE_NS+"/"+WEBSERVICES_CLIENT_1_4_XSD; // NOI18N public static final String WEBSERVICES_CLIENT_1_4_ID = "SCHEMA:"+WEBSERVICES_CLIENT_1_4; // NOI18N - + private static final String WEBSERVICES_CLIENT_2_0_XSD="jakartaee_web_services_client_2_0.xsd"; // NOI18N private static final String WEBSERVICES_CLIENT_2_0= JAKARTAEE_NS+"/"+WEBSERVICES_CLIENT_2_0_XSD; // NOI18N public static final String WEBSERVICES_CLIENT_2_0_ID = "SCHEMA:"+WEBSERVICES_CLIENT_2_0; // NOI18N @@ -577,7 +611,7 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBCOMMON_3_0_XSD="web-common_3_0.xsd"; // NOI18N private static final String WEBCOMMON_3_0 = JAVAEE_NS+"/"+WEBCOMMON_3_0_XSD; // NOI18N public static final String WEBCOMMON_3_0_ID = "SCHEMA:"+WEBCOMMON_3_0; // NOI18N - + private static final String WEBFRAGMENT_3_0_XSD="web-fragment_3_0.xsd"; // NOI18N private static final String WEBFRAGMENT_3_0 = JAVAEE_NS+"/"+WEBFRAGMENT_3_0_XSD; // NOI18N public static final String WEBFRAGMENT_3_0_ID = "SCHEMA:"+WEBFRAGMENT_3_0; // NOI18N @@ -589,31 +623,31 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBCOMMON_3_1_XSD="web-common_3_1.xsd"; // NOI18N private static final String WEBCOMMON_3_1 = NEW_JAVAEE_NS+"/"+WEBCOMMON_3_1_XSD; // NOI18N public static final String WEBCOMMON_3_1_ID = "SCHEMA:"+WEBCOMMON_3_1; // NOI18N - + private static final String WEBFRAGMENT_3_1_XSD="web-fragment_3_1.xsd"; // NOI18N private static final String WEBFRAGMENT_3_1 = NEW_JAVAEE_NS+"/"+WEBFRAGMENT_3_1_XSD; // NOI18N public static final String WEBFRAGMENT_3_1_ID = "SCHEMA:"+WEBFRAGMENT_3_1; // NOI18N - + private static final String WEBAPP_4_0_XSD="web-app_4_0.xsd"; // NOI18N private static final String WEBAPP_4_0 = NEW_JAVAEE_NS+"/"+WEBAPP_4_0_XSD; // NOI18N public static final String WEBAPP_4_0_ID = "SCHEMA:"+WEBAPP_4_0; // NOI18N - + private static final String WEBCOMMON_4_0_XSD="web-common_4_0.xsd"; // NOI18N private static final String WEBCOMMON_4_0 = NEW_JAVAEE_NS+"/"+WEBCOMMON_4_0_XSD; // NOI18N public static final String WEBCOMMON_4_0_ID = "SCHEMA:"+WEBCOMMON_4_0; // NOI18N - + private static final String WEBFRAGMENT_4_0_XSD="web-fragment_4_0.xsd"; // NOI18N private static final String WEBFRAGMENT_4_0 = NEW_JAVAEE_NS+"/"+WEBFRAGMENT_4_0_XSD; // NOI18N public static final String WEBFRAGMENT_4_0_ID = "SCHEMA:"+WEBFRAGMENT_4_0; // NOI18N - + private static final String WEBAPP_5_0_XSD="web-app_5_0.xsd"; // NOI18N private static final String WEBAPP_5_0 = JAKARTAEE_NS+"/"+WEBAPP_5_0_XSD; // NOI18N public static final String WEBAPP_5_0_ID = "SCHEMA:"+WEBAPP_5_0; // NOI18N - + private static final String WEBCOMMON_5_0_XSD="web-common_5_0.xsd"; // NOI18N private static final String WEBCOMMON_5_0 = JAKARTAEE_NS+"/"+WEBCOMMON_5_0_XSD; // NOI18N public static final String WEBCOMMON_5_0_ID = "SCHEMA:"+WEBCOMMON_5_0; // NOI18N - + private static final String WEBFRAGMENT_5_0_XSD="web-fragment_5_0.xsd"; // NOI18N private static final String WEBFRAGMENT_5_0 = JAKARTAEE_NS+"/"+WEBFRAGMENT_5_0_XSD; // NOI18N public static final String WEBFRAGMENT_5_0_ID = "SCHEMA:"+WEBFRAGMENT_5_0; // NOI18N @@ -621,48 +655,64 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String WEBAPP_6_0_XSD="web-app_6_0.xsd"; // NOI18N private static final String WEBAPP_6_0 = JAKARTAEE_NS+"/"+WEBAPP_6_0_XSD; // NOI18N public static final String WEBAPP_6_0_ID = "SCHEMA:"+WEBAPP_6_0; // NOI18N - + private static final String WEBCOMMON_6_0_XSD="web-common_6_0.xsd"; // NOI18N private static final String WEBCOMMON_6_0 = JAKARTAEE_NS+"/"+WEBCOMMON_6_0_XSD; // NOI18N public static final String WEBCOMMON_6_0_ID = "SCHEMA:"+WEBCOMMON_6_0; // NOI18N - + private static final String WEBFRAGMENT_6_0_XSD="web-fragment_6_0.xsd"; // NOI18N private static final String WEBFRAGMENT_6_0 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_0_XSD; // NOI18N public static final String WEBFRAGMENT_6_0_ID = "SCHEMA:"+WEBFRAGMENT_6_0; // NOI18N + private static final String WEBAPP_6_1_XSD="web-app_6_1.xsd"; // NOI18N + private static final String WEBAPP_6_1 = JAKARTAEE_NS+"/"+WEBAPP_6_1_XSD; // NOI18N + public static final String WEBAPP_6_1_ID = "SCHEMA:"+WEBAPP_6_1; // NOI18N + + private static final String WEBCOMMON_6_1_XSD="web-common_6_1.xsd"; // NOI18N + private static final String WEBCOMMON_6_1 = JAKARTAEE_NS+"/"+WEBCOMMON_6_1_XSD; // NOI18N + public static final String WEBCOMMON_6_1_ID = "SCHEMA:"+WEBCOMMON_6_1; // NOI18N + + private static final String WEBFRAGMENT_6_1_XSD="web-fragment_6_1.xsd"; // NOI18N + private static final String WEBFRAGMENT_6_1 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_1_XSD; // NOI18N + public static final String WEBFRAGMENT_6_1_ID = "SCHEMA:"+WEBFRAGMENT_6_1; // NOI18N + public static final String PERSISTENCE_NS = "http://java.sun.com/xml/ns/persistence"; // NOI18N public static final String NEW_PERSISTENCE_NS = "http://xmlns.jcp.org/xml/ns/persistence"; // NOI18N public static final String JAKARTA_PERSISTENCE_NS = "https://jakarta.ee/xml/ns/persistence"; // NOI18N - + private static final String PERSISTENCE_TAG="persistence"; //NOI18N private static final String PERSISTENCE_XSD="persistence_1_0.xsd"; // NOI18N private static final String PERSISTENCE = PERSISTENCE_NS+"/"+PERSISTENCE_XSD; // NOI18N - public static final String PERSISTENCE_ID = "SCHEMA:"+PERSISTENCE; // NOI18N - + public static final String PERSISTENCE_ID = "SCHEMA:"+PERSISTENCE; // NOI18N + private static final String PERSISTENCE_2_0_XSD="persistence_2_0.xsd"; // NOI18N private static final String PERSISTENCE_2_0 = PERSISTENCE_NS+"/"+PERSISTENCE_2_0_XSD; // NOI18N - public static final String PERSISTENCE_2_0_ID = "SCHEMA:"+PERSISTENCE_2_0; // NOI18N - + public static final String PERSISTENCE_2_0_ID = "SCHEMA:"+PERSISTENCE_2_0; // NOI18N + private static final String PERSISTENCE_2_1_XSD="persistence_2_1.xsd"; // NOI18N private static final String PERSISTENCE_2_1 = NEW_PERSISTENCE_NS+"/"+PERSISTENCE_2_1_XSD; // NOI18N - public static final String PERSISTENCE_2_1_ID = "SCHEMA:"+PERSISTENCE_2_1; // NOI18N - + public static final String PERSISTENCE_2_1_ID = "SCHEMA:"+PERSISTENCE_2_1; // NOI18N + private static final String PERSISTENCE_2_2_XSD="persistence_2_2.xsd"; // NOI18N private static final String PERSISTENCE_2_2 = NEW_PERSISTENCE_NS+"/"+PERSISTENCE_2_2_XSD; // NOI18N - public static final String PERSISTENCE_2_2_ID = "SCHEMA:"+PERSISTENCE_2_2; // NOI18N - + public static final String PERSISTENCE_2_2_ID = "SCHEMA:"+PERSISTENCE_2_2; // NOI18N + private static final String PERSISTENCE_3_0_XSD="persistence_3_0.xsd"; // NOI18N private static final String PERSISTENCE_3_0 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_0_XSD; // NOI18N public static final String PERSISTENCE_3_0_ID = "SCHEMA:"+PERSISTENCE_3_0; // NOI18N - + private static final String PERSISTENCE_3_1_XSD="persistence_3_0.xsd"; // NOI18N private static final String PERSISTENCE_3_1 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_1_XSD; // NOI18N public static final String PERSISTENCE_3_1_ID = "SCHEMA:"+PERSISTENCE_3_1; // NOI18N - + + private static final String PERSISTENCE_3_2_XSD="persistence_3_2.xsd"; // NOI18N + private static final String PERSISTENCE_3_2 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_2_XSD; // NOI18N + public static final String PERSISTENCE_3_2_ID = "SCHEMA:"+PERSISTENCE_3_2; // NOI18N + public static final String PERSISTENCEORM_NS = "http://java.sun.com/xml/ns/persistence/orm"; // NOI18N public static final String NEW_PERSISTENCEORM_NS = "http://xmlns.jcp.org/xml/ns/persistence/orm"; // NOI18N public static final String JAKARTA_PERSISTENCEORM_NS = "https://jakarta.ee/xml/ns/persistence/orm"; // NOI18N - + private static final String PERSISTENCEORM_TAG="entity-mappings"; //NOI18N private static final String PERSISTENCEORM_XSD="orm_1_0.xsd"; // NOI18N private static final String PERSISTENCEORM = PERSISTENCE_NS+"/"+PERSISTENCEORM_XSD; // NOI18N yes not ORM NS!!! @@ -675,25 +725,62 @@ public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { private static final String PERSISTENCEORM_2_1_XSD="orm_2_1.xsd"; // NOI18N private static final String PERSISTENCEORM_2_1 = NEW_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_2_1_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_2_1_ID = "SCHEMA:"+PERSISTENCEORM_2_1; // NOI18N - + private static final String PERSISTENCEORM_2_2_XSD="orm_2_2.xsd"; // NOI18N private static final String PERSISTENCEORM_2_2 = NEW_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_2_2_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_2_2_ID = "SCHEMA:"+PERSISTENCEORM_2_2; // NOI18N - + private static final String PERSISTENCEORM_3_0_XSD="orm_3_0.xsd"; // NOI18N private static final String PERSISTENCEORM_3_0 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_0_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_3_0_ID = "SCHEMA:"+PERSISTENCEORM_3_0; // NOI18N - + private static final String PERSISTENCEORM_3_1_XSD="orm_3_1.xsd"; // NOI18N private static final String PERSISTENCEORM_3_1 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_1_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_3_1_ID = "SCHEMA:"+PERSISTENCEORM_3_1; // NOI18N - + + private static final String PERSISTENCEORM_3_2_XSD="orm_3_2.xsd"; // NOI18N + private static final String PERSISTENCEORM_3_2 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_2_XSD; // NOI18N yes not ORM NS!!! + public static final String PERSISTENCEORM_3_2_ID = "SCHEMA:"+PERSISTENCEORM_3_2; // NOI18N + + private static final String[] SUPPORTED_SCHEMAS = new String[]{ + // ejb + EJBJAR_2_1_XSD, EJBJAR_3_0_XSD, EJBJAR_3_1_XSD, EJBJAR_3_2_XSD, EJBJAR_4_0_XSD, + // application & application-client + APP_1_4_XSD, APPCLIENT_1_4_XSD, APP_5_XSD, APPCLIENT_5_XSD, + APP_6_XSD, APPCLIENT_6_XSD, APP_7_XSD, APPCLIENT_7_XSD, + APP_8_XSD, APPCLIENT_8_XSD, APP_9_XSD, APPCLIENT_9_XSD, + APP_10_XSD, APPCLIENT_10_XSD, APP_11_XSD, APPCLIENT_11_XSD, + //web-app, web-common & web-fragment + WEBAPP_2_5_XSD, + WEBAPP_3_0_XSD, WEBFRAGMENT_3_0_XSD, WEBCOMMON_3_0_XSD, + WEBAPP_3_1_XSD, WEBFRAGMENT_3_1_XSD, WEBCOMMON_3_1_XSD, + WEBAPP_4_0_XSD, WEBFRAGMENT_4_0_XSD, WEBCOMMON_4_0_XSD, + WEBAPP_5_0_XSD, WEBFRAGMENT_5_0_XSD, WEBCOMMON_5_0_XSD, + WEBAPP_6_0_XSD, WEBFRAGMENT_6_0_XSD, WEBCOMMON_6_0_XSD, + WEBAPP_6_1_XSD, WEBFRAGMENT_6_1_XSD, WEBCOMMON_6_1_XSD, + //persistence & orm + PERSISTENCE_XSD, PERSISTENCEORM_XSD, + PERSISTENCE_2_0_XSD, PERSISTENCEORM_2_0_XSD, + PERSISTENCE_2_1_XSD, PERSISTENCEORM_2_1_XSD, + PERSISTENCE_2_2_XSD, PERSISTENCEORM_2_2_XSD, + PERSISTENCE_3_0_XSD, PERSISTENCEORM_3_0_XSD, + PERSISTENCE_3_1_XSD, PERSISTENCEORM_3_1_XSD, + PERSISTENCE_3_2_XSD, PERSISTENCEORM_3_2_XSD, + //webservice & webservice-client + WEBSERVICES_1_1_XSD, WEBSERVICES_CLIENT_1_1_XSD, + WEBSERVICES_1_2_XSD, WEBSERVICES_CLIENT_1_2_XSD, + WEBSERVICES_1_3_XSD, WEBSERVICES_CLIENT_1_3_XSD, + WEBSERVICES_1_4_XSD, WEBSERVICES_CLIENT_1_4_XSD, + WEBSERVICES_2_0_XSD, WEBSERVICES_CLIENT_2_0_XSD, + "jdbc-data-source.xsd" + }; + public String getFullURLFromSystemId(String systemId){ return null; - + } - - private static String SCHEMASLOCATION=null; + + private static File SCHEMASLOCATION=null; /** * Resolves schema definition file for deployment descriptor (spec.2_4) * @param publicId publicId for resolved entity (null in our case) @@ -702,7 +789,7 @@ public String getFullURLFromSystemId(String systemId){ */ @Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { - + if (SCHEMASLOCATION == null) { if (platformRootDir == null) { return null; @@ -710,154 +797,47 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc if (!platformRootDir.exists()) { return null; } - - String installRoot = platformRootDir.getAbsolutePath(); //System.getProperty("com.sun.aas.installRoot"); - if (installRoot==null) + + String installRoot = platformRootDir.getAbsolutePath(); //System.getProperty("com.sun.aas.installRoot"); + if (installRoot == null) { return null; + } File f = new File(installRoot); - if (f.exists()==false) + if (!f.exists()) { + return null; + } + File f2 = new File(installRoot, "/lib/schemas/"); + if (!f2.exists()) { return null; - File file = new File(installRoot+"/lib/schemas/"); - SCHEMASLOCATION = ""; - try{ - SCHEMASLOCATION= file.toURI().toURL().toExternalForm(); - }catch(Exception e){ - Logger.getLogger("payara-jakartaee").log(Level.INFO, file.getAbsolutePath(), e); // NOI18N } + SCHEMASLOCATION = f2; } - + if (systemId != null) { - if (systemId.endsWith(EJBJAR_2_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + EJBJAR_2_1_XSD); - } else if (systemId.endsWith(EJBJAR_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + EJBJAR_3_0_XSD); - } else if (systemId.endsWith(EJBJAR_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + EJBJAR_3_1_XSD); - } else if (systemId.endsWith(EJBJAR_3_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + EJBJAR_3_2_XSD); - } else if (systemId.endsWith(EJBJAR_4_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + EJBJAR_4_0_XSD); - } // application & application-client - else if (systemId.endsWith(APP_1_4_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APP_1_4_XSD); - } else if (systemId.endsWith(APPCLIENT_1_4_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APPCLIENT_1_4_XSD); - } else if (systemId.endsWith(APP_5_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APP_5_XSD); - } else if (systemId.endsWith(APPCLIENT_5_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APPCLIENT_5_XSD); - } else if (systemId.endsWith(APP_6_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APP_6_XSD); - } else if (systemId.endsWith(APPCLIENT_6_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APPCLIENT_6_XSD); - } else if (systemId.endsWith(APP_7_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APP_7_XSD); - } else if (systemId.endsWith(APPCLIENT_7_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APPCLIENT_7_XSD); - } else if (systemId.endsWith(APP_8_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APP_8_XSD); - } else if (systemId.endsWith(APPCLIENT_8_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APPCLIENT_8_XSD); - } else if (systemId.endsWith(APP_9_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APP_9_XSD); - } else if (systemId.endsWith(APPCLIENT_9_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APPCLIENT_9_XSD); - } else if (systemId.endsWith(APP_10_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APP_10_XSD); - } else if (systemId.endsWith(APPCLIENT_10_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + APPCLIENT_10_XSD); - } //web-app, web-common & web-fragment - else if (systemId.endsWith(WEBAPP_2_5_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBAPP_2_5_XSD); - } else if (systemId.endsWith(WEBAPP_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBAPP_3_0_XSD); - } else if (systemId.endsWith(WEBFRAGMENT_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBFRAGMENT_3_0_XSD); - } else if (systemId.endsWith(WEBCOMMON_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBCOMMON_3_0_XSD); - } else if (systemId.endsWith(WEBAPP_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBAPP_3_1_XSD); - } else if (systemId.endsWith(WEBFRAGMENT_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBFRAGMENT_3_1_XSD); - } else if (systemId.endsWith(WEBCOMMON_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBCOMMON_3_1_XSD); - } else if (systemId.endsWith(WEBAPP_4_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBAPP_4_0_XSD); - } else if (systemId.endsWith(WEBFRAGMENT_4_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBFRAGMENT_4_0_XSD); - } else if (systemId.endsWith(WEBCOMMON_4_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBCOMMON_4_0_XSD); - } else if (systemId.endsWith(WEBAPP_5_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBAPP_5_0_XSD); - } else if (systemId.endsWith(WEBFRAGMENT_5_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBFRAGMENT_5_0_XSD); - } else if (systemId.endsWith(WEBCOMMON_5_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBCOMMON_5_0_XSD); - } else if (systemId.endsWith(WEBAPP_6_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBAPP_6_0_XSD); - } else if (systemId.endsWith(WEBFRAGMENT_6_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBFRAGMENT_6_0_XSD); - } else if (systemId.endsWith(WEBCOMMON_6_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBCOMMON_6_0_XSD); - } //persistence & orm - else if (systemId.endsWith(PERSISTENCEORM_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCEORM_XSD); - } else if (systemId.endsWith(PERSISTENCE_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCE_XSD); - } else if (systemId.endsWith(PERSISTENCEORM_2_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCEORM_2_0_XSD); - } else if (systemId.endsWith(PERSISTENCE_2_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCE_2_0_XSD); - } else if (systemId.endsWith(PERSISTENCEORM_2_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCEORM_2_1_XSD); - } else if (systemId.endsWith(PERSISTENCE_2_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCE_2_1_XSD); - } else if (systemId.endsWith(PERSISTENCEORM_2_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCEORM_2_2_XSD); - } else if (systemId.endsWith(PERSISTENCE_2_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCE_2_2_XSD); - } else if (systemId.endsWith(PERSISTENCEORM_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCEORM_3_0_XSD); - } else if ( systemId.endsWith(PERSISTENCEORM_3_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION+PERSISTENCEORM_3_1_XSD); - } else if (systemId.endsWith(PERSISTENCE_3_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + PERSISTENCE_3_0_XSD); - } //webservice & webservice-client - else if (systemId.endsWith(WEBSERVICES_1_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_1_1_XSD); - } else if (systemId.endsWith(WEBSERVICES_1_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_1_2_XSD); - } else if (systemId.endsWith(WEBSERVICES_1_3_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_1_3_XSD); - } else if (systemId.endsWith(WEBSERVICES_1_4_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_1_4_XSD); - } else if (systemId.endsWith(WEBSERVICES_2_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_2_0_XSD); - } else if (systemId.endsWith(WEBSERVICES_CLIENT_1_1_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_CLIENT_1_1_XSD); - } else if (systemId.endsWith(WEBSERVICES_CLIENT_1_2_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_CLIENT_1_2_XSD); - } else if (systemId.endsWith(WEBSERVICES_CLIENT_1_3_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_CLIENT_1_3_XSD); - } else if (systemId.endsWith(WEBSERVICES_CLIENT_1_4_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_CLIENT_1_4_XSD); - } else if (systemId.endsWith(WEBSERVICES_CLIENT_2_0_XSD)) { - return new org.xml.sax.InputSource(SCHEMASLOCATION + WEBSERVICES_CLIENT_2_0_XSD); - } else if (systemId.endsWith("jdbc-data-source.xsd")) { //NOI18N - return new org.xml.sax.InputSource(SCHEMASLOCATION + "jdbc-data-source.xsd"); //NOI18N - } else if (XML_XSD.equals(systemId)) { + for(String schema : SUPPORTED_SCHEMAS) { + if (systemId.endsWith(schema)) { + File schemaFile = new File(SCHEMASLOCATION, schema); + if(! schemaFile.exists()) { + return null; + } else { + return new org.xml.sax.InputSource(Utilities.toURI(schemaFile).toURL().toExternalForm()); + } + } + } + if (XML_XSD.equals(systemId)) { return new org.xml.sax.InputSource(new java.io.StringReader(XML_XSD_DEF)); } } + return null; } - + @Override public Enumeration enabled(GrammarEnvironment ctx) { if (ctx.getFileObject() == null) return null; Enumeration en = ctx.getDocumentChildren(); while (en.hasMoreElements()) { - Node next = (Node) en.nextElement(); + Node next = en.nextElement(); if (next.getNodeType() == Node.DOCUMENT_TYPE_NODE) { return null; // null for web.xml specified by DTD } else if (next.getNodeType() == Node.ELEMENT_NODE) { @@ -883,12 +863,12 @@ public Enumeration enabled(GrammarEnvironment ctx) { } return null; } - + @Override public FeatureDescriptor getDescriptor() { return new FeatureDescriptor(); } - + /** Returns pseudo DTD for code completion */ @Override @@ -900,16 +880,16 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { //System.out.println(is.getSystemId()); //System.out.println(is); if (catalog != null) { - + EntityResolver resolver = catalog.getEntityResolver(); if (resolver != null) { try { - + if (ctx.getFileObject() == null) { return null; } - InputSource inputSource = null; - + InputSource inputSource = null; + String mimeType = ctx.getFileObject().getMIMEType(); if (mimeType == null){ return null; @@ -925,10 +905,16 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { inputSource = resolver.resolveEntity(EJBJAR_3_1_ID, ""); break; case "text/x-dd-ejbjar3.0": // NOI18N - inputSource = resolver.resolveEntity(EJBJAR_3_0_ID, ""); + inputSource = resolver.resolveEntity(EJBJAR_3_0_ID, ""); break; case "text/x-dd-ejbjar2.1": // NOI18N - inputSource = resolver.resolveEntity(EJBJAR_2_1_ID, ""); + inputSource = resolver.resolveEntity(EJBJAR_2_1_ID, ""); + break; + case "text/x-dd-application11.0": // NOI18N + inputSource = resolver.resolveEntity(APP_11_ID, ""); + break; + case "text/x-dd-application10.0": // NOI18N + inputSource = resolver.resolveEntity(APP_10_ID, ""); break; case "text/x-dd-application9.0": // NOI18N inputSource = resolver.resolveEntity(APP_9_ID, ""); @@ -943,10 +929,16 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { inputSource = resolver.resolveEntity(APP_6_ID, ""); break; case "text/x-dd-application5.0": // NOI18N - inputSource = resolver.resolveEntity(APP_5_ID, ""); + inputSource = resolver.resolveEntity(APP_5_ID, ""); break; case "text/x-dd-application1.4": // NOI18N - inputSource = resolver.resolveEntity(APP_1_4_ID, ""); + inputSource = resolver.resolveEntity(APP_1_4_ID, ""); + break; + case "text/x-dd-client11.0": // NOI18N + inputSource = resolver.resolveEntity(APPCLIENT_11_ID, ""); + break; + case "text/x-dd-client10.0": // NOI18N + inputSource = resolver.resolveEntity(APPCLIENT_10_ID, ""); break; case "text/x-dd-client9.0": // NOI18N inputSource = resolver.resolveEntity(APPCLIENT_9_ID, ""); @@ -961,10 +953,13 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { inputSource = resolver.resolveEntity(APPCLIENT_6_ID, ""); break; case "text/x-dd-client5.0": // NOI18N - inputSource = resolver.resolveEntity(APPCLIENT_5_ID, ""); + inputSource = resolver.resolveEntity(APPCLIENT_5_ID, ""); break; case "text/x-dd-client1.4": // NOI18N - inputSource = resolver.resolveEntity(APPCLIENT_1_4_ID, ""); + inputSource = resolver.resolveEntity(APPCLIENT_1_4_ID, ""); + break; + case "text/x-dd-servlet6.1": // NOI18N + inputSource = resolver.resolveEntity(WEBAPP_6_1_ID, ""); break; case "text/x-dd-servlet6.0": // NOI18N inputSource = resolver.resolveEntity(WEBAPP_6_0_ID, ""); @@ -984,6 +979,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-servlet2.5": // NOI18N inputSource = resolver.resolveEntity(WEBAPP_2_5_ID, ""); break; + case "text/x-dd-servlet-fragment6.1": // NOI18N + inputSource = resolver.resolveEntity(WEBFRAGMENT_6_1_ID, ""); + break; case "text/x-dd-servlet-fragment6.0": // NOI18N inputSource = resolver.resolveEntity(WEBFRAGMENT_6_0_ID, ""); break; @@ -999,6 +997,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-servlet-fragment3.0": // NOI18N inputSource = resolver.resolveEntity(WEBFRAGMENT_3_0_ID, ""); break; + case "text/x-persistence3.2": // NOI18N + inputSource = resolver.resolveEntity(PERSISTENCE_3_2_ID, ""); + break; case "text/x-persistence3.1": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCE_3_1_ID, ""); break; @@ -1017,6 +1018,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-persistence1.0": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCE_ID, ""); break; + case "text/x-orm3.2": // NOI18N + inputSource = resolver.resolveEntity(PERSISTENCEORM_3_2_ID, ""); + break; case "text/x-orm3.1": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCEORM_3_1_ID, ""); break; @@ -1033,7 +1037,7 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { inputSource = resolver.resolveEntity(PERSISTENCEORM_2_0_ID, ""); break; case "text/x-orm1.0": // NOI18N - inputSource = resolver.resolveEntity(PERSISTENCEORM_ID, ""); + inputSource = resolver.resolveEntity(PERSISTENCEORM_ID, ""); break; default: break; @@ -1042,7 +1046,7 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { if (inputSource != null) { return DTDUtil.parseDTD(true, inputSource); } - + if (is.getSystemId().endsWith("webservices.xml") ) { // NOI18N // System.out.println("webservices tag"); inputSource = resolver.resolveEntity(WEBSERVICES_1_1_ID, ""); @@ -1050,11 +1054,11 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { return DTDUtil.parseDTD(true, inputSource); } } - + } catch(SAXException e) { } catch(java.io.IOException e) { //System.out.println("eeee"); - e.printStackTrace(); + LOGGER.log(Level.WARNING, null, e); } } } @@ -1063,6 +1067,8 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { /** * Get registered URI for the given name or null if not registered. + * + * @param name * @return null if not registered */ @Override @@ -1074,34 +1080,37 @@ public String resolveURI(String name) { if (!platformRootDir.exists()) { return null; } - String installRoot = platformRootDir.getAbsolutePath(); - String prefix =""; - File file = new File(installRoot+"/lib/schemas/"); - try{ - prefix= file.toURI().toURL().toExternalForm(); - }catch(Exception e){ - Logger.getLogger("payara-jakartaee").log(Level.INFO, file.getAbsolutePath(), e); // NOI18N + String installRoot = platformRootDir.getAbsolutePath(); + String prefix = ""; + File file = new File(installRoot + "/lib/schemas/"); + try { + prefix = Utilities.toURI(file).toURL().toExternalForm(); + } catch (RuntimeException | MalformedURLException e) { + LOGGER.log(Level.INFO, file.getAbsolutePath(), e); // NOI18N } - if (name.equals("http://java.sun.com/xml/ns/jax-rpc/ri/config")){ - return prefix +"jax-rpc-ri-config.xsd"; + if (name.equals("http://java.sun.com/xml/ns/jax-rpc/ri/config")) { + return prefix + "jax-rpc-ri-config.xsd"; } // if (name.equals("http://java.sun.com/xml/ns/persistence")){ // System.out.println("prefix +persistence.xsd="+ prefix +"persistence.xsd"); // return prefix +"persistence.xsd"; -// } +// } // ludo: this is meant to be this way. - if (name.equals("http://java.sun.com/xml/ns/j2eeppppppp")){ - return prefix +"j2ee_web_services_1_1.xsd"; + if (name.equals("http://java.sun.com/xml/ns/j2eeppppppp")) { + return prefix + "j2ee_web_services_1_1.xsd"; } - + return null; } + /** * Get registered URI for the given publicId or null if not registered. + * + * @param publicId * @return null if not registered - */ + */ @Override public String resolvePublic(String publicId) { return null; - } + } } diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ide/Hk2TargetModuleID.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ide/Hk2TargetModuleID.java index 2ec4e32a294d..99314127a6b0 100644 --- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ide/Hk2TargetModuleID.java +++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ide/Hk2TargetModuleID.java @@ -111,7 +111,7 @@ public TargetModuleID getParentTargetModuleID() { } public TargetModuleID [] getChildTargetModuleID() { - return children.toArray(new TargetModuleID[children.size()]); + return children.toArray(new TargetModuleID[0]); } public void setParent(Hk2TargetModuleID parent) { diff --git a/enterprise/payara.micro/manifest.mf b/enterprise/payara.micro/manifest.mf index 7664996fd3a1..3bc5198c7948 100644 --- a/enterprise/payara.micro/manifest.mf +++ b/enterprise/payara.micro/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.payara.micro/0 OpenIDE-Module-Layer: org/netbeans/modules/fish/payara/micro/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/fish/payara/micro/Bundle.properties -OpenIDE-Module-Specification-Version: 2.18 +OpenIDE-Module-Specification-Version: 2.20 diff --git a/enterprise/payara.micro/nbproject/org-netbeans-modules-payara-micro.sig b/enterprise/payara.micro/nbproject/org-netbeans-modules-payara-micro.sig index cd2127382ef0..216889d024d5 100644 --- a/enterprise/payara.micro/nbproject/org-netbeans-modules-payara-micro.sig +++ b/enterprise/payara.micro/nbproject/org-netbeans-modules-payara-micro.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.17 +#Version 2.18 CLSS public java.lang.Object cons public init() diff --git a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java index bbd6fbb0a9bb..c75aa62c3e89 100644 --- a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java +++ b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java @@ -506,7 +506,7 @@ private void runJPDAAppReloaded() { ClassLoader reloadedClassLoader = customDefClassLoaders.get(reloadedPackageName); if (reloadedClassLoader != null) { Class reloadedClass = reloadedClassLoader.loadClass(reloadedClassName); - reloadedClass.getMethod("execute").invoke(reloadedClass.newInstance()); + reloadedClass.getMethod("execute").invoke(reloadedClass.getDeclaredConstructor().newInstance()); } } catch (Exception ex) { Exceptions.printStackTrace(ex); diff --git a/enterprise/payara.tooling/manifest.mf b/enterprise/payara.tooling/manifest.mf index 44a674bdcd99..3a9d608bdbbf 100644 --- a/enterprise/payara.tooling/manifest.mf +++ b/enterprise/payara.tooling/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.payara.tooling/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/payara/tooling/Bundle.properties -OpenIDE-Module-Specification-Version: 2.18 +OpenIDE-Module-Specification-Version: 2.20 diff --git a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig index e9ac67250856..f9592521b3b1 100644 --- a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig +++ b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.17 +#Version 2.18 CLSS public abstract interface java.io.Closeable intf java.lang.AutoCloseable diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java index c26489869d52..79427468f2ad 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java @@ -84,7 +84,13 @@ public enum JavaEEProfile { v10_0_0_web(Version.v10_0_0, Type.WEB, "10.0.0-web"), /** JakartaEE 10 full profile. */ - v10_0_0(Version.v10_0_0, Type.FULL, "10.0.0"); + v10_0_0(Version.v10_0_0, Type.FULL, "10.0.0"), + + /** JakartaEE 11 web profile. */ + v11_0_0_web(Version.v11_0_0, Type.WEB, "11.0.0-web"), + + /** JakartaEE 11 full profile. */ + v11_0_0(Version.v11_0_0, Type.FULL, "11.0.0"); //////////////////////////////////////////////////////////////////////////// // Inner enums // @@ -144,7 +150,9 @@ public enum Version { /** JakartaEE 9.1. */ v9_1_0("9.1.0"), /** JakartaEE 10.0 */ - v10_0_0("10.0.0"); + v10_0_0("10.0.0"), + /** JakartaEE 11.0 */ + v11_0_0("11.0.0"); /** JavaEE profile type name. */ private final String name; diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java index 1dbdd74f60e5..445742ee121e 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java @@ -51,7 +51,9 @@ public enum JavaSEPlatform { /** JavaSE 11. */ v11, /** JavaSE 17. */ - v17; + v17, + /** JavaSE 21. */ + v21; //////////////////////////////////////////////////////////////////////////// // Class attributes // @@ -59,7 +61,7 @@ public enum JavaSEPlatform { /** Payara JavaEE platform enumeration length. */ public static final int length = JavaSEPlatform.values().length; - + /** JavaEE platform version elements separator character. */ public static final char SEPARATOR = '.'; @@ -93,6 +95,9 @@ public enum JavaSEPlatform { /** A String representation of v17 value. */ static final String V17_STR = "17"; + /** A String representation of v21 value. */ + static final String V21_STR = "21"; + /** * Stored String values for backward String * conversion. @@ -154,6 +159,7 @@ public String toString() { case v1_8: return V1_8_STR; case v11: return V11_STR; case v17: return V17_STR; + case v21: return V21_STR; // This is unrecheable. Being here means this class does not handle // all possible values correctly. default: throw new ServerConfigException( diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV6.xml b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV6.xml index 302d44de9ab3..a8318a94eee3 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV6.xml +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV6.xml @@ -31,6 +31,10 @@ under the License. + + + + diff --git a/enterprise/profiler.j2ee/manifest.mf b/enterprise/profiler.j2ee/manifest.mf index 4b60c63ae9d5..6c359837fa8d 100644 --- a/enterprise/profiler.j2ee/manifest.mf +++ b/enterprise/profiler.j2ee/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.j2ee/1 OpenIDE-Module-Layer: org/netbeans/modules/profiler/j2ee/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/j2ee/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.59 diff --git a/enterprise/projectimport.eclipse.web/nbproject/project.properties b/enterprise/projectimport.eclipse.web/nbproject/project.properties index e2794a766a2e..7da726cf5cf2 100644 --- a/enterprise/projectimport.eclipse.web/nbproject/project.properties +++ b/enterprise/projectimport.eclipse.web/nbproject/project.properties @@ -17,4 +17,4 @@ is.eager=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.47.0 +spec.version.base=1.49.0 diff --git a/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig b/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig index 4be91af454c9..62f30cd864c1 100644 --- a/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig +++ b/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.52.0 +#Version 1.53.0 CLSS public abstract interface java.io.Closeable intf java.lang.AutoCloseable diff --git a/enterprise/servletjspapi/nbproject/project.properties b/enterprise/servletjspapi/nbproject/project.properties index 591ecfc8ceb1..da099bc66cde 100644 --- a/enterprise/servletjspapi/nbproject/project.properties +++ b/enterprise/servletjspapi/nbproject/project.properties @@ -18,7 +18,7 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.53.0 +spec.version.base=1.55.0 release.external/generated-servlet-jsp-api-4.0_2.3.jar=modules/ext/servlet4.0-jsp2.3-api.jar extra.module.files=modules/ext/servlet4.0-jsp2.3-api.jar diff --git a/enterprise/spring.webmvc/manifest.mf b/enterprise/spring.webmvc/manifest.mf index 571b4d3e5407..43331f778ced 100644 --- a/enterprise/spring.webmvc/manifest.mf +++ b/enterprise/spring.webmvc/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.spring.webmvc OpenIDE-Module-Layer: org/netbeans/modules/spring/webmvc/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/spring/webmvc/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.59 +OpenIDE-Module-Specification-Version: 1.61 OpenIDE-Module-Provides: org.netbeans.modules.web.project.framework diff --git a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/SpringConfigPanelVisual.java b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/SpringConfigPanelVisual.java index 253a1bdcdb05..281063dbf315 100644 --- a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/SpringConfigPanelVisual.java +++ b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/SpringConfigPanelVisual.java @@ -288,17 +288,14 @@ public void run() { springLibs.add(new SpringLibrary(library)); } } - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - cbSpringVersion.setModel(new DefaultComboBoxModel(items.toArray(new String[items.size()]))); - int selectedIndex = cbSpringVersion.getSelectedIndex(); - if (selectedIndex < springLibs.size()) { - springLibrary = springLibs.get(selectedIndex); - libsInitialized = true; - repaint(); - fireChange(); - } + SwingUtilities.invokeLater(() -> { + cbSpringVersion.setModel(new DefaultComboBoxModel(items.toArray(new String[0]))); + int selectedIndex = cbSpringVersion.getSelectedIndex(); + if (selectedIndex < springLibs.size()) { + springLibrary = springLibs.get(selectedIndex); + libsInitialized = true; + repaint(); + fireChange(); } }); LOG.log(Level.FINEST, "Time spent in {0} initLibraries = {1} ms", diff --git a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/SpringWebModuleExtender.java b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/SpringWebModuleExtender.java index c6c9fccc79bd..0b19fe3ea2b5 100644 --- a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/SpringWebModuleExtender.java +++ b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/SpringWebModuleExtender.java @@ -126,6 +126,7 @@ public boolean getIncludeJstl() { return includeJstl; } + @Override public synchronized SpringConfigPanelVisual getComponent() { if (component == null) { component = new SpringConfigPanelVisual(this); @@ -134,6 +135,7 @@ public synchronized SpringConfigPanelVisual getComponent() { return component; } + @Override public boolean isValid() { if (dispatcherName == null || dispatcherName.trim().length() == 0){ controller.setErrorMessage(NbBundle.getMessage(SpringConfigPanelVisual.class, "MSG_DispatcherNameIsEmpty")); // NOI18N @@ -166,18 +168,22 @@ public boolean isValid() { return true; } + @Override public HelpCtx getHelp() { return new HelpCtx(SpringWebModuleExtender.class); } + @Override public final void addChangeListener(ChangeListener l) { changeSupport.addChangeListener(l); } + @Override public final void removeChangeListener(ChangeListener l) { changeSupport.removeChangeListener(l); } + @Override public void stateChanged(ChangeEvent e) { dispatcherName = getComponent().getDispatcherName(); dispatcherMapping = getComponent().getDispatcherMapping(); @@ -238,7 +244,7 @@ private class CreateSpringConfig implements FileSystem.AtomicAction { public static final String DISPATCHER_SERVLET = "org.springframework.web.servlet.DispatcherServlet"; // NOI18N public static final String ENCODING = "UTF-8"; // NOI18N - private final Set filesToOpen = new LinkedHashSet(); + private final Set filesToOpen = new LinkedHashSet<>(); private final WebModule webModule; public CreateSpringConfig(WebModule webModule) { @@ -248,6 +254,7 @@ public CreateSpringConfig(WebModule webModule) { @NbBundle.Messages({ "CreateSpringConfig.msg.invalid.dd=Deployment descriptor cointains errors, Spring framework has to be manually configured there!" }) + @Override public void run() throws IOException { // MODIFY WEB.XML FileObject dd = webModule.getDeploymentDescriptor(); @@ -282,7 +289,7 @@ public void run() throws IOException { } // ADD JSTL LIBRARY IF ENABLED AND SPRING LIBRARY - List libraries = new ArrayList(3); + List libraries = new ArrayList<>(3); Library springLibrary = component.getSpringLibrary(); String version = component.getSpringLibraryVersion(); Library webMVCLibrary = null; @@ -375,18 +382,16 @@ public void run() throws IOException { if (scope != null) { final ConfigFileManager manager = scope.getConfigFileManager(); try { - manager.mutex().writeAccess(new ExceptionAction() { - public Void run() throws IOException { - List files = manager.getConfigFiles(); - files.addAll(newConfigFiles); - List groups = manager.getConfigFileGroups(); - String groupName = NbBundle.getMessage(SpringWebModuleExtender.class, "LBL_DefaultGroup"); - ConfigFileGroup newGroup = ConfigFileGroup.create(groupName, newConfigFiles); - groups.add(newGroup); - manager.putConfigFilesAndGroups(files, groups); - manager.save(); - return null; - } + manager.mutex().writeAccess((ExceptionAction) () -> { + List files = manager.getConfigFiles(); + files.addAll(newConfigFiles); + List groups = manager.getConfigFileGroups(); + String groupName = NbBundle.getMessage(SpringWebModuleExtender.class, "LBL_DefaultGroup"); + ConfigFileGroup newGroup = ConfigFileGroup.create(groupName, newConfigFiles); + groups.add(newGroup); + manager.putConfigFilesAndGroups(files, groups); + manager.save(); + return null; }); } catch (MutexException e) { throw (IOException)e.getException(); @@ -428,7 +433,7 @@ protected boolean addLibrariesToWebModule(List libraries, WebModule web if (groups.length == 0) { return false; } - addLibraryResult = ProjectClassPathModifier.addLibraries(libraries.toArray(new Library[libraries.size()]), groups[0].getRootFolder(), ClassPath.COMPILE); + addLibraryResult = ProjectClassPathModifier.addLibraries(libraries.toArray(new Library[0]), groups[0].getRootFolder(), ClassPath.COMPILE); } catch (IOException e) { LOGGER.log(Level.WARNING, "Libraries required for the Spring MVC project not added", e); // NOI18N } catch (UnsupportedOperationException uoe) { diff --git a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/Bundle.properties b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/Bundle.properties index 94344ac754c7..a210bc001211 100644 --- a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/Bundle.properties +++ b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/Bundle.properties @@ -23,6 +23,4 @@ OpenIDE-Module-Long-Description=Provides support for extending a web project wit Templates/SpringFramework/AbstractController.java=Abstract Controller Templates/SpringFramework/SimpleFormController.java=Simple Form Controller Templates/SpringFramework/index.jsp=View page -spring-webmvc5=Spring Web MVC 5.2.9 -spring-webmvc4=Spring Web MVC 4.3.29 -spring-webmvc3=Spring Web MVC 3.2.18 +spring-webmvc5=Spring Web MVC 5.3.31 diff --git a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/layer.xml b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/layer.xml index 92c9b08e6433..56b2bee5b582 100644 --- a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/layer.xml +++ b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/layer.xml @@ -35,12 +35,6 @@ - - - - - - diff --git a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-3.0.xml b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-3.0.xml deleted file mode 100644 index 4f1319881ef3..000000000000 --- a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-3.0.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - spring-webmvc3.0 - j2se - org.netbeans.modules.spring.webmvc.resources.Bundle - - classpath - jar:nbinst://org.netbeans.libs.springframework/modules/ext/spring-3.0/spring-webmvc-3.2.18.RELEASE.jar!/ - - - src - - - javadoc - - - - - maven-dependencies - org.springframework:spring-webmvc:3.2.18.RELEASE:jar - - - - diff --git a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-4.0.xml b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-4.0.xml deleted file mode 100644 index 068e9526f91e..000000000000 --- a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-4.0.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - spring-webmvc4.0 - j2se - org.netbeans.modules.spring.webmvc.resources.Bundle - - classpath - jar:nbinst://org.netbeans.libs.springframework/modules/ext/spring-4/spring-webmvc-4.3.29.RELEASE.jar!/ - - - src - - - javadoc - - - - - maven-dependencies - org.springframework:spring-webmvc:4.3.29.RELEASE:jar - - - diff --git a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-5.0.xml b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-5.0.xml index eebf64b234e0..aa51dbca0081 100644 --- a/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-5.0.xml +++ b/enterprise/spring.webmvc/src/org/netbeans/modules/spring/webmvc/resources/spring-webmvc-5.0.xml @@ -25,7 +25,7 @@ org.netbeans.modules.spring.webmvc.resources.Bundle classpath - jar:nbinst://org.netbeans.libs.springframework/modules/ext/spring-5/spring-webmvc-5.2.9.RELEASE.jar!/ + jar:nbinst://org.netbeans.libs.springframework/modules/ext/spring-5/spring-webmvc-5.3.31.jar!/ src @@ -36,7 +36,7 @@ maven-dependencies - org.springframework:spring-webmvc:5.2.9.RELEASE:jar + org.springframework:spring-webmvc:5.3.31:jar diff --git a/enterprise/tomcat5/manifest.mf b/enterprise/tomcat5/manifest.mf index b868a35df058..c213acd5dd26 100644 --- a/enterprise/tomcat5/manifest.mf +++ b/enterprise/tomcat5/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module: org.netbeans.modules.tomcat5/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/tomcat5/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/tomcat5/resources/layer.xml OpenIDE-Module-Provides: org.netbeans.modules.serverplugins.javaee -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.67 diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java index d4d96979fa7e..0147f5eae1a8 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java @@ -92,7 +92,7 @@ public boolean isAtLeast(TomcatVersion tv) { public enum TomEEVersion { TOMEE_15(15), TOMEE_16(16), TOMEE_17(17), TOMEE_70(70), - TOMEE_71(71), TOMEE_80(80), TOMEE_90(90); + TOMEE_71(71), TOMEE_80(80), TOMEE_90(90), TOMEE_100(100); TomEEVersion(int version) { this.version = version; } private final int version; @@ -499,6 +499,10 @@ public synchronized boolean isTomEEJaxRS() { } } + public boolean isTomEE10() { + return tomEEVersion == TomEEVersion.TOMEE_100; + } + public boolean isTomEE9() { return tomEEVersion == TomEEVersion.TOMEE_90; } @@ -518,6 +522,10 @@ public boolean isJpa30() { public boolean isJpa31() { return false; } + + public boolean isJpa32() { + return isTomEE10(); + } public boolean isJpa22() { return isTomEE8(); diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManagerImpl.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManagerImpl.java index 3b5a6978b76c..172b82e2de79 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManagerImpl.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManagerImpl.java @@ -47,6 +47,7 @@ import java.io.*; import java.net.Proxy; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.util.Base64; import java.util.MissingResourceException; import java.util.logging.Level; @@ -348,7 +349,7 @@ private static String encodePath(String str) { * @return properly escaped URL (application/x-www-form-urlencoded) in string form */ private String createTempContextXml(String docBase, Context ctx) throws IOException { - File tmpContextXml = File.createTempFile("context", ".xml"); // NOI18N + File tmpContextXml = Files.createTempFile("context", ".xml").toFile(); // NOI18N tmpContextXml.deleteOnExit(); if (!docBase.equals (ctx.getAttributeValue ("docBase"))) { //NOI18N ctx.setAttributeValue ("docBase", docBase); //NOI18N diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java index fd36d119bd26..55898ab5a52b 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java @@ -28,7 +28,8 @@ /** * This is TomEE only class. TomEE PluME support two implementations: {@code OpenJPA} * and {@code EclipseLink},

    every other TomEE flavor only support {@code OpenJPA} - * @author Petr Hejl, José Contreras + * @author Petr Hejl + * @author José Contreras */ class JpaSupportImpl implements JpaSupportImplementation { @@ -51,7 +52,8 @@ public JpaProvider getDefaultProvider() { instance.isJpa21(), instance.isJpa22(), instance.isJpa30(), - instance.isJpa31()); + instance.isJpa31(), + instance.isJpa32()); } @Override @@ -65,7 +67,8 @@ public Set getProviders() { instance.isJpa21(), instance.isJpa22(), instance.isJpa30(), - instance.isJpa31())); + instance.isJpa31(), + instance.isJpa32())); // TomEE PluME has Eclipselink and OpenJPA if (instance.isTomEEplume()) { providers.add(JpaProviderFactory.createJpaProvider( @@ -76,7 +79,8 @@ public Set getProviders() { instance.isJpa21(), instance.isJpa22(), instance.isJpa30(), - instance.isJpa31())); + instance.isJpa31(), + instance.isJpa32())); } return providers; } diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java index fa11460ff56a..ce4aacb48671 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java @@ -464,6 +464,8 @@ public Set getSupportedProfiles() { // Only TomEE versions 8/9 of type Plus/PluME support full profile if (manager.getTomEEType().ordinal() >= 3 ) { switch (manager.getTomEEVersion()) { + case TOMEE_100: + profiles.add(Profile.JAKARTA_EE_11_FULL); case TOMEE_90: profiles.add(Profile.JAKARTA_EE_9_1_FULL); break; @@ -478,6 +480,8 @@ public Set getSupportedProfiles() { } } switch (manager.getTomEEVersion()) { + case TOMEE_100: + profiles.add(Profile.JAKARTA_EE_11_WEB); case TOMEE_90: profiles.add(Profile.JAKARTA_EE_9_1_WEB); break; @@ -506,7 +510,7 @@ public Set getSupportedProfiles() { } else { switch (manager.getTomcatVersion()) { case TOMCAT_110: - profiles.add(Profile.JAKARTA_EE_10_WEB); + profiles.add(Profile.JAKARTA_EE_11_WEB); break; case TOMCAT_101: profiles.add(Profile.JAKARTA_EE_10_WEB); @@ -551,6 +555,9 @@ public Set getSupportedJavaPlatformVersions() { // TomEE has different supported Java versions if (manager.isTomEE()) { switch (manager.getTomEEVersion()) { + case TOMEE_100: + versions = versionRange(21, 23); + break; case TOMEE_90: versions = versionRange(11, 23); break; diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java index 12d60fe4749a..d7bc82617110 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java @@ -737,6 +737,8 @@ private static void addFileToList(List list, File f) { String eeDocs; switch (tm.getTomcatVersion()) { case TOMCAT_110: + eeDocs = "docs/jakartaee11-doc-api.jar"; + break; case TOMCAT_101: eeDocs = "docs/jakartaee10-doc-api.jar"; break; diff --git a/enterprise/web.beans/manifest.mf b/enterprise/web.beans/manifest.mf index 9dea77e1d326..e9c164b1475c 100644 --- a/enterprise/web.beans/manifest.mf +++ b/enterprise/web.beans/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.beans/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/beans/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/web/beans/resources/layer.xml -OpenIDE-Module-Specification-Version: 2.42 +OpenIDE-Module-Specification-Version: 2.44 AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.beans/nbproject/org-netbeans-modules-web-beans.sig b/enterprise/web.beans/nbproject/org-netbeans-modules-web-beans.sig index 671f3c98df52..33af4df53f4f 100644 --- a/enterprise/web.beans/nbproject/org-netbeans-modules-web-beans.sig +++ b/enterprise/web.beans/nbproject/org-netbeans-modules-web-beans.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.41 +#Version 2.42 CLSS public java.beans.FeatureDescriptor cons public init() diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/actions/InterceptorFactory.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/actions/InterceptorFactory.java index 95a67511f681..5d7126c08ae7 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/actions/InterceptorFactory.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/actions/InterceptorFactory.java @@ -43,7 +43,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class InterceptorFactory implements Factory { static final String INTERCEPTOR_BINDING = "InterceptorBinding"; // NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/actions/InterceptorGenerator.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/actions/InterceptorGenerator.java index b395904490e2..033c339c3f07 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/actions/InterceptorGenerator.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/actions/InterceptorGenerator.java @@ -67,7 +67,6 @@ * @author ads * */ -// @todo: Support JakartaEE class InterceptorGenerator implements CodeGenerator { private static final Logger LOG = Logger.getLogger( diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/AnnotationUtil.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/AnnotationUtil.java index 13815f93d0c9..c6d2cff05a3f 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/AnnotationUtil.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/AnnotationUtil.java @@ -36,7 +36,6 @@ * @author ads * */ -// @todo: Support JakartaEE public final class AnnotationUtil { public static final String ANY = "javax.enterprise.inject.Any"; // NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/type/ManagedBeansAnalizer.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/type/ManagedBeansAnalizer.java index c40f1ce8f495..74b303850ac8 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/type/ManagedBeansAnalizer.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/type/ManagedBeansAnalizer.java @@ -44,7 +44,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class ManagedBeansAnalizer implements ClassAnalyzer { private static final String EXTENSION = "javax.enterprise.inject.spi.Extension"; //NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/hints/CreateQualifier.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/hints/CreateQualifier.java index 691f70c759a0..196391de166a 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/hints/CreateQualifier.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/hints/CreateQualifier.java @@ -63,7 +63,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class CreateQualifier implements ErrorRule { private static final String INJECT_ANNOTATION = diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/AnnotationObjectProvider.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/AnnotationObjectProvider.java index 00e1137c340f..69cdde6a2206 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/AnnotationObjectProvider.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/AnnotationObjectProvider.java @@ -61,7 +61,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class AnnotationObjectProvider implements ObjectProvider { private static final String SPECILIZES_ANNOTATION = diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/BeansFilter.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/BeansFilter.java index f9179a4e3951..2e6b958a0a55 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/BeansFilter.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/BeansFilter.java @@ -28,7 +28,6 @@ * @author ads * */ -// @todo: Support JakartaEE class BeansFilter extends Filter { static BeansFilter get() { diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EnableBeansFilter.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EnableBeansFilter.java index 232884e74a59..999dd770febb 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EnableBeansFilter.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EnableBeansFilter.java @@ -59,7 +59,6 @@ * @author ads * */ -// @todo: Support JakartaEE class EnableBeansFilter { static final String DECORATOR = "javax.decorator.Decorator"; // NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EventInjectionPointLogic.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EventInjectionPointLogic.java index f91cd0e441a6..e5b25092ab8b 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EventInjectionPointLogic.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EventInjectionPointLogic.java @@ -58,7 +58,6 @@ * @author ads * */ -// @todo: Support JakartaEE abstract class EventInjectionPointLogic extends ParameterInjectionPointLogic { public static final String EVENT_INTERFACE = diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/FieldInjectionPointLogic.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/FieldInjectionPointLogic.java index 3037df73eb7d..67b53a3861ac 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/FieldInjectionPointLogic.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/FieldInjectionPointLogic.java @@ -67,7 +67,6 @@ /** * @author ads */ -// @todo: Support JakartaEE abstract class FieldInjectionPointLogic { static final String PRODUCER_ANNOTATION = diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorBindingChecker.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorBindingChecker.java index 6518aedee433..1e8e88b5ffca 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorBindingChecker.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorBindingChecker.java @@ -35,7 +35,6 @@ * @author ads * */ -// @todo: Support JakartaEE class InterceptorBindingChecker extends RuntimeAnnotationChecker { static final String INTERCEPTOR_BINDING = "javax.interceptor.InterceptorBinding"; // NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorObject.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorObject.java index 3c4a75ddfbf3..b84b6e352535 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorObject.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorObject.java @@ -33,7 +33,6 @@ * @author ads * */ -// @todo: Support JakartaEE class InterceptorObject extends PersistentObject implements Refreshable { static final String INTERCEPTOR = "javax.interceptor.Interceptor"; // NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/MemberBindingFilter.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/MemberBindingFilter.java index 648e774d6835..9c163975a922 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/MemberBindingFilter.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/MemberBindingFilter.java @@ -37,7 +37,6 @@ * @author ads * */ -// @todo: Support JakartaEE class MemberBindingFilter extends Filter { private static final String NON_BINDING_MEMBER_ANNOTATION = diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ParameterInjectionPointLogic.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ParameterInjectionPointLogic.java index e6bc84ecd67f..24c80843390c 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ParameterInjectionPointLogic.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ParameterInjectionPointLogic.java @@ -49,7 +49,6 @@ * @author ads * */ -// @todo: Support JakartaEE abstract class ParameterInjectionPointLogic extends FieldInjectionPointLogic implements WebBeansModelProvider { diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ScopeChecker.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ScopeChecker.java index 3dd2cf41bc93..09817bd52024 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ScopeChecker.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ScopeChecker.java @@ -33,7 +33,6 @@ * @author ads * */ -// @todo: Support JakartaEE class ScopeChecker extends RuntimeAnnotationChecker { static String SCOPE = "javax.inject.Scope"; // NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/StereotypeChecker.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/StereotypeChecker.java index fb1eff3afa67..8df2e1dc7171 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/StereotypeChecker.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/StereotypeChecker.java @@ -35,7 +35,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class StereotypeChecker extends RuntimeAnnotationChecker { static final String STEREOTYPE = "javax.enterprise.inject.Stereotype"; //NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/results/InterceptorsResultImpl.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/results/InterceptorsResultImpl.java index dc43f43516e4..ad958eb7fe5d 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/results/InterceptorsResultImpl.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/results/InterceptorsResultImpl.java @@ -45,7 +45,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class InterceptorsResultImpl implements InterceptorsResult { static final String INTERCEPTORS = "javax.interceptor.Interceptors"; // NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/results/ResultImpl.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/results/ResultImpl.java index ed68c0346bcf..96db3523432f 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/results/ResultImpl.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/results/ResultImpl.java @@ -39,7 +39,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class ResultImpl extends BaseResult implements DependencyInjectionResult.ResolutionResult { private static final String ALTERNATIVE = diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/BindingsPanel.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/BindingsPanel.java index 3490b6962aa4..2a796fd597af 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/BindingsPanel.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/BindingsPanel.java @@ -54,7 +54,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class BindingsPanel extends CDIPanel { private static final long serialVersionUID = 1230555367053797509L; diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/DecoratorsPanel.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/DecoratorsPanel.java index d35d059835bc..94e445ddc755 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/DecoratorsPanel.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/DecoratorsPanel.java @@ -40,7 +40,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class DecoratorsPanel extends BindingsPanel { private static final long serialVersionUID = -5097678699872215262L; diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/ObserversPanel.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/ObserversPanel.java index d5d56b22e097..8bb507a3fbd7 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/ObserversPanel.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/ObserversPanel.java @@ -37,7 +37,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class ObserversPanel extends BindingsPanel { private static final long serialVersionUID = -5038408349629504998L; diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/actions/WebBeansActionHelper.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/actions/WebBeansActionHelper.java index 751985ab1117..d2e7860c450f 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/actions/WebBeansActionHelper.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/navigation/actions/WebBeansActionHelper.java @@ -104,7 +104,6 @@ * @author ads * */ -// @todo: Support JakartaEE public class WebBeansActionHelper { private static final String WAIT_NODE = "LBL_WaitNode"; // NOI18N diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java index de6f707ba38c..096fdfb781c7 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java @@ -77,7 +77,9 @@ public Set instantiate(TemplateWizard wizard) throws IOException { Profile profile = null; if (project != null) { J2eeProjectCapabilities cap = J2eeProjectCapabilities.forProject(project); - if (cap != null && cap.isCdi40Supported()) { + if (cap != null && cap.isCdi41Supported()) { + profile = Profile.JAKARTA_EE_11_FULL; + } else if (cap != null && cap.isCdi40Supported()) { profile = Profile.JAKARTA_EE_10_FULL; } else if (cap != null && cap.isCdi30Supported()) { profile = Profile.JAKARTA_EE_9_FULL; diff --git a/enterprise/web.beans/test/unit/src/org/netbeans/modules/web/beans/xdm/model/Util.java b/enterprise/web.beans/test/unit/src/org/netbeans/modules/web/beans/xdm/model/Util.java index b7946a406ae8..db9aff1e01af 100644 --- a/enterprise/web.beans/test/unit/src/org/netbeans/modules/web/beans/xdm/model/Util.java +++ b/enterprise/web.beans/test/unit/src/org/netbeans/modules/web/beans/xdm/model/Util.java @@ -31,6 +31,7 @@ import java.io.OutputStream; import java.io.PrintWriter; import java.net.URI; +import java.nio.file.Files; import javax.swing.text.Document; import org.netbeans.modules.web.beans.xml.WebBeansModel; @@ -153,7 +154,7 @@ public static WebBeansModel dumpAndReloadModel(WebBeansModel sm) throws Exceptio } public static File dumpToTempFile(Document doc) throws Exception { - File f = File.createTempFile("faces-config-tmp", "xml"); + File f = Files.createTempFile("faces-config-tmp", "xml").toFile(); System.out.println("file: " + f.getAbsolutePath()); dumpToFile(doc, f); return f; diff --git a/enterprise/web.bootsfaces/manifest.mf b/enterprise/web.bootsfaces/manifest.mf index 4392eb4bcd14..947064dfdc6f 100644 --- a/enterprise/web.bootsfaces/manifest.mf +++ b/enterprise/web.bootsfaces/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.bootsfaces OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/bootsfaces/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.94 +OpenIDE-Module-Specification-Version: 1.96 AutoUpdate-Show-In-Client: true OpenIDE-Module-Provides: org.netbeans.modules.web.jsf.complib diff --git a/enterprise/web.client.rest/manifest.mf b/enterprise/web.client.rest/manifest.mf index a191d05d9f68..39bbe31406b2 100644 --- a/enterprise/web.client.rest/manifest.mf +++ b/enterprise/web.client.rest/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.client.rest OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/client/rest/Bundle.properties -OpenIDE-Module-Specification-Version: 1.37 +OpenIDE-Module-Specification-Version: 1.39 OpenIDE-Module-Layer: org/netbeans/modules/web/client/rest/layer.xml diff --git a/enterprise/web.core.syntax/nbproject/project.properties b/enterprise/web.core.syntax/nbproject/project.properties index 6c3ea779c6cb..fb179dac9ace 100644 --- a/enterprise/web.core.syntax/nbproject/project.properties +++ b/enterprise/web.core.syntax/nbproject/project.properties @@ -25,7 +25,7 @@ javac.source=1.8 requires.nb.javac=true javadoc.arch=${basedir}/arch.xml -spec.version.base=2.67.0 +spec.version.base=2.69.0 test.config.validation.includes=\ **/AutoCompletionTest.class,**/CompletionTest.class diff --git a/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/JSPProcessor.java b/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/JSPProcessor.java index 590e46f1246b..e300e1d64281 100644 --- a/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/JSPProcessor.java +++ b/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/JSPProcessor.java @@ -33,6 +33,7 @@ import javax.servlet.jsp.tagext.VariableInfo; import javax.swing.text.BadLocationException; import javax.swing.text.Document; +import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.editor.BaseDocument; import org.netbeans.lib.editor.util.swing.DocumentUtilities; import org.netbeans.modules.editor.NbEditorUtilities; @@ -52,25 +53,25 @@ * @author Tomasz.Slota@Sun.COM */ public abstract class JSPProcessor { + protected static final Logger logger = Logger.getLogger(JSPProcessor.class.getName()); + //static cache of FileObject---ParserData + private static final WeakHashMap PARSER_DATA_CACHE = new WeakHashMap<>(); protected Document doc; protected FileObject fobj; - protected static final Logger logger = Logger.getLogger(JSPProcessor.class.getName()); - protected boolean processCalled = false; protected boolean processingSuccessful = true; - //static cache of FileObject---ParserData - private static final WeakHashMap PARSER_DATA_CACHE = new WeakHashMap(); - + private boolean processCalled = false; + private boolean jakartaVariant = false; private ParserData parserData; private static class ParserData { - private JspParserAPI.ParseResult parserResult; - private JspColoringData coloringData; + private final JspParserAPI.ParseResult parserResult; + private final JspColoringData coloringData; public ParserData(JspParserAPI.ParseResult parserResult, JspColoringData coloringData) { assert parserResult != null; - + this.parserResult = parserResult; this.coloringData = coloringData; } @@ -86,7 +87,7 @@ public ParseResult getParserResult() { private ParserData getParserData() { assert parserData != null; //never allow to return null - + return parserData; } @@ -109,7 +110,10 @@ protected String createBeanVarDeclarations(List localBeans) { if (beanData != null) { for (PageInfo.BeanData bean : beanData) { if (!localBeans.contains(bean.getId())) { - beanDeclarationsBuff.append(bean.getClassName() + " " + bean.getId() + ";\n"); //NOI18N + beanDeclarationsBuff.append(bean.getClassName()); + beanDeclarationsBuff.append(" "); //NOI18N + beanDeclarationsBuff.append(bean.getId()); + beanDeclarationsBuff.append(";\n"); //NOI18N } } } @@ -118,7 +122,10 @@ protected String createBeanVarDeclarations(List localBeans) { for (TagAttributeInfo info : pageInfo.getTagInfo().getAttributes()) { if (info.getTypeName() != null) { // will be null e.g. for fragment attrs if (!localBeans.contains(info.getName())) { - beanDeclarationsBuff.append(info.getTypeName() + " " + info.getName() + ";\n"); //NOI18N + beanDeclarationsBuff.append(info.getTypeName()); + beanDeclarationsBuff.append(" "); //NOI18N + beanDeclarationsBuff.append(info.getName()); + beanDeclarationsBuff.append(";\n"); //NOI18N } } } @@ -193,7 +200,7 @@ protected void processIncludes(boolean onlyPrelude, final String path) { return; } - final Collection processedFiles = new TreeSet(processedIncludes()); + final Collection processedFiles = new TreeSet<>(processedIncludes()); processedFiles.add(fobj.getPath()); if (pageInfo.getIncludePrelude() != null) { @@ -247,16 +254,14 @@ private void processIncludedFile(String filePath, Collection processedFi processIncludedFile(includedJSPFileProcessor); } } - } catch (IOException e) { - logger.log(Level.WARNING, e.getMessage(), e); - } catch (BadLocationException e) { + } catch (IOException | BadLocationException e) { logger.log(Level.WARNING, e.getMessage(), e); } } } public static boolean ignoreLockFromUnitTest = false; - + public synchronized void process() throws BadLocationException { processCalled = true; @@ -268,6 +273,9 @@ public synchronized void process() throws BadLocationException { return; } + ClassPath cp = ClassPath.getClassPath(fobj, ClassPath.COMPILE); + jakartaVariant = cp != null && cp.findResource("jakarta/servlet/http/HttpServlet.class") != null; + //workaround for issue #120195 - Deadlock in jspparser while reformatting JSP // //we MAY be called here this way: @@ -317,15 +325,12 @@ public synchronized void process() throws BadLocationException { } - final AtomicReference ble = new AtomicReference(); - doc.render(new Runnable() { - - public void run() { - try { - renderProcess(); - } catch (BadLocationException ex) { - ble.set(ex); - } + final AtomicReference ble = new AtomicReference<>(); + doc.render(() -> { + try { + renderProcess(); + } catch (BadLocationException ex) { + ble.set(ex); } }); if (ble.get() != null) { @@ -334,7 +339,7 @@ public void run() { } protected abstract void processIncludedFile(IncludedJSPFileProcessor includedJSPFileProcessor); - + protected abstract void renderProcess() throws BadLocationException; /** @@ -354,7 +359,9 @@ protected String createImplicitImportStatements(List localImports) { // (JSP doesn't belong to a project) for (String pckg : imports) { if (!localImports.contains(pckg)) { - importsBuff.append("import " + pckg + ";\n"); //NOI18N + importsBuff.append("import "); //NOI18N + importsBuff.append(pckg); + importsBuff.append(";\n"); //NOI18N } } } @@ -366,10 +373,20 @@ private String[] getImportsFromJspParser() { PageInfo pi = getPageInfo(); if (pi == null) { //we need at least some basic imports - return new String[]{"javax.servlet.*", "javax.servlet.http.*", "javax.servlet.jsp.*"}; + if(jakartaVariant) { + return new String[]{"jakarta.servlet.*", "jakarta.servlet.http.*", "jakarta.servlet.jsp.*"}; + } else { + return new String[]{"javax.servlet.*", "javax.servlet.http.*", "javax.servlet.jsp.*"}; + } } List imports = pi.getImports(); - return imports == null ? null : imports.toArray(new String[imports.size()]); + if(imports == null) { + return null; + } + return imports + .stream() + .map(i -> jakartaVariant ? i.replaceFirst("^javax\\.", "jakarta.") : i) + .toArray(i -> new String[i]); } protected abstract Collection processedIncludes(); diff --git a/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/JspSyntaxSupport.java b/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/JspSyntaxSupport.java index a76cee0db87d..384f2f173e9b 100644 --- a/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/JspSyntaxSupport.java +++ b/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/JspSyntaxSupport.java @@ -126,7 +126,7 @@ public class JspSyntaxSupport extends ExtSyntaxSupport implements FileChangeList JspTagTokenContext.COMMENT }; - protected FileObject fobj; + private FileObject fobj; /** Special bracket finder is used when caret is in JSP context */ private boolean useCustomBracketFinder = true; @@ -158,22 +158,6 @@ private void initFileObject() { } } - public String[] getImports(){ - JspParserAPI.ParseResult pre = getParseResult(); - if (pre != null){ - PageInfo pi = pre.getPageInfo(); - if(pi == null) { - //report error but do not break the entire CC - err.log(Level.WARNING, null, new NullPointerException("PageInfo obtained from JspParserAPI.ParseResult is null")); - return null; - } - List imports = pi.getImports(); - return imports.toArray(new String[imports.size()]); - } - - return null; - } - public boolean isXmlSyntax(){ JspContextInfo jspCO = JspContextInfo.getContextInfo(fobj); if(jspCO == null) { @@ -204,9 +188,9 @@ protected Map getPrefixMapper() { if (result != null && result.getPageInfo() != null) { //if (result.isParsingSuccess()) { // PENDING - can we somehow get incomplete parsed information ? - if (result.getPageInfo().getXMLPrefixMapper().size() > 0) { + if (!result.getPageInfo().getXMLPrefixMapper().isEmpty()) { prefixMapper = result.getPageInfo().getApproxXmlPrefixMapper(); - if (prefixMapper.size() == 0){ + if (prefixMapper.isEmpty()){ prefixMapper = result.getPageInfo().getXMLPrefixMapper(); } prefixMapper.putAll(result.getPageInfo().getJspPrefixMapper()); @@ -239,19 +223,11 @@ private Map getTagLibraries(boolean requiresFresh) { } private TagInfo[] getSortedTagInfos(TagInfo[] tinfos) { - Arrays.sort(tinfos, new Comparator() { - public int compare(Object o1, Object o2) { - TagInfo ti1 = (TagInfo)o1; - TagInfo ti2 = (TagInfo)o2; - String tname1 = (ti1.getDisplayName() == null ? ti1.getTagName() : ti1.getDisplayName()); - String tname2 = (ti2.getDisplayName() == null ? ti2.getTagName() : ti2.getDisplayName()); - if(tname1 == null || tname2 == null) return 0; - return tname1.compareTo(tname2); - } - @Override - public boolean equals(Object o) { - return o.equals(this); - } + Arrays.sort(tinfos, (TagInfo ti1, TagInfo ti2) -> { + String tname1 = (ti1.getDisplayName() == null ? ti1.getTagName() : ti1.getDisplayName()); + String tname2 = (ti2.getDisplayName() == null ? ti2.getTagName() : ti2.getDisplayName()); + if(tname1 == null || tname2 == null) return 0; + return tname1.compareTo(tname2); }); return tinfos; } @@ -302,7 +278,7 @@ public int checkCompletion(JTextComponent target, String typedText, boolean visi char first = typedText.charAt(0); //get typed char - TokenItem item = null; //get token on the cursor + TokenItem item; //get token on the cursor try{ item = getItemAtOrBefore(target.getCaret().getDot()); }catch(BadLocationException e) { @@ -401,7 +377,7 @@ public int checkCompletion(JTextComponent target, String typedText, boolean visi } /** Returns offset where the next offset after this offset starts. */ - private final int getTokenEnd( TokenItem item ) { + private int getTokenEnd( TokenItem item ) { if (item == null) return 0; //getDocument().getLength(); return item.getOffset() + item.getImage().length(); @@ -410,7 +386,7 @@ private final int getTokenEnd( TokenItem item ) { /** Filters list of strings so only strings starting * with a given prefix are returned in the new List. */ public static final List filterList(List toFilter, String prefix) { - List newList = new ArrayList(); + List newList = new ArrayList<>(); Object item; for (int i = 0; i < toFilter.size(); i++) { item = toFilter.get(i); @@ -432,7 +408,7 @@ else if (item instanceof TagAttributeInfo) /** Filters list of strings so only strings starting * with a given prefix are returned in the new List. */ public static final List filterStrings(List toFilter, String prefix) { - List newList = new ArrayList(); + List newList = new ArrayList<>(); for(String val : toFilter) { if(val.startsWith(prefix)) { newList.add(val); @@ -547,15 +523,13 @@ private TagInfo[] getAllTagInfos(TagLibraryInfo tagLibrary) { tagAllInfosLength = tagInfosLength; } if (tagFileInfos != null) { // it can be null, when the jsp parser finished unexpectedly - tagAllInfosLength = tagAllInfosLength + tagFileInfos.length; + tagAllInfosLength += tagFileInfos.length; } allTags = new TagInfo[tagAllInfosLength]; if (tagInfos != null) { - for (int i = 0; i < tagInfosLength; i++) { - allTags[i] = tagInfos[i]; - } + System.arraycopy(tagInfos, 0, allTags, 0, tagInfosLength); } if (tagFileInfos != null) { for (int i = 0; i < tagFileInfos.length; i++) { @@ -575,9 +549,7 @@ protected List getAllTags(String prefix, boolean requiresFresh) { initCompletionData(); if (STANDARD_JSP_PREFIX.equals(prefix)) { TagInfo[] stanTagDatas = getTagInfos(); - for (int i=0; i getAllDirectives() { initCompletionData(); - List items = new ArrayList(); + List items = new ArrayList<>(); //Is xml syntax? => return nothing. if (isXmlSyntax()) return items; @@ -674,9 +643,7 @@ protected List getAllDirectives() { directiveData = directiveJspData; } - for (int i = 0; i < directiveData.length; i++){ - items.add(directiveData[i]); - } + items.addAll(Arrays.asList(directiveData)); return items; } @@ -695,8 +662,7 @@ protected List getAllDirectiveAttributes(String directive) { for (int i=0; i standardTagTagDatasList = new ArrayList(); + List standardTagTagDatasList = new ArrayList<>(); standardTagTagDatasList.addAll(Arrays.asList(standardJspTagDatas)); standardTagTagDatasList.add(new TagInfo("doBody", null, TagInfo.BODY_CONTENT_EMPTY, url + "syntaxref2017.html", null, null, // NOI18N @@ -1001,12 +967,12 @@ private static void initCompletionData() { new TagAttributeInfo("xmlns:x", false, url+"syntaxref2024.html#1003301#1003311", false)}) }; - List xmlJspTagDatasList = new ArrayList(); + List xmlJspTagDatasList = new ArrayList<>(); xmlJspTagDatasList.addAll(Arrays.asList(standardJspTagDatas)); xmlJspTagDatasList.addAll(Arrays.asList(commonXMLTagDatas)); xmlJspTagDatas = xmlJspTagDatasList.toArray(new TagInfo[]{}); - List xmlTagFileTagDatasList = new ArrayList(); + List xmlTagFileTagDatasList = new ArrayList<>(); xmlTagFileTagDatasList.addAll(Arrays.asList(standardTagTagDatas)); xmlTagFileTagDatasList.addAll(Arrays.asList(commonXMLTagDatas)); xmlTagFileTagDatas = xmlTagFileTagDatasList.toArray(new TagInfo[]{}); @@ -1043,29 +1009,39 @@ public String toString() { /** Debug output of all tags and directives. */ private String printJspCompletionInfo() { - StringBuffer output = new StringBuffer(); + StringBuilder output = new StringBuilder(); output.append("TAGS\n"); // NOI18N List tagPrefixes = getTagPrefixes(""); // NOI18N for (int i = 0; i < tagPrefixes.size(); i++) { String prefix = (String)tagPrefixes.get(i); - output.append(" " + prefix + "\n"); // NOI18N + output.append(" "); // NOI18N + output.append(prefix); + output.append("\n"); // NOI18N List tags = getTags(prefix, ""); // NOI18N for (int j = 0; j < tags.size(); j++) { if (tags.get(j) instanceof TagInfo){ TagInfo ti = (TagInfo) tags.get(j); - output.append(" " + ti.getTagName() + "\n"); + output.append(" "); // NOI18N + output.append(ti.getTagName()); + output.append("\n"); // NOI18N TagAttributeInfo[] attributes = ti.getAttributes(); for (int k = 0; k < attributes.length; k++) { - output.append(" " + attributes[k].getName() + "\n");// NOI18N + output.append(" "); // NOI18N + output.append(attributes[k].getName()); + output.append("\n");// NOI18N } } else { String tagName = (String)tags.get(j); - output.append(" " + tagName + "\n"); // NOI18N + output.append(" "); // NOI18N + output.append(tagName); + output.append("\n"); // NOI18N List attributes = getTagAttributes(prefix, tagName, "");// NOI18N for (int k = 0; k < attributes.size(); k++) { String attribute = (String)attributes.get(k); - output.append(" " + attribute + "\n");// NOI18N + output.append(" "); // NOI18N + output.append(attribute); + output.append("\n"); // NOI18N } } } @@ -1077,18 +1053,26 @@ private String printJspCompletionInfo() { for (int i = 0; i < directives.size(); i++) { if (directives.get(i) instanceof TagInfo){ TagInfo ti = (TagInfo) directives.get(i); - output.append(" " + ti.getTagName() + "\n"); + output.append(" "); // NOI18N + output.append(ti.getTagName()); + output.append("\n"); // NOI18N TagAttributeInfo[] attributes = ti.getAttributes(); for (int k = 0; k < attributes.length; k++) { - output.append(" " + attributes[k].getName() + "\n");// NOI18N + output.append(" "); // NOI18N + output.append(attributes[k].getName()); + output.append("\n");// NOI18N } } else { String directive = (String)directives.get(i); - output.append(" " + directive + "\n");// NOI18N + output.append(" "); // NOI18N + output.append(directive); + output.append("\n");// NOI18N List attributes = getDirectiveAttributes(directive, "");// NOI18N for (int k = 0; k < attributes.size(); k++) { String attribute = (String)attributes.get(k); - output.append(" " + attribute + "\n");// NOI18N + output.append(" "); // NOI18N + output.append(attribute); + output.append("\n"); // NOI18N } } } @@ -1113,8 +1097,10 @@ public TokenItem getItemAtOrBefore(int offset) throws BadLocationException { backItem = getTokenChain(Math.max(offset-50, 0), offset); } - if (chainLength++ > 1000) + if (chainLength > 1000) { break; + } + chainLength++; } if (backItem == null) return null; @@ -1165,23 +1151,23 @@ public SyntaxElement getElementChain( int offset ) throws BadLocationException { //JSP comment if(id == JspTagTokenContext.COMMENT || id == JspDirectiveTokenContext.COMMENT) { - return getCommentChain(item, offset); + return getCommentChain(item); } //Expression language handling if(item.getTokenContextPath().contains(ELTokenContext.contextPath)) { - return getELChain(item, offset); + return getELChain(item); } if (id == JspTagTokenContext.SYMBOL2 || id == JspDirectiveTokenContext.SYMBOL2) { if (isScriptStartToken(item)) { - return getScriptingChain(item, offset); + return getScriptingChain(item); } if ((getTokenEnd(item) == offset) && isScriptEndToken(item)) { item.getNext(); if (!isTagDirToken(item)) - return getContentChain(item, offset); + return getContentChain(item); } return null; } @@ -1209,13 +1195,13 @@ public SyntaxElement getElementChain( int offset ) throws BadLocationException { if (elementStart.getTokenID() == JspTagTokenContext.SYMBOL || elementStart.getTokenID() == JspDirectiveTokenContext.SYMBOL) { if (elementStart.getImage().equals("<")) { // NOI18N - return getTagOrDirectiveChain(true, elementStart, offset); + return getTagOrDirectiveChain(true, elementStart); } if (elementStart.getImage().equals(" we do not have to distinguish tokenIDs - //it is sufficient to work with numeric ids (solves directive/tag tokenID problem) TokenItem item = firstToken.getNext(); String name = getWholeWord(item, JspTagTokenContext.TAG); while ((item != null) && (item.getTokenID().getNumericID() == JspTagTokenContext.TAG_ID || - item.getTokenID().getNumericID() == JspTagTokenContext.WHITESPACE_ID )) + item.getTokenID().getNumericID() == JspTagTokenContext.WHITESPACE_ID )) { item = item.getNext(); + } TreeMap attributes = new TreeMap(); while (isInnerTagDirToken(item)) { // collect the attributes if (item.getTokenID().getNumericID() == JspTagTokenContext.ATTRIBUTE_ID) { String attributeName = getWholeWord(item, JspTagTokenContext.ATTRIBUTE); // forward to the next non-ATTRIBUTE token - while ((item != null) && (item.getTokenID().getNumericID() == JspTagTokenContext.ATTRIBUTE_ID)) + while ((item != null) && (item.getTokenID().getNumericID() == JspTagTokenContext.ATTRIBUTE_ID)) { item = item.getNext(); + } // find the value while ((item != null) && (item.getTokenID().getNumericID() == JspTagTokenContext.SYMBOL_ID) && - (isValueBeginning(item.getImage()))) + (isValueBeginning(item.getImage()))) { item = item.getNext(); - StringBuffer value = new StringBuffer(); + } + StringBuilder value = new StringBuilder(); while ((item != null) && ((item.getTokenID().getNumericID() == JspTagTokenContext.ATTR_VALUE_ID) || (item.getTokenID().getNumericID() == JspTagTokenContext.EOL_ID))) { @@ -1546,11 +1535,12 @@ private SyntaxElement getTagOrDirectiveChain(boolean tag, TokenItem firstToken, } } - private SyntaxElement getEndTagChain(TokenItem firstToken, int offset) { + private SyntaxElement getEndTagChain(TokenItem firstToken) { TokenItem item = firstToken.getNext(); String name = getWholeWord(item, JspTagTokenContext.TAG); - while ((item != null) && (item.getTokenID() == JspTagTokenContext.TAG)) + while ((item != null) && (item.getTokenID() == JspTagTokenContext.TAG)) { item = item.getNext(); + } while (isInnerTagDirToken(item)) { item = item.getNext(); } @@ -1559,7 +1549,7 @@ private SyntaxElement getEndTagChain(TokenItem firstToken, int offset) { } private String getWholeWord(TokenItem firstToken, TokenID requestedTokenID) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); while ((firstToken != null) && (firstToken.getTokenID().getNumericID() == requestedTokenID.getNumericID())) { sb.append(firstToken.getImage()); firstToken = firstToken.getNext(); @@ -1570,7 +1560,7 @@ private String getWholeWord(TokenItem firstToken, TokenID requestedTokenID) { /** Returns an element of scripting language starting with firstToken. * If forstToken is null, returns element representing end of the document. */ - private SyntaxElement getScriptingChain(TokenItem firstToken, int offset) { + private SyntaxElement getScriptingChain(TokenItem firstToken) { if (firstToken == null) { return new SyntaxElement.ScriptingL(this, getDocument().getLength(), getDocument().getLength()); @@ -1593,7 +1583,7 @@ private SyntaxElement getScriptingChain(TokenItem firstToken, int offset) { /** Returns an element of content language starting with firstToken. * If forstToken is null, returns element representing end of the document. */ - private SyntaxElement getContentChain(TokenItem firstToken, int offset) { + private SyntaxElement getContentChain(TokenItem firstToken) { if (firstToken == null) { return new SyntaxElement.ContentL(this, getDocument().getLength(), getDocument().getLength()); @@ -1664,9 +1654,9 @@ public List getPossibleEndTags(int offset, int anchor, String public List getPossibleEndTags(int offset, int anchor, String pattern, boolean firstOnly) throws BadLocationException { SyntaxElement elem = getElementChain( offset ); - Stack stack = new Stack(); - List result = new ArrayList(); - Set found = new HashSet(); + Stack stack = new Stack<>(); + List result = new ArrayList<>(); + Set found = new HashSet<>(); if( elem != null ) { elem = elem.getPrevious(); // we need smtg. before our ' ), ship inside the tag + TokenItem token = inputToken; if (token != null && token.getTokenID().getNumericID() == JspTagTokenContext.SYMBOL_ID && token.getImage().charAt(token.getImage().length()-1) == '>') token = token.getPrevious(); @@ -1891,12 +1882,14 @@ private int[] findMatchingTag(TokenItem token){ if (token != null && ((token.getTokenID().getNumericID() == JspTagTokenContext.TAG_ID && token.getImage().trim().length() > 0) || (token.getTokenID().getNumericID() == JspTagTokenContext.SYMBOL_ID && token.getImage().charAt(0)=='<'))){ - if (token.getTokenID().getNumericID() == JspTagTokenContext.SYMBOL_ID) // the starting of the jsp tag + if (token.getTokenID().getNumericID() == JspTagTokenContext.SYMBOL_ID) { // the starting of the jsp tag // we are somewhere at beginning of the jsp tag. Find out the token with the jsp tag. while (token !=null && !(token.getTokenID().getNumericID() == JspTagTokenContext.TAG_ID - && token.getImage().trim().length() > 0)) + && token.getImage().trim().length() > 0)) { token = token.getNext(); // move at the jsp tag + } + } isInside = true; // the curret is somewhere in ' 0) // this is hack, because a whitspaces are returned are with TAG_ID && !(token.getTokenID().getNumericID() == JspTagTokenContext.SYMBOL_ID - && token.getImage().charAt(token.getImage().length()-1) == '>')) + && token.getImage().charAt(token.getImage().length()-1) == '>')) { token = token.getPrevious(); - if (token!=null && token.getTokenID().getNumericID() == JspTagTokenContext.TAG_ID) + } + if (token!=null && token.getTokenID().getNumericID() == JspTagTokenContext.TAG_ID) { isInside = true; + } } } // Now we have the begining of the tag and we can start with the finding opposit tag. @@ -2060,6 +2055,7 @@ public boolean isSingletonTag(TokenItem tagTokenItem) { * and character and string constants. Returns empty array by default. */ @Override + @SuppressWarnings("ReturnOfCollectionOrArrayField") protected TokenID[] getBracketSkipTokens() { return JSP_BRACKET_SKIP_TOKENS; } @@ -2122,23 +2118,29 @@ boolean isValid() { } + @Override public void fileFolderCreated(FileEvent fe) { } + @Override public void fileDataCreated(FileEvent fe) { } + @Override public void fileChanged(FileEvent fe) { } + @Override public void fileDeleted(FileEvent fe) { //refresh fileobject initFileObject(); } + @Override public void fileRenamed(FileRenameEvent fe) { } + @Override public void fileAttributeChanged(FileAttributeEvent fe) { } } diff --git a/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/SimplifiedJspServlet.java b/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/SimplifiedJspServlet.java index fff69549fefd..a7400a870fde 100644 --- a/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/SimplifiedJspServlet.java +++ b/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/SimplifiedJspServlet.java @@ -44,7 +44,6 @@ import org.netbeans.modules.parsing.api.Source; import org.netbeans.modules.web.jsps.parserapi.PageInfo; -import org.netbeans.spi.editor.completion.CompletionItem; import org.openide.cookies.EditorCookie; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileSystem; @@ -52,7 +51,9 @@ import org.openide.loaders.DataObject; import org.openide.loaders.DataObjectNotFoundException; import org.openide.util.NbBundle; + import static org.netbeans.api.jsp.lexer.JspTokenId.JavaCodeType; + import org.netbeans.lib.editor.util.CharSequenceUtilities; import org.netbeans.modules.csl.spi.GsfUtilities; @@ -83,21 +84,21 @@ public class SimplifiedJspServlet extends JSPProcessor { private static final String CLASS_FOOTER = "\n\t}\n}"; //NOI18N private CharSequence charSequence; private final Snapshot snapshot; - private final ArrayList codeBlocks = new ArrayList(); - private List localImportsFound = new ArrayList(); - private List localBeansFound = new ArrayList(); - - private List header = new LinkedList(); - private List scriptlets = new LinkedList(); - private List declarations = new LinkedList(); - private List localImports = new LinkedList(); + private final ArrayList codeBlocks = new ArrayList<>(); + private final List localImportsFound = new ArrayList<>(); + private final List localBeansFound = new ArrayList<>(); + + private final List header = new LinkedList<>(); + private final List scriptlets = new LinkedList<>(); + private final List declarations = new LinkedList<>(); + private final List localImports = new LinkedList<>(); // keep bean declarations separate to avoid duplicating the declaration, see #130745 - List beanDeclarations = new LinkedList(); - Embedding pageExtends = null; - - private List implicitImports = new LinkedList(); + private final List beanDeclarations = new LinkedList<>(); + private final List implicitImports = new LinkedList<>(); + private Embedding pageExtends = null; + private int expressionIndex = 1; - + public SimplifiedJspServlet(Snapshot snapshot, Document doc){ this(snapshot, doc, null); @@ -145,11 +146,7 @@ private boolean isUnfinishedScriptletInQueue(TokenSequence ts) { protected void renderProcess() throws BadLocationException{ //check servlet API on classpath if (!isServletAPIOnClasspath()){ - SwingUtilities.invokeLater(new Runnable() { - public void run() { - displayServletAPIMissingWarning(); - } - }); + SwingUtilities.invokeLater(this::displayServletAPIMissingWarning); processingSuccessful = false; return; } @@ -237,13 +234,13 @@ public void run() { beanDeclarations.add(snapshot.create("\n" + createBeanVarDeclarations(localBeansFound), "text/x-java")); } - + private boolean consumeWS(TokenSequence tokenSequence){ if (tokenSequence.token().id() == JspTokenId.WHITESPACE){ return tokenSequence.moveNext(); } - + return true; } @@ -251,7 +248,7 @@ private boolean consumeWS(TokenSequence tokenSequence){ * The information about imports obtained from the JSP Parser * does not include data about offsets, * therefore it is necessary to some manual parsing. - * + * * This method creates embeddings and stores them in the * localImports * @@ -292,7 +289,7 @@ private void processJavaInTagValues(TokenSequence tokenSequence) { String singleImport = importContent.substring(startOffset, endOffset).trim(); localImportsFound.add(singleImport); startOffset = endOffset + 1; - + } while (moreToProcess); } else { pieceOfCode = extractCodeFromTagAttribute(tokenSequence, @@ -366,12 +363,11 @@ private void processJavaInTagValues(TokenSequence tokenSequence) { private PieceOfCode extractCodeFromTagAttribute(TokenSequence tokenSequence, List tagName, List attrName) { PieceOfCode pieceOfCode = null; - + if (tokenSequence.token().id() == JspTokenId.TAG && tagName.contains(tokenSequence.token().text().toString().trim())) { //NOI18N int startPos = tokenSequence.offset(); - tokensearchloop: while (tokenSequence.moveNext() && consumeWS(tokenSequence) && !(tokenSequence.token().id() == JspTokenId.SYMBOL && TokenUtilities.equals(tokenSequence.token().text(), "%>"))) { @@ -394,7 +390,7 @@ private PieceOfCode extractCodeFromTagAttribute(TokenSequence tokenSequence, Lis int len = val.length() - 1; String imprt = val.substring(1, len); pieceOfCode = new PieceOfCode(imprt, startOffset, imprt.length()); - break tokensearchloop; + break; } } } @@ -408,16 +404,14 @@ private PieceOfCode extractCodeFromTagAttribute(TokenSequence tokenSequence, Lis return pieceOfCode; } - + private boolean isServletAPIOnClasspath() { ClassPath cp = ClassPath.getClassPath(fobj, ClassPath.COMPILE); - if (cp != null && cp.findResource("javax/servlet/http/HttpServlet.class") != null) { //NOI18N - return true; - } - - return false; + return cp != null + && (cp.findResource("javax/servlet/http/HttpServlet.class") != null //NOI18N + || cp.findResource("jakarta/servlet/http/HttpServlet.class") != null); //NOI18N } @Override @@ -461,7 +455,7 @@ public Embedding getSimplifiedServlet() { return null; } - List content = new LinkedList(); + List content = new LinkedList<>(); // debug code to find the root cause of #169924 assert !implicitImports.contains(null) : "implicitImports contains null"; @@ -469,7 +463,7 @@ public Embedding getSimplifiedServlet() { assert !declarations.contains(null) : "declarations contains null"; assert !beanDeclarations.contains(null) : "beanDeclarations contains null"; assert !scriptlets.contains(null) : "scriptlets contains null"; - + content.addAll(implicitImports); content.addAll(localImports); content.addAll(header); @@ -485,7 +479,7 @@ public Embedding getSimplifiedServlet() { String msg = "---\n" + embedding.getSnapshot().getText() + "\n---"; logger.finest(msg); } - + return embedding; } @@ -511,15 +505,12 @@ private String getIncludedPath(TokenSequence tokenSequence) { public abstract static class VirtualJavaClass { public final void create(Document doc, String virtualClassBody) { - FileObject fileDummyJava = null; - List javaCompletionItems = null; - try { FileSystem memFS = FileUtil.createMemoryFileSystem(); - fileDummyJava = memFS.getRoot().createData("SimplifiedJSPServlet", "java"); //NOI18N - PrintWriter writer = new PrintWriter(fileDummyJava.getOutputStream()); - writer.print(virtualClassBody); - writer.close(); + FileObject fileDummyJava = memFS.getRoot().createData("SimplifiedJSPServlet", "java"); //NOI18N + try (PrintWriter writer = new PrintWriter(fileDummyJava.getOutputStream())) { + writer.print(virtualClassBody); + } Source source = Source.create(fileDummyJava); process(fileDummyJava, source); @@ -532,9 +523,9 @@ public final void create(Document doc, String virtualClassBody) { } private class PieceOfCode{ - private String content; - private int startOffset; - private int length; + private final String content; + private final int startOffset; + private final int length; public PieceOfCode(String content, int startOffset, int length) { this.content = content; diff --git a/enterprise/web.core.syntax/test/unit/src/org/netbeans/test/web/core/syntax/TestBase2.java b/enterprise/web.core.syntax/test/unit/src/org/netbeans/test/web/core/syntax/TestBase2.java index 44706af29d9c..5034285ed0c8 100644 --- a/enterprise/web.core.syntax/test/unit/src/org/netbeans/test/web/core/syntax/TestBase2.java +++ b/enterprise/web.core.syntax/test/unit/src/org/netbeans/test/web/core/syntax/TestBase2.java @@ -83,7 +83,7 @@ public final void initParserJARs() throws MalformedURLException { } list.add(f.toURI().toURL()); } - JspParserImpl.setParserJARs(list.toArray(new URL[list.size()])); + JspParserImpl.setParserJARs(list.toArray(new URL[0])); } public final ClassPath createServletAPIClassPath() throws MalformedURLException, IOException { @@ -108,7 +108,7 @@ public final ClassPath createClassPath(String property) FileObject fo = FileUtil.toFileObject(f); fos.add(FileUtil.getArchiveRoot(fo)); } - return ClassPathSupport.createClassPath(fos.toArray(new FileObject[fos.size()])); + return ClassPathSupport.createClassPath(fos.toArray(new FileObject[0])); } protected void assertFileContentsMatches(String relFilePath, String newFileName, diff --git a/enterprise/web.core/nbproject/org-netbeans-modules-web-core.sig b/enterprise/web.core/nbproject/org-netbeans-modules-web-core.sig index cabbff78600b..c3daa22e58bf 100644 --- a/enterprise/web.core/nbproject/org-netbeans-modules-web-core.sig +++ b/enterprise/web.core/nbproject/org-netbeans-modules-web-core.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.54.0 +#Version 2.55.0 CLSS public abstract java.awt.Component cons protected init() diff --git a/enterprise/web.core/nbproject/project.properties b/enterprise/web.core/nbproject/project.properties index 8505f48f36ee..6c7b85dd797b 100644 --- a/enterprise/web.core/nbproject/project.properties +++ b/enterprise/web.core/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=2.55.0 +spec.version.base=2.57.0 requires.nb.javac=true test.config.stableBTD.includes=**/*Test.class diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/Util.java b/enterprise/web.core/src/org/netbeans/modules/web/core/Util.java index c38d390010b5..1de66aba4146 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/Util.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/Util.java @@ -167,7 +167,7 @@ public static SourceGroup[] getJavaSourceGroups(Project project) { result.add(sourceGroup); } } - return result.toArray(new SourceGroup[result.size()]); + return result.toArray(new SourceGroup[0]); } private static Set getTestSourceGroups(Project project, SourceGroup[] sourceGroups) { diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/api/JspColoringData.java b/enterprise/web.core/src/org/netbeans/modules/web/core/api/JspColoringData.java index 539fba4d3dff..150efed28caa 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/api/JspColoringData.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/api/JspColoringData.java @@ -34,7 +34,6 @@ * * @author Petr Jiricka */ -// @todo: Support JakartaEE public final class JspColoringData extends PropertyChangeSupport { /** An property whose change is fired every time the tag library diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/palette/JspPaletteUtilities.java b/enterprise/web.core/src/org/netbeans/modules/web/core/palette/JspPaletteUtilities.java index 2b888b1ef236..0426a892548b 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/palette/JspPaletteUtilities.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/palette/JspPaletteUtilities.java @@ -32,6 +32,7 @@ import javax.swing.text.Caret; import javax.swing.text.Document; import javax.swing.text.JTextComponent; +import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.source.ClasspathInfo; import org.netbeans.modules.editor.indent.api.Indent; import org.netbeans.api.java.source.CompilationController; @@ -50,7 +51,6 @@ * * @author Libor Kotouc */ -// @todo: Support JakartaEE public final class JspPaletteUtilities { public static final String CARET = "&CARET&";// NOI18N @@ -58,7 +58,7 @@ public final class JspPaletteUtilities { private static final String JSTL_URI = "http://java.sun.com/jsp/jstl/core"; //NOI18N private static final String SQL_PREFIX = "sql"; //NOI18N private static final String SQL_URI = "http://java.sun.com/jsp/jstl/sql"; //NOI18N - + public static void insert(String s, JTextComponent target) throws BadLocationException { insert(s, target, true); } @@ -143,6 +143,15 @@ public static PageInfo.BeanData[] getAllBeans(JTextComponent target) { return null; } + public static boolean isJakartaVariant(JTextComponent target) { + FileObject fobj = getFileObject(target); + if(fobj != null) { + ClassPath cp = ClassPath.getClassPath(fobj, ClassPath.COMPILE); + return cp != null && cp.findResource("jakarta/servlet/http/HttpServletRequest.class") != null; + } + return false; + } + public static boolean idExists(String id, PageInfo.BeanData[] beanData) { boolean res = false; if (id != null && beanData != null) { @@ -160,11 +169,8 @@ public static boolean idExists(String id, PageInfo.BeanData[] beanData) { public static boolean typeExists(JTextComponent target, final String fqcn) { final boolean[] result = {false}; if (fqcn != null) { - runUserActionTask(target, new Task() { - - public void run(CompilationController parameter) throws Exception { - result[0] = parameter.getElements().getTypeElement(fqcn) != null; - } + runUserActionTask(target, (CompilationController parameter) -> { + result[0] = parameter.getElements().getTypeElement(fqcn) != null; }); } return result[0]; @@ -185,10 +191,11 @@ private static void runUserActionTask(JTextComponent target, Task getTypeProperties(JTextComponent target, final String fqcn, final String[] prefix) { - final List result = new ArrayList(); + final List result = new ArrayList<>(); if (prefix != null) { runUserActionTask(target, new Task() { + @Override public void run(CompilationController parameter) throws Exception { TypeElement te = parameter.getElements().getTypeElement(fqcn); if (te != null) { @@ -236,7 +243,7 @@ private boolean match(String methodName, String[] prefix) { } return result; } - + /**************************************************************************/ public static String getTagLibPrefix(JTextComponent target, String tagLibUri) { FileObject fobj = getFileObject(target); @@ -251,7 +258,7 @@ public static String getTagLibPrefix(JTextComponent target, String tagLibUri) { } return null; } - + /**************************************************************************/ public static String findJstlPrefix(JTextComponent target) { String res = getTagLibPrefix(target, JSTL_URI); @@ -298,5 +305,5 @@ private static void insertTagLibRef(JTextComponent target, String prefix, String }); } } - + } diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/palette/items/GetProperty.java b/enterprise/web.core/src/org/netbeans/modules/web/core/palette/items/GetProperty.java index 068bf090bbd2..33b88ae6dcad 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/palette/items/GetProperty.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/palette/items/GetProperty.java @@ -33,7 +33,6 @@ * * @author Libor Kotouc */ -// @todo: Support JakartaEE public class GetProperty implements ActiveEditorDrop { public static final String[] implicitBeans = new String[] { // NOI18N @@ -43,13 +42,13 @@ public class GetProperty implements ActiveEditorDrop { "session", "application", "out", - "config", - "page", - "exception" + "config", + "page", + "exception" }; public static final int BEAN_DEFAULT = 0; public static final String[] implicitTypes = new String[] { // NOI18N - "javax.servlet.http.HttpServletRequest", + "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "javax.servlet.jsp.PageContext", "javax.servlet.http.HttpSession", @@ -57,20 +56,32 @@ public class GetProperty implements ActiveEditorDrop { "javax.servlet.jsp.JspWriter", "javax.servlet.ServletConfig", "java.lang.Object", - "java.lang.Throwable" + "java.lang.Throwable" }; - protected List allBeans = new ArrayList(); + public static final String[] implicitTypesJakarta = new String[] { // NOI18N + "jakarta.servlet.http.HttpServletRequest", + "jakarta.servlet.http.HttpServletResponse", + "jakarta.servlet.jsp.PageContext", + "jakarta.servlet.http.HttpSession", + "jakarta.servlet.ServletContext", + "jakarta.servlet.jsp.JspWriter", + "jakarta.servlet.ServletConfig", + "java.lang.Object", + "java.lang.Throwable" + }; + protected List allBeans = new ArrayList<>(); private int beanIndex = BEAN_DEFAULT; private String bean = ""; private String property = ""; - + public GetProperty() { } + @Override public boolean handleTransfer(JTextComponent targetComponent) { allBeans = initAllBeans(targetComponent); GetPropertyCustomizer c = new GetPropertyCustomizer(this, targetComponent); - + boolean accept = c.showDialog(); if (accept) { String body = createBody(); @@ -80,21 +91,20 @@ public boolean handleTransfer(JTextComponent targetComponent) { accept = false; } } - + return accept; } private String createBody() { - String strBean = " name=\"\""; // NOI18N - if (beanIndex == -1) + String strBean; // NOI18N + if (beanIndex == -1) { strBean = " name=\"" + bean + "\""; // NOI18N - else + } else { strBean = " name=\"" + allBeans.get(beanIndex).getId() + "\""; // NOI18N - + } + String strProperty = " property=\"" + property + "\""; // NOI18N - - String gp = ""; // NOI18N - return gp; + return ""; // NOI18N } public int getBeanIndex() { @@ -122,10 +132,17 @@ public void setProperty(String property) { } protected List initAllBeans(JTextComponent targetComponent) { - ArrayList res = new ArrayList(); + String[] types; + if(JspPaletteUtilities.isJakartaVariant(targetComponent)) { + types = implicitTypesJakarta; + } else { + types = implicitTypes; + } + + ArrayList res = new ArrayList<>(); for (int i = 0; i < implicitBeans.length; i++) { String id = implicitBeans[i]; - String fqcn = implicitTypes[i]; + String fqcn = types[i]; res.add(new BeanDescr(id, fqcn)); } PageInfo.BeanData[] bd = JspPaletteUtilities.getAllBeans(targetComponent); @@ -137,7 +154,7 @@ protected List initAllBeans(JTextComponent targetComponent) { return res; } - + class BeanDescr { private String id; private String fqcn; @@ -167,9 +184,9 @@ public BeanDescr(String id, String fqcn) { public String toString() { return id; } - + } - + public List getAllBeans(){ return allBeans; } diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/AdvancedFilter.template b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/AdvancedFilter.template index a302f8e294a3..864c1e323e1f 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/AdvancedFilter.template +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/AdvancedFilter.template @@ -2,7 +2,7 @@ <#assign licensePrefix = " * "> <#assign licenseLast = " */"> <#include "${project.licensePath}"> - + <#if package?? && package != ""> package ${package}; @@ -16,6 +16,27 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import java.util.Set; +<#if jakartaPackages> +<#if includeDispatcher??> +import jakarta.servlet.DispatcherType; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +<#if classAnnotation??> +import jakarta.servlet.annotation.WebFilter; + +<#if includeInitParams??> +import jakarta.servlet.annotation.WebInitParam; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; +<#else> <#if includeDispatcher??> import javax.servlet.DispatcherType; @@ -35,6 +56,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; + /** * @@ -49,11 +71,11 @@ public class ${name} implements Filter { // The filter configuration object we are associated with. If // this value is null, this filter instance is not currently - // configured. + // configured. private FilterConfig filterConfig = null; public ${name}() { - } + } private void doBeforeProcessing(RequestWrapper request, ResponseWrapper response) throws IOException, ServletException { @@ -90,7 +112,7 @@ public class ${name} implements Filter { log(buf.toString()); } */ - } + } private void doAfterProcessing(RequestWrapper request, ResponseWrapper response) throws IOException, ServletException { @@ -98,9 +120,9 @@ public class ${name} implements Filter { // Write code here to process the request and/or response after // the rest of the filter chain is invoked. - + // For example, a logging filter might log the attributes on the - // request object after the request has been processed. + // request object after the request has been processed. /* for (Enumeration en = request.getAttributeNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); @@ -114,7 +136,7 @@ public class ${name} implements Filter { /* PrintWriter respOut = new PrintWriter(response.getWriter()); respOut.println("

    This has been appended by an intrusive filter.

    "); - + respOut.println("

    Params (after the filter chain):
    "); for (Enumeration en = request.getParameterNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); @@ -147,7 +169,7 @@ public class ${name} implements Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - + if (debug) log("${name}:doFilter()"); // Create wrappers for the request and response objects. @@ -160,9 +182,9 @@ public class ${name} implements Filter { // include requests. RequestWrapper wrappedRequest = new RequestWrapper((HttpServletRequest)request); ResponseWrapper wrappedResponse = new ResponseWrapper((HttpServletResponse)response); - + doBeforeProcessing(wrappedRequest, wrappedResponse); - + Throwable problem = null; try { @@ -186,7 +208,7 @@ public class ${name} implements Filter { sendProcessingError(problem, response); } } - + /** * Return the filter configuration object for this filter. */ @@ -204,18 +226,18 @@ public class ${name} implements Filter { } /** - * Destroy method for this filter + * Destroy method for this filter */ - public void destroy() { + public void destroy() { } /** - * Init method for this filter + * Init method for this filter */ - public void init(FilterConfig filterConfig) { + public void init(FilterConfig filterConfig) { this.filterConfig = filterConfig; if (filterConfig != null) { - if (debug) { + if (debug) { log("${name}: Initializing filter"); } } @@ -237,18 +259,18 @@ public class ${name} implements Filter { } private void sendProcessingError(Throwable t, ServletResponse response) { - String stackTrace = getStackTrace(t); + String stackTrace = getStackTrace(t); if(stackTrace != null && !stackTrace.equals("")) { try { response.setContentType("text/html"); PrintStream ps = new PrintStream(response.getOutputStream()); - PrintWriter pw = new PrintWriter(ps); + PrintWriter pw = new PrintWriter(ps); pw.print("\n\nError\n\n\n"); //NOI18N - + // PENDING! Localize this for next official release - pw.print("

    The resource did not process correctly

    \n
    \n"); 
    -		pw.print(stackTrace); 
    +		pw.print("

    The resource did not process correctly

    \n
    \n");
    +		pw.print(stackTrace);
     		pw.print("
    \n"); //NOI18N pw.close(); ps.close(); @@ -282,13 +304,13 @@ public class ${name} implements Filter { } public void log(String msg) { - filterConfig.getServletContext().log(msg); + filterConfig.getServletContext().log(msg); } /** * This request wrapper class extends the support class HttpServletRequestWrapper, * which implements all the methods in the HttpServletRequest interface, as - * delegations to the wrapped request. + * delegations to the wrapped request. * You only need to override the methods that you need to change. * You can get access to the wrapped request using the method getRequest() */ @@ -305,7 +327,7 @@ public class ${name} implements Filter { public void setParameter(String name, String []values) { if (debug) System.out.println("${name}::setParameter(" + name + "=" + values + ")" + " localParams = "+ localParams); - + if (localParams == null) { localParams = new Hashtable(); // Copy the parameters from the underlying request. @@ -355,7 +377,7 @@ public class ${name} implements Filter { if (localParams == null) return getRequest().getParameterNames(); return localParams.keys(); - } + } <#if java15style??> @Override @@ -371,14 +393,14 @@ public class ${name} implements Filter { /** * This response wrapper class extends the support class HttpServletResponseWrapper, * which implements all the methods in the HttpServletResponse interface, as - * delegations to the wrapped response. + * delegations to the wrapped response. * You only need to override the methods that you need to change. * You can get access to the wrapped response using the method getResponse() */ class ResponseWrapper extends HttpServletResponseWrapper { public ResponseWrapper(HttpServletResponse response) { - super(response); + super(response); } // You might, for example, wish to know what cookies were set on the response @@ -387,14 +409,14 @@ public class ${name} implements Filter { // are being set. /* protected Vector cookies = null; - + // Create a new method that doesn't exist in HttpServletResponse public Enumeration getCookies() { if (cookies == null) cookies = new Vector(); return cookies.elements(); } - + // Override this method from HttpServletResponse to keep track // of cookies locally as well as in the wrapped response. public void addCookie (Cookie cookie) { diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/BodyTagHandler.template b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/BodyTagHandler.template index d60f70627f35..960a3c658d05 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/BodyTagHandler.template +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/BodyTagHandler.template @@ -2,16 +2,23 @@ <#assign licensePrefix = " * "> <#assign licenseLast = " */"> <#include "${project.licensePath}"> - + <#if package?? && package != ""> package ${package}; import java.io.IOException; +<#if jakartaPackages> +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.tagext.BodyContent; +import jakarta.servlet.jsp.tagext.BodyTagSupport; +<#else> import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.BodyContent; import javax.servlet.jsp.tagext.BodyTagSupport; + /** * @@ -19,14 +26,14 @@ import javax.servlet.jsp.tagext.BodyTagSupport; */ public class ${name} extends BodyTagSupport { - - /** - * Creates new instance of tag handler + + /** + * Creates new instance of tag handler */ public ${name}() { super(); } - + //////////////////////////////////////////////////////////////// /// /// /// User methods. /// @@ -34,7 +41,7 @@ public class ${name} extends BodyTagSupport { /// Modify these methods to customize your tag handler. /// /// /// //////////////////////////////////////////////////////////////// - + /** * Method called from doStartTag(). * Fill in this method to perform other operations from doStartTag(). @@ -42,9 +49,9 @@ public class ${name} extends BodyTagSupport { private void otherDoStartTagOperations() { // TODO: code that performs other operations in doStartTag // should be placed here. - // It will be called after initializing variables, - // finding the parent, setting IDREFs, etc, and - // before calling theBodyShouldBeEvaluated(). + // It will be called after initializing variables, + // finding the parent, setting IDREFs, etc, and + // before calling theBodyShouldBeEvaluated(). // // For example, to print something out to the JSP, use the following: // @@ -55,7 +62,7 @@ public class ${name} extends BodyTagSupport { // // do something // } } - + /** * Method called from doEndTag() * Fill in this method to perform other operations from doEndTag(). @@ -67,7 +74,7 @@ public class ${name} extends BodyTagSupport { // finding the parent, setting IDREFs, etc, and // before calling shouldEvaluateRestOfPageAfterEndTag(). } - + /** * Fill in this method to process the body content of the tag. * You only need to do this if the tag's BodyContent property @@ -81,25 +88,25 @@ public class ${name} extends BodyTagSupport { // // out.println("" + attribute_1 + ""); // out.println("
    "); - + // write the body content (after processing by the JSP engine) on the output Writer bodyContent.writeOut(out); - + // Or else get the body content as a string and process it, e.g.: // String bodyStr = bodyContent.getString(); // String result = yourProcessingMethod(bodyStr); // out.println(result); - + // TODO: insert code to write html after writing the body content. // e.g.: // // out.println("
    "); - - + + // clear the body content for the next time through. bodyContent.clearBody(); } - + //////////////////////////////////////////////////////////////// /// /// /// Tag Handler interface methods. /// @@ -108,7 +115,7 @@ public class ${name} extends BodyTagSupport { /// methods that they call. /// /// /// //////////////////////////////////////////////////////////////// - + /** * This method is called when the JSP engine encounters the start tag, * after the attributes are processed. @@ -122,14 +129,14 @@ public class ${name} extends BodyTagSupport { public int doStartTag() throws JspException { otherDoStartTagOperations(); - + if (theBodyShouldBeEvaluated()) { return EVAL_BODY_BUFFERED; } else { return SKIP_BODY; } } - + /** * This method is called after the JSP engine finished processing the tag. * @return EVAL_PAGE if the JSP engine should continue evaluating the JSP page, otherwise return SKIP_PAGE. @@ -141,14 +148,14 @@ public class ${name} extends BodyTagSupport { public int doEndTag() throws JspException { otherDoEndTagOperations(); - + if (shouldEvaluateRestOfPageAfterEndTag()) { return EVAL_PAGE; } else { return SKIP_PAGE; } } - + /** * This method is called after the JSP engine processes the body content of the tag. * @return EVAL_BODY_AGAIN if the JSP engine should evaluate the tag body again, otherwise return SKIP_BODY. @@ -163,19 +170,19 @@ public class ${name} extends BodyTagSupport { // This code is generated for tags whose bodyContent is "JSP" BodyContent bodyCont = getBodyContent(); JspWriter out = bodyCont.getEnclosingWriter(); - + writeTagBodyContent(out, bodyCont); } catch (Exception ex) { handleBodyContentException(ex); } - + if (theBodyShouldBeEvaluatedAgain()) { return EVAL_BODY_AGAIN; } else { return SKIP_BODY; } } - + /** * Handles exception from processing the body content. */ @@ -183,7 +190,7 @@ public class ${name} extends BodyTagSupport { // Since the doAfterBody method is guarded, place exception handing code here. throw new JspException("Error in ${name} tag", ex); } - + /** * Fill in this method to determine if the rest of the JSP page * should be generated after this tag is finished. @@ -197,7 +204,7 @@ public class ${name} extends BodyTagSupport { // return true; } - + /** * Fill in this method to determine if the tag body should be evaluated * again after evaluating the body. @@ -213,5 +220,5 @@ public class ${name} extends BodyTagSupport { // return false; } - + } diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/Servlet.template b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/Servlet.template index b1800a6b9dd4..dd4d528526f9 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/Servlet.template +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/Servlet.template @@ -9,6 +9,18 @@ package ${package}; import java.io.IOException; import java.io.PrintWriter; +<#if jakartaPackages> +import jakarta.servlet.ServletException; +<#if classAnnotation??> +import jakarta.servlet.annotation.WebServlet; + +<#if includeInitParams??> +import jakarta.servlet.annotation.WebInitParam; + +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +<#else> import javax.servlet.ServletException; <#if classAnnotation??> import javax.servlet.annotation.WebServlet; @@ -19,6 +31,7 @@ import javax.servlet.annotation.WebInitParam; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + /** * @@ -28,8 +41,8 @@ import javax.servlet.http.HttpServletResponse; ${classAnnotation} public class ${name} extends HttpServlet { - - /** + + /** * Processes requests for both HTTP GET and POST methods. * @param request servlet request * @param response servlet response @@ -49,7 +62,7 @@ public class ${name} extends HttpServlet { out.println("${doctype?j_string}"); out.println(""); out.println(""); - out.println("Servlet ${name}"); + out.println("Servlet ${name}"); out.println(""); out.println(""); out.println("

    Servlet ${name} at " + request.getContextPath () + "

    "); @@ -60,10 +73,10 @@ public class ${name} extends HttpServlet { out.close(); } - } + } // - /** + /** * Handles the HTTP GET method. * @param request servlet request * @param response servlet response @@ -76,9 +89,9 @@ public class ${name} extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); - } + } - /** + /** * Handles the HTTP POST method. * @param request servlet request * @param response servlet response @@ -93,7 +106,7 @@ public class ${name} extends HttpServlet { processRequest(request, response); } - /** + /** * Returns a short description of the servlet. * @return a String containing servlet description */ diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/ServletListener.template b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/ServletListener.template index 6bd2071dfddd..0d008ea72a09 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/ServletListener.template +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/ServletListener.template @@ -7,9 +7,16 @@ package ${package}; +<#if jakartaPackages> +<#if classAnnotation??> +import jakarta.servlet.annotation.WebListener; + + +<#else> <#if classAnnotation??> import javax.servlet.annotation.WebListener; + /** * Web application lifecycle listener. diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/SimpleFilter.template b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/SimpleFilter.template index c0d3a15039d0..482862f8c5ff 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/SimpleFilter.template +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/SimpleFilter.template @@ -11,6 +11,23 @@ import java.io.IOException; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; +<#if jakartaPackages> +<#if includeDispatcher??> +import jakarta.servlet.DispatcherType; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +<#if classAnnotation??> +import jakarta.servlet.annotation.WebFilter; + +<#if includeInitParams??> +import jakarta.servlet.annotation.WebInitParam; + +<#else> <#if includeDispatcher??> import javax.servlet.DispatcherType; @@ -26,7 +43,7 @@ import javax.servlet.annotation.WebFilter; <#if includeInitParams??> import javax.servlet.annotation.WebInitParam; - + /** * * @author ${user} @@ -40,11 +57,11 @@ public class ${name} implements Filter { // The filter configuration object we are associated with. If // this value is null, this filter instance is not currently - // configured. + // configured. private FilterConfig filterConfig = null; public ${name}() { - } + } private void doBeforeProcessing(ServletRequest request, ServletResponse response) throws IOException, ServletException { @@ -71,7 +88,7 @@ public class ${name} implements Filter { log(buf.toString()); } */ - } + } private void doAfterProcessing(ServletRequest request, ServletResponse response) throws IOException, ServletException { @@ -79,9 +96,9 @@ public class ${name} implements Filter { // Write code here to process the request and/or response after // the rest of the filter chain is invoked. - + // For example, a logging filter might log the attributes on the - // request object after the request has been processed. + // request object after the request has been processed. /* for (Enumeration en = request.getAttributeNames(); en.hasMoreElements(); ) { String name = (String)en.nextElement(); @@ -114,7 +131,7 @@ public class ${name} implements Filter { if (debug) log("${name}:doFilter()"); doBeforeProcessing(request, response); - + Throwable problem = null; try { chain.doFilter(request, response); @@ -137,7 +154,7 @@ public class ${name} implements Filter { sendProcessingError(problem, response); } } - + /** * Return the filter configuration object for this filter. */ @@ -155,18 +172,18 @@ public class ${name} implements Filter { } /** - * Destroy method for this filter + * Destroy method for this filter */ - public void destroy() { + public void destroy() { } /** - * Init method for this filter + * Init method for this filter */ - public void init(FilterConfig filterConfig) { + public void init(FilterConfig filterConfig) { this.filterConfig = filterConfig; if (filterConfig != null) { - if (debug) { + if (debug) { log("${name}:Initializing filter"); } } @@ -187,18 +204,18 @@ public class ${name} implements Filter { } private void sendProcessingError(Throwable t, ServletResponse response) { - String stackTrace = getStackTrace(t); + String stackTrace = getStackTrace(t); if(stackTrace != null && !stackTrace.equals("")) { try { response.setContentType("text/html"); PrintStream ps = new PrintStream(response.getOutputStream()); - PrintWriter pw = new PrintWriter(ps); + PrintWriter pw = new PrintWriter(ps); pw.print("\n\nError\n\n\n"); //NOI18N - + // PENDING! Localize this for next official release - pw.print("

    The resource did not process correctly

    \n
    \n"); 
    -		pw.print(stackTrace); 
    +		pw.print("

    The resource did not process correctly

    \n
    \n");
    +		pw.print(stackTrace);
     		pw.print("
    \n"); //NOI18N pw.close(); ps.close(); @@ -232,7 +249,7 @@ public class ${name} implements Filter { } public void log(String msg) { - filterConfig.getServletContext().log(msg); + filterConfig.getServletContext().log(msg); } } diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/SimpleTagHandler.template b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/SimpleTagHandler.template index fac56a9bb10f..b5fdc3f1a621 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/SimpleTagHandler.template +++ b/enterprise/web.core/src/org/netbeans/modules/web/core/resources/templates/SimpleTagHandler.template @@ -7,10 +7,17 @@ package ${package}; +<#if jakartaPackages> +import jakarta.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.tagext.JspFragment; +import jakarta.servlet.jsp.tagext.SimpleTagSupport; +<#else> import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.JspFragment; import javax.servlet.jsp.tagext.SimpleTagSupport; + /** * @@ -19,7 +26,7 @@ import javax.servlet.jsp.tagext.SimpleTagSupport; public class ${name} extends SimpleTagSupport { /** - * Called by the container to invoke this tag. + * Called by the container to invoke this tag. * The implementation of this method is provided by the tag library developer, * and handles all tag processing, body iteration, etc. */ diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/Bundle.properties b/enterprise/web.core/src/org/netbeans/modules/web/wizards/Bundle.properties index 7b48115d17f3..c3a1a65a141f 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/Bundle.properties +++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/Bundle.properties @@ -314,7 +314,7 @@ A11Y_DESC_SessiontAttrListener=HTTP Session Attribute Listener MSG_noListenerSelected=Check at least one Servlet Listener -MSG_noResourceInClassPath=No {0} in Class Path +MSG_noResourceInClassPath=No {0}/{1} in Class Path MSG_noWebInfDirectory=No WEB-INF directory in the project. New one will be created in the target folder. @@ -419,9 +419,9 @@ OPT_BodyTag=BodyTagSupport TITLE_tagHandlerPanel=Tag Handler Type Selection -DESC_SimpleTag=Creates a tag handler that extends javax.servlet.jsp.tagext.SimpleTagSupport. +DESC_SimpleTag=Creates a tag handler that extends jakarta/javax.servlet.jsp.tagext.SimpleTagSupport. -DESC_BodyTag=Creates a tag handler that extends javax.servlet.jsp.tagext.BodyTagSupport. +DESC_BodyTag=Creates a tag handler that extends jakarta/javax.servlet.jsp.tagext.BodyTagSupport. LBL_SimpleTag_Mnemonic=s diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerGenerator.java b/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerGenerator.java index cc76d2a72fa9..d23af224dc4b 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerGenerator.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerGenerator.java @@ -30,6 +30,7 @@ import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; import javax.lang.model.util.ElementFilter; +import org.netbeans.api.java.source.ClasspathInfo; import org.netbeans.api.java.source.GeneratorUtilities; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.JavaSource.Phase; @@ -38,6 +39,14 @@ import org.netbeans.api.java.source.TreeUtilities; import org.netbeans.api.java.source.WorkingCopy; import org.netbeans.modules.j2ee.core.api.support.java.GenerationUtils; +import org.openide.filesystems.FileObject; + +import static org.netbeans.modules.web.wizards.ListenerPanel.HTTP_SESSION_ATTRIBUTE_LISTENER; +import static org.netbeans.modules.web.wizards.ListenerPanel.HTTP_SESSION_LISTENER; +import static org.netbeans.modules.web.wizards.ListenerPanel.SERVLET_CONTEXT_ATTRIBUTE_LISTENER; +import static org.netbeans.modules.web.wizards.ListenerPanel.SERVLET_CONTEXT_LISTENER; +import static org.netbeans.modules.web.wizards.ListenerPanel.SERVLET_REQUEST_ATTRIBUTE_LISTENER; +import static org.netbeans.modules.web.wizards.ListenerPanel.SERVLET_REQUEST_LISTENER; /** * Generator for servlet listener class @@ -45,19 +54,27 @@ * @author milan.kuchtiak@sun.com * Created on March, 2004 */ -// @todo: Support JakartaEE public class ListenerGenerator { - boolean isContext; - boolean isContextAttr; - boolean isSession; - boolean isSessionAttr; - boolean isRequest; - boolean isRequestAttr; + private final boolean isContext; + private final boolean isContextAttr; + private final boolean isSession; + private final boolean isSessionAttr; + private final boolean isRequest; + private final boolean isRequestAttr; private GenerationUtils gu; - /** Creates a new instance of ListenerGenerator */ + /** + * Creates a new instance of ListenerGenerator + * + * @param isContext + * @param isContextAttr + * @param isSession + * @param isSessionAttr + * @param isRequest + * @param isRequestAttr + */ public ListenerGenerator(boolean isContext, boolean isContextAttr, boolean isSession, boolean isSessionAttr, boolean isRequest, boolean isRequestAttr) { this.isContext = isContext; this.isContextAttr = isContextAttr; @@ -68,20 +85,18 @@ public ListenerGenerator(boolean isContext, boolean isContextAttr, boolean isSes } public void generate(JavaSource clazz) throws IOException { - Task task = new Task() { - public void run(WorkingCopy workingCopy) throws Exception { - workingCopy.toPhase(Phase.RESOLVED); - CompilationUnitTree cut = workingCopy.getCompilationUnit(); - - gu = GenerationUtils.newInstance(workingCopy); - for (Tree typeDecl : cut.getTypeDecls()) { - if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) { - Element e = workingCopy.getTrees().getElement(new TreePath(new TreePath(workingCopy.getCompilationUnit()), typeDecl)); - if (e != null && e.getKind().isClass()) { - TypeElement te = (TypeElement) e; - ClassTree ct = (ClassTree) typeDecl; - workingCopy.rewrite(ct, generateInterfaces(workingCopy, te, ct, gu)); - } + Task task = (WorkingCopy workingCopy) -> { + workingCopy.toPhase(Phase.RESOLVED); + CompilationUnitTree cut = workingCopy.getCompilationUnit(); + + gu = GenerationUtils.newInstance(workingCopy); + for (Tree typeDecl : cut.getTypeDecls()) { + if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) { + Element e = workingCopy.getTrees().getElement(new TreePath(new TreePath(workingCopy.getCompilationUnit()), typeDecl)); + if (e != null && e.getKind().isClass()) { + TypeElement te = (TypeElement) e; + ClassTree ct = (ClassTree) typeDecl; + workingCopy.rewrite(ct, generateInterfaces(workingCopy, te, ct, gu, clazz)); } } } @@ -97,29 +112,35 @@ public void run(WorkingCopy workingCopy) throws Exception { // if (isRequestAttr) addRequestAttrListenerMethods(); } - private ClassTree generateInterfaces(WorkingCopy wc, TypeElement te, ClassTree ct, GenerationUtils gu) { + private ClassTree generateInterfaces(WorkingCopy wc, TypeElement te, ClassTree ct, GenerationUtils gu, JavaSource clazz) { ClassTree newClassTree = ct; - List ifList = new ArrayList(); - List methods = new ArrayList(); - + List ifList = new ArrayList<>(); + List methods = new ArrayList<>(); + + FileObject jakartaServletRequestListenerFo = clazz.getClasspathInfo() + .getClassPath(ClasspathInfo.PathKind.COMPILE) + .findResource("jakarta" + SERVLET_REQUEST_LISTENER.replace('.', '/') + ".class"); + + String prefix = jakartaServletRequestListenerFo == null ? "javax" : "jakarta"; + if (isContext) { - ifList.add("javax.servlet.ServletContextListener"); + ifList.add(prefix + SERVLET_CONTEXT_LISTENER); } if (isContextAttr) { - ifList.add("javax.servlet.ServletContextAttributeListener"); + ifList.add(prefix + SERVLET_CONTEXT_ATTRIBUTE_LISTENER); } if (isSession) { - ifList.add("javax.servlet.http.HttpSessionListener"); + ifList.add(prefix + HTTP_SESSION_LISTENER); } if (isSessionAttr) { - ifList.add("javax.servlet.http.HttpSessionAttributeListener"); + ifList.add(prefix + HTTP_SESSION_ATTRIBUTE_LISTENER); } if (isRequest) { - ifList.add("javax.servlet.ServletRequestListener"); + ifList.add(prefix + SERVLET_REQUEST_LISTENER); } if (isRequestAttr) { - ifList.add("javax.servlet.ServletRequestAttributeListener"); + ifList.add(prefix + SERVLET_REQUEST_ATTRIBUTE_LISTENER); } for (String ifName : ifList) { newClassTree = gu.addImplementsClause(newClassTree, ifName); diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerIterator.java b/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerIterator.java index ad4b629df978..c903d03267e2 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerIterator.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerIterator.java @@ -26,7 +26,6 @@ import java.util.Set; import javax.swing.JComponent; import javax.swing.event.ChangeListener; -import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; import java.util.logging.Level; @@ -41,6 +40,7 @@ import org.openide.DialogDisplayer; import org.netbeans.spi.project.ui.templates.support.Templates; import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectUtils; import org.netbeans.api.project.SourceGroup; import org.netbeans.api.project.Sources; import org.netbeans.modules.j2ee.common.dd.DDHelper; @@ -66,7 +66,7 @@ public class ListenerIterator implements TemplateWizard.AsynchronousInstantiatingIterator { private static final Logger LOG = Logger.getLogger(ListenerIterator.class.getName()); - + // CHANGEME vvv //private static final long serialVersionUID = ...L; @@ -76,12 +76,15 @@ protected WizardDescriptor.Panel[] createPanels(TemplateWizard wizard) { Project project = Templates.getProject( wiz ); SourceGroup[] sourceGroups = Util.getJavaSourceGroups(project); panel = new ListenerPanel(wizard); - + WizardDescriptor.Panel packageChooserPanel; if (sourceGroups.length == 0) { - Sources sources = (Sources) project.getLookup().lookup(org.netbeans.api.project.Sources.class); + Sources sources = (Sources) ProjectUtils.getSources(project); sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC); - packageChooserPanel = Templates.createSimpleTargetChooser(project, sourceGroups, panel); + packageChooserPanel = Templates + .buildSimpleTargetChooser(project, sourceGroups) + .bottomPanel(panel) + .create(); } else packageChooserPanel = JavaTemplates.createPackageChooser(project, sourceGroups, panel); @@ -92,6 +95,7 @@ protected WizardDescriptor.Panel[] createPanels(TemplateWizard wizard) { }; } + @Override public Set instantiate () throws IOException/*, IllegalStateException*/ { // Here is the default plain behavior. Simply takes the selected // template (you need to have included the standard second panel @@ -101,16 +105,23 @@ public Set instantiate () throws IOException/*, IllegalStateExceptio // More advanced wizards can create multiple objects from template // (return them all in the result of this method), populate file // contents on the fly, etc. - + FileObject folder = Templates.getTargetFolder(wiz); DataFolder targetFolder = DataFolder.findFolder(folder); - + + ClassPath classPath = ClassPath.getClassPath(folder,ClassPath.SOURCE); String listenerName = wiz.getTargetName(); - DataObject result = null; - + DataObject result; + if (classPath != null) { - Map templateParameters = new HashMap(); + Map templateParameters = new HashMap<>(); + ClassPath cp = ClassPath.getClassPath(folder, ClassPath.COMPILE); + if (cp != null && cp.findResource("jakarta/servlet/http/HttpServlet.class") != null) { + templateParameters.put("jakartaPackages", true); + } else { + templateParameters.put("jakartaPackages", false); + } if (!panel.createElementInDD() && Utilities.isJavaEE6Plus(wiz)) { templateParameters.put("classAnnotation", AnnotationGenerator.webListener()); } @@ -134,7 +145,7 @@ public Set instantiate () throws IOException/*, IllegalStateExceptio if (webAppFo!=null) { webApp = DDProvider.getDefault().getDDRoot(webAppFo); } - if (webApp!=null) { + if (webApp!=null) { Listener[] oldListeners = webApp.getListener(); boolean found=false; for (int i=0;i instantiate () throws IOException/*, IllegalStateExceptio try { Listener listener = (Listener)webApp.createBean("Listener");//NOI18N listener.setListenerClass(className); - StringBuffer desc= new StringBuffer(); + StringBuilder desc= new StringBuilder(); int i=0; if (panel.isContextListener()) { desc.append("ServletContextListener"); //NOI18N @@ -213,11 +224,9 @@ public Set instantiate () throws IOException/*, IllegalStateExceptio } } } else { - String mes = MessageFormat.format ( - NbBundle.getMessage (ListenerIterator.class, "TXT_wrongFolderForClass"), - new Object [] {"Servlet Listener"}); //NOI18N + String mes = NbBundle.getMessage (ListenerIterator.class, "TXT_wrongFolderForClass", "Servlet Listener"); //NOI18N NotifyDescriptor desc = new NotifyDescriptor.Message(mes,NotifyDescriptor.Message.ERROR_MESSAGE); - DialogDisplayer.getDefault().notify(desc); + DialogDisplayer.getDefault().notify(desc); return null; } return Collections.singleton (result); @@ -230,16 +239,17 @@ public Set instantiate () throws IOException/*, IllegalStateExceptio private transient TemplateWizard wiz; private static final long serialVersionUID = -7586964579556513549L; - + // You can keep a reference to the TemplateWizard which can // provide various kinds of useful information such as // the currently selected target name. // Also the panels will receive wiz as their "settings" object. + @Override public void initialize (WizardDescriptor wiz) { this.wiz = (TemplateWizard) wiz; index = 0; panels = createPanels (this.wiz); - + // Creating steps. Object prop = wiz.getProperty (WizardDescriptor.PROP_CONTENT_DATA); // NOI18N String[] beforeSteps = null; @@ -247,7 +257,7 @@ public void initialize (WizardDescriptor wiz) { beforeSteps = (String[])prop; } String[] steps = Utilities.createSteps (beforeSteps, panels); - + for (int i = 0; i < panels.length; i++) { Component c = panels[i].getComponent (); if (steps[i] == null) { @@ -265,6 +275,7 @@ public void initialize (WizardDescriptor wiz) { } } } + @Override public void uninitialize (WizardDescriptor wiz) { this.wiz = null; panels = null; @@ -275,31 +286,39 @@ public void uninitialize (WizardDescriptor wiz) { // few more options for customization. If you e.g. want to make panels appear // or disappear dynamically, go ahead. + @Override public String name () { return NbBundle.getMessage(ListenerIterator.class, "TITLE_x_of_y", index + 1, panels.length); } + @Override public boolean hasNext () { return index < panels.length - 1; } + @Override public boolean hasPrevious () { return index > 0; } + @Override public void nextPanel () { if (! hasNext ()) throw new NoSuchElementException (); index++; } + @Override public void previousPanel () { if (! hasPrevious ()) throw new NoSuchElementException (); index--; } + @Override public WizardDescriptor.Panel current() { return panels[index]; } // If nothing unusual changes in the middle of the wizard, simply: + @Override public final void addChangeListener (ChangeListener l) {} + @Override public final void removeChangeListener (ChangeListener l) {} // If something changes dynamically (besides moving between panels), // e.g. the number of panels changes in response to user input, then diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerPanel.java b/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerPanel.java index a986696ec62c..b146eed92f3b 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerPanel.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/ListenerPanel.java @@ -43,9 +43,8 @@ * * @author Milan Kuchtiak */ -// @todo: Support JakartaEE public class ListenerPanel implements WizardDescriptor.Panel { - + /** The visual component that displays this panel. * If you need to access the component from this class, * just use getComponent(). @@ -53,22 +52,27 @@ public class ListenerPanel implements WizardDescriptor.Panel { private ListenerVisualPanel component; private transient TemplateWizard wizard; - private static final String SERVLET_CONTEXT_LISTENER = "javax.servlet.ServletContextListener"; //NOI18N - private static final String SERVLET_CONTEXT_ATTRIBUTE_LISTENER = "javax.servlet.ServletContextAttributeListener"; //NOI18N - private static final String HTTP_SESSION_LISTENER = "javax.servlet.http.HttpSessionListener"; //NOI18N - private static final String HTTP_SESSION_ATTRIBUTE_LISTENER = "javax.servlet.http.HttpSessionAttributeListener"; //NOI18N - private static final String SERVLET_REQUEST_LISTENER = "javax.servlet.ServletRequestListener"; //NOI18N - private static final String SERVLET_REQUEST_ATTRIBUTE_LISTENER = "javax.servlet.ServletRequestAttributeListener"; //NOI18N + static final String SERVLET_CONTEXT_LISTENER = ".servlet.ServletContextListener"; //NOI18N + static final String SERVLET_CONTEXT_ATTRIBUTE_LISTENER = ".servlet.ServletContextAttributeListener"; //NOI18N + static final String HTTP_SESSION_LISTENER = ".servlet.http.HttpSessionListener"; //NOI18N + static final String HTTP_SESSION_ATTRIBUTE_LISTENER = ".servlet.http.HttpSessionAttributeListener"; //NOI18N + static final String SERVLET_REQUEST_LISTENER = ".servlet.ServletRequestListener"; //NOI18N + static final String SERVLET_REQUEST_ATTRIBUTE_LISTENER = ".servlet.ServletRequestAttributeListener"; //NOI18N - /** Create the wizard panel descriptor. */ + /** + * Create the wizard panel descriptor. + * + * @param wizard + */ public ListenerPanel(TemplateWizard wizard) { this.wizard=wizard; } - + // Get the visual component for the panel. In this template, the component // is kept separate. This can be more efficient: if the wizard is created // but never displayed, or not all panels are displayed, it is better to // create only those which really need to be visible. + @Override public Component getComponent() { if (component == null) { Project project = Templates.getProject( wizard ); @@ -86,12 +90,14 @@ public Component getComponent() { } return component; } - + + @Override public HelpCtx getHelp() { //return new HelpCtx(ListenerPanel.class); return HelpCtx.DEFAULT_HELP; } - + + @Override public boolean isValid() { if(!isListenerSelected()) { wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, //NOI18N @@ -119,30 +125,36 @@ public boolean isValid() { resource = SERVLET_REQUEST_ATTRIBUTE_LISTENER; } } - if (cp != null && resource != null && cp.findResource(resource.replace('.', '/')+".class")==null) { //NOI18N - wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE,org.openide.util.NbBundle.getMessage(ListenerPanel.class, "MSG_noResourceInClassPath", resource)); + + if (cp != null && resource != null + && cp.findResource("jakarta" + resource.replace('.', '/') + ".class") == null //NOI18N + && cp.findResource("javax" + resource.replace('.', '/') + ".class") == null //NOI18N + ) { + wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE,org.openide.util.NbBundle.getMessage(ListenerPanel.class, "MSG_noResourceInClassPath", "jakarta." + resource, "javax." + resource)); return false; } WebModule module = WebModule.getWebModule(project.getProjectDirectory()); if (createElementInDD() && (module == null || module.getWebInf() == null)) { - wizard.putProperty(WizardDescriptor.PROP_WARNING_MESSAGE,org.openide.util.NbBundle.getMessage(ListenerPanel.class, "MSG_noWebInfDirectory", resource)); //NOI18N + wizard.putProperty(WizardDescriptor.PROP_WARNING_MESSAGE,org.openide.util.NbBundle.getMessage(ListenerPanel.class, "MSG_noWebInfDirectory")); //NOI18N return true; } wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, ""); //NOI18N wizard.putProperty(WizardDescriptor.PROP_WARNING_MESSAGE, ""); //NOI18N return true; - } - + } + // FIXME: use org.openide.util.ChangeSupport for ChangeListeners - private final Set listeners = new HashSet(1); - + private final Set listeners = new HashSet<>(1); + + @Override public final void addChangeListener (ChangeListener l) { synchronized (listeners) { listeners.add (l); } } + @Override public final void removeChangeListener (ChangeListener l) { synchronized (listeners) { listeners.remove (l); @@ -151,7 +163,7 @@ public final void removeChangeListener (ChangeListener l) { protected final void fireChangeEvent () { Iterator it; synchronized (listeners) { - it = new HashSet(listeners).iterator (); + it = new HashSet<>(listeners).iterator (); } ChangeEvent ev = new ChangeEvent (this); while (it.hasNext ()) { @@ -159,34 +171,36 @@ protected final void fireChangeEvent () { } } - + // You can use a settings object to keep track of state. // Normally the settings object will be the WizardDescriptor, // so you can use WizardDescriptor.getProperty & putProperty // to store information entered by the user. + @Override public void readSettings(Object settings) { } + @Override public void storeSettings(Object settings) { } boolean createElementInDD (){ return component.createElementInDD(); } - + boolean isContextListener() {return component.isContextListener();} - + boolean isContextAttrListener() {return component.isContextAttrListener();} - + boolean isSessionListener() {return component.isSessionListener();} - + boolean isSessionAttrListener() {return component.isSessionAttrListener();} - + boolean isRequestListener() {return component.isRequestListener();} - + boolean isRequestAttrListener() {return component.isRequestAttrListener();} boolean isListenerSelected() { return isContextListener() || isContextAttrListener() || - isSessionListener() || isSessionAttrListener() || + isSessionListener() || isSessionAttrListener() || isRequestListener() || isRequestAttrListener(); } } diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java b/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java index 6136e3f848d4..d6f6ba78d5de 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java @@ -202,6 +202,11 @@ private static boolean isJSF40(WebModule wm) { ClassPath classpath = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE); return classpath != null && classpath.findResource("jakarta/faces/lifecycle/ClientWindowScoped.class") != null; //NOI18N } + + private static boolean isJSF41(WebModule wm) { + ClassPath classpath = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE); + return classpath != null && classpath.findResource("jakarta/faces/convert/UUIDConverter.class") != null; //NOI18N + } public Set instantiate(TemplateWizard wiz) throws IOException { // Here is the default plain behavior. Simply takes the selected @@ -236,7 +241,9 @@ public Set instantiate(TemplateWizard wiz) throws IOException { template = templateParent.getFileObject("JSP", "xhtml"); //NOI18N WebModule wm = WebModule.getWebModule(df.getPrimaryFile()); if (wm != null) { - if (isJSF40(wm)) { + if (isJSF41(wm)) { + wizardProps.put("isJSF41", Boolean.TRUE); + } else if (isJSF40(wm)) { wizardProps.put("isJSF40", Boolean.TRUE); } else if (isJSF30(wm)) { wizardProps.put("isJSF30", Boolean.TRUE); diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/ServletIterator.java b/enterprise/web.core/src/org/netbeans/modules/web/wizards/ServletIterator.java index 62d5663c06ae..5127495ae4a1 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/ServletIterator.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/ServletIterator.java @@ -26,7 +26,7 @@ import java.util.Set; import javax.swing.JComponent; import javax.swing.event.ChangeListener; -import javax.swing.text.StyledEditorKit; +import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.project.JavaProjectConstants; import org.netbeans.api.java.queries.SourceLevelQuery; import org.netbeans.api.project.ProjectUtils; @@ -51,20 +51,20 @@ /** * A template wizard iterator for new servlets, filters and listeners. - * + * * @author radim.kubacki@sun.com * @author ana.von.klopp@sun.com * @author milan.kuchtiak@sun.com */ public class ServletIterator implements TemplateWizard.AsynchronousInstantiatingIterator { - + private static final long serialVersionUID = -4147344271705652643L; private static final Version JAVA_VERSION_17 = Version.fromDottedNotationWithFallback("1.7"); //NOI18N - private transient FileType fileType; - private transient TargetEvaluator evaluator = null; - private transient DeployData deployData = null; + private transient FileType fileType; + private transient TargetEvaluator evaluator = null; + private transient DeployData deployData = null; private transient int index; private transient WizardDescriptor.Panel[] panels; private transient TemplateWizard wizard; @@ -82,6 +82,7 @@ public static ServletIterator createFilterIterator() { return new ServletIterator(FileType.FILTER); } + @Override public void initialize(WizardDescriptor wiz) { this.wizard = (TemplateWizard) wiz; index = 0; @@ -95,37 +96,37 @@ public void initialize(WizardDescriptor wiz) { } Project project = Templates.getProject(wizard); - DataFolder targetFolder=null; + DataFolder targetFolder; try { targetFolder = wizard.getTargetFolder(); } catch (IOException ex) { targetFolder = DataFolder.findFolder(project.getProjectDirectory()); } - evaluator.setInitialFolder(targetFolder,project); + evaluator.setInitialFolder(targetFolder,project); boolean canCreate = ((ServletData)deployData).canCreate(wizard); - + if (fileType == FileType.SERVLET) { panels = new WizardDescriptor.Panel[]{ new FinishableProxyWizardPanel( createPackageChooserPanel(wizard, null), new HelpCtx(ServletIterator.class.getName() + "." + fileType), // #114487 - canCreate ), + canCreate ), ServletPanel.createServletPanel(evaluator, wizard) }; } else if (fileType == FileType.FILTER) { customPanel = new WrapperSelection(wizard); - panels = new WizardDescriptor.Panel[]{ canCreate ? + panels = new WizardDescriptor.Panel[]{ canCreate ? createPackageChooserPanel(wizard, customPanel): - new FinishableProxyWizardPanel( - createPackageChooserPanel(wizard, customPanel), - new HelpCtx(ServletIterator.class.getName() + new FinishableProxyWizardPanel( + createPackageChooserPanel(wizard, customPanel), + new HelpCtx(ServletIterator.class.getName() + "." + fileType), false), ServletPanel.createServletPanel(evaluator, wizard), ServletPanel.createFilterPanel(evaluator, wizard) }; } - + // Creating steps. Object prop = wizard.getProperty (WizardDescriptor.PROP_CONTENT_DATA); // NOI18N String[] beforeSteps = null; @@ -133,8 +134,8 @@ public void initialize(WizardDescriptor wiz) { beforeSteps = (String[])prop; } String[] steps = Utilities.createSteps(beforeSteps, panels); - - for (int i = 0; i < panels.length; i++) { + + for (int i = 0; i < panels.length; i++) { JComponent jc = (JComponent)panels[i].getComponent(); if (steps[i] == null) { // Default step name to component name of panel. @@ -154,7 +155,9 @@ private WizardDescriptor.Panel createPackageChooserPanel(TemplateWizard wizard, if (sourceGroups.length == 0) { Sources sources = ProjectUtils.getSources(project); sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC); - return Templates.createSimpleTargetChooser(project, sourceGroups); + return Templates + .buildSimpleTargetChooser(project, sourceGroups) + .create(); }else { return JavaTemplates.createPackageChooser(project, sourceGroups); } @@ -162,39 +165,50 @@ private WizardDescriptor.Panel createPackageChooserPanel(TemplateWizard wizard, if (sourceGroups.length == 0) { Sources sources = ProjectUtils.getSources(project); sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC); - return Templates.createSimpleTargetChooser(project, sourceGroups, customPanel); + return Templates + .buildSimpleTargetChooser(project, sourceGroups) + .bottomPanel(customPanel) + .create(); } else { return JavaTemplates.createPackageChooser(project, sourceGroups, customPanel); } } } - + + @Override public Set instantiate() throws IOException { // Create the target folder. The next piece is independent of // the type of file we create, and it should be moved to the // evaluator class instead. The exact same process // should be used when checking if the directory is valid from - // the wizard itself. + // the wizard itself. // ------------------------- FROM HERE ------------------------- - + FileObject dir = Templates.getTargetFolder(wizard); DataFolder df = DataFolder.findFolder(dir); + FileObject template = Templates.getTemplate(wizard); if (FileType.FILTER.equals(fileType) && ((WrapperSelection)customPanel).isWrapper()) { template = Templates.getTemplate(wizard); FileObject templateParent = template.getParent(); template = templateParent.getFileObject("AdvancedFilter","java"); //NOI18N } - - HashMap templateParameters = new HashMap(); + + HashMap templateParameters = new HashMap<>(); + ClassPath cp = ClassPath.getClassPath(dir, ClassPath.COMPILE); + if (cp != null && cp.findResource("jakarta/servlet/http/HttpServlet.class") != null) { + templateParameters.put("jakartaPackages", true); + } else { + templateParameters.put("jakartaPackages", false); + } templateParameters.put("servletEditorFold", NbBundle.getMessage(ServletIterator.class, "MSG_ServletEditorFold")); //NOI18N templateParameters.put("java17style", isJava17orLater(df.getPrimaryFile())); //NOI18N // Fix for IZ171834 - Badly generated servlet template in JavaEE6 Web Application initServletEmptyData( ); - + if (!deployData.makeEntry() && Utilities.isJavaEE6Plus(wizard)) { if (fileType == FileType.SERVLET) { AnnotationGenerator.webServlet((ServletData)deployData, templateParameters); @@ -204,7 +218,7 @@ public Set instantiate() throws IOException { } } - DataObject dTemplate = DataObject.find(template); + DataObject dTemplate = DataObject.find(template); DataObject dobj = dTemplate.createFromTemplate(df, Templates.getTargetName(wizard), templateParameters); //#150274 @@ -250,16 +264,16 @@ public Set instantiate() throws IOException { if (packageName!=null) packageName = packageName.replace('/','.'); else packageName=""; - // compute (and set) the servlet-class + // compute (and set) the servlet-class deployData.setClassName(packageName.length()==0?targetName:packageName+"."+targetName); - // compute (and set) the servlet-name and url-pattern + // compute (and set) the servlet-name and url-pattern String servletName = ((ServletData)deployData).createDDServletName(targetName); ((ServletData)deployData).createDDServletMapping(servletName); - } + } deployData.createDDEntries(); - + if (fileType == FileType.SERVLET && dobj.getPrimaryFile()!=null) { - dobj.getPrimaryFile().setAttribute("org.netbeans.modules.web.IsServletFile", + dobj.getPrimaryFile().setAttribute("org.netbeans.modules.web.IsServletFile", Boolean.TRUE); // NOI18N } @@ -284,40 +298,47 @@ private static Boolean isJava17orLater(FileObject target) { return Boolean.FALSE; } + @Override public void uninitialize(WizardDescriptor wizard) { this.wizard = null; panels = null; } // --- WizardDescriptor.Iterator METHODS: --- - + + @Override public String name() { return NbBundle.getMessage (ServletIterator.class, "TITLE_x_of_y", index + 1, panels.length); } - + // If the user has elected to place the file in a regular // directory (not a web module) then we don't show the DD info - // panel. + // panel. + @Override public boolean hasNext() { return index < panels.length - 1 && (deployData.hasDD() || Utilities.isJavaEE6Plus(wizard)); } - + + @Override public boolean hasPrevious() { return index > 0; } + @Override public void nextPanel() { if (!hasNext()) throw new NoSuchElementException(); index++; } + @Override public void previousPanel() { if (!hasPrevious()) throw new NoSuchElementException(); index--; } + @Override public WizardDescriptor.Panel current() { return panels[index]; } - + /* * Fix for IZ171834 - Badly generated servlet template in JavaEE6 Web Application */ @@ -332,7 +353,7 @@ private void initServletEmptyData( ) { if ( evaluator.getClassName() == null ){ /* * User skip second panel. So one need to generate - * default servlet name and url mapping. + * default servlet name and url mapping. */ // this call will set file and class name in evaluator. panels[1].readSettings( wizard ); @@ -340,15 +361,17 @@ private void initServletEmptyData( ) { data.createDDServletMapping( data.getName()); } } - + // PENDING - Ann suggests updating the available panels based on - // changes. Here is what should happen: + // changes. Here is what should happen: // 1. If target is directory, disable DD panels // 2. If target is web module but the user does not want to make a - // DD entry, disable second DD panel for Filters. + // DD entry, disable second DD panel for Filters. // If nothing unusual changes in the middle of the wizard, simply: + @Override public final void addChangeListener(ChangeListener l) {} + @Override public final void removeChangeListener(ChangeListener l) {} } diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/TagHandlerIterator.java b/enterprise/web.core/src/org/netbeans/modules/web/wizards/TagHandlerIterator.java index 1c497b13aacd..7694305521ea 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/TagHandlerIterator.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/TagHandlerIterator.java @@ -24,12 +24,13 @@ import java.util.Collections; import java.util.NoSuchElementException; import java.util.Set; -import java.text.MessageFormat; +import java.util.HashMap; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JComponent; import javax.swing.event.ChangeListener; import org.netbeans.api.j2ee.core.Profile; +import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.source.JavaSource; import org.netbeans.modules.web.core.Util; import org.openide.filesystems.FileObject; @@ -41,6 +42,7 @@ import org.openide.DialogDisplayer; import org.netbeans.spi.project.ui.templates.support.Templates; import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectUtils; import org.netbeans.api.project.Sources; import org.netbeans.api.project.SourceGroup; import org.netbeans.modules.j2ee.core.api.support.classpath.ContainerClassPathModifier; @@ -64,23 +66,26 @@ public class TagHandlerIterator implements TemplateWizard.AsynchronousInstantiatingIterator { private static final Logger LOG = Logger.getLogger(TagHandlerIterator.class.getName()); private WizardDescriptor.Panel packageChooserPanel,tagHandlerSelectionPanel,tagInfoPanel; - + // You should define what panels you want to use here: protected WizardDescriptor.Panel[] createPanels (Project project,TemplateWizard wiz) { - Sources sources = (Sources) project.getLookup().lookup(org.netbeans.api.project.Sources.class); + Sources sources = (Sources) ProjectUtils.getSources(project); SourceGroup[] sourceGroups = Util.getJavaSourceGroups(project); tagHandlerSelectionPanel = new TagHandlerSelection(wiz); - + if (sourceGroups.length == 0) - packageChooserPanel = Templates.createSimpleTargetChooser(project, sourceGroups, tagHandlerSelectionPanel); + packageChooserPanel = Templates + .buildSimpleTargetChooser(project, sourceGroups) + .bottomPanel(tagHandlerSelectionPanel) + .create(); else packageChooserPanel = JavaTemplates.createPackageChooser(project,sourceGroups,tagHandlerSelectionPanel); - + sourceGroups = sources.getSourceGroups(WebProjectConstants.TYPE_DOC_ROOT); if (sourceGroups==null || sourceGroups.length==0) sourceGroups = Util.getJavaSourceGroups(project); if (sourceGroups==null || sourceGroups.length==0) - sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC); + sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC); tagInfoPanel = new TagInfoPanel(wiz, project, sourceGroups); return new WizardDescriptor.Panel[] { packageChooserPanel, @@ -88,6 +93,7 @@ protected WizardDescriptor.Panel[] createPanels (Project proje }; } + @Override public Set instantiate () throws IOException/*, IllegalStateException*/ { // Here is the default plain behavior. Simply takes the selected // template (you need to have included the standard second panel @@ -97,23 +103,31 @@ public Set instantiate () throws IOException/*, IllegalStateException*/ { // More advanced wizards can create multiple objects from template // (return them all in the result of this method), populate file // contents on the fly, etc. - + org.openide.filesystems.FileObject dir = Templates.getTargetFolder( wiz ); DataFolder df = DataFolder.findFolder( dir ); - + + HashMap templateParameters = new HashMap<>(); + ClassPath cp = ClassPath.getClassPath(dir, ClassPath.COMPILE); + if(cp != null && cp.findResource("jakarta/servlet/http/HttpServlet.class") != null) { + templateParameters.put("jakartaPackages", true); + } else { + templateParameters.put("jakartaPackages", false); + } + FileObject template = Templates.getTemplate( wiz ); - + if (((TagHandlerSelection)tagHandlerSelectionPanel).isBodyTagSupport()) { FileObject templateParent = template.getParent(); template = templateParent.getFileObject("BodyTagHandler","java"); //NOI18N } - DataObject dTemplate = DataObject.find( template ); - DataObject dobj = dTemplate.createFromTemplate( df, Templates.getTargetName( wiz ) ); + DataObject dTemplate = DataObject.find( template ); + DataObject dobj = dTemplate.createFromTemplate(df, Templates.getTargetName(wiz), templateParameters); // writing to TLD File TagInfoPanel tldPanel = (TagInfoPanel)tagInfoPanel; Object[][] attrs = tldPanel.getAttributes(); boolean isBodyTag = ((TagHandlerSelection)tagHandlerSelectionPanel).isBodyTagSupport(); - + // writing setters to tag handler if (attrs.length>0 || isBodyTag) { JavaSource clazz = JavaSource.forFileObject(dobj.getPrimaryFile()); @@ -136,15 +150,13 @@ public Set instantiate () throws IOException/*, IllegalStateException*/ { } - + // writing to TLD file if (tldPanel.writeToTLD()) { FileObject tldFo = tldPanel.getTLDFile(); if (tldFo!=null) { if (!tldFo.canWrite()) { - String mes = MessageFormat.format ( - NbBundle.getMessage (TagHandlerIterator.class, "MSG_tldRO"), - new Object [] {tldFo.getNameExt()}); + String mes = NbBundle.getMessage (TagHandlerIterator.class, "MSG_tldRO",tldFo.getNameExt()); NotifyDescriptor desc = new NotifyDescriptor.Message(mes,NotifyDescriptor.Message.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(desc); } else { @@ -153,9 +165,7 @@ public Set instantiate () throws IOException/*, IllegalStateException*/ { try { taglib = tldDO.getTaglib(); } catch (IOException ex) { - String mes = MessageFormat.format ( - NbBundle.getMessage (TagHandlerIterator.class, "MSG_tldCorrupted"), - new Object [] {tldFo.getNameExt()}); + String mes = NbBundle.getMessage (TagHandlerIterator.class, "MSG_tldCorrupted",tldFo.getNameExt()); NotifyDescriptor desc = new NotifyDescriptor.Message(mes,NotifyDescriptor.Message.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(desc); } @@ -204,28 +214,29 @@ public Set instantiate () throws IOException/*, IllegalStateException*/ { } } } - + return Collections.singleton(dobj); } // --- The rest probably does not need to be touched. --- - + private transient int index; private transient WizardDescriptor.Panel[] panels; private transient TemplateWizard wiz; private static final long serialVersionUID = -7586964579556513549L; - + // You can keep a reference to the TemplateWizard which can // provide various kinds of useful information such as // the currently selected target name. // Also the panels will receive wiz as their "settings" object. + @Override public void initialize (WizardDescriptor wiz) { this.wiz = (TemplateWizard) wiz; index = 0; Project project = Templates.getProject( wiz ); panels = createPanels (project,this.wiz); - + // Creating steps. Object prop = wiz.getProperty (WizardDescriptor.PROP_CONTENT_DATA); // NOI18N String[] beforeSteps = null; @@ -233,7 +244,7 @@ public void initialize (WizardDescriptor wiz) { beforeSteps = (String[])prop; } String[] steps = Utilities.createSteps (beforeSteps, panels); - + for (int i = 0; i < panels.length; i++) { Component c = panels[i].getComponent (); if (steps[i] == null) { @@ -251,6 +262,7 @@ public void initialize (WizardDescriptor wiz) { } } } + @Override public void uninitialize (WizardDescriptor wiz) { this.wiz = null; panels = null; @@ -261,31 +273,39 @@ public void uninitialize (WizardDescriptor wiz) { // few more options for customization. If you e.g. want to make panels appear // or disappear dynamically, go ahead. + @Override public String name () { return NbBundle.getMessage(TagHandlerIterator.class, "TITLE_x_of_y", index + 1, panels.length); } - + + @Override public boolean hasNext () { return index < panels.length - 1; } + @Override public boolean hasPrevious () { return index > 0; } + @Override public void nextPanel () { if (! hasNext ()) throw new NoSuchElementException (); index++; } + @Override public void previousPanel () { if (! hasPrevious ()) throw new NoSuchElementException (); index--; } + @Override public WizardDescriptor.Panel current () { return panels[index]; } - + // If nothing unusual changes in the middle of the wizard, simply: + @Override public final void addChangeListener (ChangeListener l) {} + @Override public final void removeChangeListener (ChangeListener l) {} // If something changes dynamically (besides moving between panels), // e.g. the number of panels changes in response to user input, then diff --git a/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java b/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java index 9859732f425e..e9347cd90e2f 100644 --- a/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java +++ b/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java @@ -539,7 +539,7 @@ private static FileSystem mksystem(NbTestCase t) throws Exception { // get layer for the AS/GlassFish // addLayer(layers, "org/netbeans/modules/j2ee/sun/ide/j2ee/layer.xml"); // addLayer(layers, "org/netbeans/modules/tomcat5/resources/layer.xml"); - MultiFileSystem mfs = new MultiFileSystem((FileSystem[]) layers.toArray(new FileSystem[layers.size()])); + MultiFileSystem mfs = new MultiFileSystem((FileSystem[]) layers.toArray(new FileSystem[0])); return mfs; } diff --git a/enterprise/web.debug/manifest.mf b/enterprise/web.debug/manifest.mf index 86040fd48407..c27acaf9ce9e 100644 --- a/enterprise/web.debug/manifest.mf +++ b/enterprise/web.debug/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.debug/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/debug/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/web/debug/resources/layer.xml -OpenIDE-Module-Specification-Version: 2.59 +OpenIDE-Module-Specification-Version: 2.61 OpenIDE-Module-Requires: org.netbeans.spi.debugger.jpda.EditorContext, org.netbeans.modules.debugger.jpda.ui AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.el/manifest.mf b/enterprise/web.el/manifest.mf index b914e14d3a73..af05e58aed52 100644 --- a/enterprise/web.el/manifest.mf +++ b/enterprise/web.el/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.web.el OpenIDE-Module-Layer: org/netbeans/modules/web/el/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/el/Bundle.properties -OpenIDE-Module-Specification-Version: 1.75 +OpenIDE-Module-Specification-Version: 1.77 diff --git a/enterprise/web.el/nbproject/org-netbeans-modules-web-el.sig b/enterprise/web.el/nbproject/org-netbeans-modules-web-el.sig index e04eb73a0c38..f4acff1483cd 100644 --- a/enterprise/web.el/nbproject/org-netbeans-modules-web-el.sig +++ b/enterprise/web.el/nbproject/org-netbeans-modules-web-el.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.74 +#Version 1.75 CLSS public abstract interface java.io.Serializable diff --git a/enterprise/web.el/src/org/netbeans/modules/web/el/ELIndex.java b/enterprise/web.el/src/org/netbeans/modules/web/el/ELIndex.java index eb66ae8f6ef5..3844c775e643 100644 --- a/enterprise/web.el/src/org/netbeans/modules/web/el/ELIndex.java +++ b/enterprise/web.el/src/org/netbeans/modules/web/el/ELIndex.java @@ -56,7 +56,7 @@ public static ELIndex get(FileObject file) { try { QuerySupport support = QuerySupport.forRoots(ELIndexer.Factory.NAME, ELIndexer.Factory.VERSION, - sourceRoots.toArray(new FileObject[sourceRoots.size()])); + sourceRoots.toArray(new FileObject[0])); return new ELIndex(support); diff --git a/enterprise/web.el/test/unit/src/org/netbeans/modules/web/el/ELTestBase.java b/enterprise/web.el/test/unit/src/org/netbeans/modules/web/el/ELTestBase.java index 96e931a7e116..e7f9c99d105d 100644 --- a/enterprise/web.el/test/unit/src/org/netbeans/modules/web/el/ELTestBase.java +++ b/enterprise/web.el/test/unit/src/org/netbeans/modules/web/el/ELTestBase.java @@ -328,7 +328,7 @@ private String describeCompletion(String caretLine, String text, int caretOffset sb.append("\n"); // Sort to make test more stable - Collections.sort(proposals, new Comparator() { + proposals.sort(new Comparator() { public int compare(CompletionProposal p1, CompletionProposal p2) { // Smart items first @@ -558,7 +558,7 @@ public static ClassPath createBootClassPath() throws IOException { // System.out.println(url); } // System.out.println("-----------"); - return ClassPathSupport.createClassPath(roots.toArray(new URL[roots.size()])); + return ClassPathSupport.createClassPath(roots.toArray(new URL[0])); } public final ClassPath createServletAPIClassPath() throws MalformedURLException, IOException { @@ -574,7 +574,7 @@ public final ClassPath createServletAPIClassPath() throws MalformedURLException, FileObject fo = FileUtil.toFileObject(f); fos.add(FileUtil.getArchiveRoot(fo)); } - return ClassPathSupport.createClassPath(fos.toArray(new FileObject[fos.size()])); + return ClassPathSupport.createClassPath(fos.toArray(new FileObject[0])); } protected static class FakeWebModuleProvider implements WebModuleProvider { diff --git a/enterprise/web.freeform/manifest.mf b/enterprise/web.freeform/manifest.mf index 6f0076fd143d..5517ddf50fc7 100644 --- a/enterprise/web.freeform/manifest.mf +++ b/enterprise/web.freeform/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.freeform -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.57 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/freeform/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/web/freeform/resources/layer.xml AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.freeform/src/org/netbeans/modules/web/freeform/LookupProviderImpl.java b/enterprise/web.freeform/src/org/netbeans/modules/web/freeform/LookupProviderImpl.java index 2fad249cc948..6b84a07afe8b 100644 --- a/enterprise/web.freeform/src/org/netbeans/modules/web/freeform/LookupProviderImpl.java +++ b/enterprise/web.freeform/src/org/netbeans/modules/web/freeform/LookupProviderImpl.java @@ -213,7 +213,7 @@ public WebClasspath(AntProjectHelper helper, PropertyEvaluator evaluator, Auxili public void prjOpened() { registeredRoots = getWebRoots(aux, project, evaluator); - FileObject fos[] = registeredRoots.toArray(new FileObject[registeredRoots.size()]); + FileObject fos[] = registeredRoots.toArray(new FileObject[0]); ClassPath cp = ClassPathSupport.createClassPath(fos); registeredCP = new ClassPath[] { cp }; GlobalPathRegistry.getDefault().register(ClassPath.SOURCE, registeredCP); @@ -253,7 +253,7 @@ private synchronized void updateClasspath() { List newRoots = getWebRoots(aux, project, evaluator); if (newRoots != null && !newRoots.equals(registeredRoots)) { - FileObject fos[] = newRoots.toArray(new FileObject[newRoots.size()]); + FileObject fos[] = newRoots.toArray(new FileObject[0]); ClassPath cp = ClassPathSupport.createClassPath(fos); GlobalPathRegistry.getDefault().unregister(ClassPath.SOURCE, registeredCP); registeredCP = new ClassPath[] { cp }; diff --git a/enterprise/web.freeform/src/org/netbeans/modules/web/freeform/ui/NewWebFreeformProjectWizardIterator.java b/enterprise/web.freeform/src/org/netbeans/modules/web/freeform/ui/NewWebFreeformProjectWizardIterator.java index 90b1b50f800f..373f8e990e3b 100644 --- a/enterprise/web.freeform/src/org/netbeans/modules/web/freeform/ui/NewWebFreeformProjectWizardIterator.java +++ b/enterprise/web.freeform/src/org/netbeans/modules/web/freeform/ui/NewWebFreeformProjectWizardIterator.java @@ -82,7 +82,7 @@ private WizardDescriptor.Panel[] createPanels () { l.add(new WebLocationsWizardPanel()); l.addAll(Arrays.asList(NewJavaFreeformProjectSupport.createJavaPanels())); l.add(new WebClasspathWizardPanel()); - return l.toArray(new WizardDescriptor.Panel[l.size()]); + return l.toArray(new WizardDescriptor.Panel[0]); } public Set instantiate () throws IOException { @@ -157,7 +157,7 @@ public void initialize(WizardDescriptor wiz) { JComponent jc = (JComponent)c; l.add(jc.getName()); } - String[] steps = l.toArray(new String[l.size()]); + String[] steps = l.toArray(new String[0]); for (int i = 0; i < panels.length; i++) { Component c = panels[i].getComponent(); assert c instanceof JComponent; diff --git a/enterprise/web.jsf.editor/manifest.mf b/enterprise/web.jsf.editor/manifest.mf index dc89fcd4a1d3..7dc4209e7357 100644 --- a/enterprise/web.jsf.editor/manifest.mf +++ b/enterprise/web.jsf.editor/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.jsf.editor OpenIDE-Module-Layer: org/netbeans/modules/web/jsf/editor/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jsf/editor/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 2.2 +OpenIDE-Module-Specification-Version: 2.4 AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/actions/NamespaceProcessor.java b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/actions/NamespaceProcessor.java index 297e35dcdb42..d72604e1e8e7 100644 --- a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/actions/NamespaceProcessor.java +++ b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/actions/NamespaceProcessor.java @@ -48,7 +48,6 @@ import org.netbeans.modules.web.jsf.editor.facelets.JsfNamespaceComparator; import org.netbeans.modules.web.jsf.editor.hints.LibraryDeclarationChecker; import org.netbeans.modules.web.jsfapi.api.JsfSupport; -import org.netbeans.modules.web.jsfapi.api.JsfVersion; import org.netbeans.modules.web.jsfapi.api.Library; import org.netbeans.modules.web.jsfapi.api.NamespaceUtils; @@ -126,7 +125,7 @@ private List getSortedVariants(String prefix) { // Add all other variants List sortedList = new ArrayList<>(supportedLibraries.keySet()); - Collections.sort(sortedList, JsfNamespaceComparator.getInstance()); + sortedList.sort(JsfNamespaceComparator.getInstance()); sortedList.stream() .filter(not(namespacesForPrefix::contains)) diff --git a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/completion/JsfAttributesCompletionHelper.java b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/completion/JsfAttributesCompletionHelper.java index 1c3624824804..f394c7c43567 100644 --- a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/completion/JsfAttributesCompletionHelper.java +++ b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/completion/JsfAttributesCompletionHelper.java @@ -34,7 +34,6 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; -import static java.util.function.Predicate.not; import javax.lang.model.element.NestingKind; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; @@ -491,7 +490,7 @@ public static void completeXMLNSAttribute(CompletionContext context, List otherNamespaces = new ArrayList<>(jsfs.getLibraries().keySet()); - Collections.sort(otherNamespaces, JsfNamespaceComparator.getInstance()); + otherNamespaces.sort(JsfNamespaceComparator.getInstance()); int otherNamespaceSortPriority = 20; for (String namespace : otherNamespaces) { diff --git a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/el/FaceletsELPlugin.java b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/el/FaceletsELPlugin.java index 8ef565dd121d..083a08b1ae9b 100644 --- a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/el/FaceletsELPlugin.java +++ b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/el/FaceletsELPlugin.java @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.project.FileOwnerQuery; import org.netbeans.api.project.Project; import org.netbeans.modules.html.editor.api.gsf.HtmlParserResult; @@ -38,7 +39,9 @@ import org.netbeans.modules.web.el.spi.Function; import org.netbeans.modules.web.el.spi.ImplicitObject; import org.netbeans.modules.web.el.spi.ImplicitObjectType; + import static org.netbeans.modules.web.el.spi.ImplicitObjectType.*; + import org.netbeans.modules.web.el.spi.ResolverContext; import org.netbeans.modules.web.el.spi.ResourceBundle; import org.netbeans.modules.web.jsf.api.editor.JSFResourceBundlesProvider; @@ -58,7 +61,8 @@ public class FaceletsELPlugin extends ELPlugin { private static final String PLUGIN_NAME = "JSF Facelets EL Plugin"; //NOI18N - private Collection IMPL_OBJECTS; + private Collection implObjects; + private Collection implObjectsJakarta; @Override public String getName() { @@ -71,35 +75,66 @@ public Collection getMimeTypes() { } @Override + @SuppressWarnings("ReturnOfCollectionOrArrayField") public synchronized Collection getImplicitObjects(FileObject file) { if(!getMimeTypes().contains(file.getMIMEType())) { return Collections.emptyList(); } - if(IMPL_OBJECTS == null) { - IMPL_OBJECTS = new ArrayList<>(9); - - IMPL_OBJECTS.addAll(getScopeObjects()); - - IMPL_OBJECTS.add( new FacesContextObject()); - IMPL_OBJECTS.add( new ApplicationObject()); - IMPL_OBJECTS.add( new ComponentObject()); - IMPL_OBJECTS.add( new FlashObject()); - IMPL_OBJECTS.add( new ResourceObject()); - IMPL_OBJECTS.add( new SessionObject()); - IMPL_OBJECTS.add( new ViewObject() ); - IMPL_OBJECTS.add( new JsfImplicitObject("cookie", "java.util.Map", MAP_TYPE) ); //NOI18N - IMPL_OBJECTS.add( new JsfImplicitObject("cc", "javax.faces.component.UIComponent", RAW) ); //NOI18N - IMPL_OBJECTS.add( new JsfImplicitObject("request", "javax.servlet.http.HttpServletRequest", OBJECT_TYPE) ); //NOI18N - IMPL_OBJECTS.add( new JsfImplicitObject("header", "java.util.Map", MAP_TYPE) ); //NOI18N - IMPL_OBJECTS.add( new JsfImplicitObject("headerValues", "java.util.Map", MAP_TYPE) ); //NOI18N - IMPL_OBJECTS.add( new JsfImplicitObject("initParam", "java.util.Map", MAP_TYPE) ); //NOI18N - IMPL_OBJECTS.add( new JsfImplicitObject("param", "java.util.Map", MAP_TYPE) ); //NOI18N - IMPL_OBJECTS.add( new JsfImplicitObject("paramValues", "java.util.Map", MAP_TYPE) ); //NOI18N + if(implObjects == null) { + List implObjectsBuilder = new ArrayList<>(9); + + implObjectsBuilder.addAll(getScopeObjects()); + + implObjectsBuilder.add(new JsfImplicitObject("facesContext", "javax.faces.context.FacesContext", OBJECT_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("application", "javax.servlet.ServletContext", OBJECT_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("component", "javax.faces.component.UIComponent", OBJECT_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("flash", "javax.faces.context.Flash", OBJECT_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("resource", "javax.faces.application.ResourceHandler", OBJECT_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("session", "javax.servlet.http.HttpSession", OBJECT_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("view", "javax.faces.component.UIViewRoot", OBJECT_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("cookie", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("cc", "javax.faces.component.UIComponent", RAW)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("request", "javax.servlet.http.HttpServletRequest", OBJECT_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("header", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("headerValues", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("initParam", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("param", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsBuilder.add(new JsfImplicitObject("paramValues", "java.util.Map", MAP_TYPE)); //NOI18N + + implObjects = Collections.unmodifiableCollection(implObjectsBuilder); + + + List implObjectsJakartaBuilder = new ArrayList<>(9); + + implObjectsJakartaBuilder.addAll(getScopeObjects()); + + implObjectsJakartaBuilder.add(new JsfImplicitObject("facesContext", "jakarta.faces.context.FacesContext", OBJECT_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("application", "jakarta.servlet.ServletContext", OBJECT_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("component", "jakarta.faces.component.UIComponent", OBJECT_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("flash", "jakarta.faces.context.Flash", OBJECT_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("resource", "jakarta.faces.application.ResourceHandler", OBJECT_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("session", "jakarta.servlet.http.HttpSession", OBJECT_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("view", "jakarta.faces.component.UIViewRoot", OBJECT_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("cookie", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("cc", "jakarta.faces.component.UIComponent", RAW)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("request", "jakarta.servlet.http.HttpServletRequest", OBJECT_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("header", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("headerValues", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("initParam", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("param", "java.util.Map", MAP_TYPE)); //NOI18N + implObjectsJakartaBuilder.add(new JsfImplicitObject("paramValues", "java.util.Map", MAP_TYPE)); //NOI18N + + implObjectsJakarta = Collections.unmodifiableCollection(implObjectsJakartaBuilder); } - - return IMPL_OBJECTS; + ClassPath cp = ClassPath.getClassPath(file, ClassPath.COMPILE); + boolean jakartaVariant = cp != null && cp.findResource("jakarta/servlet/http/HttpServlet.class") != null; + if(jakartaVariant) { + return implObjectsJakarta; + } else { + return implObjects; + } } @Override @@ -194,53 +229,11 @@ private static String getSimpleNameForType(String fqn) { return fqn.substring(fqn.lastIndexOf(".") + 1); //NOI18N } - static class FacesContextObject extends JsfImplicitObject { - public FacesContextObject(){ - super("facesContext", "javax.faces.context.FacesContext", OBJECT_TYPE); //NOI18N - } - } - - static class ApplicationObject extends JsfImplicitObject { - public ApplicationObject(){ - super("application", "javax.servlet.ServletContext", OBJECT_TYPE); //NOI18N - } - } - - static class ComponentObject extends JsfImplicitObject { - public ComponentObject(){ - super("component", "javax.faces.component.UIComponent", OBJECT_TYPE); //NOI18N - } - } - - static class FlashObject extends JsfImplicitObject { - public FlashObject(){ - super("flash", "javax.faces.context.Flash", OBJECT_TYPE); //NOI18N - } - } - - static class ResourceObject extends JsfImplicitObject { - public ResourceObject(){ - super("resource", "javax.faces.application.ResourceHandler", OBJECT_TYPE); //NOI18N - } - } - - static class SessionObject extends JsfImplicitObject { - public SessionObject(){ - super("session", "javax.servlet.http.HttpSession", OBJECT_TYPE); //NOI18N - } - } - - static class ViewObject extends JsfImplicitObject { - public ViewObject(){ - super("view", "javax.faces.component.UIViewRoot", OBJECT_TYPE); //NOI18N - } - } - - private static class JsfImplicitObject implements ImplicitObject { - private String name, clazz; - private ImplicitObjectType type; + private final String name; + private final String clazz; + private final ImplicitObjectType type; public JsfImplicitObject(String name, String clazz, ImplicitObjectType type) { this.name = name; diff --git a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java index 3edc81ca88fd..f8b0b7c9561b 100644 --- a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java +++ b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java @@ -581,7 +581,7 @@ private DocumentInfo[] sortDocuments(DocumentInfo[] facesDocuments, list.add(new DocumentOrderingWrapper(facesDocuments[i])); } DocumentOrderingWrapper[] ordering = - list.toArray(new DocumentOrderingWrapper[list.size()]); + list.toArray(new DocumentOrderingWrapper[0]); if (absoluteOrdering == null) { DocumentOrderingWrapper.sort(ordering); // sorting complete, now update the appropriate locations within @@ -796,7 +796,7 @@ public static DocumentInfo[] getConfigDocuments(URLClassLoader jsfRIClassLoader, } catch (InterruptedException ignored) { } } - return docs.toArray(new DocumentInfo[docs.size()]); + return docs.toArray(new DocumentInfo[0]); } @@ -973,6 +973,7 @@ private static class ParseTask implements Callable { private static final Map VERSION_FACES_SCHEMA_FACES_MAPPING; static { Map map = new HashMap<>(); + map.put("4.1", "com/sun/faces/web-facesconfig_4_1.xsd"); map.put("4.0", "com/sun/faces/web-facesconfig_4_0.xsd"); map.put("3.0", "com/sun/faces/web-facesconfig_3_0.xsd"); map.put("2.3", "com/sun/faces/web-facesconfig_2_3.xsd"); @@ -986,6 +987,7 @@ private static class ParseTask implements Callable { private static final Map VERSION_FACES_SCHEMA_FACELET_TAGLIB_MAPPING; static { Map map = new HashMap<>(); + map.put("4.1", "com/sun/faces/web-facelettaglibrary_4_1.xsd"); map.put("4.0", "com/sun/faces/web-facelettaglibrary_4_0.xsd"); map.put("3.0", "com/sun/faces/web-facelettaglibrary_3_0.xsd"); map.put("2.3", "com/sun/faces/web-facelettaglibrary_2_3.xsd"); diff --git a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/index/CompositeComponentModel.java b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/index/CompositeComponentModel.java index 8844e032114e..a8ac679c18df 100644 --- a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/index/CompositeComponentModel.java +++ b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/index/CompositeComponentModel.java @@ -64,6 +64,7 @@ public class CompositeComponentModel extends JsfPageModel { static final String HAS_IMPLEMENTATION_KEY = "has_implementation"; //NOI18N //other private static final String WEBAPP_RESOURCES_DIRECTORY = "javax.faces.WEBAPP_RESOURCES_DIRECTORY"; + private static final String WEBAPP_RESOURCES_DIRECTORY_JAKARTA = "jakarta.faces.WEBAPP_RESOURCES_DIRECTORY"; private static final String RESOURCES_FOLDER_NAME = "resources"; //NOI18N private static final char VALUES_SEPARATOR = ','; //NOI18N private static final char ATTRIBUTES_SEPARATOR = ';'; //NOI18N @@ -231,7 +232,8 @@ private static FileObject getResourcesDirectory(FileObject file) { if (ddRoot != null) { InitParam[] parameters = ddRoot.getContextParam(); for (InitParam param: parameters) { - if (param.getParamName().contains(WEBAPP_RESOURCES_DIRECTORY)) { + if (param.getParamName().contains(WEBAPP_RESOURCES_DIRECTORY) + || param.getParamName().contains(WEBAPP_RESOURCES_DIRECTORY_JAKARTA)) { relPath = param.getParamValue().trim(); } } diff --git a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBase.java b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBase.java index 609dab42c37d..b3c719f35265 100644 --- a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBase.java +++ b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/TestBase.java @@ -256,7 +256,7 @@ public static ClassPath createBootClassPath() throws IOException { // System.out.println(url); } // System.out.println("-----------"); - return ClassPathSupport.createClassPath(roots.toArray(new URL[roots.size()])); + return ClassPathSupport.createClassPath(roots.toArray(new URL[0])); } public final ClassPath createServletAPIClassPath() throws MalformedURLException, IOException { @@ -272,7 +272,7 @@ public final ClassPath createServletAPIClassPath() throws MalformedURLException, FileObject fo = FileUtil.toFileObject(f); fos.add(FileUtil.getArchiveRoot(fo)); } - return ClassPathSupport.createClassPath(fos.toArray(new FileObject[fos.size()])); + return ClassPathSupport.createClassPath(fos.toArray(new FileObject[0])); } protected static class FakeWebModuleProvider implements WebModuleProvider { diff --git a/enterprise/web.jsf.icefaces/manifest.mf b/enterprise/web.jsf.icefaces/manifest.mf index 982e45b14be2..464c60883636 100644 --- a/enterprise/web.jsf.icefaces/manifest.mf +++ b/enterprise/web.jsf.icefaces/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.jsf.icefaces OpenIDE-Module-Layer: org/netbeans/modules/web/jsf/icefaces/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jsf/icefaces/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.39 +OpenIDE-Module-Specification-Version: 1.41 AutoUpdate-Show-In-Client: true OpenIDE-Module-Provides: org.netbeans.modules.web.jsf.complib diff --git a/enterprise/web.jsf.icefaces/src/org/netbeans/modules/web/jsf/icefaces/Icefaces2Implementation.java b/enterprise/web.jsf.icefaces/src/org/netbeans/modules/web/jsf/icefaces/Icefaces2Implementation.java index 605a820cd4b0..4706695ba88a 100644 --- a/enterprise/web.jsf.icefaces/src/org/netbeans/modules/web/jsf/icefaces/Icefaces2Implementation.java +++ b/enterprise/web.jsf.icefaces/src/org/netbeans/modules/web/jsf/icefaces/Icefaces2Implementation.java @@ -243,8 +243,7 @@ public void remove(WebModule webModule) { } else { icefacesLibraries = Icefaces2Customizer.getIcefacesLibraries(); } - ProjectClassPathModifier.removeLibraries(icefacesLibraries.toArray( - new Library[icefacesLibraries.size()]), webModule.getJavaSources()[0], ClassPath.COMPILE); + ProjectClassPathModifier.removeLibraries(icefacesLibraries.toArray(new Library[0]), webModule.getJavaSources()[0], ClassPath.COMPILE); } catch (IOException ex) { LOGGER.log(Level.WARNING, "Exception during removing JSF suite from an web project", ex); //NOI18N } catch (UnsupportedOperationException ex) { diff --git a/enterprise/web.jsf.kit/manifest.mf b/enterprise/web.jsf.kit/manifest.mf index 017ba4b04570..14dbe015e69f 100644 --- a/enterprise/web.jsf.kit/manifest.mf +++ b/enterprise/web.jsf.kit/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.jsf.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jsf/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.52 OpenIDE-Module-Provides: org.netbeans.modules.web.project.framework diff --git a/enterprise/web.jsf.kit/nbproject/project.xml b/enterprise/web.jsf.kit/nbproject/project.xml index 83b6f2d9cd77..082de89722d4 100644 --- a/enterprise/web.jsf.kit/nbproject/project.xml +++ b/enterprise/web.jsf.kit/nbproject/project.xml @@ -51,20 +51,6 @@ 2.0 - - org.netbeans.modules.web.jsf12 - - 1 - 1.0 - - - - org.netbeans.modules.web.jsf12ri - - 1 - 1.4 - - org.netbeans.modules.web.jsf20 diff --git a/enterprise/web.jsf.navigation/manifest.mf b/enterprise/web.jsf.navigation/manifest.mf index ab41861ef750..d37494be729e 100644 --- a/enterprise/web.jsf.navigation/manifest.mf +++ b/enterprise/web.jsf.navigation/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.jsf.navigation/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jsf/navigation/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/web/jsf/navigation/mf-layer.xml -OpenIDE-Module-Specification-Version: 2.49 +OpenIDE-Module-Specification-Version: 2.51 AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.jsf.navigation/nbproject/org-netbeans-modules-web-jsf-navigation.sig b/enterprise/web.jsf.navigation/nbproject/org-netbeans-modules-web-jsf-navigation.sig index f018dc6045c2..3e8186eac85a 100644 --- a/enterprise/web.jsf.navigation/nbproject/org-netbeans-modules-web-jsf-navigation.sig +++ b/enterprise/web.jsf.navigation/nbproject/org-netbeans-modules-web-jsf-navigation.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.48 +#Version 2.49 CLSS public java.lang.Object cons public init() diff --git a/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/PFObjectSceneListener.java b/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/PFObjectSceneListener.java index ab506938bbbf..9ae324f39856 100644 --- a/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/PFObjectSceneListener.java +++ b/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/PFObjectSceneListener.java @@ -69,7 +69,7 @@ public void selectionChanged(ObjectSceneEvent event, Set prevSelection, if (selected.isEmpty()) { scene.getPageFlowView().setDefaultActivatedNode(); } else { - scene.getPageFlowView().setActivatedNodes(selected.toArray(new Node[selected.size()])); + scene.getPageFlowView().setActivatedNodes(selected.toArray(new Node[0])); } } diff --git a/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/layout/GridGraphLayoutUtility.java b/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/layout/GridGraphLayoutUtility.java index cca1d288f72b..1bc85ac2041c 100644 --- a/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/layout/GridGraphLayoutUtility.java +++ b/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/layout/GridGraphLayoutUtility.java @@ -22,7 +22,6 @@ import java.awt.Rectangle; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; @@ -79,7 +78,7 @@ public static void performLayout( GraphPinScene graph, boolean } Point index = new Point(); ArrayList connected = new ArrayList (node2connected.get(node)); - Collections.sort(connected, new Comparator() { + connected.sort(new Comparator() { public int compare(N node1, N node2) { return node2connected.get(node1).size() - node2connected.get(node2).size(); } diff --git a/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/layout/SceneElementComparator.java b/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/layout/SceneElementComparator.java index b911abebbde3..cf1f76b02787 100644 --- a/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/layout/SceneElementComparator.java +++ b/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/layout/SceneElementComparator.java @@ -143,7 +143,7 @@ public static PageFlowSceneElement getNextSelectableElement(PageFlowScene scene, PageFlowSceneElement nextElement = null; if (!sortedElements.isEmpty()) { - Collections.sort(sortedElements, new SceneElementComparator(scene)); + sortedElements.sort(new SceneElementComparator(scene)); if (reverse) { Collections.reverse(sortedElements); } diff --git a/enterprise/web.jsf.richfaces/manifest.mf b/enterprise/web.jsf.richfaces/manifest.mf index 5a7864039e17..53e13b85d442 100644 --- a/enterprise/web.jsf.richfaces/manifest.mf +++ b/enterprise/web.jsf.richfaces/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.jsf.richfaces OpenIDE-Module-Layer: org/netbeans/modules/web/jsf/richfaces/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jsf/richfaces/Bundle.properties -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.53 AutoUpdate-Show-In-Client: true OpenIDE-Module-Provides: org.netbeans.modules.web.jsf.complib diff --git a/enterprise/web.jsf.richfaces/src/org/netbeans/modules/web/jsf/richfaces/Richfaces4Implementation.java b/enterprise/web.jsf.richfaces/src/org/netbeans/modules/web/jsf/richfaces/Richfaces4Implementation.java index ecf9bc95a745..71c6a767045c 100644 --- a/enterprise/web.jsf.richfaces/src/org/netbeans/modules/web/jsf/richfaces/Richfaces4Implementation.java +++ b/enterprise/web.jsf.richfaces/src/org/netbeans/modules/web/jsf/richfaces/Richfaces4Implementation.java @@ -104,8 +104,7 @@ public void remove(WebModule webModule) { } else { richfacesLibraries = Richfaces4Customizer.getRichfacesLibraries(); } - ProjectClassPathModifier.removeLibraries(richfacesLibraries.toArray( - new Library[richfacesLibraries.size()]), webModule.getJavaSources()[0], ClassPath.COMPILE); + ProjectClassPathModifier.removeLibraries(richfacesLibraries.toArray(new Library[0]), webModule.getJavaSources()[0], ClassPath.COMPILE); } catch (IOException ex) { LOGGER.log(Level.WARNING, "Exception during removing JSF suite from an web project", ex); //NOI18N } catch (UnsupportedOperationException ex) { diff --git a/enterprise/web.jsf/licenseinfo.xml b/enterprise/web.jsf/licenseinfo.xml index e04457198e5f..54a3274a6561 100644 --- a/enterprise/web.jsf/licenseinfo.xml +++ b/enterprise/web.jsf/licenseinfo.xml @@ -104,6 +104,8 @@ src/org/netbeans/modules/web/jsf/resources/web-facesconfig_3_0.xsd src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_4_0.xsd src/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_0.xsd + src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_4_1.xsd + src/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_1.xsd diff --git a/enterprise/web.jsf/nbproject/org-netbeans-modules-web-jsf.sig b/enterprise/web.jsf/nbproject/org-netbeans-modules-web-jsf.sig index a8e6e713a3c0..e5e4cc9ae5ee 100644 --- a/enterprise/web.jsf/nbproject/org-netbeans-modules-web-jsf.sig +++ b/enterprise/web.jsf/nbproject/org-netbeans-modules-web-jsf.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.2.0 +#Version 2.3.0 CLSS public abstract interface java.beans.PropertyChangeListener intf java.util.EventListener diff --git a/enterprise/web.jsf/nbproject/project.properties b/enterprise/web.jsf/nbproject/project.properties index ce4c9b3e8568..a25bc471a290 100644 --- a/enterprise/web.jsf/nbproject/project.properties +++ b/enterprise/web.jsf/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=2.3.0 +spec.version.base=2.5.0 test.config.default.excludes=\ **/JSFEditorUtilitiesTest.class,\ diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java index 83cb1278b97f..20e04c815aa4 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java @@ -47,6 +47,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String URL_JSF_2_3="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_3.xsd"; // NOI18N private static final String URL_JSF_3_0="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_3_0.xsd"; // NOI18N private static final String URL_JSF_4_0="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_0.xsd"; // NOI18N + private static final String URL_JSF_4_1="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_1.xsd"; // NOI18N public static final String JAVAEE_NS = "http://java.sun.com/xml/ns/javaee"; // NOI18N public static final String NEW_JAVAEE_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N @@ -58,6 +59,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String JSF_2_3_XSD="web-facesconfig_2_3.xsd"; // NOI18N private static final String JSF_3_0_XSD="web-facesconfig_3_0.xsd"; // NOI18N private static final String JSF_4_0_XSD="web-facesconfig_4_0.xsd"; // NOI18N + private static final String JSF_4_1_XSD="web-facesconfig_4_1.xsd"; // NOI18N private static final String JSF_1_2=JAVAEE_NS+"/"+JSF_1_2_XSD; // NOI18N private static final String JSF_2_0=JAVAEE_NS+"/"+JSF_2_0_XSD; // NOI18N private static final String JSF_2_1=JAVAEE_NS+"/"+JSF_2_1_XSD; // NOI18N @@ -65,6 +67,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String JSF_2_3=NEW_JAVAEE_NS+"/"+JSF_2_3_XSD; // NOI18N private static final String JSF_3_0=JAKARTAEE_NS+"/"+JSF_3_0_XSD; // NOI18N private static final String JSF_4_0=JAKARTAEE_NS+"/"+JSF_4_0_XSD; // NOI18N + private static final String JSF_4_1=JAKARTAEE_NS+"/"+JSF_4_1_XSD; // NOI18N public static final String JSF_ID_1_2="SCHEMA:"+JSF_1_2; // NOI18N public static final String JSF_ID_2_0="SCHEMA:"+JSF_2_0; // NOI18N public static final String JSF_ID_2_1="SCHEMA:"+JSF_2_1; // NOI18N @@ -72,6 +75,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa public static final String JSF_ID_2_3="SCHEMA:"+JSF_2_3; // NOI18N public static final String JSF_ID_3_0="SCHEMA:"+JSF_3_0; // NOI18N public static final String JSF_ID_4_0="SCHEMA:"+JSF_4_0; // NOI18N + public static final String JSF_ID_4_1="SCHEMA:"+JSF_4_1; // NOI18N // faces-config resources @@ -83,8 +87,10 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa public static final String RES_FACES_CONFIG_2_3 = "faces-config_2_3.xml"; public static final String RES_FACES_CONFIG_3_0 = "faces-config_3_0.xml"; public static final String RES_FACES_CONFIG_4_0 = "faces-config_4_0.xml"; + public static final String RES_FACES_CONFIG_4_1 = "faces-config_4_1.xml"; //facelets + private static final String FILE_FACELETS_TAGLIB_SCHEMA_41="web-facelettaglibrary_4_1.xsd"; //NOI18N private static final String FILE_FACELETS_TAGLIB_SCHEMA_40="web-facelettaglibrary_4_0.xsd"; //NOI18N private static final String FILE_FACELETS_TAGLIB_SCHEMA_30="web-facelettaglibrary_3_0.xsd"; //NOI18N private static final String FILE_FACELETS_TAGLIB_SCHEMA_23="web-facelettaglibrary_2_3.xsd"; //NOI18N @@ -92,6 +98,8 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String FILE_FACELETS_TAGLIB_SCHEMA_20="web-facelettaglibrary_2_0.xsd"; //NOI18N private static final String FILE_FACELETS_TAGLIB_DTD_10="facelet-taglib_1_0.dtd"; //NOI18N + private static final String URL_FACELETS_TAGLIB_SCHEMA_41 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_41; // NOI18N + private static final String ID_FACELETS_TAGLIB_SCHEMA_41 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_41; private static final String URL_FACELETS_TAGLIB_SCHEMA_40 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_40; // NOI18N private static final String ID_FACELETS_TAGLIB_SCHEMA_40 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_40; private static final String URL_FACELETS_TAGLIB_SCHEMA_30 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_30; // NOI18N @@ -104,6 +112,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String ID_FACELETS_TAGLIB_SCHEMA_20 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_20; private static final String ID_FACELETS_TAGLIB_DTD_10 = "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"; //NOI18N + private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_41; // NOI18N private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_40; // NOI18N private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_30; // NOI18N private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_23; // NOI18N @@ -112,7 +121,6 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String RESOURCE_URL_FACELETS_TAGLIB_DTD_10 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_DTD_10; // NOI18N - /** Creates a new instance of StrutsCatalog */ public JSFCatalog() { } @@ -131,12 +139,14 @@ public java.util.Iterator getPublicIDs() { list.add(JSF_ID_2_3); list.add(JSF_ID_3_0); list.add(JSF_ID_4_0); + list.add(JSF_ID_4_1); list.add(ID_FACELETS_TAGLIB_DTD_10); list.add(ID_FACELETS_TAGLIB_SCHEMA_20); list.add(ID_FACELETS_TAGLIB_SCHEMA_22); list.add(ID_FACELETS_TAGLIB_SCHEMA_23); list.add(ID_FACELETS_TAGLIB_SCHEMA_30); list.add(ID_FACELETS_TAGLIB_SCHEMA_40); + list.add(ID_FACELETS_TAGLIB_SCHEMA_41); return list.listIterator(); } @@ -145,37 +155,47 @@ public java.util.Iterator getPublicIDs() { * @return null if not registered */ public String getSystemID(String publicId) { - if (JSF_ID_1_0.equals(publicId)) - return URL_JSF_1_0; - else if (JSF_ID_1_1.equals(publicId)) - return URL_JSF_1_1; - else if (JSF_ID_1_2.equals(publicId)) - return URL_JSF_1_2; - else if (JSF_ID_2_0.equals(publicId)) - return URL_JSF_2_0; - else if (JSF_ID_2_1.equals(publicId)) - return URL_JSF_2_1; - else if (JSF_ID_2_2.equals(publicId)) - return URL_JSF_2_2; - else if (JSF_ID_2_3.equals(publicId)) - return URL_JSF_2_3; - else if (JSF_ID_3_0.equals(publicId)) - return URL_JSF_3_0; - else if (JSF_ID_4_0.equals(publicId)) - return URL_JSF_4_0; - else if (ID_FACELETS_TAGLIB_DTD_10.equals(publicId)) - return RESOURCE_URL_FACELETS_TAGLIB_DTD_10; - else if(ID_FACELETS_TAGLIB_SCHEMA_20.equals(publicId)) - return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20; - else if(ID_FACELETS_TAGLIB_SCHEMA_22.equals(publicId)) - return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22; - else if(ID_FACELETS_TAGLIB_SCHEMA_23.equals(publicId)) - return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23; - else if(ID_FACELETS_TAGLIB_SCHEMA_30.equals(publicId)) - return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30; - else if(ID_FACELETS_TAGLIB_SCHEMA_40.equals(publicId)) - return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40; - else return null; + if (null == publicId) { + return null; + } + switch (publicId) { + case JSF_ID_1_0: + return URL_JSF_1_0; + case JSF_ID_1_1: + return URL_JSF_1_1; + case JSF_ID_1_2: + return URL_JSF_1_2; + case JSF_ID_2_0: + return URL_JSF_2_0; + case JSF_ID_2_1: + return URL_JSF_2_1; + case JSF_ID_2_2: + return URL_JSF_2_2; + case JSF_ID_2_3: + return URL_JSF_2_3; + case JSF_ID_3_0: + return URL_JSF_3_0; + case JSF_ID_4_0: + return URL_JSF_4_0; + case JSF_ID_4_1: + return URL_JSF_4_1; + case ID_FACELETS_TAGLIB_DTD_10: + return RESOURCE_URL_FACELETS_TAGLIB_DTD_10; + case ID_FACELETS_TAGLIB_SCHEMA_20: + return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20; + case ID_FACELETS_TAGLIB_SCHEMA_22: + return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22; + case ID_FACELETS_TAGLIB_SCHEMA_23: + return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23; + case ID_FACELETS_TAGLIB_SCHEMA_30: + return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30; + case ID_FACELETS_TAGLIB_SCHEMA_40: + return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40; + case ID_FACELETS_TAGLIB_SCHEMA_41: + return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41; + default: + return null; + } } /** @@ -230,7 +250,7 @@ public String getShortDescription() { } /** - * Resolves schema definition file for taglib descriptor (spec.1_1, 1_2, 2_0, 2_1, 2_2, 2_3, 3_0, 4_0) + * Resolves schema definition file for taglib descriptor (spec.1_1, 1_2, 2_0, 2_1, 2_2, 2_3, 3_0, 4_0, 4_1) * @param publicId publicId for resolved entity (null in our case) * @param systemId systemId for resolved entity * @return InputSource for publisId, @@ -256,6 +276,8 @@ public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) t return new org.xml.sax.InputSource(URL_JSF_3_0); } else if (JSF_4_0.equals(systemId)) { return new org.xml.sax.InputSource(URL_JSF_4_0); + } else if (JSF_4_1.equals(systemId)) { + return new org.xml.sax.InputSource(URL_JSF_4_1); } else if (URL_FACELETS_TAGLIB_SCHEMA_20.equals(systemId)) { return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20); } else if (URL_FACELETS_TAGLIB_SCHEMA_22.equals(systemId)) { @@ -266,6 +288,8 @@ public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) t return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30); } else if (URL_FACELETS_TAGLIB_SCHEMA_40.equals(systemId)) { return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40); + } else if (URL_FACELETS_TAGLIB_SCHEMA_41.equals(systemId)) { + return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41); } else if (systemId!=null && systemId.endsWith(JSF_1_2_XSD)) { return new org.xml.sax.InputSource(URL_JSF_1_2); } else if (systemId!=null && systemId.endsWith(JSF_2_0_XSD)) { @@ -280,6 +304,8 @@ public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) t return new org.xml.sax.InputSource(URL_JSF_3_0); } else if (systemId!=null && systemId.endsWith(JSF_4_0_XSD)) { return new org.xml.sax.InputSource(URL_JSF_4_0); + } else if (systemId!=null && systemId.endsWith(JSF_4_1_XSD)) { + return new org.xml.sax.InputSource(URL_JSF_4_1); } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_20)) { return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20); } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_22)) { @@ -290,6 +316,8 @@ public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) t return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30); } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_40)) { return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40); + } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_41)) { + return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41); } else { return null; } @@ -316,28 +344,43 @@ public static JsfVersion extractVersion(Document document) { JsfVersion value = JsfVersion.JSF_1_0; // This is the default version if (dt != null) { - if (JSF_ID_1_0.equals(dt.getPublicId())) { - value = JsfVersion.JSF_1_0; - } else if (JSF_ID_1_1.equals(dt.getPublicId())) { - value = JsfVersion.JSF_1_1; - } else if (JSF_ID_1_2.equals(dt.getPublicId())) { - value = JsfVersion.JSF_1_2; - } else if (JSF_ID_2_0.equals(dt.getPublicId())) { - value = JsfVersion.JSF_2_0; - } else if (JSF_ID_2_1.equals(dt.getPublicId())) { - value = JsfVersion.JSF_2_1; - } else if (JSF_ID_2_2.equals(dt.getPublicId())) { - value = JsfVersion.JSF_2_2; - } else if (JSF_ID_2_3.equals(dt.getPublicId())) { - value = JsfVersion.JSF_2_3; - } else if (JSF_ID_3_0.equals(dt.getPublicId())) { - value = JsfVersion.JSF_3_0; - }else if (JSF_ID_4_0.equals(dt.getPublicId())) { - value = JsfVersion.JSF_4_0; + switch (dt.getPublicId()) { + case JSF_ID_1_0: + value = JsfVersion.JSF_1_0; + break; + case JSF_ID_1_1: + value = JsfVersion.JSF_1_1; + break; + case JSF_ID_1_2: + value = JsfVersion.JSF_1_2; + break; + case JSF_ID_2_0: + value = JsfVersion.JSF_2_0; + break; + case JSF_ID_2_1: + value = JsfVersion.JSF_2_1; + break; + case JSF_ID_2_2: + value = JsfVersion.JSF_2_2; + break; + case JSF_ID_2_3: + value = JsfVersion.JSF_2_3; + break; + case JSF_ID_3_0: + value = JsfVersion.JSF_3_0; + break; + case JSF_ID_4_0: + value = JsfVersion.JSF_4_0; + break; + case JSF_ID_4_1: + value = JsfVersion.JSF_4_1; + break; + default: + break; } } return value; } -} +} \ No newline at end of file diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigDataObject.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigDataObject.java index 7b5b99628d52..07063bb68026 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigDataObject.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigDataObject.java @@ -70,7 +70,6 @@ public class JSFConfigDataObject extends MultiDataObject implements org.openide. public static final String PROP_DOC_VALID = "documentValid"; // NOI18N - /** Creates a new instance of StrutsConfigDataObject */ public JSFConfigDataObject(FileObject pf, JSFConfigLoader loader) throws DataObjectExistsException { super(pf, loader); init(); diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigLoaderBeanInfo.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigLoaderBeanInfo.java index 4b1e77f28cfa..614e21056f15 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigLoaderBeanInfo.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigLoaderBeanInfo.java @@ -26,7 +26,7 @@ import org.openide.util.Exceptions; import org.openide.util.ImageUtilities; -/** StrutsConfig loader bean info. +/** * * @author Petr Pisl */ diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigNode.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigNode.java index 2238c6bc3bde..89f70cacbae9 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigNode.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFConfigNode.java @@ -31,7 +31,6 @@ public class JSFConfigNode extends DataNode { public static final String ICON_BASE = "org/netbeans/modules/web/jsf/resources/JSFConfigIcon.png"; - /** Creates a new instance of StrutsConfigNode */ public JSFConfigNode (final JSFConfigDataObject dataObject) { super(dataObject,Children.LEAF); setIconBaseWithExtension(ICON_BASE); diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java index 3f90ced55d10..79e56e14b95e 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java @@ -577,7 +577,9 @@ public void run() { if (ddRoot != null) { Profile profile = webModule.getJ2eeProfile(); if (profile != null && profile.isAtLeast(Profile.JAVA_EE_5) && jsfVersion != null) { - if (jsfVersion.isAtLeast(JsfVersion.JSF_4_0)) { + if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) { + facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_4_1; + } else if (jsfVersion.isAtLeast(JsfVersion.JSF_4_0)) { facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_4_0; } else if (jsfVersion.isAtLeast(JsfVersion.JSF_3_0)) { facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_3_0; @@ -698,7 +700,11 @@ public void run() { FileObject template = FileUtil.getConfigRoot().getFileObject(WELCOME_XHTML_TEMPLATE); HashMap params = new HashMap<>(); if (jsfVersion != null) { - if (jsfVersion.isAtLeast(JsfVersion.JSF_3_0)) { + if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) { + params.put("isJSF41", Boolean.TRUE); //NOI18N + } if (jsfVersion.isAtLeast(JsfVersion.JSF_4_0)) { + params.put("isJSF40", Boolean.TRUE); //NOI18N + } else if (jsfVersion.isAtLeast(JsfVersion.JSF_3_0)) { params.put("isJSF30", Boolean.TRUE); //NOI18N } else if (jsfVersion.isAtLeast(JsfVersion.JSF_2_2)) { params.put("isJSF22", Boolean.TRUE); //NOI18N @@ -749,7 +755,8 @@ private boolean isGlassFishv3(String serverInstanceID) { String shortName; try { shortName = Deployment.getDefault().getServerInstance(serverInstanceID).getServerID(); - if ("gfv700ee10".equals(shortName) || "gfv610ee9".equals(shortName) || "gfv6ee9".equals(shortName) + if ("gfv800ee11".equals(shortName) || "gfv700ee10".equals(shortName) + || "gfv610ee9".equals(shortName) || "gfv6ee9".equals(shortName) || "gfv510ee8".equals(shortName) || "gfv5ee8".equals(shortName) || "gfv5".equals(shortName) || "gfv4ee7".equals(shortName) || "gfv4".equals(shortName) || "gfv3ee6".equals(shortName) diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java index 0f5ccd5bb61e..e137a0b891cc 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java @@ -70,6 +70,7 @@ public class JSFUtils { public static final String DEFAULT_JSF_2_0_NAME = "jsf20"; //NOI18N public static final String DEFAULT_JSF_3_0_NAME = "jsf30"; //NOI18N public static final String DEFAULT_JSF_4_0_NAME = "jsf40"; //NOI18N + public static final String DEFAULT_JSF_4_1_NAME = "jsf41"; //NOI18N // the name of jstl library public static final String DEFAULT_JSTL_1_1_NAME = "jstl11"; //NOI18N @@ -86,6 +87,7 @@ public class JSFUtils { public static final String JSF_2_3__API_SPECIFIC_CLASS = "javax.faces.push.PushContext"; //NOI18N public static final String JSF_3_0__API_SPECIFIC_CLASS = "jakarta.faces.push.PushContext"; //NOI18N public static final String JSF_4_0__API_SPECIFIC_CLASS = "jakarta.faces.lifecycle.ClientWindowScoped"; //NOI18N + public static final String JSF_4_1__API_SPECIFIC_CLASS = "jakarta.faces.convert.UUIDConverter"; //NOI18N public static final String MYFACES_SPECIFIC_CLASS = "org.apache.myfaces.webapp.StartupServletContextListener"; //NOI18N //constants for web.xml (Java EE) @@ -432,7 +434,9 @@ public static MetadataModel getModel(Project project) { public static String getNamespaceDomain(WebModule webModule) { JsfVersion version = webModule != null ? JsfVersionUtils.forWebModule(webModule) : null; String nsLocation = NamespaceUtils.SUN_COM_LOCATION; - if (version != null && version.isAtLeast(JsfVersion.JSF_2_2)) { + if (version != null && version.isAtLeast(JsfVersion.JSF_4_0)) { + nsLocation = NamespaceUtils.JAKARTA_ORG_LOCATION; + } else if (version != null && version.isAtLeast(JsfVersion.JSF_2_2)) { nsLocation = NamespaceUtils.JCP_ORG_LOCATION; } return nsLocation; diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JsfTemplateUtils.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JsfTemplateUtils.java index 0127a98d8c16..08872616268d 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JsfTemplateUtils.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JsfTemplateUtils.java @@ -22,7 +22,6 @@ import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.util.ArrayList; -import java.util.Collections; import java.util.Comparator; import java.util.Enumeration; import java.util.List; @@ -91,7 +90,7 @@ public static List