diff --git a/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml b/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml index 915ced74c6a0..e78d776d2f29 100644 --- a/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml @@ -28,7 +28,7 @@ body: multiple: false options: - "Apache NetBeans 22" -# - "Apache NetBeans 22 release candidate" + - "Apache NetBeans 23 release candidate" - "Apache NetBeans latest daily build" validations: required: true @@ -73,6 +73,7 @@ body: multiple: false options: - "No / Don't know" + - "Apache NetBeans 22" - "Apache NetBeans 21" - "Apache NetBeans 20" - "Apache NetBeans 19" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c7d7e52fe6b..6befecbe2b53 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -124,7 +124,7 @@ jobs: timeout-minutes: 40 strategy: matrix: - java: [ '17', '21', '22' ] + java: [ '17', '21', '23-ea' ] exclude: - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} fail-fast: false @@ -525,6 +525,18 @@ jobs: - name: Extract run: tar --zstd -xf build.tar.zst + - name: apisupport.project + run: ant $OPTS -f apisupport/apisupport.project test + + - name: apisupport.refactoring + run: ant $OPTS -f apisupport/apisupport.refactoring test + + - name: apisupport.wizards + run: ant $OPTS -f apisupport/apisupport.wizards test + + - name: timers + run: ant $OPTS -f apisupport/timers test + - name: ide/api.xml run: ant $OPTS -f ide/api.xml test @@ -808,7 +820,7 @@ jobs: timeout-minutes: 50 strategy: matrix: - java: [ '17', '21', '22' ] + java: [ '17', '21', '23-ea' ] exclude: - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} fail-fast: false @@ -1403,56 +1415,6 @@ 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 - runs-on: ubuntu-latest - timeout-minutes: 60 - strategy: - matrix: - java: [ '17' ] - fail-fast: false - steps: - - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v4 - 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@v4 - with: - name: build - - - name: Extract - run: tar --zstd -xf build.tar.zst - - - name: apisupport.project - run: ant $OPTS -f apisupport/apisupport.project test - - - name: apisupport.refactoring - run: ant $OPTS -f apisupport/apisupport.refactoring test - - - name: apisupport.wizards - run: ant $OPTS -f apisupport/apisupport.wizards test - - - name: timers - run: ant $OPTS -f apisupport/timers test - - - name: Create Test Summary - uses: test-summary/action@v2 - if: failure() - with: - paths: "./*/*/build/test/*/results/TEST-*.xml" - - java-hints-test: name: Java Hints ${{ matrix.config }} on Linux/JDK ${{ matrix.java }} # equals env.test_java == 'true' @@ -1462,10 +1424,10 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17', '22' ] + java: [ '17', '23-ea' ] config: [ 'batch1', 'batch2' ] exclude: - - java: ${{ github.event_name == 'pull_request' && 'nothing' || '22' }} + - java: ${{ github.event_name == 'pull_request' && 'nothing' || '23-ea' }} fail-fast: false steps: @@ -1509,13 +1471,13 @@ jobs: java-debugger-test: name: Java Debugger tests 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' }} + if: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || contains(github.event.pull_request.labels.*.name, 'debugger') || 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: [ '17', '21', '22' ] + java: [ '17', '21', '23-ea' ] exclude: - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} fail-fast: false @@ -2114,9 +2076,8 @@ jobs: - name: web.jsfapi run: ant $OPTS -f enterprise/web.jsfapi test -# Fails -# - name: web.jspparser -# run: ant $OPTS -f enterprise/web.jspparser test + - name: web.jspparser + run: ant $OPTS -f enterprise/web.jspparser test # Fails # - name: web.project @@ -2658,7 +2619,6 @@ jobs: - java-hints-test - java-debugger-test - profiler-test - - apisupport-modules-test - build-tools - webcommon-test - php diff --git a/.gitignore b/.gitignore index 6045e2589e5a..d20d1599df4e 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,8 @@ /nb/ide.launcher/windows/nbproject/Package-*.bash /platform/o.n.bootstrap/launcher/windows/nbproject/Makefile-*.mk /platform/o.n.bootstrap/launcher/windows/nbproject/Package-*.bash +/enterprise/web.jspparser/test/unit/data/emptyWebProject/lib/*.jar +/enterprise/web.jspparser/test/unit/data/project2/lib/*.jar # Database logs derby.log diff --git a/apisupport/apisupport.ant/manifest.mf b/apisupport/apisupport.ant/manifest.mf index 99bf9f2919ce..91e09bdfbdc8 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.97 +OpenIDE-Module-Specification-Version: 2.98 AutoUpdate-Show-In-Client: false OpenIDE-Module-Layer: org/netbeans/modules/apisupport/project/resources/layer.xml diff --git a/apisupport/apisupport.installer.maven/manifest.mf b/apisupport/apisupport.installer.maven/manifest.mf index dfcb4a450122..8ffa9129d304 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.47 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/apisupport/apisupport.installer/manifest.mf b/apisupport/apisupport.installer/manifest.mf index fa3cdcddb112..ebd6287366e8 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.48 +OpenIDE-Module-Specification-Version: 1.49 diff --git a/apisupport/apisupport.kit/manifest.mf b/apisupport/apisupport.kit/manifest.mf index 71f90de6eb74..732dea9169b4 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.55 +OpenIDE-Module-Specification-Version: 1.56 OpenIDE-Module-Provides: org.netbeans.modules.apisupport.kit diff --git a/apisupport/apisupport.project/manifest.mf b/apisupport/apisupport.project/manifest.mf index 8249b93cd79c..ca578473b9fb 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.101 +OpenIDE-Module-Specification-Version: 1.102 diff --git a/apisupport/apisupport.refactoring/manifest.mf b/apisupport/apisupport.refactoring/manifest.mf index cf88272d9dec..fa7873bfa3f0 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.62 +OpenIDE-Module-Specification-Version: 1.63 diff --git a/apisupport/apisupport.wizards/manifest.mf b/apisupport/apisupport.wizards/manifest.mf index f95f8229d96c..72242032354b 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.45 +OpenIDE-Module-Specification-Version: 1.46 diff --git a/apisupport/maven.apisupport/manifest.mf b/apisupport/maven.apisupport/manifest.mf index 5ddfb1a6b17a..9c3a2e42a359 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.84 +OpenIDE-Module-Specification-Version: 1.85 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 16b3c8508079..5a7c08bc9b53 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,8 +24,6 @@ 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; @@ -49,6 +47,7 @@ import org.netbeans.modules.maven.model.pom.Project; import org.netbeans.modules.maven.model.pom.Repository; import org.netbeans.modules.maven.model.pom.RepositoryPolicy; +import org.netbeans.modules.maven.options.MavenVersionSettings; import org.netbeans.modules.maven.spi.newproject.CreateProjectBuilder; import org.openide.util.Exceptions; @@ -58,12 +57,12 @@ */ final class NBMNativeMWI { - static void instantiate(ProjectInfo vi, File projFile, String version, boolean useOsgi, MavenProject mp) { + static void instantiate(ProjectInfo vi, File projFile, String nbVersion, boolean useOsgi, MavenProject mp) { CreateProjectBuilder builder = new CreateProjectBuilder(projFile, vi.groupId, vi.artifactId, vi.version) .setPackageName(vi.packageName) .setPackaging("nbm") .setAdditionalNonPomWork(new AdditionalFiles()) - .setAdditionalOperations(new AdditionalOperations(version, useOsgi)); + .setAdditionalOperations(new AdditionalOperations(nbVersion, useOsgi)); if (mp != null) { builder = builder.setParentProject(mp); } @@ -237,7 +236,6 @@ public void performOperation(POMModel model) { //nbm-maven-plugin boolean addPlugin = true; String managedPVersion = null; - String pVersion = MavenNbModuleImpl.getLatestNbmPluginVersion(); // boolean useOsgiDepsSet = false; if (parent != null) { //TODO do we want to support the case when the plugin is defined in parent pom with inherited=true? @@ -259,12 +257,13 @@ public void performOperation(POMModel model) { } } } + MavenVersionSettings settings = MavenVersionSettings.getDefault(); if (addPlugin) { Plugin p = model.getFactory().createPlugin(); p.setGroupId(MavenNbModuleImpl.GROUPID_APACHE); p.setArtifactId(MavenNbModuleImpl.NBM_PLUGIN); if (managedPVersion == null) { - p.setVersion(pVersion); + p.setVersion(MavenNbModuleImpl.getLatestNbmPluginVersion()); } p.setExtensions(true); if (useOsgi) { @@ -278,52 +277,44 @@ public void performOperation(POMModel model) { //now comes the compiler plugin addPlugin = true; managedPVersion = null; - String source = null; - String target = null; - pVersion = "3.11.0"; if (parent != null) { //TODO do we want to support the case when the plugin is defined in parent pom with inherited=true? PluginManagement pm = parent.getPluginManagement(); if (pm != null) { - for (org.apache.maven.model.Plugin p : pm.getPlugins()) { - if (Constants.GROUP_APACHE_PLUGINS.equals(p.getGroupId()) && Constants.PLUGIN_COMPILER.equals(p.getArtifactId())) { - managedPVersion = p.getVersion(); - Xpp3Dom conf = (Xpp3Dom) p.getConfiguration(); - if (conf != null) { - Xpp3Dom sourceEl = conf.getChild("source"); - if (sourceEl != null) { - source = sourceEl.getValue(); - } - Xpp3Dom targetEl = conf.getChild("target"); - if (targetEl != null) { - target = targetEl.getValue(); + if (parent.getProperties().getProperty("maven.compiler.release") != null) { + addPlugin = false; + } else { + for (org.apache.maven.model.Plugin p : pm.getPlugins()) { + if (Constants.GROUP_APACHE_PLUGINS.equals(p.getGroupId()) && Constants.PLUGIN_COMPILER.equals(p.getArtifactId())) { + managedPVersion = p.getVersion(); + Xpp3Dom conf = (Xpp3Dom) p.getConfiguration(); + if (conf != null) { + if ( conf.getChild("release") != null + || conf.getChild("source") != null + || conf.getChild("target") != null) { + addPlugin = false; + } } + break; } - break; } } } } - addPlugin = target == null || source == null; if (addPlugin) { Plugin p = model.getFactory().createPlugin(); p.setGroupId(Constants.GROUP_APACHE_PLUGINS); p.setArtifactId(Constants.PLUGIN_COMPILER); if (managedPVersion == null) { - p.setVersion(pVersion); + p.setVersion(settings.getVersion(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER)); } - Configuration c = model.getFactory().createConfiguration(); - c.setSimpleParameter("source", "1.8"); - c.setSimpleParameter("target", "1.8"); - p.setConfiguration(c); getOrCreateBuild(model).addPlugin(p); + model.getProject().getProperties().setProperty("maven.compiler.release", "17"); } //now the jar plugin - addPlugin = true; managedPVersion = null; String useManifest = null; - pVersion = "3.3.0"; if (parent != null) { //TODO do we want to support the case when the plugin is defined in parent pom with inherited=true? PluginManagement pm = parent.getPluginManagement(); @@ -359,6 +350,7 @@ public void performOperation(POMModel model) { p.setGroupId(Constants.GROUP_APACHE_PLUGINS); p.setArtifactId(Constants.PLUGIN_JAR); if (managedPVersion == null) { + String pVersion = settings.getVersion(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_JAR); p.setVersion(pVersion); managedPVersion = pVersion; } diff --git a/apisupport/maven.apisupport/test/unit/src/org/netbeans/modules/maven/apisupport/NBMNativeMWITest.java b/apisupport/maven.apisupport/test/unit/src/org/netbeans/modules/maven/apisupport/NBMNativeMWITest.java index 869fe7a1b20a..2fa9e7aa1c21 100644 --- a/apisupport/maven.apisupport/test/unit/src/org/netbeans/modules/maven/apisupport/NBMNativeMWITest.java +++ b/apisupport/maven.apisupport/test/unit/src/org/netbeans/modules/maven/apisupport/NBMNativeMWITest.java @@ -38,6 +38,8 @@ public class NBMNativeMWITest extends NbTestCase { + private static final String EXPECTED_JAVAC_PLUGIN_VERSION = "3.13.0"; + private FileObject wd; public NBMNativeMWITest(String testName) { @@ -64,7 +66,7 @@ public void testPathNoParent() throws IOException, XmlPullParserException { assertEquals("nbm-maven-plugin", model.getBuild().getPlugins().get(0).getArtifactId()); assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), model.getBuild().getPlugins().get(0).getVersion()); assertEquals("maven-compiler-plugin", model.getBuild().getPlugins().get(1).getArtifactId()); - assertEquals("3.11.0", model.getBuild().getPlugins().get(1).getVersion()); + assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, model.getBuild().getPlugins().get(1).getVersion()); assertEquals(0, model.getRepositories().size()); } @@ -82,7 +84,7 @@ public void testPathNoParentSnapshot() throws IOException, XmlPullParserExceptio assertEquals("nbm-maven-plugin", model.getBuild().getPlugins().get(0).getArtifactId()); assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), model.getBuild().getPlugins().get(0).getVersion()); assertEquals("maven-compiler-plugin", model.getBuild().getPlugins().get(1).getArtifactId()); - assertEquals("3.11.0", model.getBuild().getPlugins().get(1).getVersion()); + assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, model.getBuild().getPlugins().get(1).getVersion()); assertEquals(1, model.getRepositories().size()); } @@ -109,7 +111,7 @@ public void testPathParent() throws IOException, XmlPullParserException { assertEquals("nbm-maven-plugin", model.getBuild().getPlugins().get(0).getArtifactId()); assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), model.getBuild().getPlugins().get(0).getVersion()); assertEquals("maven-compiler-plugin", model.getBuild().getPlugins().get(1).getArtifactId()); - assertEquals("3.11.0", model.getBuild().getPlugins().get(1).getVersion()); + assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, model.getBuild().getPlugins().get(1).getVersion()); assertEquals(0, model.getRepositories().size()); } @@ -135,7 +137,7 @@ public void testPathParentSnapshot() throws IOException, XmlPullParserException assertEquals("nbm-maven-plugin", model.getBuild().getPlugins().get(0).getArtifactId()); assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), model.getBuild().getPlugins().get(0).getVersion()); assertEquals("maven-compiler-plugin", model.getBuild().getPlugins().get(1).getArtifactId()); - assertEquals("3.11.0", model.getBuild().getPlugins().get(1).getVersion()); + assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, model.getBuild().getPlugins().get(1).getVersion()); assertEquals(1, model.getRepositories().size()); } @@ -190,7 +192,7 @@ public void testPathParentJar() throws IOException, XmlPullParserException { assertEquals("nbm-maven-plugin", modeloutput.getBuild().getPlugins().get(0).getArtifactId()); assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), modeloutput.getBuild().getPlugins().get(0).getVersion()); assertEquals("maven-compiler-plugin", modeloutput.getBuild().getPlugins().get(1).getArtifactId()); - assertEquals("3.11.0", modeloutput.getBuild().getPlugins().get(1).getVersion()); + assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, modeloutput.getBuild().getPlugins().get(1).getVersion()); assertEquals(0, model.getRepositories().size()); } diff --git a/apisupport/timers/manifest.mf b/apisupport/timers/manifest.mf index 7015ddff5895..f6440d98df2c 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.56 +OpenIDE-Module-Specification-Version: 1.57 AutoUpdate-Show-In-Client: true diff --git a/cpplite/cpplite.debugger/manifest.mf b/cpplite/cpplite.debugger/manifest.mf index dceff650eab9..6c1481f7fa5e 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.17 +OpenIDE-Module-Specification-Version: 1.18 diff --git a/cpplite/cpplite.editor/manifest.mf b/cpplite/cpplite.editor/manifest.mf index 708c207e824d..f7217b1eaa7b 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.16 +OpenIDE-Module-Specification-Version: 1.17 diff --git a/cpplite/cpplite.kit/manifest.mf b/cpplite/cpplite.kit/manifest.mf index cea2d0344ac2..727320821958 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.16 +OpenIDE-Module-Specification-Version: 1.17 diff --git a/cpplite/cpplite.project/manifest.mf b/cpplite/cpplite.project/manifest.mf index b444bd2fe41e..7a007bd781f6 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.16 +OpenIDE-Module-Specification-Version: 1.17 diff --git a/enterprise/api.web.webmodule/manifest.mf b/enterprise/api.web.webmodule/manifest.mf index 71d15edd5143..5975312711cd 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.63 +OpenIDE-Module-Specification-Version: 1.64 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/cloud.amazon/manifest.mf b/enterprise/cloud.amazon/manifest.mf index 915f38913b56..335657d3a2d4 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.37 +OpenIDE-Module-Specification-Version: 1.38 diff --git a/enterprise/cloud.common/manifest.mf b/enterprise/cloud.common/manifest.mf index e51c5462d868..bf35b4921a46 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.36 +OpenIDE-Module-Specification-Version: 1.37 diff --git a/enterprise/cloud.oracle/external/binaries-list b/enterprise/cloud.oracle/external/binaries-list index 194a2c6741d2..cc4884799098 100644 --- a/enterprise/cloud.oracle/external/binaries-list +++ b/enterprise/cloud.oracle/external/binaries-list @@ -32,6 +32,7 @@ D9918C04C60741D1BBEFBCC82E9D3B8BE690D412 com.oracle.oci.sdk:oci-java-sdk-objects 3088420C75219556F803B55D8B71B96D29D1FC80 com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:3.25.3 A7D98B96CEA17F78E4BB9270B4A60FEBFACF6C78 com.oracle.oci.sdk:oci-java-sdk-core:3.25.3 2236737DDF39CA3A3BABDB58B41F50C47E861EA7 com.oracle.oci.sdk:oci-java-sdk-containerengine:3.25.3 +923F38FE7186DFCBF921F9B3626832FFFFB8F6E9 com.oracle.oci.sdk:oci-java-sdk-artifacts:3.25.3 E5F6CAE5CA7ECAAC1EC2827A9E2D65AE2869CADA org.apache.httpcomponents:httpclient:4.5.13 853B96D3AFBB7BF8CC303FE27EE96836A10C1834 org.apache.httpcomponents:httpcore:4.4.13 diff --git a/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt b/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt index 77fab270b8f5..10b6404ef8f3 100644 --- a/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt +++ b/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt @@ -3,7 +3,7 @@ Description: Oracle Cloud Infrastructure SDK for Java Origin: https://github.com/oracle/oci-java-sdk Version: 3.25.3 License: UPL-Apache-2.0 -Files: oci-java-sdk-circuitbreaker-3.25.3.jar, oci-java-sdk-common-3.25.3.jar, oci-java-sdk-database-3.25.3.jar, oci-java-sdk-identity-3.25.3.jar, oci-java-sdk-workrequests-3.25.3.jar, oci-java-sdk-adm-3.25.3.jar, oci-java-sdk-devops-3.25.3.jar, oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar, oci-java-sdk-common-httpclient-3.25.3.jar, oci-java-sdk-common-httpclient-jersey-3.25.3.jar oci-java-sdk-keymanagement-3.25.3.jar oci-java-sdk-vault-3.25.3.jar oci-java-sdk-containerengine-3.25.3.jar oci-java-sdk-core-3.25.3.jar oci-java-sdk-objectstorage-3.25.3.jar oci-java-sdk-objectstorage-extensions-3.25.3.jar oci-java-sdk-objectstorage-generated-3.25.3.jar +Files: oci-java-sdk-circuitbreaker-3.25.3.jar, oci-java-sdk-common-3.25.3.jar, oci-java-sdk-database-3.25.3.jar, oci-java-sdk-identity-3.25.3.jar, oci-java-sdk-workrequests-3.25.3.jar, oci-java-sdk-adm-3.25.3.jar, oci-java-sdk-devops-3.25.3.jar, oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar, oci-java-sdk-common-httpclient-3.25.3.jar, oci-java-sdk-common-httpclient-jersey-3.25.3.jar oci-java-sdk-keymanagement-3.25.3.jar oci-java-sdk-vault-3.25.3.jar oci-java-sdk-containerengine-3.25.3.jar oci-java-sdk-core-3.25.3.jar oci-java-sdk-objectstorage-3.25.3.jar oci-java-sdk-objectstorage-extensions-3.25.3.jar oci-java-sdk-objectstorage-generated-3.25.3.jar, oci-java-sdk-artifacts-3.25.3.jar Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. diff --git a/enterprise/cloud.oracle/manifest.mf b/enterprise/cloud.oracle/manifest.mf index eb908421be8b..356c13b0211d 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.11 +OpenIDE-Module-Specification-Version: 1.12 OpenIDE-Module-Display-Category: Cloud diff --git a/enterprise/cloud.oracle/nbproject/project.properties b/enterprise/cloud.oracle/nbproject/project.properties index 3f1ec9aa79e2..7463cc5d67a8 100644 --- a/enterprise/cloud.oracle/nbproject/project.properties +++ b/enterprise/cloud.oracle/nbproject/project.properties @@ -33,6 +33,7 @@ release.external/oci-java-sdk-objectstorage-generated-3.25.3.jar=modules/ext/oci release.external/oci-java-sdk-objectstorage-extensions-3.25.3.jar=modules/ext/oci-java-sdk-objectstorage-extensions-3.25.3.jar release.external/oci-java-sdk-core-3.25.3.jar=modules/ext/oci-java-sdk-core-3.25.3.jar release.external/oci-java-sdk-containerengine-3.25.3.jar=modules/ext/oci-java-sdk-containerengine-3.25.3.jar +release.external/oci-java-sdk-artifacts-3.25.3.jar=modules/ext/oci-java-sdk-artifacts-3.25.3.jar release.external/httpclient-4.5.13.jar=modules/ext/httpclient-4.5.13.jar release.external/httpcore-4.4.13.jar=modules/ext/httpcore-4.4.13.jar release.external/javassist-3.25.0-GA.jar=modules/ext/javassist-3.25.0-GA.jar diff --git a/enterprise/cloud.oracle/nbproject/project.xml b/enterprise/cloud.oracle/nbproject/project.xml index 73205d6646ae..797fc5dcdb62 100644 --- a/enterprise/cloud.oracle/nbproject/project.xml +++ b/enterprise/cloud.oracle/nbproject/project.xml @@ -307,6 +307,10 @@ ext/oci-java-sdk-containerengine-3.25.3.jar external/oci-java-sdk-containerengine-3.25.3.jar + + ext/oci-java-sdk-artifacts-3.25.3.jar + external/oci-java-sdk-artifacts-3.25.3.jar + ext/httpclient-4.5.13.jar external/httpclient-4.5.13.jar diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java index 4d25183bac78..bfc515d76fe3 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java @@ -19,11 +19,11 @@ package org.netbeans.modules.cloud.oracle; import com.oracle.bmc.auth.BasicAuthenticationDetailsProvider; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.List; import javax.swing.Action; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import org.netbeans.modules.cloud.oracle.items.OCIItem; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; @@ -114,6 +114,11 @@ public void refresh() { if (factory != null) { factory.refreshKeys(); } + update(item); + } + + public void update(OCIItem item) { + } @Override @@ -121,10 +126,11 @@ public Node.Handle getHandle() { return super.getHandle(); } - private final class RefreshListener implements ChangeListener { + private final class RefreshListener implements PropertyChangeListener { @Override - public void stateChanged(ChangeEvent e) { + public void propertyChange(PropertyChangeEvent evt) { refresh(); + fireDisplayNameChange("", getDisplayName()); } } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java index d20706a03454..5e8d6f807289 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java @@ -34,6 +34,7 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import java.util.concurrent.CompletableFuture; import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; @@ -48,7 +49,6 @@ import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; import org.netbeans.modules.cloud.oracle.items.TenancyItem; -import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.NotifyDescriptor.ComposedInput.Callback; @@ -56,8 +56,8 @@ import org.openide.NotifyDescriptor.QuickPick.Item; import org.openide.awt.ActionID; import org.openide.awt.ActionRegistration; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; +import org.openide.util.RequestProcessor; /** * @@ -67,47 +67,46 @@ category = "Tools", id = "org.netbeans.modules.cloud.oracle.actions.AddADBAction" ) -@ActionRegistration( - displayName = "#AddADB", +@ActionRegistration( + displayName = "#AddADB", asynchronous = true ) @NbBundle.Messages({ "AddADB=Add Oracle Autonomous DB", "SelectProfile=Select OCI Profile", - "# {0} - tenancy name", - "# {1} - region id", - "SelectProfile_Description={0} (region: {1})", "SelectCompartment=Select Compartment", "SelectDatabase=Select Database", "NoDatabase=No Database available in this Compartment", "EnterUsername=Enter Username", - "EnterPassword=Enter Password" + "EnterPassword=Enter Password", + "MSG_CollectingProfiles=Searching for OCI Profiles", + "MSG_CollectingProfiles_Text=Loading OCI Profiles", + "MSG_CollectingItems=Loading OCI contents", + "MSG_CollectingItems_Text=Listing compartments and databases", + "SelectProfile_Description={0} (region: {1})" }) public class AddADBAction implements ActionListener { + private static final Logger LOGGER = Logger.getLogger(AddADBAction.class.getName()); - + private static final String DB = "db"; //NOI18N private static final String USERNAME = "username"; //NOI18N private static final String PASSWORD = "password"; //NOI18N private static final int NUMBER_OF_INPUTS = 4; + private static final RequestProcessor RP = new RequestProcessor(AddADBAction.class); - @NbBundle.Messages({ - "MSG_CollectingProfiles=Searching for OCI Profiles", - "MSG_CollectingProfiles_Text=Loading OCI Profiles", - "MSG_CollectingItems=Loading OCI contents", - "MSG_CollectingItems_Text=Listing compartments and databases", - }) @Override public void actionPerformed(ActionEvent e) { addADB(); } - - public DatabaseItem addADB() { - Map result = new HashMap<> (); - + + public CompletableFuture addADB() { + Map result = new HashMap<>(); + CompletableFuture future = new CompletableFuture(); + NotifyDescriptor.ComposedInput ci = new NotifyDescriptor.ComposedInput(Bundle.AddADB(), NUMBER_OF_INPUTS, new Callback() { - Map values = new HashMap<> (); + Map values = new HashMap<>(); @Override public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int number) { @@ -115,7 +114,7 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu ProgressHandle h = ProgressHandle.createHandle(Bundle.MSG_CollectingProfiles()); h.start(); h.progress(Bundle.MSG_CollectingProfiles_Text()); - + Map profiles = new LinkedHashMap<>(); Map tenancyItems = new LinkedHashMap<>(); try { @@ -157,9 +156,9 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu NotifyDescriptor prev = input.getInputs()[number - 2]; OCIItem prevItem = null; if (prev instanceof NotifyDescriptor.QuickPick) { - for (QuickPick.Item item : ((QuickPick)prev).getItems()) { + for (QuickPick.Item item : ((QuickPick) prev).getItems()) { if (item.isSelected()) { - prevItem = (OCIItem)values.get(number - 1).get(item.getLabel()); + prevItem = (OCIItem) values.get(number - 1).get(item.getLabel()); break; } } @@ -201,36 +200,40 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu return null; } } - + }); - if (DialogDescriptor.OK_OPTION == DialogDisplayer.getDefault().notify(ci)) { - try { - DatabaseItem selectedDatabase = (DatabaseItem) result.get(DB); - DownloadWalletAction action = new DownloadWalletAction(selectedDatabase); - WalletInfo info = new WalletInfo( - DownloadWalletDialog.getWalletsDir().getAbsolutePath(), - AbstractPasswordPanel.generatePassword(), - (String) result.get(USERNAME), - ((String) result.get(PASSWORD)).toCharArray(), - selectedDatabase.getKey().getValue(), - selectedDatabase.getCompartmentId()); - action.addConnection(info); - return selectedDatabase; - } catch (IOException ex) { - Exceptions.printStackTrace(ex); + DialogDisplayer.getDefault().notifyFuture(ci).handle((r, exception) -> { + if (exception == null) { + try { + DatabaseItem selectedDatabase = (DatabaseItem) result.get(DB); + DownloadWalletAction action = new DownloadWalletAction(selectedDatabase); + WalletInfo info = new WalletInfo( + DownloadWalletDialog.getWalletsDir().getAbsolutePath(), + AbstractPasswordPanel.generatePassword(), + (String) result.get(USERNAME), + ((String) result.get(PASSWORD)).toCharArray(), + selectedDatabase); + action.addConnection(info); + future.complete(selectedDatabase); + } catch (IOException ex) { + future.completeExceptionally(exception); + } + } else { + future.completeExceptionally(exception); } - } - return null; + return null; + }); + return future; } - + private NotifyDescriptor.QuickPick createQuickPick(Map ociItems, String title) { - + List items = ociItems.entrySet().stream() .map(entry -> new Item(entry.getKey(), entry.getValue().getDescription())) .collect(Collectors.toList()); return new NotifyDescriptor.QuickPick(title, title, items, false); } - + private Map getFlatCompartment(TenancyItem tenancy) { Map compartments = new HashMap<>(); OCISessionInitiator session = OCIManager.getDefault().getActiveSession(); @@ -259,7 +262,7 @@ FlatCompartmentItem getItem(OCID compId) { nextPageToken = response.getOpcNextPage(); } while (nextPageToken != null); Map pickItems = computeFlatNames(compartments); - pickItems.put(tenancy.getName()+" (root)", tenancy); // NOI18N + pickItems.put(tenancy.getName() + " (root)", tenancy); // NOI18N return pickItems; } @@ -272,6 +275,7 @@ private Map computeFlatNames(Map com } private abstract class FlatCompartmentItem extends CompartmentItem { + private final OCID parentId; private String flatName; @@ -288,9 +292,13 @@ public String getName() { if (flatName == null) { String parentFlatName = ""; FlatCompartmentItem parentComp = getItem(parentId); - if (parentComp != null) parentFlatName = parentComp.getName(); + if (parentComp != null) { + parentFlatName = parentComp.getName(); + } flatName = super.getName(); - if (!parentFlatName.isEmpty()) flatName = parentFlatName + "/" + flatName; // NOI18N + if (!parentFlatName.isEmpty()) { + flatName = parentFlatName + "/" + flatName; // NOI18N + } } return flatName; } @@ -299,7 +307,7 @@ public String getName() { } private Map getDbs(OCIItem parent) { - Map items = new HashMap<> (); + Map items = new HashMap<>(); try { if (parent instanceof CompartmentItem) { DatabaseNode.getDatabases().apply((CompartmentItem) parent).forEach((db) -> items.put(db.getName(), db)); @@ -309,5 +317,5 @@ private Map getDbs(OCIItem parent) { } return items; } - + } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java index e4d0dc0eb6ae..1e43599166ec 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java @@ -18,19 +18,19 @@ */ package org.netbeans.modules.cloud.oracle.actions; +import org.netbeans.modules.cloud.oracle.steps.PasswordStep; +import org.netbeans.modules.cloud.oracle.steps.DatasourceNameStep; +import org.netbeans.modules.cloud.oracle.steps.OverwriteStep; import com.oracle.bmc.devops.DevopsClient; import com.oracle.bmc.devops.model.DeployArtifactSource; import com.oracle.bmc.devops.model.DeployArtifactSummary; import com.oracle.bmc.devops.model.InlineDeployArtifactSource; -import com.oracle.bmc.devops.model.ProjectSummary; import com.oracle.bmc.devops.model.UpdateDeployArtifactDetails; import com.oracle.bmc.devops.requests.GetDeployArtifactRequest; import com.oracle.bmc.devops.requests.ListDeployArtifactsRequest; -import com.oracle.bmc.devops.requests.ListProjectsRequest; import com.oracle.bmc.devops.requests.UpdateDeployArtifactRequest; import com.oracle.bmc.devops.responses.GetDeployArtifactResponse; import com.oracle.bmc.devops.responses.ListDeployArtifactsResponse; -import com.oracle.bmc.devops.responses.ListProjectsResponse; import org.netbeans.api.db.explorer.DatabaseConnection; import com.oracle.bmc.model.BmcException; import com.oracle.bmc.vault.VaultsClient; @@ -51,20 +51,14 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; -import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; import java.util.UUID; -import java.util.function.Function; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.stream.Collectors; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.project.Project; @@ -72,31 +66,24 @@ import static org.netbeans.modules.cloud.oracle.OCIManager.getDefault; import org.netbeans.modules.cloud.oracle.assets.DependencyUtils; import org.netbeans.modules.cloud.oracle.assets.Steps; -import org.netbeans.modules.cloud.oracle.assets.Step; +import org.netbeans.modules.cloud.oracle.steps.CompartmentStep; +import org.netbeans.modules.cloud.oracle.steps.DevopsStep; import org.netbeans.modules.cloud.oracle.assets.Steps.NextStepProvider; -import org.netbeans.modules.cloud.oracle.assets.Steps.ProjectStep; -import org.netbeans.modules.cloud.oracle.assets.Steps.TenancyStep; -import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem; +import org.netbeans.modules.cloud.oracle.steps.KeyStep; +import org.netbeans.modules.cloud.oracle.steps.ProjectStep; +import org.netbeans.modules.cloud.oracle.steps.TenancyStep; +import org.netbeans.modules.cloud.oracle.steps.VaultStep; import org.netbeans.modules.cloud.oracle.devops.DevopsProjectItem; -import org.netbeans.modules.cloud.oracle.devops.DevopsProjectService; -import org.netbeans.modules.cloud.oracle.items.OCID; -import org.netbeans.modules.cloud.oracle.items.OCIItem; import org.netbeans.modules.cloud.oracle.vault.KeyItem; -import org.netbeans.modules.cloud.oracle.vault.KeyNode; -import org.netbeans.modules.cloud.oracle.vault.SecretItem; -import org.netbeans.modules.cloud.oracle.vault.SecretNode; import org.netbeans.modules.cloud.oracle.vault.VaultItem; -import org.netbeans.modules.cloud.oracle.vault.VaultNode; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; -import org.openide.NotifyDescriptor.QuickPick.Item; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; import org.openide.awt.ActionRegistration; import org.openide.util.Lookup; import org.openide.util.NbBundle; -import org.openide.util.Pair; import org.openide.util.lookup.Lookups; /** @@ -116,20 +103,8 @@ }) @NbBundle.Messages({ "AddADBToVault=Add Oracle Autonomous DB details to OCI Vault", - "SelectKey=Select Key", - "SelectVault=Select Vault", "SecretsCreated=Secrets were created or updated", - "NoKeys=No keys in this Vault. Select another one.", - "DatasourceName=Datasource Name", - "AddVersion=Add new versions", - "Cancel=Cancel", - "SecretExists=Secrets with name {0} already exists", - "NoProfile=There is not any OCI profile in the config", - "NoCompartment=There are no compartments in the Tenancy", - "Password=Enter password for Database user {0}", "NoConfigMap=No ConfigMap found in the Devops project {0}", - "SelectDevopsProject=Select Devops Project", - "NoDevopsProjects=There are no Devops Projects in selected Compartment", "ConfigmapUpdateFailed=Failed to update ConfigMap", "CreatingSecret=Creating secret {0}", "UpdatingSecret=Updating secret {0}", @@ -138,7 +113,6 @@ "DatasourceEmpty=Datasource name cannot be empty" }) public class AddDbConnectionToVault implements ActionListener { - private static final Logger LOG = Logger.getLogger(AddDbConnectionToVault.class.getName()); private final DatabaseConnection context; @@ -146,357 +120,37 @@ public class AddDbConnectionToVault implements ActionListener { public AddDbConnectionToVault(DatabaseConnection context) { this.context = context; } - - class VaultStep implements Step { - - private Map vaults = null; - private VaultItem selected; - private Lookup lookup; - - public Step prepare(CompartmentItem compartment, Lookup lookup) { - this.lookup = lookup; - ProgressHandle h = ProgressHandle.createHandle(Bundle.MSG_CollectingItems()); - h.start(); - h.progress(Bundle.MSG_CollectingItems_Text()); - try { - vaults = getVaults(compartment); - } finally { - h.finish(); - } - return this; - } - - @Override - public NotifyDescriptor createInput() { - return createQuickPick(vaults, Bundle.SelectVault()); - } - - @Override - public Step getNext() { - return new KeyStep().prepare(getValue(), lookup); - } - - @Override - public void setValue(String selected) { - this.selected = vaults.get(selected); - } - - @Override - public VaultItem getValue() { - if (onlyOneChoice()) { - selected = vaults.values().iterator().next(); - } - return selected; - } - - @Override - public boolean onlyOneChoice() { - return vaults.size() == 1; - } - } - - class KeyStep implements Step> { - - private Map keys = null; - private KeyItem selected; - private VaultItem vault; - private Lookup lookup; - - public Step> prepare(VaultItem vault, Lookup lookup) { - this.vault = vault; - this.lookup = lookup; - ProgressHandle h = ProgressHandle.createHandle(Bundle.MSG_CollectingItems()); - h.start(); - h.progress(Bundle.MSG_CollectingItems_Text()); - try { - keys = getKeys(vault); - } finally { - h.finish(); - } - return this; - } - - @Override - public boolean onlyOneChoice() { - return keys.size() == 1; - } - - @Override - public NotifyDescriptor createInput() { - if (keys.size() > 1) { - return createQuickPick(keys, Bundle.SelectKey()); - } - if (keys.size() == 0) { - return new NotifyDescriptor.QuickPick("", Bundle.NoKeys(), Collections.emptyList(), false); - } - - throw new IllegalStateException("No data to create input"); // NOI18N - } - - @Override - public Step getNext() { - return new DatasourceNameStep().prepare(getValue(), lookup); - } - - @Override - public void setValue(String selected) { - this.selected = keys.get(selected); - } - - @Override - public Pair getValue() { - if (keys.size() == 1) { - return Pair.of(vault, keys.values().iterator().next()); - } - return Pair.of(vault, selected); - } - - } - - class DatasourceNameStep implements Step, Result> { - - private Result result = new Result(); - private Lookup lookup; - - @Override - public Step, Result> prepare(Pair item, Lookup lookup) { - this.lookup = lookup; - result.vault = item.first(); - result.key = item.second(); - return this; - } - - @Override - public NotifyDescriptor createInput() { - return new NotifyDescriptor.InputLine("DEFAULT", Bundle.DatasourceName()); //NOI18N - } - - @Override - public Step getNext() { - return new OverwriteStep().prepare(result, lookup); - } - - @Override - public void setValue(String selected) { - result.datasourceName = selected; - } - - @Override - public Result getValue() { - return result; - } - - @Override - public boolean onlyOneChoice() { - return false; - } - - } - - class OverwriteStep implements Step { - - private Result result; - private Set dsNames; - private String choice; - private Lookup lookup; - - @Override - public Step prepare(Result result, Lookup lookup) { - this.lookup = lookup; - this.result = result; - if (result.datasourceName == null || result.datasourceName.isEmpty()) { - return this; - } - List secrets = SecretNode.getSecrets().apply(result.vault); - this.dsNames = secrets.stream() - .map(s -> extractDatasourceName(s.getName())) - .filter(Objects::nonNull) - .collect(Collectors.toSet()); - return this; - } - - @Override - public NotifyDescriptor createInput() { - if (result.datasourceName == null || result.datasourceName.isEmpty()) { - return new NotifyDescriptor.QuickPick("", Bundle.DatasourceEmpty(), Collections.emptyList(), false); - } - List yesNo = new ArrayList(); - yesNo.add(new Item(Bundle.AddVersion(), "")); - yesNo.add(new Item(Bundle.Cancel(), "")); - return new NotifyDescriptor.QuickPick("", Bundle.SecretExists(result.datasourceName), yesNo, false); - } - - @Override - public Step getNext() { - return new PasswordStep().prepare(result, lookup); - } - - @Override - public void setValue(String choice) { - this.choice = choice; - } - - @Override - public Result getValue() { - if (Bundle.AddVersion().equals(choice) || onlyOneChoice()) { - result.update = true; - return result; - } - return null; - } - - @Override - public boolean onlyOneChoice() { - return dsNames != null && !dsNames.contains(result.datasourceName); - } - - } - - class PasswordStep implements Step { - private Result item; - private boolean ask; - private Lookup lookup; - - @Override - public Step prepare(Result item, Lookup lookup) { - this.lookup = lookup; - item.password = context.getPassword(); - ask = item.password == null || item.password.isEmpty(); - this.item = item; - return this; - } - - @Override - public NotifyDescriptor createInput() { - return new NotifyDescriptor.PasswordLine("DEFAULT", Bundle.Password(context.getUser())); //NOI18N - } - - @Override - public boolean onlyOneChoice() { - return !ask; - } - - @Override - public Step getNext() { - return new DevopsStep().prepare(item, lookup); - } - - @Override - public void setValue(String password) { - item.password = password; - } - - @Override - public Result getValue() { - return item; - } - } - - class DevopsStep implements Step { - private Result item; - private Map devopsProjects; - private Lookup lookup; - - @Override - public Step prepare(Result item, Lookup lookup) { - this.item = item; - this.lookup = lookup; - ProgressHandle h = ProgressHandle.createHandle(Bundle.MSG_CollectingItems()); - h.start(); - h.progress(Bundle.MSG_CollectingItems_Text()); - try { - List devops = DevopsProjectService.getDevopsProjectOcid(); - - Map allProjectsInCompartment = getDevopsProjects(item.vault.getCompartmentId()); - Map filtered = allProjectsInCompartment.entrySet() - .stream() - .filter(e -> devops.contains(e.getValue().getKey().getValue())) - .collect(Collectors - .toMap(Entry::getKey, Entry::getValue)); - if (filtered.size() > 0) { - devopsProjects = filtered; - } else { - devopsProjects = allProjectsInCompartment; - } - if (devopsProjects.size() == 1) { - item.project = devopsProjects.values().iterator().next(); - } - - } finally { - h.finish(); - } - return this; - } - - @Override - public NotifyDescriptor createInput() { - if (devopsProjects.size() > 1) { - return createQuickPick(devopsProjects, Bundle.SelectDevopsProject()); - } - if (devopsProjects.isEmpty()) { - return new NotifyDescriptor.QuickPick("", Bundle.NoDevopsProjects(), Collections.emptyList(), false); - } - throw new IllegalStateException("No data to create input"); // NOI18N - } - - @Override - public boolean onlyOneChoice() { - return devopsProjects.size() == 1; - } - - @Override - public Step getNext() { - NextStepProvider nsProvider = lookup.lookup(NextStepProvider.class); - if (nsProvider != null) { - Step ns = nsProvider.nextStepFor(this); - if (ns != null) { - return ns.prepare(getValue(), lookup); - } - } - return null; - } - - @Override - public void setValue(String projectName) { - item.project = devopsProjects.get(projectName); - } - - @Override - public Result getValue() { - return item; - } - } - - static final class Result { - VaultItem vault; - KeyItem key; - String datasourceName; - String password; - DevopsProjectItem project; - private boolean update; - } @Override public void actionPerformed(ActionEvent e) { NextStepProvider nsProvider = NextStepProvider.builder() - .stepForClass(Steps.CompartmentStep.class, (s) -> new VaultStep()) + .stepForClass(CompartmentStep.class, (s) -> new VaultStep()) + .stepForClass(VaultStep.class, (s) -> new KeyStep()) + .stepForClass(KeyStep.class, (s) -> new DatasourceNameStep()) + .stepForClass(DatasourceNameStep.class, (s) -> new OverwriteStep()) + .stepForClass(OverwriteStep.class, (s) -> new PasswordStep(context.getPassword(), context.getUser())) + .stepForClass(PasswordStep.class, (s) -> new DevopsStep()) .stepForClass(DevopsStep.class, (s) -> new ProjectStep()) .build(); Lookup lookup = Lookups.fixed(nsProvider); - Steps.getDefault().executeMultistep(new TenancyStep(), lookup).thenAccept(r -> { - Result result = ((Pair) r).second(); - Project project = ((Pair) r).first(); - if (result.datasourceName == null || result.datasourceName.isEmpty()) { + Steps.getDefault().executeMultistep(new TenancyStep(), lookup).thenAccept(vals -> { + Project project = vals.getValueForStep(ProjectStep.class); + DevopsProjectItem devopsProject = vals.getValueForStep(DevopsStep.class); + String datasourceName = vals.getValueForStep(DatasourceNameStep.class); + VaultItem vault = vals.getValueForStep(VaultStep.class); + KeyItem key = vals.getValueForStep(KeyStep.class); + String password = vals.getValueForStep(PasswordStep.class); + if (datasourceName == null || datasourceName.isEmpty()) { NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.DatasourceEmpty()); DialogDisplayer.getDefault().notify(msg); return; } - addDbConnectionToVault(result, project); + addDbConnectionToVault(vault, key, project, devopsProject, datasourceName, password); }); } - private void addDbConnectionToVault(Result item, Project project) { - ProgressHandle h = ProgressHandle.createHandle(Bundle.UpdatingVault(item.vault.getName())); + private void addDbConnectionToVault(VaultItem vault, KeyItem key, Project project, DevopsProjectItem devopsProject, String datasourceName, String password) { + ProgressHandle h = ProgressHandle.createHandle(Bundle.UpdatingVault(vault.getName())); h.start(); h.progress(Bundle.ReadingSecrets()); @@ -504,20 +158,20 @@ private void addDbConnectionToVault(Result item, Project project) { VaultsClient client = VaultsClient.builder().build(getDefault().getActiveProfile().getConfigProvider()); ListSecretsRequest listSecretsRequest = ListSecretsRequest.builder() - .compartmentId(item.vault.getCompartmentId()) - .vaultId(item.vault.getKey().getValue()) + .compartmentId(vault.getCompartmentId()) + .vaultId(vault.getKey().getValue()) .limit(88) .build(); ListSecretsResponse secrets = client.listSecrets(listSecretsRequest); - Map existingSecrets = secrets.getItems().stream() - .collect(Collectors.toMap(s -> s.getSecretName(), s -> s.getId())); + Map existingSecrets = secrets.getItems().stream() + .collect(Collectors.toMap(s -> s.getSecretName(), s -> s.getId())); Map values = new HashMap() { { put("Username", context.getUser()); //NOI18N - put("Password", item.password); //NOI18N + put("Password", password); //NOI18N put("OCID", (String) context.getConnectionProperties().get("OCID")); //NOI18N put("CompartmentOCID", (String) context.getConnectionProperties().get("CompartmentOCID")); //NOI18N put("wallet_Password", UUID.randomUUID().toString()); //NOI18N @@ -525,7 +179,7 @@ private void addDbConnectionToVault(Result item, Project project) { }; for (Entry entry : values.entrySet()) { - String secretName = "DATASOURCES_" + item.datasourceName + "_" + entry.getKey().toUpperCase(); //NOI18N + String secretName = "DATASOURCES_" + datasourceName + "_" + entry.getKey().toUpperCase(); //NOI18N String base64Content = Base64.getEncoder().encodeToString(entry.getValue().getBytes(StandardCharsets.UTF_8)); SecretContentDetails contentDetails = Base64SecretContentDetails.builder() @@ -553,9 +207,9 @@ private void addDbConnectionToVault(Result item, Project project) { .secretContent(contentDetails) .secretRules(new ArrayList<>(Arrays.asList(SecretReuseRule.builder() .isEnforcedOnDeletedSecretVersions(false).build()))) - .compartmentId(item.vault.getCompartmentId()) - .vaultId(item.vault.getKey().getValue()) - .keyId(item.key.getKey().getValue()) + .compartmentId(vault.getCompartmentId()) + .vaultId(vault.getKey().getValue()) + .keyId(key.getKey().getValue()) .build(); CreateSecretRequest request = CreateSecretRequest .builder() @@ -575,13 +229,13 @@ private void addDbConnectionToVault(Result item, Project project) { // Add Vault to the ConfigMap artifact DevopsClient devopsClient = DevopsClient.builder().build(OCIManager.getDefault().getActiveProfile().getConfigProvider()); ListDeployArtifactsRequest request = ListDeployArtifactsRequest.builder() - .projectId(item.project.getKey().getValue()).build(); + .projectId(devopsProject.getKey().getValue()).build(); ListDeployArtifactsResponse response = devopsClient.listDeployArtifacts(request); List artifacts = response.getDeployArtifactCollection().getItems(); boolean found = false; for (DeployArtifactSummary artifact : artifacts) { - if ((item.project.getName() + "_oke_configmap").equals(artifact.getDisplayName())) { //NOI18N - h.progress("updating " + item.project.getName() + "_oke_configmap"); //NOI18N + if ((devopsProject.getName() + "_oke_configmap").equals(artifact.getDisplayName())) { //NOI18N + h.progress("updating " + devopsProject.getName() + "_oke_configmap"); //NOI18N found = true; GetDeployArtifactRequest artRequest = GetDeployArtifactRequest.builder().deployArtifactId(artifact.getId()).build(); GetDeployArtifactResponse artResponse = devopsClient.getDeployArtifact(artRequest); @@ -589,7 +243,7 @@ private void addDbConnectionToVault(Result item, Project project) { if (source instanceof InlineDeployArtifactSource) { byte[] content = ((InlineDeployArtifactSource) source).getBase64EncodedContent(); String srcString = updateProperties(new String(content, StandardCharsets.UTF_8), - item.vault.getCompartmentId(), item.vault.getKey().getValue(), item.datasourceName); + vault.getCompartmentId(), vault.getKey().getValue(), datasourceName); byte[] base64Content = Base64.getEncoder().encode(srcString.getBytes(StandardCharsets.UTF_8)); DeployArtifactSource updatedSource = InlineDeployArtifactSource.builder() .base64EncodedContent(base64Content).build(); @@ -605,7 +259,7 @@ private void addDbConnectionToVault(Result item, Project project) { } } if (!found) { - NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.NoConfigMap(item.project.getName()), NotifyDescriptor.WARNING_MESSAGE); + NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.NoConfigMap(devopsProject.getName()), NotifyDescriptor.WARNING_MESSAGE); DialogDisplayer.getDefault().notify(msg); } NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.SecretsCreated()); @@ -644,7 +298,7 @@ protected static String updateProperties(String configmap, String compartmentOci path.entrySet().removeIf(entry -> entry.getKey() >= f); if (propertiesName != null) { int propIndent = previousIndent; - if (properties.size() == 0) { + if (properties.isEmpty()) { propIndent = indent + 2; } output.append( @@ -716,63 +370,4 @@ private static String formatProperties(String proprtiesName, Map return output.toString(); } - private static NotifyDescriptor.QuickPick createQuickPick(Map ociItems, String title) { - - List items = ociItems.entrySet().stream() - .map(entry -> new NotifyDescriptor.QuickPick.Item(entry.getKey(), entry.getValue().getDescription())) - .collect(Collectors.toList()); - return new NotifyDescriptor.QuickPick(title, title, items, false); - } - - protected static Map getDevopsProjects(String compartmentId) { - try (DevopsClient client = new DevopsClient(OCIManager.getDefault().getConfigProvider());) { - ListProjectsRequest request = ListProjectsRequest.builder().compartmentId(compartmentId).build(); - ListProjectsResponse response = client.listProjects(request); - - List projects = response.getProjectCollection().getItems(); - for (ProjectSummary project : projects) { - project.getNotificationConfig().getTopicId(); - - } - return projects.stream() - .map(p -> new DevopsProjectItem(OCID.of(p.getId(), "DevopsProject"), // NOI18N - compartmentId, - p.getName())) - .collect(Collectors.toMap(DevopsProjectItem::getName, Function.identity())); - } - } - - protected static Map getVaults(OCIItem parent) { - Map items = new HashMap<>(); - try { - if (parent instanceof CompartmentItem) { - VaultNode.getVaults().apply((CompartmentItem) parent).forEach((db) -> items.put(db.getName(), db)); - } - } catch (BmcException e) { - LOG.log(Level.SEVERE, "Unable to load vault list", e); //NOI18N - } - return items; - } - - protected static Map getKeys(OCIItem parent) { - Map items = new HashMap<>(); - try { - if (parent instanceof VaultItem) { - KeyNode.getKeys().apply((VaultItem) parent).forEach(key -> items.put(key.getName(), key)); - } - } catch (BmcException e) { - LOG.log(Level.SEVERE, "Unable to load key list", e); //NOI18N - } - return items; - } - - static Pattern p = Pattern.compile("[A-Z]*_([a-zA-Z0-9]*)_[A-Z]*"); //NOI18N - - protected static String extractDatasourceName(String value) { - Matcher m = p.matcher(value); - if (m.matches()) { - return m.group(1); - } - return null; - } } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/ConfigMapCommand.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/ConfigMapCommand.java new file mode 100644 index 000000000000..7348bd14963f --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/ConfigMapCommand.java @@ -0,0 +1,379 @@ +/* + * 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.cloud.oracle.actions; + +import com.oracle.bmc.devops.DevopsClient; +import com.oracle.bmc.devops.model.DeployArtifactSource; +import com.oracle.bmc.devops.model.DeployArtifactSummary; +import com.oracle.bmc.devops.model.InlineDeployArtifactSource; +import com.oracle.bmc.devops.model.UpdateDeployArtifactDetails; +import com.oracle.bmc.devops.requests.GetDeployArtifactRequest; +import com.oracle.bmc.devops.requests.ListDeployArtifactsRequest; +import com.oracle.bmc.devops.requests.UpdateDeployArtifactRequest; +import com.oracle.bmc.devops.responses.GetDeployArtifactResponse; +import com.oracle.bmc.devops.responses.ListDeployArtifactsResponse; +import com.oracle.bmc.model.BmcException; +import com.oracle.bmc.vault.VaultsClient; +import com.oracle.bmc.vault.model.Base64SecretContentDetails; +import com.oracle.bmc.vault.model.CreateSecretDetails; +import com.oracle.bmc.vault.model.SecretContentDetails; +import com.oracle.bmc.vault.model.SecretReuseRule; +import com.oracle.bmc.vault.model.UpdateSecretDetails; +import com.oracle.bmc.vault.requests.CreateSecretRequest; +import com.oracle.bmc.vault.requests.ListSecretsRequest; +import com.oracle.bmc.vault.requests.UpdateSecretRequest; +import com.oracle.bmc.vault.responses.ListSecretsResponse; +import com.oracle.bmc.vault.responses.UpdateSecretResponse; +import java.io.StringWriter; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import org.netbeans.modules.cloud.oracle.steps.DevopsStep; +import java.util.Arrays; +import java.util.Base64; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; +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.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import org.netbeans.api.db.explorer.ConnectionManager; +import org.netbeans.api.db.explorer.DatabaseConnection; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.api.project.Project; +import org.netbeans.modules.cloud.oracle.OCIManager; +import static org.netbeans.modules.cloud.oracle.OCIManager.getDefault; +import org.netbeans.modules.cloud.oracle.assets.CloudAssets; +import org.netbeans.modules.cloud.oracle.assets.DependencyUtils; +import org.netbeans.modules.cloud.oracle.assets.PropertiesGenerator; +import org.netbeans.modules.cloud.oracle.assets.Steps; +import org.netbeans.modules.cloud.oracle.database.DatabaseItem; +import org.netbeans.modules.cloud.oracle.devops.DevopsProjectItem; +import org.netbeans.modules.cloud.oracle.steps.DatasourceNameStep; +import org.netbeans.modules.cloud.oracle.steps.KeyStep; +import org.netbeans.modules.cloud.oracle.steps.OverwriteStep; +import org.netbeans.modules.cloud.oracle.steps.PasswordStep; +import org.netbeans.modules.cloud.oracle.steps.ProjectStep; +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.netbeans.modules.cloud.oracle.steps.CompartmentStep; +import org.netbeans.modules.cloud.oracle.steps.TenancyStep; +import org.netbeans.modules.cloud.oracle.vault.KeyItem; +import org.netbeans.modules.cloud.oracle.vault.VaultItem; +import org.netbeans.spi.lsp.CommandProvider; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; +import org.openide.util.lookup.Lookups; +import org.openide.util.lookup.ServiceProvider; + +/** + * Command that updates a ConfigMap with the current properties generated from the contents of {@link CloudAssets}. + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "SuggestVault=For better security when using Autonomous Database, be sure to also add OCI Vault.", + "UpdatingConfigMap=Updating Config Map", + "CMUpdated=ConfigMap in \"{0}\" project was updated" +}) +@ServiceProvider(service = CommandProvider.class) +public class ConfigMapCommand implements CommandProvider { + + private static final Logger LOG = Logger.getLogger(ConfigMapCommand.class.getName()); + + private static final String COMMAND_UPLOAD_TO_CONFIGMAP = "nbls.cloud.assets.configmap.upload"; //NOI18N + + private static final Set COMMANDS = new HashSet<>(Arrays.asList( + COMMAND_UPLOAD_TO_CONFIGMAP + )); + + @Override + public Set getCommands() { + return Collections.unmodifiableSet(COMMANDS); + } + + @Override + public CompletableFuture runCommand(String command, List arguments) { + Steps.NextStepProvider.Builder nsProviderBuilder = Steps.NextStepProvider.builder(); + CompletableFuture future = new CompletableFuture(); + + nsProviderBuilder.stepForClass(TenancyStep.class, (s) -> new CompartmentStep()) + .stepForClass(CompartmentStep.class, (s) -> new DevopsStep()) + .stepForClass(DevopsStep.class, (s) -> new ProjectStep()); + + Collection items = CloudAssets.getDefault().getAssignedItems(); + AtomicReference vaultRef = new AtomicReference<>(); + AtomicReference dbRef = new AtomicReference<>(); + for (OCIItem item : items) { + if (item instanceof VaultItem) { + vaultRef.set((VaultItem) item); + nsProviderBuilder.stepForClass(PasswordStep.class, (s) -> new KeyStep(vaultRef.get())); + } else if (item instanceof DatabaseItem) { + dbRef.set((DatabaseItem) item); + DatabaseConnection conn = null; + DatabaseConnection[] connections = ConnectionManager.getDefault().getConnections(); + for (int i = 0; i < connections.length; i++) { + if (item.getKey().getValue().equals( + connections[i].getConnectionProperties().get("OCID"))) { //NOI18N + conn = connections[i]; + break; + } + } + String user, password; + if (conn != null) { + user = conn.getUser(); + password = conn.getPassword(); + } else { + user = null; + password = null; + } + nsProviderBuilder.stepForClass(ProjectStep.class, (s) -> new PasswordStep(user, password)); + } + } + + if (vaultRef.get() == null && dbRef.get() != null) { + NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.SuggestVault(), NotifyDescriptor.INFORMATION_MESSAGE); + DialogDisplayer.getDefault().notifyLater(msg); + } + + Lookup lookup = Lookups.fixed(nsProviderBuilder.build()); + Steps.getDefault() + .executeMultistep(new TenancyStep(), lookup) + .thenAccept(values -> { + Project project = values.getValueForStep(ProjectStep.class); + KeyItem key = values.getValueForStep(KeyStep.class); + DevopsProjectItem devopsProject = values.getValueForStep(DevopsStep.class); + + ProgressHandle h = ProgressHandle.createHandle(Bundle.UpdatingConfigMap()); + try { + PropertiesGenerator propGen = new PropertiesGenerator(false); + if (vaultRef.get() != null) { + updateVault(h, key, vaultRef.get(), propGen, project); + } + if (updateConfigMap(h, devopsProject, propGen, command)) { + NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.CMUpdated(devopsProject.getName()), NotifyDescriptor.INFORMATION_MESSAGE); + DialogDisplayer.getDefault().notifyLater(msg); + } else { + NotifyDescriptor.Message msg = new NotifyDescriptor.Message(org.netbeans.modules.cloud.oracle.actions.Bundle.NoConfigMap(devopsProject.getName()), NotifyDescriptor.WARNING_MESSAGE); + DialogDisplayer.getDefault().notifyLater(msg); + } + future.complete(null); + } catch(ThreadDeath e) { + future.completeExceptionally(e); + throw e; + } catch (Throwable e) { + future.completeExceptionally(e); + NotifyDescriptor.Message msg = new NotifyDescriptor.Message(e.getMessage(), NotifyDescriptor.WARNING_MESSAGE); + DialogDisplayer.getDefault().notify(msg); + } finally { + h.finish(); + } + }); + return future; + } + + private boolean updateConfigMap(ProgressHandle h, DevopsProjectItem devopsProject, PropertiesGenerator propGen, String datasourceName) { + // Add Vault to the ConfigMap artifact + DevopsClient devopsClient = DevopsClient.builder().build(OCIManager.getDefault().getActiveProfile().getConfigProvider()); + ListDeployArtifactsRequest request = ListDeployArtifactsRequest.builder() + .projectId(devopsProject.getKey().getValue()).build(); + ListDeployArtifactsResponse response = devopsClient.listDeployArtifacts(request); + List artifacts = response.getDeployArtifactCollection().getItems(); + boolean found = false; + for (DeployArtifactSummary artifact : artifacts) { + if ((devopsProject.getName() + "_oke_configmap").equals(artifact.getDisplayName())) { //NOI18N + h.progress("updating " + devopsProject.getName() + "_oke_configmap"); //NOI18N + found = true; + GetDeployArtifactRequest artRequest = GetDeployArtifactRequest.builder().deployArtifactId(artifact.getId()).build(); + GetDeployArtifactResponse artResponse = devopsClient.getDeployArtifact(artRequest); + DeployArtifactSource source = artResponse.getDeployArtifact().getDeployArtifactSource(); + if (source instanceof InlineDeployArtifactSource) { + byte[] content = ((InlineDeployArtifactSource) source).getBase64EncodedContent(); + String srcString = updateProperties(new String(content, StandardCharsets.UTF_8), propGen); + byte[] base64Content = Base64.getEncoder().encode(srcString.getBytes(StandardCharsets.UTF_8)); + DeployArtifactSource updatedSource = InlineDeployArtifactSource.builder() + .base64EncodedContent(base64Content).build(); + UpdateDeployArtifactDetails updateArtifactDetails = UpdateDeployArtifactDetails.builder() + .deployArtifactSource(updatedSource) + .build(); + UpdateDeployArtifactRequest updateArtifactRequest = UpdateDeployArtifactRequest.builder() + .updateDeployArtifactDetails(updateArtifactDetails) + .deployArtifactId(artifact.getId()) + .build(); + devopsClient.updateDeployArtifact(updateArtifactRequest); + } + } + } + return found; + } + + private void updateVault(ProgressHandle h, KeyItem key, VaultItem vault, PropertiesGenerator propGen, Project project) { + h.progress(Bundle.UpdatingVault(vault.getName())); + VaultsClient client = VaultsClient.builder().build(getDefault().getActiveProfile().getConfigProvider()); + ListSecretsRequest listSecretsRequest = ListSecretsRequest.builder() + .compartmentId(vault.getCompartmentId()) + .vaultId(vault.getKey().getValue()) + .limit(88) + .build(); + ListSecretsResponse secrets = client.listSecrets(listSecretsRequest); + Map existingSecrets = secrets.getItems().stream() + .collect(Collectors.toMap(s -> s.getSecretName(), s -> s.getId())); + + for (Map.Entry entry : propGen.getVaultSecrets().entrySet()) { + String secretName = entry.getKey(); + String base64Content = Base64.getEncoder().encodeToString(entry.getValue().getBytes(StandardCharsets.UTF_8)); + + SecretContentDetails contentDetails = Base64SecretContentDetails.builder() + .content(base64Content) + .stage(SecretContentDetails.Stage.Current).build(); + if (existingSecrets.containsKey(secretName)) { + h.progress(Bundle.UpdatingSecret(secretName)); + UpdateSecretDetails updateSecretDetails = UpdateSecretDetails.builder() + .secretContent(contentDetails) + .build(); + UpdateSecretRequest request = UpdateSecretRequest.builder() + .secretId(existingSecrets.get(secretName)) + .updateSecretDetails(updateSecretDetails) + .build(); + try { + UpdateSecretResponse response = client.updateSecret(request); + } catch (BmcException ex) { + // Update fails if the new value is same as the current one. It is safe to ignore + LOG.log(Level.WARNING, "Update of secret failed", ex); + } + } else { + h.progress(Bundle.CreatingSecret(secretName)); + CreateSecretDetails createDetails = CreateSecretDetails.builder() + .secretName(secretName) + .secretContent(contentDetails) + .secretRules(new ArrayList<>(Arrays.asList(SecretReuseRule.builder() + .isEnforcedOnDeletedSecretVersions(false).build()))) + .compartmentId(vault.getCompartmentId()) + .vaultId(vault.getKey().getValue()) + .keyId(key.getKey().getValue()) + .build(); + CreateSecretRequest request = CreateSecretRequest + .builder() + .createSecretDetails(createDetails) + .build(); + client.createSecret(request); + } + } + + // Add Vault dependency to the project + try { + DependencyUtils.addDependency(project, "io.micronaut.oraclecloud", "micronaut-oraclecloud-vault"); + } catch (IllegalStateException e) { + LOG.log(Level.INFO, "Unable to add Vault dependency", e); + } + } + + protected static String updateProperties(String configmap, PropertiesGenerator propGen) { + StringWriter output = new StringWriter(); + String[] lines = configmap.split("\n"); + int previousIndent = 0; + Map path = new LinkedHashMap<>(); + String propertiesName = null; + Map properties = new LinkedHashMap<>(); + for (int i = 0; i < lines.length; i++) { + String line = lines[i]; + if (line.trim().startsWith("#") || line.isEmpty()) { + output.append(line); + output.append("\n"); + continue; + } + int indent = 0; + while (line.charAt(indent) == ' ') { + indent++; + } + if (previousIndent > indent || (propertiesName != null && !line.contains("="))) { + final int f = indent; + path.entrySet().removeIf(entry -> entry.getKey() >= f); + if (propertiesName != null) { + int propIndent = previousIndent; + if (properties.isEmpty()) { + propIndent = indent + 2; + } + output.append( + formatProperties(propertiesName, properties, propIndent, propGen)); + + properties.clear(); + } + propertiesName = null; + if (line.trim().equals("---")) { //NOI18N + output.append(line); + output.append("\n"); + continue; + } + } + if (propertiesName == null) { + if (line.indexOf(':') < 0) { + throw new IllegalStateException("Invalid ConfigMap format"); //NOI18N + } + String k = line.substring(0, line.indexOf(':')).trim(); + String v = line.substring(line.indexOf(':') + 1).trim(); + if (k == null) { + throw new IllegalStateException(); + } + + path.put(indent, k); + output.append(line); + output.append("\n"); + if (v.trim().equals("|")) { + propertiesName = k; + continue; + } + } + if (propertiesName != null && line.contains("=")) { + properties.put(line.substring(0, line.indexOf('=')).trim(), + line.substring(line.indexOf('=') + 1).trim()); + } + previousIndent = indent; + } + output.append(formatProperties(propertiesName, properties, previousIndent, propGen)); + + return output.toString(); + } + + + private static String formatProperties(String proprtiesName, Map prop, int indent, PropertiesGenerator propGen) { + StringBuilder output = new StringBuilder(); + prop.entrySet().removeIf(entry -> propGen.getAllPropertiesNames().contains(entry.getKey())); + if (proprtiesName.startsWith("bootstrap")) { // NOI18N + prop.putAll(propGen.getBootstrap()); + } else if (proprtiesName.startsWith("application")) { // NOI18N + prop.putAll(propGen.getApplication()); + } + for (Map.Entry entry : prop.entrySet()) { + output.append(new String(new char[indent]).replace('\0', ' ')); + output.append(entry.getKey()); + output.append("="); + output.append(entry.getValue()); + output.append("\n"); + } + return output.toString(); + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java index e3e2f3164236..7daa765138c6 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java @@ -149,8 +149,9 @@ void addConnection(DownloadWalletDialog.WalletInfo p) { } } Properties props = new Properties(); - props.put("OCID", p.getOcid()); //NOI18N - props.put("CompartmentOCID", p.getComaprtmentId()); //NOI18N + props.put("OCID", p.getDb().getKey().getValue()); //NOI18N + props.put("CompartmentOCID", p.getDb().getCompartmentId()); //NOI18N + props.put("Description", p.getDb().getDescription()); String dbUrl = MessageFormat.format(URL_TEMPLATE, connectionName, BaseUtilities.escapeParameters(new String[] { walletPath.toString() })); DatabaseConnection dbConn = DatabaseConnection.create( drivers[0], diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.java index 8b84c7d42209..ae5dc56ee182 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletDialog.java @@ -18,17 +18,16 @@ */ package org.netbeans.modules.cloud.oracle.actions; -import org.netbeans.modules.cloud.oracle.items.OCIItem; import java.awt.Dialog; import java.awt.GraphicsEnvironment; import java.io.File; import java.io.IOException; -import java.util.Arrays; import java.util.Locale; import java.util.Optional; import javax.swing.JFileChooser; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import org.netbeans.modules.cloud.oracle.database.DatabaseItem; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; @@ -74,7 +73,7 @@ final class DownloadWalletDialog extends AbstractPasswordPanel { dbPasswordField.getDocument().addDocumentListener(docListener); } - static Optional showDialog(OCIItem db) { + static Optional showDialog(DatabaseItem db) { File home = new File(System.getProperty("user.home")); //NOI18N String lastUsedDir = NbPreferences.forModule(DownloadWalletAction.class).get(LAST_USED_DIR, home.getAbsolutePath()); //NOI18N @@ -92,7 +91,7 @@ static Optional showDialog(OCIItem db) { String dbUser = dlgPanel.dbUserField.getText(); char[] dbPasswd = dlgPanel.dbPasswordField.getPassword(); NbPreferences.forModule(DownloadWalletAction.class).put(LAST_USED_DIR, path); //NOI18N - return Optional.of(new WalletInfo(path, generatePassword(), dbUser, dbPasswd, db.getKey().getValue(), db.getCompartmentId())); + return Optional.of(new WalletInfo(path, generatePassword(), dbUser, dbPasswd, db)); } } else { try { @@ -111,7 +110,7 @@ static Optional showDialog(OCIItem db) { return Optional.empty(); } char[] password = inp.getInputText().toCharArray(); - return Optional.of(new WalletInfo(walletsDir.getAbsolutePath(), generatePassword(), username, password, db.getKey().getValue(), db.getCompartmentId())); + return Optional.of(new WalletInfo(walletsDir.getAbsolutePath(), generatePassword(), username, password, (DatabaseItem) db)); } catch (IOException ex) { Exceptions.printStackTrace(ex); } @@ -306,16 +305,14 @@ static class WalletInfo { private final char[] walletPassword; private final String dbUser; private char[] dbPassword; - private final String ocid; - private final String comaprtmentId; + private final DatabaseItem db; - public WalletInfo(String path, char[] walletPassword, String dbUser, char[] dbPassword, String ocid, String comaprtmentOcid) { + public WalletInfo(String path, char[] walletPassword, String dbUser, char[] dbPassword, DatabaseItem db) { this.path = path; this.walletPassword = walletPassword; this.dbUser = dbUser; this.dbPassword = dbPassword; - this.ocid = ocid; - this.comaprtmentId = comaprtmentOcid; + this.db = db; } public String getPath() { @@ -334,12 +331,8 @@ public char[] getDbPassword() { return dbPassword; } - public String getOcid() { - return ocid; - } - - public String getComaprtmentId() { - return comaprtmentId; + public DatabaseItem getDb() { + return db; } } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/Step.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AbstractStep.java similarity index 69% rename from enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/Step.java rename to enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AbstractStep.java index 3bb8721dd13c..a30e56c2e2f1 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/Step.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AbstractStep.java @@ -18,25 +18,23 @@ */ package org.netbeans.modules.cloud.oracle.assets; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; import org.openide.NotifyDescriptor; -import org.openide.util.Lookup; /** * * @author Jan Horvath */ -public interface Step { - - Step prepare(T item, Lookup lookup); - - NotifyDescriptor createInput(); +public abstract class AbstractStep { //implements Step { + + public void prepare(ProgressHandle handle, Values values) { } - boolean onlyOneChoice(); + public abstract NotifyDescriptor createInput(); - Step getNext(); + public abstract boolean onlyOneChoice(); - void setValue(String selected); + public abstract void setValue(String selected); - U getValue(); - + public abstract U getValue(); } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddNewAssetCommand.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddNewAssetCommand.java index c98adcfce38a..dcfa8e51d569 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddNewAssetCommand.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddNewAssetCommand.java @@ -18,6 +18,9 @@ */ package org.netbeans.modules.cloud.oracle.assets; +import org.netbeans.modules.cloud.oracle.steps.SuggestedStep; +import org.netbeans.modules.cloud.oracle.steps.ProjectStep; +import org.netbeans.modules.cloud.oracle.steps.CompartmentStep; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -27,22 +30,20 @@ import java.util.Set; import java.util.concurrent.CompletableFuture; import org.netbeans.api.project.Project; -import org.netbeans.modules.cloud.oracle.assets.Steps.ItemTypeStep; +import org.netbeans.modules.cloud.oracle.actions.AddADBAction; +import org.netbeans.modules.cloud.oracle.database.DatabaseItem; +import org.netbeans.modules.cloud.oracle.steps.ItemTypeStep; import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.netbeans.modules.cloud.oracle.steps.DatabaseConnectionStep; +import org.netbeans.modules.cloud.oracle.steps.TenancyStep; import org.netbeans.spi.lsp.CommandProvider; -import org.openide.util.Lookup; -import org.openide.util.NbBundle; -import org.openide.util.Pair; +import org.openide.util.lookup.Lookups; import org.openide.util.lookup.ServiceProvider; /** * * @author Jan Horvath */ -@NbBundle.Messages({ - "NoProjects=No Project Found", - "SelectProject=Select Project to Update Dependencies", - "SelectResourceType=Select Resource Type"}) @ServiceProvider(service = CommandProvider.class) public class AddNewAssetCommand implements CommandProvider { @@ -68,20 +69,48 @@ public Set getCommands() { @Override public CompletableFuture runCommand(String command, List arguments) { CompletableFuture future = new CompletableFuture(); + Steps.NextStepProvider nsProvider = Steps.NextStepProvider.builder() + .stepForClass(ItemTypeStep.class, (s) -> { + if ("Databases".equals(s.getValue())) { + return new DatabaseConnectionStep(); + } + return new TenancyStep(); + }).stepForClass(TenancyStep.class, (s) -> new CompartmentStep()) + .stepForClass(CompartmentStep.class, (s) -> new SuggestedStep(null)) + .stepForClass(SuggestedStep.class, (s) -> new ProjectStep()) + .build(); Steps.getDefault() - .executeMultistep(new ItemTypeStep(), Lookup.EMPTY) - .thenAccept(result -> { - Project project = ((Pair) result).first(); - OCIItem item = ((Pair) result).second(); - CloudAssets.getDefault().addItem(item); - String[] art = DEP_MAP.get(item.getKey().getPath()); - try { - DependencyUtils.addDependency(project, art[0], art[1]); - } catch (IllegalStateException e) { - future.completeExceptionally(e); + .executeMultistep(new ItemTypeStep(), Lookups.fixed(nsProvider)) + .thenAccept(values -> { + Project project = values.getValueForStep(ProjectStep.class); + CompletableFuture item; + if ("Databases".equals(values.getValueForStep(ItemTypeStep.class))) { + DatabaseItem i = values.getValueForStep(DatabaseConnectionStep.class); + if (i == null) { + item = new AddADBAction().addADB(); + } else { + item = CompletableFuture.completedFuture(i); + } + } else { + OCIItem i = values.getValueForStep(SuggestedStep.class); + if (i == null) { + future.cancel(true); + return; + } else { + item = CompletableFuture.completedFuture(i); + } } + item.thenAccept(i -> { + CloudAssets.getDefault().addItem(i); + String[] art = DEP_MAP.get(i.getKey().getPath()); + try { + DependencyUtils.addDependency(project, art[0], art[1]); + future.complete(null); + } catch (IllegalStateException e) { + future.completeExceptionally(e); + } + }); }); - future.complete(null); return future; } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddSuggestedItemAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddSuggestedItemAction.java index 6e6a7815fb1e..9b33a57d6fa4 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddSuggestedItemAction.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddSuggestedItemAction.java @@ -18,23 +18,21 @@ */ package org.netbeans.modules.cloud.oracle.assets; +import org.netbeans.modules.cloud.oracle.steps.SuggestedStep; +import org.netbeans.modules.cloud.oracle.steps.CompartmentStep; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.HashMap; -import java.util.Map; import java.util.logging.Logger; -import org.netbeans.api.db.explorer.ConnectionManager; -import org.netbeans.api.db.explorer.DatabaseConnection; import org.netbeans.modules.cloud.oracle.actions.AddADBAction; -import org.netbeans.modules.cloud.oracle.assets.Steps.DatabaseConnectionStep; -import org.netbeans.modules.cloud.oracle.assets.Steps.TenancyStep; +import org.netbeans.modules.cloud.oracle.steps.DatabaseConnectionStep; +import org.netbeans.modules.cloud.oracle.steps.TenancyStep; import org.netbeans.modules.cloud.oracle.database.DatabaseItem; -import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; import org.openide.awt.ActionID; import org.openide.awt.ActionRegistration; import org.openide.util.Lookup; import org.openide.util.NbBundle; +import org.openide.util.RequestProcessor; import org.openide.util.lookup.Lookups; /** @@ -52,22 +50,12 @@ @NbBundle.Messages({ "AddSuggestedItem=Add Suggested Oracle Cloud Resource", - "SelectProfile=Select OCI Profile", "# {0} - tenancy name", "# {1} - region id", - "SelectProfile_Description={0} (region: {1})", - "SelectCompartment=Select Compartment", - "NoProfile=There is not any OCI profile in the config", "NoCompartment=There are no compartments in the Tenancy", "CollectingProfiles=Searching for OCI Profiles", - "CollectingProfiles_Text=Loading OCI Profiles", - "CollectingItems=Loading OCI contents", - "CollectingItems_Text=Listing compartments and databases", - "SelectItem=Select {0}", - "SelectDBConnection=Select Database Connection" -}) + "CollectingItems=Loading OCI contents",}) public class AddSuggestedItemAction implements ActionListener { - private static final Logger LOG = Logger.getLogger(AddADBAction.class.getName()); private final SuggestedItem context; @@ -79,35 +67,29 @@ public AddSuggestedItemAction(SuggestedItem context) { @Override public void actionPerformed(ActionEvent e) { if ("Databases".equals(context.getPath())) { //NOI18N - Map adbConnections = new HashMap<>(); - DatabaseConnection[] connections = ConnectionManager.getDefault().getConnections(); - for (int i = 0; i < connections.length; i++) { - String name = connections[i].getDisplayName(); - String ocid = connections[i].getConnectionProperties().getProperty("OCID"); //NOI18N - String compartmentId = connections[i].getConnectionProperties().getProperty("CompartmentOCID"); //NOI18N - if (ocid != null && compartmentId != null) { - DatabaseItem dbItem - = new DatabaseItem(OCID.of(ocid, "Databases"), compartmentId, name, null, name); //NOI18N - adbConnections.put(name, dbItem); - } - } - if (adbConnections.isEmpty()) { - DatabaseItem db = new AddADBAction().addADB(); - if (db != null) { - CloudAssets.getDefault().addItem(db); - } - } else { - Steps.getDefault().executeMultistep(new DatabaseConnectionStep(adbConnections), Lookup.EMPTY) - .thenAccept(result -> CloudAssets.getDefault().addItem((OCIItem) result)); - } + Steps.getDefault().executeMultistep(new DatabaseConnectionStep(), Lookup.EMPTY) + .thenAccept(values -> { + DatabaseItem db = values.getValueForStep(DatabaseConnectionStep.class); + if (db != null) { + CloudAssets.getDefault().addItem(db); + } else { + new AddADBAction().addADB().thenAccept(i -> { + CloudAssets.getDefault().addItem(i); + }); + } + }); return; } Steps.NextStepProvider nsProvider = Steps.NextStepProvider.builder() - .stepForClass(Steps.CompartmentStep.class, (s) -> new Steps.SuggestedStep(context.getPath())) + .stepForClass(TenancyStep.class, (s) -> new CompartmentStep()) + .stepForClass(CompartmentStep.class, (s) -> new SuggestedStep(context.getPath())) .build(); Lookup lookup = Lookups.fixed(nsProvider); Steps.getDefault().executeMultistep(new TenancyStep(), lookup) - .thenAccept(result -> CloudAssets.getDefault().addItem((OCIItem) result)); + .thenAccept(values -> { + OCIItem item = values.getValueForStep(SuggestedStep.class); + CloudAssets.getDefault().addItem(item); + }); } } diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/WhatsNewTab.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddToProject.java similarity index 50% rename from nb/welcome/src/org/netbeans/modules/welcome/ui/WhatsNewTab.java rename to enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddToProject.java index 2e077bee83d8..e7d2fd0cafeb 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/WhatsNewTab.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/AddToProject.java @@ -16,35 +16,43 @@ * specific language governing permissions and limitations * under the License. */ +package org.netbeans.modules.cloud.oracle.assets; -package org.netbeans.modules.welcome.ui; - -import java.awt.GridLayout; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.ContentSection; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.openide.awt.ActionID; +import org.openide.awt.ActionRegistration; +import org.openide.util.NbBundle; /** * - * @author S. Aubrecht + * @author Jan Horvath */ -class WhatsNewTab extends AbstractTab { +@ActionID( + category = "Tools", + id = "org.netbeans.modules.cloud.oracle.actions.AddToProject" +) +@ActionRegistration( + displayName = "#AddToProject", + asynchronous = true +) + +@NbBundle.Messages({ + "AddToProject=Add to Oracle Cloud Assets" +}) +public class AddToProject implements ActionListener { - public WhatsNewTab() { - super( BundleSupport.getLabel( "WhatsNewTab") ); //NOI18N + private final OCIItem context; + + public AddToProject(OCIItem context) { + this.context = context; } @Override - protected JComponent buildContent() { - JPanel main = new JPanel( new GridLayout(1,0) ); - main.setOpaque(false); - main.setBorder(BorderFactory.createEmptyBorder()); - - main.add( new ContentSection( BundleSupport.getLabel( "SectionBlogs" ), //NOI18N - new Blogs(), true ) ); - - return main; + public void actionPerformed(ActionEvent e) { + CloudAssets.getDefault().addItem(context); } + + } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CloudAssets.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CloudAssets.java index b9cf8b17c670..96ba371cb3c1 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CloudAssets.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CloudAssets.java @@ -29,14 +29,21 @@ import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.io.StringReader; import java.lang.reflect.Type; import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -44,11 +51,11 @@ import javax.swing.event.ChangeListener; import org.netbeans.api.db.explorer.ConnectionManager; import org.netbeans.api.db.explorer.DatabaseConnection; -import org.netbeans.modules.cloud.oracle.OCIChildFactory; import org.netbeans.modules.cloud.oracle.bucket.BucketItem; import org.netbeans.modules.cloud.oracle.compute.ClusterItem; import org.netbeans.modules.cloud.oracle.compute.ComputeInstanceItem; import org.netbeans.modules.cloud.oracle.database.DatabaseItem; +import org.netbeans.modules.cloud.oracle.developer.ContainerRepositoryItem; import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; import org.netbeans.modules.cloud.oracle.vault.VaultItem; @@ -60,10 +67,13 @@ import org.openide.util.Parameters; /** + * Maintains a set of OCI resources that are either assigned or recommended for + * assignment to a workspace. * * @author Jan Horvath */ public final class CloudAssets { + private static final Logger LOG = Logger.getLogger(CloudAssets.class.getName()); private static final String SUGGESTED = "Suggested"; //NOI18N @@ -73,7 +83,9 @@ public final class CloudAssets { private boolean assetsLoaded = false; private Set items = new HashSet<>(); - private Set suggested = new HashSet<>(); + private final Set suggested = new HashSet<>(); + + private final Map refNames = new HashMap<>(); private final ChangeSupport changeSupport; private final Gson gson; @@ -90,7 +102,7 @@ public final class CloudAssets { for (int i = 0; i < connections.length; i++) { String ocid = (String) connections[i].getConnectionProperties().get("OCID"); //NOI18N if (ocid != null) { - ocids.add(ocid); + ocids.add(ocid); } } boolean update = false; @@ -115,25 +127,36 @@ public static synchronized CloudAssets getDefault() { return instance; } - public void addItem(OCIItem newItem) { + public synchronized void addItem(OCIItem newItem) { Parameters.notNull("newItem cannot be null", newItem); - items.add(newItem); - update(); - storeAssets(); + long presentCount = items.stream() + .filter(i -> i.getKey().getPath().equals(newItem.getKey().getPath())) + .count(); + if (newItem.maxInProject() > presentCount) { + items.add(newItem); + update(); + storeAssets(); + } } - void removeItem(OCIItem item) { + synchronized void removeItem(OCIItem item) { + boolean update = false; + if (refNames.remove(item) != null) { + update = true; + } if (items.remove(item)) { - update(); + update = true; + } + if (update) { storeAssets(); + update(); } } - public void update() { + void update() { OpenProjectsFinder.getDefault().findOpenProjects().thenAccept(projects -> { SuggestionAnalyzer analyzer = new DependenciesAnalyzer(); - Set suggested = analyzer.findSuggestions(projects); - setSuggestions(suggested); + setSuggestions(analyzer.findSuggestions(projects)); }); } @@ -159,12 +182,60 @@ private synchronized void setSuggestions(Set newSuggested) { changeSupport.fireChange(); } - public List getItems() { + /** + * Returns a Collection of all items, including suggested + * items. + * + * @return {@link Collection} of {@link OCIItem} + */ + public Collection getItems() { List list = new ArrayList<>(suggested); list.addAll(items); return list; } + /** + * Returns a Collection of items assigned by user. This doesn't + * include suggested items. + * + * @return {@link Collection} of {@link OCIItem} + */ + public Collection getAssignedItems() { + return Collections.unmodifiableCollection(items); + } + + public boolean setReferenceName(OCIItem item, String refName) { + Parameters.notNull("refName", refName); //NOI18N + Parameters.notNull("OCIItem", item); //NOI18N + for (Entry refEntry : refNames.entrySet()) { + if (refEntry.getKey().getKey().getPath().equals(item.getKey().getPath()) + && refName.equals(refEntry.getValue())) { + return false; + } + } + String oldRefName = refNames.get(item); + refNames.put(item, refName); + storeAssets(); + item.fireRefNameChanged(oldRefName, refName); +// item.fireRefNameChanged(null, refName); + return true; + } + + public String getReferenceName(OCIItem item) { + return refNames.get(item); + } + + private void setReferenceName(String ocid, String refName) { + for (OCIItem item : items) { + if (item.getKey().getValue().equals(ocid)) { + refNames.put(item, refName); + storeAssets(); + item.fireRefNameChanged(null, refName); + return; + } + } + } + /** * Adds a ChangeListener to the listener list. * @@ -187,9 +258,6 @@ synchronized void storeAssets() { if (!assetsLoaded) { return; } - Set toStore = items.stream() - .filter(i -> !SUGGESTED.equals(i.getKey().getPath())) //NOI18N - .collect(Collectors.toSet()); FileObject file = null; try { FileObject fo = FileUtil.createFolder(FileUtil.getConfigRoot(), CLOUD_ASSETS_PATH); @@ -202,9 +270,25 @@ synchronized void storeAssets() { } if (file != null) { try (FileLock lock = file.lock()) { - OutputStream os = file.getOutputStream(lock); - os.write(gson.toJson(toStore).getBytes()); - os.close(); + OutputStream os = file.getOutputStream(lock); + JsonWriter jsonWriter = gson.newJsonWriter(new OutputStreamWriter(os)); + jsonWriter.beginObject(); + jsonWriter.name("items").beginArray(); //NOI18N + for (OCIItem item : items) { + gson.toJson(item, item.getClass(), jsonWriter); + } + jsonWriter.endArray(); + jsonWriter.name("referenceNames").beginArray(); //NOI18N + for (Entry entry : refNames.entrySet()) { + jsonWriter.beginObject(); + jsonWriter.name("ocid").value(entry.getKey().getKey().getValue()); //NOI18N + jsonWriter.name("referenceName").value(entry.getValue()); //NOI18N + jsonWriter.endObject(); + } + jsonWriter.endArray(); + jsonWriter.endObject(); + jsonWriter.close(); + os.close(); } catch (IOException ex) { Exceptions.printStackTrace(ex); } @@ -229,32 +313,76 @@ synchronized void loadAssets() { try (JsonReader reader = new JsonReader(new StringReader(content))) { Set loaded = new HashSet<>(); - reader.beginArray(); + Map loadingRefNames = new HashMap<>(); + reader.beginObject(); while (reader.hasNext()) { - JsonElement element = JsonParser.parseReader(reader); - String path = element.getAsJsonObject() - .get("id").getAsJsonObject() //NOI18N - .get("path").getAsString(); //NOI18N - switch (path) { - case "Databases": //NOI18N - loaded.add(gson.fromJson(element, DatabaseItem.class)); - break; - case "Bucket": //NOI18N - loaded.add(gson.fromJson(element, BucketItem.class)); - break; - case "Cluster": //NOI18N - loaded.add(gson.fromJson(element, ClusterItem.class)); + String rootObjName = reader.nextName(); + switch (rootObjName) { + case "items": //NOI18N + reader.beginArray(); + while (reader.hasNext()) { + JsonElement element = JsonParser.parseReader(reader); + String path = element.getAsJsonObject() + .get("id").getAsJsonObject() //NOI18N + .get("path").getAsString(); //NOI18N + switch (path) { + case "Databases": //NOI18N + loaded.add(gson.fromJson(element, DatabaseItem.class)); + break; + case "Bucket": //NOI18N + loaded.add(gson.fromJson(element, BucketItem.class)); + break; + case "Cluster": //NOI18N + loaded.add(gson.fromJson(element, ClusterItem.class)); + break; + case "ComputeInstance": //NOI18N + loaded.add(gson.fromJson(element, ComputeInstanceItem.class)); + break; + case "Vault": //NOI18N + loaded.add(gson.fromJson(element, VaultItem.class)); + break; + case "ContainerRepository": //NOI18N + loaded.add(gson.fromJson(element, ContainerRepositoryItem.class)); + break; + } + } + reader.endArray(); break; - case "ComputeInstance": //NOI18N - loaded.add(gson.fromJson(element, ComputeInstanceItem.class)); - break; - case "Vault": //NOI18N - loaded.add(gson.fromJson(element, VaultItem.class)); + case "referenceNames": //NOI18N + reader.beginArray(); + while (reader.hasNext()) { + reader.beginObject(); + String refOcid = null; + String refName = null; + while (reader.hasNext()) { + String name = reader.nextName(); + switch (name) { + case "ocid": + refOcid = reader.nextString(); + break; + case "referenceName": + refName = reader.nextString(); + break; + default: + reader.skipValue(); + break; + } + if (refOcid != null && refName != null) { + loadingRefNames.put(refOcid, refName); + } + } + reader.endObject(); + } + reader.endArray(); break; } } - reader.endArray(); + reader.endObject(); items = loaded; + for (Entry entry : loadingRefNames.entrySet()) { + setReferenceName(entry.getKey(), entry.getValue()); + } + } catch (JsonIOException | JsonSyntaxException | IOException e) { LOG.log(Level.INFO, "Unable to load assets", e); } finally { @@ -263,7 +391,6 @@ synchronized void loadAssets() { } private static final class OCIDDeserializer implements JsonDeserializer { - @Override public OCID deserialize(JsonElement json, Type type, JsonDeserializationContext jdc) throws JsonParseException { JsonObject jsonObject = json.getAsJsonObject(); diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CreatePoliciesCommand.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CreatePoliciesCommand.java index 84630bbd12aa..111be65006bc 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CreatePoliciesCommand.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/CreatePoliciesCommand.java @@ -27,25 +27,19 @@ import java.util.Properties; import java.util.Set; import java.util.concurrent.CompletableFuture; -import java.util.logging.Logger; import org.netbeans.modules.cloud.oracle.policy.PolicyGenerator; import org.netbeans.spi.lsp.CommandProvider; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; -import org.openide.util.Exceptions; import org.openide.util.RequestProcessor; import org.openide.util.lookup.ServiceProvider; /** - * + * * @author Jan Horvath */ @ServiceProvider(service = CommandProvider.class) public class CreatePoliciesCommand implements CommandProvider { - private static final Logger LOG = Logger.getLogger(CreatePoliciesCommand.class.getName()); - - - private static final String COMMAND_CREATE_POLICIES = "nbls.cloud.assets.policy.create.local"; //NOI18N private static final String COMMAND_CREATE_CONFIG = "nbls.cloud.assets.config.create.local"; //NOI18N private static final String COMMAND_CLOUD_ASSETS_REFRESH = "nbls.cloud.assets.refresh"; //NOI18N @@ -81,7 +75,9 @@ public CompletableFuture runCommand(String command, List argumen } else if (COMMAND_CREATE_CONFIG.equals(command)) { StringWriter writer = new StringWriter(); Properties dbProps = new Properties(); - dbProps.putAll(PropertiesGenerator.getProperties(null)); + PropertiesGenerator propGen = new PropertiesGenerator(false); + dbProps.putAll(propGen.getApplication()); + dbProps.putAll(propGen.getBootstrap()); try { dbProps.store(writer, "Generated application.properties\n" //NOI18N + "Uncomment following line when running inside Oracle Cloud\n" //NOI18N @@ -95,5 +91,5 @@ public CompletableFuture runCommand(String command, List argumen } return future; } - + } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/DependenciesAnalyzer.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/DependenciesAnalyzer.java index 717f39e5646e..3fd0013fb382 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/DependenciesAnalyzer.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/DependenciesAnalyzer.java @@ -62,6 +62,7 @@ public Set findSuggestions(Project[] projects) { } result.add(SuggestedItem.forPath("Cluster")); result.add(SuggestedItem.forPath("ComputeInstance")); + result.add(SuggestedItem.forPath("ContainerRepository")); return result; } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/OCIPropertiesProvider.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/OCIPropertiesProvider.java index afb6e45e04c1..89f469b050c9 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/OCIPropertiesProvider.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/OCIPropertiesProvider.java @@ -51,7 +51,6 @@ import org.netbeans.api.db.explorer.ConnectionManager; import org.netbeans.api.db.explorer.DatabaseConnection; import org.netbeans.spi.lsp.CommandProvider; -import org.openide.util.Lookup; import org.openide.util.lookup.ServiceProvider; /** @@ -85,7 +84,9 @@ public CompletableFuture runCommand(String command, List argumen Properties dbProps = new Properties(); DatabaseConnection conn = ConnectionManager.getDefault().getPreferredConnection(true); - dbProps.putAll(PropertiesGenerator.getProperties(null)); + PropertiesGenerator propGen = new PropertiesGenerator(true); + dbProps.putAll(propGen.getApplication()); + dbProps.putAll(propGen.getBootstrap()); // If cloud assets are empty, try to get properties for a preferred DB connection if (conn != null && dbProps.isEmpty()) { dbProps.put("datasources.default.url", conn.getDatabaseURL()); //NOI18N diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/PropertiesGenerator.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/PropertiesGenerator.java index 5e863e70eab1..d6b86efa2f85 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/PropertiesGenerator.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/PropertiesGenerator.java @@ -18,12 +18,18 @@ */ package org.netbeans.modules.cloud.oracle.assets; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.UUID; import org.netbeans.api.db.explorer.ConnectionManager; import org.netbeans.api.db.explorer.DatabaseConnection; import org.netbeans.modules.cloud.oracle.bucket.BucketItem; import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.netbeans.modules.cloud.oracle.vault.VaultItem; /** * @@ -31,20 +37,48 @@ */ public final class PropertiesGenerator { - private PropertiesGenerator() { - } + private static final String DEFAULT = "DEFAULT"; + final Map application = new HashMap<>(); + final Map bootstrap = new HashMap<>(); + final Map secrets = new HashMap<>(); + final List allPropertiesNames = Arrays.asList( + "micronaut.object-storage.oracle-cloud.default.bucket", + "micronaut.object-storage.oracle-cloud.default.namespace", + "datasources.default.dialect", + "datasources.default.ocid", + "datasources.default.walletPassword", + "datasources.default.username", + "datasources.default.password", + "datasources.default.url", + "oci.config.instance-principal.enabled", + "oci.vault.config.enabled", + "oci.vault.vaults[0].ocid", + "oci.vault.vaults[0].compartment-ocid" + ); - public static Map getProperties(String environment) { - Map result = new HashMap<>(); - for (OCIItem item : CloudAssets.getDefault().getItems()) { + public PropertiesGenerator(boolean local) { + Collection items = CloudAssets.getDefault().getItems(); + VaultItem vault = null; + DatabaseConnection conn = null; + for (OCIItem item : items) { + if ("Vault".equals(item.getKey().getPath())) { + vault = (VaultItem) item; + } + } + for (OCIItem item : items) { + String refName = CloudAssets.getDefault().getReferenceName(item); + if (refName == null) { + refName = DEFAULT; + } + String nameLowercase = refName.toLowerCase(); + String refNameUppercase = refName.toUpperCase(); switch (item.getKey().getPath()) { case "Bucket": //NOI18N - result.put("micronaut.object-storage.oracle-cloud.default.bucket", item.getKey().getValue()); //NOI18N - result.put("micronaut.object-storage.oracle-cloud.default.namespace", ((BucketItem) item).getNamespace()); //NOI18N + application.put("micronaut.object-storage.oracle-cloud." + nameLowercase + ".bucket", item.getKey().getValue()); //NOI18N + application.put("micronaut.object-storage.oracle-cloud." + nameLowercase + ".namespace", ((BucketItem) item).getNamespace()); //NOI18N break; case "Databases": //NOI18N DatabaseConnection[] connections = ConnectionManager.getDefault().getConnections(); - DatabaseConnection conn = null; for (int i = 0; i < connections.length; i++) { if (item.getKey().getValue().equals( connections[i].getConnectionProperties().get("OCID"))) { //NOI18N @@ -53,22 +87,68 @@ public static Map getProperties(String environment) { } } if (conn != null) { - result.put("datasources.default.url", conn.getDatabaseURL()); //NOI18N - result.put("datasources.default.username", conn.getUser()); //NOI18N - result.put("datasources.default.password", conn.getPassword()); //NOI18N - result.put("datasources.default.driverClassName", conn.getDriverClass()); //NOI18N - String ocid = (String) conn.getConnectionProperties().get("OCID"); //NOI18N - if (ocid != null && !ocid.isEmpty()) { - result.put("datasources.default.ocid", ocid); //NOI18N + + if (vault != null) { + application.put("datasources." + nameLowercase + ".dialect", "ORACLE"); // NOI18N + application.put("datasources." + nameLowercase + ".ocid", "${DATASOURCES_" + refNameUppercase + "_OCID}"); // NOI18N + application.put("datasources." + nameLowercase + ".walletPassword", "${DATASOURCES_" + refNameUppercase + "_WALLET_PASSWORD}"); // NOI18N + application.put("datasources." + nameLowercase + ".username", "${DATASOURCES_" + refNameUppercase + "_USERNAME}"); // NOI18N + application.put("datasources." + nameLowercase + ".password", "${DATASOURCES_" + refNameUppercase + "_PASSWORD}"); // NOI18N + putSecret(refNameUppercase, "Username", conn.getUser()); //NOI18N + putSecret(refNameUppercase, "Password", conn.getPassword()); //NOI18N + putSecret(refNameUppercase, "OCID", (String) conn.getConnectionProperties().get("OCID")); //NOI18N + putSecret(refNameUppercase, "CompartmentOCID", (String) conn.getConnectionProperties().get("CompartmentOCID")); //NOI18N + putSecret(refNameUppercase, "wallet_Password", UUID.randomUUID().toString()); //NOI18N + } else { + if (local) { + application.put("datasources." + nameLowercase + ".url", conn.getDatabaseURL()); //NOI18N + } + application.put("datasources." + nameLowercase + ".username", conn.getUser()); //NOI18N + application.put("datasources." + nameLowercase + ".password", conn.getPassword()); //NOI18N + application.put("datasources." + nameLowercase + ".walletPassword", UUID.randomUUID().toString()); //NOI18N + application.put("datasources." + nameLowercase + ".driverClassName", conn.getDriverClass()); //NOI18N + String ocid = (String) conn.getConnectionProperties().get("OCID"); //NOI18N + if (ocid != null && !ocid.isEmpty()) { + application.put("datasources." + nameLowercase + ".ocid", ocid); //NOI18N + } } } - break; - case "Vault": - result.put("oci.vault.vaults[0].ocid", item.getKey().getValue()); //NOI18N - result.put("oci.vault.vaults[0].compartment-ocid", item.getCompartmentId()); //NOI18N } } - return result; + if (!local) { + bootstrap.put("oci.config.instance-principal.enabled", "true"); // NOI18N + } + if (vault != null) { + bootstrap.put("oci.vault.config.enabled", "true"); // NOI18N + bootstrap.put("oci.vault.vaults[0].ocid", vault.getKey().getValue()); //NOI18N + bootstrap.put("oci.vault.vaults[0].compartment-ocid", vault.getCompartmentId()); //NOI18N + } + } + + private void putSecret(String datasourceName, String name, String value) { + String secretName = "DATASOURCES_" + datasourceName + "_" + name; //NOI18N + secrets.put(secretName, value); + } + + /** + * Returns all potentially used property names. This can be useful for cleaning up unused values, such as those in a Config Map. + * + * @return {@link Collection} + */ + public Collection getAllPropertiesNames() { + return allPropertiesNames; + } + + public synchronized Map getApplication() { + return Collections.unmodifiableMap(application); + } + + public synchronized Map getBootstrap() { + return Collections.unmodifiableMap(bootstrap); + } + + public synchronized Map getVaultSecrets() { + return Collections.unmodifiableMap(secrets); } } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/RemoveFromProject.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/RemoveFromProject.java index de4d3e1611cc..55f5c8277b03 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/RemoveFromProject.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/RemoveFromProject.java @@ -39,7 +39,7 @@ ) @NbBundle.Messages({ - "RemoveFromProject=Remove From Assets" + "RemoveFromProject=Remove From Oracle Cloud Assets" }) public class RemoveFromProject implements ActionListener { @@ -54,5 +54,4 @@ public void actionPerformed(ActionEvent e) { CloudAssets.getDefault().removeItem(context); } - } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SetReferenceNameAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SetReferenceNameAction.java new file mode 100644 index 000000000000..6cd2a6b651c4 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SetReferenceNameAction.java @@ -0,0 +1,80 @@ +/* + * 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.cloud.oracle.assets; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.openide.DialogDescriptor; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.openide.awt.ActionID; +import org.openide.awt.ActionRegistration; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@ActionID( + category = "Tools", + id = "org.netbeans.modules.cloud.oracle.actions.SetReferenceName" +) +@ActionRegistration( + displayName = "#ReferenceName", + asynchronous = true +) + +@NbBundle.Messages({ + "ReferenceName=Set a reference name", + "ReferenceNameValidationError=Reference Name can contain only letters and numbers", + "ReferenceNameSame=Reference names must be unique for each resource type." +}) +public class SetReferenceNameAction implements ActionListener { + + private final OCIItem context; + + public SetReferenceNameAction(OCIItem context) { + this.context = context; + } + + @Override + public void actionPerformed(ActionEvent e) { + String oldRefName = CloudAssets.getDefault().getReferenceName(context); + if (oldRefName == null) { + oldRefName = ""; + } + NotifyDescriptor.InputLine inp = new NotifyDescriptor.InputLine(oldRefName, Bundle.ReferenceName()); + Object selected = DialogDisplayer.getDefault().notify(inp); + if (DialogDescriptor.OK_OPTION != selected) { + return; + } + String refName = inp.getInputText(); + if (refName.matches("[a-zA-Z0-9]+")) { //NOI18N + if (!CloudAssets.getDefault().setReferenceName(context, refName)) { + NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.ReferenceNameSame()); + DialogDisplayer.getDefault().notify(msg); + } + } else { + NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.ReferenceNameValidationError()); + DialogDisplayer.getDefault().notify(msg); + } + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/Steps.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/Steps.java index fe3f4c19fa2c..866a42309354 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/Steps.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/Steps.java @@ -18,69 +18,38 @@ */ package org.netbeans.modules.cloud.oracle.assets; -import com.oracle.bmc.identity.Identity; -import com.oracle.bmc.identity.IdentityClient; -import com.oracle.bmc.identity.model.Compartment; -import com.oracle.bmc.identity.model.Tenancy; -import com.oracle.bmc.identity.requests.ListCompartmentsRequest; -import com.oracle.bmc.identity.responses.ListCompartmentsResponse; -import com.oracle.bmc.model.BmcException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.MissingResourceException; -import java.util.Optional; -import java.util.TreeMap; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; -import java.util.logging.Level; import java.util.logging.Logger; import org.netbeans.api.progress.ProgressHandle; -import org.netbeans.api.project.Project; -import org.netbeans.api.project.ProjectInformation; -import org.netbeans.api.project.ProjectUtils; -import org.netbeans.modules.cloud.oracle.OCIManager; -import org.netbeans.modules.cloud.oracle.OCIProfile; -import org.netbeans.modules.cloud.oracle.OCISessionInitiator; -import org.netbeans.modules.cloud.oracle.bucket.BucketNode; -import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem; -import org.netbeans.modules.cloud.oracle.compute.ClusterNode; -import org.netbeans.modules.cloud.oracle.compute.ComputeInstanceNode; -import org.netbeans.modules.cloud.oracle.database.DatabaseItem; -import org.netbeans.modules.cloud.oracle.database.DatabaseNode; -import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; -import org.netbeans.modules.cloud.oracle.items.TenancyItem; -import org.netbeans.modules.cloud.oracle.vault.VaultNode; -import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; -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.lookup.Lookups; import org.openide.util.lookup.ProxyLookup; /** - * An implementation of the {@link Step} interface used for multiple commands or actions. - * + * An implementation of the {@link Step} interface used for multiple commands or + * actions. + * * @author Jan Horvath */ @NbBundle.Messages({ - "Databases=Oracle Autonomous Database", - "Vault=OCI Vault", - "Bucket=Object Storage Bucket", - "Cluster=Oracle Container Engine", - "Compute=Compute Instance" + "MSG_CollectingItems=Loading OCI contents", + "FetchingDevopsProjects=Fetching DevOps projects", + "SelectItem=Select {0}", + "LoadingItems=Loading items for the next step" }) public final class Steps { + private static final Logger LOG = Logger.getLogger(Steps.class.getName()); private static final RequestProcessor RP = new RequestProcessor("Steps"); //NOI18N private static Steps instance = null; @@ -92,48 +61,61 @@ public static synchronized Steps getDefault() { return instance; } - public CompletableFuture executeMultistep(Step firstStep, Lookup lookup) { + public CompletableFuture executeMultistep(AbstractStep firstStep, Lookup lookup) { DialogDisplayer dd = DialogDisplayer.getDefault(); CompletableFuture future = new CompletableFuture(); RP.post(() -> { - Multistep multistep = new Multistep(firstStep, lookup); - NotifyDescriptor.ComposedInput ci = new NotifyDescriptor.ComposedInput(Bundle.AddSuggestedItem(), 3, multistep.createInput()); - if (DialogDescriptor.OK_OPTION == dd.notify(ci)) { - future.complete(multistep.getResult()); - } else { - future.cancel(true); + try { + Multistep multistep = new Multistep(firstStep, lookup); + NotifyDescriptor.ComposedInput ci = new NotifyDescriptor.ComposedInput(Bundle.AddSuggestedItem(), 3, multistep.createInput()); + dd.notifyFuture(ci).handle((result, exception) -> { + if (exception != null) { + future.completeExceptionally(exception); + } else { + future.complete(multistep.getResult()); + } + return null; + }); + } catch (Throwable t) { + future.completeExceptionally(t); } }); return future; } - + /** - * Provider class that supplies the next {@link Step} for navigation from the current {@link Step}. - * + * Provider class that supplies the next {@link Step} for navigation from + * the current {@link Step}. + * */ public static class NextStepProvider { - private final Map, Function> steps; - + + private final Map, Function> steps; + /** - * Private constructor to initialize the NextStepProvider with a map of steps. + * Private constructor to initialize the NextStepProvider with a map of + * steps. * - * @param steps a map associating classes with their corresponding {@link Step} instances + * @param steps a map associating classes with their corresponding + * {@link Step} instances */ - private NextStepProvider(Map, Function> steps) { + private NextStepProvider(Map, Function> steps) { this.steps = steps; } - + /** * Retrieves the next {@link Step} for the specified {@link Step}. * - * @param currentStep the current step for which the next step is to be retrieved - * @return the {@link Step} associated with the specified class, or null if no step is found + * @param currentStep the current step for which the next step is to be + * retrieved + * @return the {@link Step} associated with the specified class, or null + * if no step is found */ - public Step nextStepFor(Step currentStep) { - Function nextStep = steps.get(currentStep.getClass()); + public AbstractStep nextStepFor(AbstractStep currentStep) { + Function nextStep = steps.get(currentStep.getClass()); return nextStep != null ? nextStep.apply(currentStep) : null; } - + /** * Creates a new Builder for constructing a NextStepProvider. * @@ -142,19 +124,20 @@ public Step nextStepFor(Step currentStep) { public static Builder builder() { return new Builder(); } - + /** * Builder class for constructing a NextStepProvider. */ public static class Builder { - private final Map, Function> steps = new HashMap<> (); + + private final Map, Function> steps = new HashMap<>(); /** * Private constructor for the Builder. */ private Builder() { } - + /** * Associates a {@link Step} function with a class in the builder. * @@ -162,11 +145,11 @@ private Builder() { * @param stepFunction the function to be associated with the class * @return the current Builder instance for method chaining */ - public Builder stepForClass(Class clazz, Function stepFunction) { + public Builder stepForClass(Class clazz, Function stepFunction) { steps.put(clazz, stepFunction); return this; } - + /** * Builds and returns a NextStepProvider with the configured steps. * @@ -178,22 +161,38 @@ public NextStepProvider build() { } } + /** + * Provides values for steps in the multi step dialog. + * + */ + public interface Values { + + /** + * Returns a value for a given {@link Step}. + * + * @param step + * @return + */ + public T getValueForStep(Class> step); + } private static class Multistep { - private final LinkedList steps = new LinkedList<>(); + private final LinkedList steps = new LinkedList<>(); private final Lookup lookup; + private final Values values; - Multistep(Step firstStep, Lookup lookup) { + Multistep(AbstractStep firstStep, Lookup lookup) { steps.add(firstStep); - this.lookup = lookup; + values = new MultistepValues(steps); + this.lookup = new ProxyLookup(Lookups.fixed(values), lookup); } NotifyDescriptor.ComposedInput.Callback createInput() { return new NotifyDescriptor.ComposedInput.Callback() { private int lastNumber = 0; - private void readValue(Step step, NotifyDescriptor desc) { + private void readValue(AbstractStep step, NotifyDescriptor desc) { String selected = null; if (!step.onlyOneChoice()) { if (desc instanceof NotifyDescriptor.QuickPick) { @@ -216,7 +215,7 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu while (steps.size() > 1) { steps.removeLast(); } - steps.getLast().prepare(null, lookup); + prepare(steps.getLast()); } else if (lastNumber > number) { steps.removeLast(); while (steps.getLast().onlyOneChoice() && steps.size() > 1) { @@ -226,12 +225,12 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu return steps.getLast().createInput(); } else { readValue(steps.getLast(), input.getInputs()[number - 2]); - steps.add(steps.getLast().getNext()); + steps.add(getNextFor(steps.getLast())); } lastNumber = number; while (steps.getLast() != null && steps.getLast().onlyOneChoice()) { - steps.add(steps.getLast().getNext()); + steps.add(getNextFor(steps.getLast())); } if (steps.getLast() == null) { steps.removeLast(); @@ -239,227 +238,58 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu } return steps.getLast().createInput(); } - }; - } - - public Object getResult() { - return steps.getLast().getValue(); - } - } - - public static final class TenancyStep implements Step { - List profiles = new LinkedList<>(); - private AtomicReference selected = new AtomicReference<>(); - private Lookup lookup; - - @Override - public NotifyDescriptor createInput() { - if (onlyOneChoice()) { - throw new IllegalStateException("No data to create input"); // NOI18N - } - String title = Bundle.SelectProfile(); - List items = new ArrayList<>(profiles.size()); - for (OCIProfile p : profiles) { - Tenancy t = p.getTenancyData(); - if (t != null) { - items.add(new NotifyDescriptor.QuickPick.Item(p.getId(), Bundle.SelectProfile_Description(t.getName(), t.getHomeRegionKey()))); - } - } - if (profiles.stream().filter(p -> p.getTenancy().isPresent()).count() == 0) { - title = Bundle.NoProfile(); - } - return new NotifyDescriptor.QuickPick(title, title, items, false); - } - @Override - public Step getNext() { - return new CompartmentStep().prepare(getValue(), lookup); - } - - @Override - public Step prepare(Object i, Lookup lookup) { - this.lookup = lookup; - ProgressHandle h = ProgressHandle.createHandle(Bundle.CollectingProfiles()); - h.start(); - h.progress(Bundle.CollectingProfiles_Text()); - try { - profiles = OCIManager.getDefault().getConnectedProfiles(); - } finally { - h.finish(); - } - return this; - } - - public void setValue(String value) { - for (OCIProfile profile : profiles) { - if (profile.getId().equals(value)) { - profile.getTenancy().ifPresent(t -> this.selected.set(t)); - break; + private void prepare(AbstractStep step) { + ProgressHandle h = ProgressHandle.createHandle(Bundle.LoadingItems()); + h.start(); + try { + h.progress(Bundle.LoadingItems()); + step.prepare(h, values); + } finally { + h.finish(); + } } - } - } - @Override - public TenancyItem getValue() { - if (onlyOneChoice()) { - return profiles.stream() - .map(p -> p.getTenancy()) - .filter(Optional::isPresent) - .map(Optional::get) - .findFirst() - .get(); - } - return selected.get(); - } - - @Override - public boolean onlyOneChoice() { - return profiles.stream().filter(p -> p.getTenancy().isPresent()).count() == 1; - } - } - - public static final class CompartmentStep implements Step { - private Map compartments = null; - private CompartmentItem selected; - private Lookup lookup; - - public Step prepare(TenancyItem tenancy, Lookup lookup) { - this.lookup = lookup; - ProgressHandle h = ProgressHandle.createHandle(Bundle.CollectingItems()); - h.start(); - h.progress(Bundle.CollectingItems_Text()); - try { - compartments = getFlatCompartment(tenancy); - } finally { - h.finish(); - } - return this; - } - - @Override - public NotifyDescriptor createInput() { - if (onlyOneChoice()) { - throw new IllegalStateException("Input shouldn't be displayed for one choice"); // NOI18N - } - if (compartments.isEmpty()) { - return createQuickPick(compartments, Bundle.NoCompartment()); - } - return createQuickPick(compartments, Bundle.SelectCompartment()); - } - - @Override - public Step getNext() { - NextStepProvider nsProvider = lookup.lookup(NextStepProvider.class); - if (nsProvider != null) { - Step ns = nsProvider.nextStepFor(this); - if (ns != null) { - return ns.prepare(getValue(), lookup); + private AbstractStep getNextFor(AbstractStep step) { + Steps.NextStepProvider nsProvider = lookup.lookup(Steps.NextStepProvider.class); + if (nsProvider != null) { + AbstractStep ns = nsProvider.nextStepFor(step); + if (ns != null) { + prepare(ns); + return ns; + } + } + return null; } - } - return null; - } - - @Override - public void setValue(String selected) { - this.selected = (CompartmentItem) compartments.get(selected); - } - - @Override - public CompartmentItem getValue() { - if (onlyOneChoice()) { - return (CompartmentItem) compartments.values().iterator().next(); - } - return selected; + }; } - @Override - public boolean onlyOneChoice() { - return compartments.size() == 1; + public Values getResult() { + return values; } - } - /** - * Show list of items for a suggested type. - * - */ - static class SuggestedStep implements Step { + private static class MultistepValues implements Values { - private Map items = new HashMap<>(); - private OCIItem selected; - private Lookup lookup; - private final String suggestedType; + private final List steps; - public SuggestedStep(String suggestedType) { - this.suggestedType = suggestedType; - } - - public SuggestedStep prepare(CompartmentItem compartment, Lookup lookup) { - this.lookup = lookup; - ProgressHandle h = ProgressHandle.createHandle(Bundle.CollectingItems()); - h.start(); - h.progress(Bundle.CollectingItems_Text()); - try { - getItemsByPath(compartment, suggestedType).forEach((db) -> items.put(db.getName(), db)); - } finally { - h.finish(); + public MultistepValues(List steps) { + this.steps = steps; } - return this; - } - private String getSuggestedItemName() { - switch (suggestedType) { - case "Databases": - return Bundle.Databases(); - case "Vault": - return Bundle.Vault(); - case "Bucket": - return Bundle.Bucket(); - case "Cluster": - return Bundle.Cluster(); - case "ComputeInstance": - return Bundle.Compute(); - } - throw new MissingResourceException("Missing OCI type", null, suggestedType); - } - - @Override - public NotifyDescriptor createInput() { - return createQuickPick(items, Bundle.SelectItem(getSuggestedItemName())); - } - - @Override - public Step getNext() { - NextStepProvider nsProvider = lookup.lookup(NextStepProvider.class); - if (nsProvider != null) { - Step ns = nsProvider.nextStepFor(this); - if (ns != null) { - return ns.prepare(getValue(), lookup); + @Override + public T getValueForStep(Class> forStep) { + for (AbstractStep step : steps) { + if (step.getClass().equals(forStep)) { + return (T) step.getValue(); + } } - } - return null; - } - - @Override - public void setValue(String selected) { - this.selected = items.get(selected); - } - - @Override - public OCIItem getValue() { - if (onlyOneChoice()) { - selected = items.values().iterator().next(); + return null; } - return selected; - } - - @Override - public boolean onlyOneChoice() { - return false; } } - private static NotifyDescriptor.QuickPick createQuickPick(Map ociItems, String title) { - List items = new ArrayList<> (); + public static NotifyDescriptor.QuickPick createQuickPick(Map ociItems, String title) { + List items = new ArrayList<>(); for (Map.Entry entry : ociItems.entrySet()) { String description = entry.getValue().getDescription(); if (description == null || description.isBlank()) { @@ -470,282 +300,4 @@ private static NotifyDescriptor.QuickPick createQuickPick(Ma return new NotifyDescriptor.QuickPick(title, title, items, false); } - /** - * Retrieve all compartments from a tenancy. - * - * @param tenancy - * @return - */ - static private Map getFlatCompartment(TenancyItem tenancy) { - Map compartments = new HashMap<>(); - OCISessionInitiator session = OCIManager.getDefault().getActiveSession(); - Identity identityClient = session.newClient(IdentityClient.class); - String nextPageToken = null; - - do { - ListCompartmentsResponse response - = identityClient.listCompartments( - ListCompartmentsRequest.builder() - .compartmentId(tenancy.getKey().getValue()) - .compartmentIdInSubtree(true) - .lifecycleState(Compartment.LifecycleState.Active) - .accessLevel(ListCompartmentsRequest.AccessLevel.Accessible) - .limit(1000) - .page(nextPageToken) - .build()); - for (Compartment comp : response.getItems()) { - FlatCompartmentItem ci = new FlatCompartmentItem(comp) { - FlatCompartmentItem getItem(OCID compId) { - return compartments.get(compId); - } - }; - compartments.put(ci.getKey(), ci); - } - nextPageToken = response.getOpcNextPage(); - } while (nextPageToken != null); - Map pickItems = computeFlatNames(compartments); - pickItems.put(tenancy.getName() + " (root)", tenancy); // NOI18N - return pickItems; - } - - static private Map computeFlatNames(Map compartments) { - Map pickItems = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); - for (FlatCompartmentItem comp : compartments.values()) { - pickItems.put(comp.getName(), comp); - } - return pickItems; - } - - /** - * This class represents compartments in a flat structure. Individual levels are separated by slashes. - * - */ - static private abstract class FlatCompartmentItem extends CompartmentItem { - - private final OCID parentId; - private String flatName; - - private FlatCompartmentItem(Compartment ociComp) { - super(OCID.of(ociComp.getId(), "Compartment"), ociComp.getCompartmentId(), ociComp.getName()); // NOI18N - setDescription(ociComp.getDescription()); - parentId = OCID.of(ociComp.getCompartmentId(), "Compartment"); // NOI18N - } - - public String getName() { - if (parentId.getValue() == null) { - return ""; - } - if (flatName == null) { - String parentFlatName = ""; - FlatCompartmentItem parentComp = getItem(parentId); - if (parentComp != null) { - parentFlatName = parentComp.getName(); - } - flatName = super.getName(); - if (!parentFlatName.isEmpty()) { - flatName = parentFlatName + "/" + flatName; // NOI18N - } - } - return flatName; - } - - abstract FlatCompartmentItem getItem(OCID compId); - } - - /** - * This step allows the user to select which type of resource will be added. - */ - static class ItemTypeStep implements Step { - String[] types = {"Databases", "Vault", "Bucket"}; //NOI18N - - private Lookup lookup; - private String selected; - - @Override - public Step prepare(Object item, Lookup lookup) { - this.lookup = lookup; - return this; - } - - @Override - public NotifyDescriptor createInput() { - List items = new ArrayList<>(types.length); - for (String itemType : types) { - items.add(new NotifyDescriptor.QuickPick.Item(itemType, itemType)); - } - return new NotifyDescriptor.QuickPick(Bundle.SelectResourceType(), Bundle.SelectResourceType(), items, false); - } - - @Override - public boolean onlyOneChoice() { - return false; - } - - @Override - public Step getNext() { - NextStepProvider nsProvider = NextStepProvider.builder() - .stepForClass(CompartmentStep.class, (s) -> new SuggestedStep(getValue())) - .stepForClass(SuggestedStep.class, (s) -> new ProjectStep()) - .build(); - return new TenancyStep().prepare(null, new ProxyLookup(Lookups.fixed(nsProvider), lookup)); - } - - @Override - public void setValue(String selected) { - this.selected = selected; - } - - @Override - public String getValue() { - return selected; - } - - } - - /** - * The purpose of this step is to select a project to update dependencies. - */ - public static class ProjectStep implements Step { - - private final CompletableFuture projectsFuture; - Map projects; - private Project selectedProject; - private Object item; - - public ProjectStep() { - projectsFuture = OpenProjectsFinder.getDefault().findTopLevelProjects(); - this.projects = new HashMap<> (); - } - - @Override - public Step prepare(Object item, Lookup lookup) { - this.item = item; - try { - Project[] p = projectsFuture.get(); - for (int i = 0; i < p.length; i++) { - ProjectInformation pi = ProjectUtils.getInformation(p[i]); - projects.put(pi.getDisplayName(), p[i]); - } - } catch (InterruptedException ex) { - Exceptions.printStackTrace(ex); - } catch (ExecutionException ex) { - Exceptions.printStackTrace(ex); - } - return this; - } - - @Override - public NotifyDescriptor createInput() { - List items = new ArrayList<>(projects.size()); - for (Map.Entry entry : projects.entrySet()) { - - items.add(new NotifyDescriptor.QuickPick.Item( - entry.getKey(), - entry.getValue().getProjectDirectory().getName())); - } - String title = Bundle.SelectProject(); - if (projects.size() == 0) { - title = Bundle.NoProjects(); - } - return new NotifyDescriptor.QuickPick(title, title, items, false); - } - - @Override - public boolean onlyOneChoice() { - return projects.size() == 1; - } - - @Override - public Step getNext() { - return null; - } - - @Override - public void setValue(String selected) { - selectedProject = projects.get(selected); - } - - @Override - public Object getValue() { - if (projects.size() == 1) { - selectedProject = (Project) projects.values().toArray()[0]; - } - return Pair.of(selectedProject, item); - } - - } - - /** - * Retrieve items of a given type from a specified compartment. - * @param parent Compartment to search for items - * @param path Type of the items - * @return List of items found - */ - protected static List getItemsByPath(CompartmentItem parent, String path) { - Map items = new HashMap<>(); - try { - switch (path) { - case "Databases": //NOI18N - return DatabaseNode.getDatabases().apply(parent); - case "Vault": //NOI18N - return VaultNode.getVaults().apply(parent); - case "Bucket": //NOI18N - return BucketNode.getBuckets().apply(parent); - case "Cluster": //NOI18N - return ClusterNode.getClusters().apply(parent); - case "ComputeInstance": //NOI18N - return ComputeInstanceNode.getComputeInstances().apply(parent); - default: - return Collections.emptyList(); - } - } catch (BmcException e) { - LOG.log(Level.SEVERE, "Unable to load vault list", e); //NOI18N - } - return Collections.emptyList(); - } - - /** - * Step to select an existing database connection from the Database Explorer. - * - */ - static final class DatabaseConnectionStep implements Step { - - private final Map adbConnections; - private DatabaseItem selected; - - public DatabaseConnectionStep(Map adbConnections) { - this.adbConnections = adbConnections; - } - - @Override - public Step prepare(Object empty, Lookup lookup) { - return this; - } - - @Override - public NotifyDescriptor createInput() { - return createQuickPick(adbConnections, Bundle.SelectDBConnection()); - } - - @Override - public Step getNext() { - return null; - } - - @Override - public void setValue(String selected) { - this.selected = (DatabaseItem) adbConnections.get(selected); - } - - @Override - public DatabaseItem getValue() { - return selected; - } - - @Override - public boolean onlyOneChoice() { - return false; - } - } - } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java index a166afd07ec1..3726f69f8503 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java @@ -32,8 +32,9 @@ "SelectDatabases=Select Oracle Autonomous Database", "SelectVault=Select OCI Vault", "SelectBucket=Select Object Storage Bucket", - "SelectCluster=Select Oracle Container Engine", - "SelectCompute=Select Compute Instance" + "SelectCluster=Select Oracle Container Engine for Kubernetes", + "SelectCompute=Select Compute Instance", + "SelectContainerRepository=Select Container Repository" }) public final class SuggestedItem extends OCIItem { @@ -51,7 +52,7 @@ public String getPath() { } public Set getExclusivePaths() { - return exclusivePaths; + return Collections.unmodifiableSet(exclusivePaths); } public static SuggestedItem forPath(String path) { @@ -66,6 +67,8 @@ public static SuggestedItem forPath(String path) { return new SuggestedItem("Cluster", Bundle.SelectCluster(), Collections.singleton("ComputeInstance")); //NOI18N case "ComputeInstance": //NOI18N return new SuggestedItem("ComputeInstance", Bundle.SelectCompute(), Collections.singleton("Cluster")); //NOI18N + case "ContainerRepository": //NOI18N + return new SuggestedItem("ContainerRepository", Bundle.SelectContainerRepository(), Collections.singleton("ContainerRepository")); //NOI18N default: throw new IllegalArgumentException(""); } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java index 64f98f07dcfc..2f2cfab50990 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java @@ -26,13 +26,48 @@ * @author Jan Horvath */ public final class ComputeInstanceItem extends OCIItem { - - public ComputeInstanceItem(OCID id, String compartmentId, String name) { + private String publicIp = null; + private String processorDescription; + private String username; + private String imageId; + + public ComputeInstanceItem(OCID id, String compartmentId, String name, String processorDescription, String imageId, String publicIp, String username) { super(id, compartmentId, name); + this.processorDescription = processorDescription; + this.publicIp = publicIp; + this.username = username; + this.imageId = imageId; } public ComputeInstanceItem() { super(); } + + public String getPublicIp() { + if (publicIp == null) { + return "-"; //NOI18N + } + return publicIp; + } + + public String getProcessorDescription() { + return processorDescription; + } + + public String getUsername() { + return username; + } + + void setUsername(String username) { + this.username = username; + } + + public String getImageId() { + return imageId; + } + + void setPublicId(String publicIp) { + this.publicIp = publicIp; + } } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceNode.java index 784e90acff29..2780fd1d599a 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceNode.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceNode.java @@ -19,11 +19,22 @@ package org.netbeans.modules.cloud.oracle.compute; import com.oracle.bmc.core.ComputeClient; +import com.oracle.bmc.core.VirtualNetworkClient; import com.oracle.bmc.core.model.Instance; +import com.oracle.bmc.core.model.Vnic; +import com.oracle.bmc.core.model.VnicAttachment; +import com.oracle.bmc.core.requests.GetImageRequest; +import com.oracle.bmc.core.requests.GetVnicRequest; import com.oracle.bmc.core.requests.ListInstancesRequest; +import com.oracle.bmc.core.requests.ListVnicAttachmentsRequest; +import com.oracle.bmc.core.responses.GetImageResponse; +import com.oracle.bmc.core.responses.GetVnicResponse; +import com.oracle.bmc.core.responses.ListVnicAttachmentsResponse; +import java.util.List; import java.util.stream.Collectors; import org.netbeans.modules.cloud.oracle.ChildrenProvider; import org.netbeans.modules.cloud.oracle.NodeProvider; +import org.netbeans.modules.cloud.oracle.OCIManager; import org.netbeans.modules.cloud.oracle.OCINode; import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem; import org.netbeans.modules.cloud.oracle.items.OCID; @@ -35,7 +46,7 @@ * @author Jan Horvath */ @NbBundle.Messages({ - "CoputeInstanceDesc=Compute Instance: {0}" + "CoputeInstanceDesc=Compute Instance: {0}\nPublic IP: {1}\nUsername: {2}\nProcessor: {3}" }) public class ComputeInstanceNode extends OCINode { private static final String COMPUTE_INSTANCE_ICON = "org/netbeans/modules/cloud/oracle/resources/computeinstance.svg"; // NOI18N @@ -45,13 +56,69 @@ public ComputeInstanceNode(ComputeInstanceItem instance) { setName(instance.getName()); setDisplayName(instance.getName()); setIconBaseWithExtension(COMPUTE_INSTANCE_ICON); - setShortDescription(Bundle.CoputeInstanceDesc(instance.getName())); + setShortDescription(Bundle.CoputeInstanceDesc( + instance.getName(), + instance.getPublicIp(), + instance.getUsername(), + instance.getProcessorDescription() + )); } public static NodeProvider createNode() { - return ComputeInstanceNode::new; + return (instance) -> { + update(instance); + return new ComputeInstanceNode(instance); + }; } + + + static public void update(ComputeInstanceItem instance) { + ComputeClient computeClient = ComputeClient.builder() + .build(OCIManager.getDefault().getActiveProfile().getAuthenticationProvider()); + if (instance.getImageId() != null) { + GetImageRequest request = GetImageRequest.builder() + .imageId(instance.getImageId()).build(); + GetImageResponse response = computeClient.getImage(request); + String os = response.getImage().getOperatingSystem(); + if (os.contains("Oracle")) { //NOI18N + instance.setUsername("opc"); //NOI18N + } else if (os.contains("Ubuntu")) { //NOI18N + instance.setUsername("ubuntu"); //NOI18N + } else if (os.contains("CentOS")) { //NOI18N + instance.setUsername("centos"); //NOI18N + } else if (os.contains("Debian")) { //NOI18N + instance.setUsername("debian"); //NOI18N + } else if (os.contains("Windows")) { //NOI18N + instance.setUsername("Administrator"); //NOI18N + } else { + instance.setUsername("opc"); //NOI18N + } + } + + VirtualNetworkClient virtualNetworkClient = VirtualNetworkClient.builder() + .build(OCIManager.getDefault().getActiveProfile().getAuthenticationProvider()); + + ListVnicAttachmentsRequest listVnicAttachmentsRequest = ListVnicAttachmentsRequest.builder() + .compartmentId(instance.getCompartmentId()) + .instanceId(instance.getKey().getValue()) + .build(); + + ListVnicAttachmentsResponse listVnicAttachmentsResponse = computeClient.listVnicAttachments(listVnicAttachmentsRequest); + List vnicAttachments = listVnicAttachmentsResponse.getItems(); + for (VnicAttachment vnicAttachment : vnicAttachments) { + GetVnicRequest getVnicRequest = GetVnicRequest.builder() + .vnicId(vnicAttachment.getVnicId()) + .build(); + GetVnicResponse getVnicResponse = virtualNetworkClient.getVnic(getVnicRequest); + Vnic vnic = getVnicResponse.getVnic(); + + if (vnic.getPublicIp() != null) { + instance.setPublicId(vnic.getPublicIp()); + } + } + } + /** * Retrieves list of Vaults belonging to a given Compartment. * @@ -60,7 +127,7 @@ public static NodeProvider createNode() { */ public static ChildrenProvider.SessionAware getComputeInstances() { return (compartmentId, session) -> { - ComputeClient client = session.newClient(ComputeClient.class); + final ComputeClient client = session.newClient(ComputeClient.class); ListInstancesRequest listInstancesRequest = ListInstancesRequest.builder() .compartmentId(compartmentId.getKey().getValue()) @@ -75,7 +142,11 @@ public static ChildrenProvider.SessionAware new ComputeInstanceItem( OCID.of(d.getId(), "ComputeInstance"), //NOI18N compartmentId.getKey().getValue(), - d.getDisplayName() + d.getDisplayName(), + d.getShapeConfig().getProcessorDescription(), + d.getImageId(), + null, + null )) .collect(Collectors.toList()); }; diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseNode.java index d00c005feb54..611581a68a26 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseNode.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseNode.java @@ -84,7 +84,7 @@ public static ChildrenProvider getDatabases() { OCID.of(d.getId(), "Databases"), //NOI18N compartmentId.getKey().getValue(), d.getDbName(), - d.getConnectionUrls().getOrdsUrl()+SERVICE_CONSOLE_SUFFIX, + d.getConnectionUrls().getOrdsUrl() + SERVICE_CONSOLE_SUFFIX, getConnectionName(profiles)); StringBuilder sb = new StringBuilder(); sb.append(Bundle.LBL_WorkloadType(d.getDbWorkload().getValue())); diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerRepositoryItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerRepositoryItem.java new file mode 100644 index 000000000000..75b1655c20c2 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerRepositoryItem.java @@ -0,0 +1,71 @@ +/* + * 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.cloud.oracle.developer; + +import org.netbeans.modules.cloud.oracle.items.OCID; +import org.netbeans.modules.cloud.oracle.items.OCIItem; + +/** + * + * @author Jan Horvath + */ +public final class ContainerRepositoryItem extends OCIItem { + + private Boolean isPublic; + private Integer imageCount; + private String regionCode; + private String namespace; + + public ContainerRepositoryItem(OCID id, String compartmentId, String name, String regionCode, String namespace, Boolean isPublic, Integer imageCount) { + super(id, compartmentId, name); + this.regionCode = regionCode; + this.namespace = namespace; + this.isPublic = isPublic; + this.imageCount = imageCount; + } + + public ContainerRepositoryItem() { + super(); + } + + public Boolean getIsPublic() { + return isPublic; + } + + public Integer getImageCount() { + return imageCount; + } + + public void setImageCount(Integer imageCount) { + this.imageCount = imageCount; + } + + public String getRegionCode() { + return regionCode; + } + + public String getNamespace() { + return namespace; + } + + public String getUrl() { + return String.format("%s.ocir.io/%s/%s", getRegionCode(), getNamespace(), getName()); + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerRepositoryNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerRepositoryNode.java new file mode 100644 index 000000000000..5b58f1f535e8 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerRepositoryNode.java @@ -0,0 +1,103 @@ +/* + * 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.cloud.oracle.developer; + +import com.oracle.bmc.artifacts.ArtifactsClient; +import com.oracle.bmc.artifacts.model.ContainerRepository; +import com.oracle.bmc.artifacts.requests.GetContainerRepositoryRequest; +import com.oracle.bmc.artifacts.requests.ListContainerRepositoriesRequest; +import com.oracle.bmc.artifacts.responses.GetContainerRepositoryResponse; +import java.util.stream.Collectors; +import org.netbeans.modules.cloud.oracle.ChildrenProvider; +import org.netbeans.modules.cloud.oracle.NodeProvider; +import org.netbeans.modules.cloud.oracle.OCIManager; +import org.netbeans.modules.cloud.oracle.OCINode; +import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem; +import org.netbeans.modules.cloud.oracle.items.OCID; +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "ContainerRepositoryDesc=Container Repository: {0}\nURL: {1}" +}) +public class ContainerRepositoryNode extends OCINode { + private static final String CONTAINER_REPOSITORY_ICON = "org/netbeans/modules/cloud/oracle/resources/containerrepository.svg"; // NOI18N + + public ContainerRepositoryNode(ContainerRepositoryItem instance) { + super(instance); + setName(instance.getName()); + setDisplayName(instance.getName()); + setIconBaseWithExtension(CONTAINER_REPOSITORY_ICON); + setShortDescription(Bundle.ContainerRepositoryDesc(instance.getName(), instance.getUrl())); + } + + public static NodeProvider createNode() { + return ContainerRepositoryNode::new; + } + + @Override + public void update(OCIItem item) { + ContainerRepositoryItem orig = (ContainerRepositoryItem) item; + ArtifactsClient client = OCIManager.getDefault().getActiveProfile().newClient(ArtifactsClient.class); + GetContainerRepositoryRequest listContainerRepositoriesRequest = GetContainerRepositoryRequest.builder() + .repositoryId(item.getKey().getValue()) + .build(); + + GetContainerRepositoryResponse response = client.getContainerRepository(listContainerRepositoriesRequest); + ContainerRepository cr = response.getContainerRepository(); + orig.setImageCount(cr.getImageCount()); + + } + + /** + * Retrieves list of Vaults belonging to a given Compartment. + * + * @return Returns {@code ChildrenProvider} which fetches List of + * {@code BucketItem} for given {@code CompartmentItem} + */ + public static ChildrenProvider.SessionAware getContainerRepositories() { + return (compartmentId, session) -> { + ArtifactsClient client = session.newClient(ArtifactsClient.class); + + ListContainerRepositoriesRequest listContainerRepositoriesRequest = ListContainerRepositoriesRequest.builder() + .compartmentId(compartmentId.getKey().getValue()) + .build(); + + return client.listContainerRepositories(listContainerRepositoriesRequest) + .getContainerRepositoryCollection() + .getItems() + .stream() + .map(d -> new ContainerRepositoryItem( + OCID.of(d.getId(), "ContainerRepository"), //NOI18N + compartmentId.getKey().getValue(), + d.getDisplayName(), + session.getRegion().getRegionCode(), + d.getNamespace(), + d.getIsPublic(), + d.getImageCount() + )) + .collect(Collectors.toList()); + }; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerTagItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerTagItem.java new file mode 100644 index 000000000000..72c517131c3c --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerTagItem.java @@ -0,0 +1,67 @@ +/* + * 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.cloud.oracle.developer; + +import org.netbeans.modules.cloud.oracle.items.OCID; +import org.netbeans.modules.cloud.oracle.items.OCIItem; + +/** + * + * @author Jan Horvath + */ +public final class ContainerTagItem extends OCIItem { + + private String digest; + private String version; + private String regionCode; + private String namespace; + private String repositoryName; + + public ContainerTagItem(OCID id, String compartmentId, String repositoryName, String regionCode, String namespace, String version, String digest) { + super(id, compartmentId, version != null ? version : digest); + this.regionCode = regionCode; + this.version = version; + this.digest = digest; + this.repositoryName = repositoryName; + this.namespace = namespace; + } + + public ContainerTagItem() { + super(); + } + + public String getUrl() { + if (version != null) { + return String.format("%s.ocir.io/%s/%s:%s", regionCode, namespace, repositoryName, version); + } + return String.format("%s.ocir.io/%s/%s@%s", regionCode, namespace, repositoryName, digest); + } + + public String getDigest() { + return digest; + } + + public String getVersion() { + if (version == null) { + return ""; + } + return version; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerTagNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerTagNode.java new file mode 100644 index 000000000000..5869f53d5f8f --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/developer/ContainerTagNode.java @@ -0,0 +1,85 @@ +/* + * 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.cloud.oracle.developer; + +import com.oracle.bmc.artifacts.ArtifactsClient; +import com.oracle.bmc.artifacts.requests.ListContainerImagesRequest; +import java.util.stream.Collectors; +import org.netbeans.modules.cloud.oracle.ChildrenProvider; +import org.netbeans.modules.cloud.oracle.NodeProvider; +import org.netbeans.modules.cloud.oracle.OCINode; +import org.netbeans.modules.cloud.oracle.items.OCID; +import org.openide.nodes.Children; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "ContainerTagDesc=Pull URL: {0}\nVersion: {1}\nDigest: {2}" +}) +public class ContainerTagNode extends OCINode { + private static final String CONTAINER_TAG_ICON = "org/netbeans/modules/cloud/oracle/resources/containertag.svg"; // NOI18N + + public ContainerTagNode(ContainerTagItem tag) { + super(tag, Children.LEAF); + setName(tag.getName()); + setDisplayName(tag.getName()); + setIconBaseWithExtension(CONTAINER_TAG_ICON); + setShortDescription(Bundle.ContainerTagDesc(tag.getUrl(), tag.getVersion(), tag.getDigest())); + } + + public static NodeProvider createNode() { + return ContainerTagNode::new; + } + + /** + * Retrieves list of Vaults belonging to a given Compartment. + * + * @return Returns {@code ChildrenProvider} which fetches List of + * {@code BucketItem} for given {@code CompartmentItem} + */ + public static ChildrenProvider.SessionAware getContainerTags() { + return (containerRepository, session) -> { + ArtifactsClient client = session.newClient(ArtifactsClient.class); + + ListContainerImagesRequest listContainerImagesRequest = ListContainerImagesRequest.builder() + .compartmentId(containerRepository.getCompartmentId()) + .repositoryId(containerRepository.getKey().getValue()) + .build(); + + return client.listContainerImages(listContainerImagesRequest) + .getContainerImageCollection() + .getItems() + .stream() + .map(d -> new ContainerTagItem( + OCID.of(d.getId(), "ContainerTag"), //NOI18N + containerRepository.getCompartmentId(), + containerRepository.getName(), + containerRepository.getRegionCode(), + containerRepository.getNamespace(), + d.getVersion(), + d.getDigest().trim() + )) + .collect(Collectors.toList()); + }; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/NamedReference.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/NamedReference.java new file mode 100644 index 000000000000..8d8d77198d23 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/NamedReference.java @@ -0,0 +1,41 @@ +/* + * 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.cloud.oracle.items; + +/** + * References a resource that can be used in source code under a specified name, such as a datasource or an OCI vault. + * + * @author Jan Horvath + */ +public interface NamedReference { + + /** + * Set a reference name. + * + * @param referenceName + */ + public void setReferenceName(String referenceName); + + /** + * Returns a reference name. + * @return + */ + public String getReferenceName(); + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java index 3e823455a03b..69243f29dea5 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java @@ -18,9 +18,9 @@ */ package org.netbeans.modules.cloud.oracle.items; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; import java.util.Objects; -import javax.swing.event.ChangeListener; -import org.openide.util.ChangeSupport; /** * Represents Oracle Cloud Resource identified by Oracle Cloud Identifier (OCID) @@ -32,7 +32,7 @@ public abstract class OCIItem { final String name; final String compartmentId; String description; - transient ChangeSupport changeSupport; + final transient PropertyChangeSupport changeSupport; /** * Construct a new {@code OCIItem}. @@ -45,7 +45,7 @@ public OCIItem(OCID id, String compartmentId, String name) { this.id = id; this.name = name; this.compartmentId = compartmentId; - changeSupport = new ChangeSupport(this); + changeSupport = new PropertyChangeSupport(this); } public OCIItem() { @@ -101,29 +101,33 @@ public void setDescription(String description) { * Triggers node refresh. */ public void refresh() { - changeSupport.fireChange(); + changeSupport.firePropertyChange("children", 0, 1); } /** * Adds a ChangeListener to the listener list. * - * @param listener the ChangeListener to be added. + * @param listener the PropertyChangeListener to be added. */ - public void addChangeListener(ChangeListener listener) { - changeSupport.addChangeListener(listener); + public void addChangeListener(PropertyChangeListener listener) { + changeSupport.addPropertyChangeListener(listener); } /** * Removes a ChangeListener from the listener list. * - * @param listener the ChangeListener to be removed. + * @param listener the PropertyChangeListener to be removed. */ - public void removeChangeListener(ChangeListener listener) { - changeSupport.removeChangeListener(listener); + public void removeChangeListener(PropertyChangeListener listener) { + changeSupport.removePropertyChangeListener(listener); + } + + protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { + changeSupport.firePropertyChange(propertyName, oldValue, newValue); } public int maxInProject() { - return 0; + return 1; } @Override @@ -156,5 +160,8 @@ public boolean equals(Object obj) { return Objects.equals(this.id, other.id); } + public void fireRefNameChanged(String oldRefName, String referenceName) { + changeSupport.firePropertyChange("referenceName", oldRefName, referenceName); + } } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/policy/PolicyGenerator.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/policy/PolicyGenerator.java index d7beb09c1731..2d521b63101a 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/policy/PolicyGenerator.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/policy/PolicyGenerator.java @@ -18,17 +18,18 @@ */ package org.netbeans.modules.cloud.oracle.policy; -import java.util.List; +import java.util.Collection; import org.netbeans.modules.cloud.oracle.assets.SuggestedItem; import org.netbeans.modules.cloud.oracle.items.OCIItem; /** - * + * Creates application.properties, bootstrap.properties and OCI Vault secrets from current contents of the {@link CloudAssets}. + * * @author Jan Horvath */ public class PolicyGenerator { - public static String createPolicies(List items) { + public static String createPolicies(Collection items) { OCIItem execution = null; String principalType; for (OCIItem item : items) { diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/containerrepository.svg b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/containerrepository.svg new file mode 100644 index 000000000000..98403a24370c --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/containerrepository.svg @@ -0,0 +1,133 @@ + + + + + + + + + diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/containertag.svg b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/containertag.svg new file mode 100644 index 000000000000..98403a24370c --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/containertag.svg @@ -0,0 +1,133 @@ + + + + + + + + + diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/layer.xml b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/layer.xml index b40972c8d16f..5314e8831d6e 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/layer.xml +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/resources/layer.xml @@ -79,6 +79,9 @@ + + + @@ -202,6 +205,23 @@ + + + + + + + + + + + + + + + + + diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/CompartmentStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/CompartmentStep.java new file mode 100644 index 000000000000..891e12b442c4 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/CompartmentStep.java @@ -0,0 +1,178 @@ +/* + * 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.cloud.oracle.steps; + +import com.oracle.bmc.identity.Identity; +import com.oracle.bmc.identity.IdentityClient; +import com.oracle.bmc.identity.model.Compartment; +import com.oracle.bmc.identity.requests.ListCompartmentsRequest; +import com.oracle.bmc.identity.responses.ListCompartmentsResponse; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.OCIManager; +import org.netbeans.modules.cloud.oracle.OCISessionInitiator; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import static org.netbeans.modules.cloud.oracle.assets.Steps.createQuickPick; +import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem; +import org.netbeans.modules.cloud.oracle.items.OCID; +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.netbeans.modules.cloud.oracle.items.TenancyItem; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "NoCompartment=There are no compartments in the Tenancy", + "CollectingItems_Text=Listing compartments and databases", + "SelectCompartment=Select Compartment", + "# {0} - Name of the compartment", + "Root={0} (root)" +}) +public final class CompartmentStep extends AbstractStep { + + private Map compartments = null; + private CompartmentItem selected; + + @Override + public void prepare(ProgressHandle h, Values values) { + h.progress(Bundle.CollectingItems_Text()); + TenancyItem tenancy = values.getValueForStep(TenancyStep.class); + compartments = getFlatCompartment(tenancy); + } + + @Override + public NotifyDescriptor createInput() { + if (onlyOneChoice()) { + throw new IllegalStateException("Input shouldn't be displayed for one choice"); // NOI18N + } + if (compartments.isEmpty()) { + return createQuickPick(compartments, Bundle.NoCompartment()); + } + return createQuickPick(compartments, Bundle.SelectCompartment()); + } + + @Override + public void setValue(String selected) { + this.selected = (CompartmentItem) compartments.get(selected); + } + + @Override + public CompartmentItem getValue() { + if (onlyOneChoice()) { + return (CompartmentItem) compartments.values().iterator().next(); + } + return selected; + } + + @Override + public boolean onlyOneChoice() { + return compartments.size() == 1; + } + + /** + * Retrieve all compartments from a tenancy. + * + * @param tenancy + * @return + */ + static private Map getFlatCompartment(TenancyItem tenancy) { + Map compartments = new HashMap<>(); + OCISessionInitiator session = OCIManager.getDefault().getActiveSession(); + Identity identityClient = session.newClient(IdentityClient.class); + String nextPageToken = null; + + do { + ListCompartmentsResponse response + = identityClient.listCompartments( + ListCompartmentsRequest.builder() + .compartmentId(tenancy.getKey().getValue()) + .compartmentIdInSubtree(true) + .lifecycleState(Compartment.LifecycleState.Active) + .accessLevel(ListCompartmentsRequest.AccessLevel.Accessible) + .limit(1000) + .page(nextPageToken) + .build()); + for (Compartment comp : response.getItems()) { + FlatCompartmentItem ci = new FlatCompartmentItem(comp) { + @Override + FlatCompartmentItem getItem(OCID compId) { + return compartments.get(compId); + } + }; + compartments.put(ci.getKey(), ci); + } + nextPageToken = response.getOpcNextPage(); + } while (nextPageToken != null); + Map pickItems = computeFlatNames(compartments); + pickItems.put(Bundle.Root(tenancy.getName()), tenancy); + return pickItems; + } + + static private Map computeFlatNames(Map compartments) { + Map pickItems = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); + for (FlatCompartmentItem comp : compartments.values()) { + pickItems.put(comp.getName(), comp); + } + return pickItems; + } + + /** + * This class represents compartments in a flat structure. Individual levels + * are separated by slashes. + * + */ + static private abstract class FlatCompartmentItem extends CompartmentItem { + + private final OCID parentId; + private String flatName; + + private FlatCompartmentItem(Compartment ociComp) { + super(OCID.of(ociComp.getId(), "Compartment"), ociComp.getCompartmentId(), ociComp.getName()); // NOI18N + setDescription(ociComp.getDescription()); + parentId = OCID.of(ociComp.getCompartmentId(), "Compartment"); // NOI18N + } + + public String getName() { + if (parentId.getValue() == null) { + return ""; + } + if (flatName == null) { + String parentFlatName = ""; + FlatCompartmentItem parentComp = getItem(parentId); + if (parentComp != null) { + parentFlatName = parentComp.getName(); + } + flatName = super.getName(); + if (!parentFlatName.isEmpty()) { + flatName = parentFlatName + "/" + flatName; // NOI18N + } + } + return flatName; + } + + abstract FlatCompartmentItem getItem(OCID compId); + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DatabaseConnectionStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DatabaseConnectionStep.java new file mode 100644 index 000000000000..75de3288c71c --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DatabaseConnectionStep.java @@ -0,0 +1,82 @@ +/* + * 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.cloud.oracle.steps; + +import java.util.HashMap; +import java.util.Map; +import org.netbeans.api.db.explorer.ConnectionManager; +import org.netbeans.api.db.explorer.DatabaseConnection; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps; +import org.netbeans.modules.cloud.oracle.database.DatabaseItem; +import org.netbeans.modules.cloud.oracle.items.OCID; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * Step to select an existing database connection from the Database Explorer. + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "SelectDBConnection=Select Database Connection" +}) +public final class DatabaseConnectionStep extends AbstractStep { + + private final Map adbConnections; + private DatabaseItem selected = null; + + public DatabaseConnectionStep() { + adbConnections = new HashMap<>(); + DatabaseConnection[] connections = ConnectionManager.getDefault().getConnections(); + for (int i = 0; i < connections.length; i++) { + String name = connections[i].getDisplayName(); + String ocid = connections[i].getConnectionProperties().getProperty("OCID"); //NOI18N + String compartmentId = connections[i].getConnectionProperties().getProperty("CompartmentOCID"); //NOI18N + String description = connections[i].getConnectionProperties().getProperty("Description"); //NOI18N + if (ocid != null && compartmentId != null) { + DatabaseItem dbItem + = new DatabaseItem(OCID.of(ocid, "Databases"), compartmentId, name, null, name); //NOI18N + dbItem.setDescription(description); + adbConnections.put(name, dbItem); + } + } + } + + @Override + public NotifyDescriptor createInput() { + return Steps.createQuickPick(adbConnections, Bundle.SelectDBConnection()); + } + + @Override + public void setValue(String selected) { + this.selected = (DatabaseItem) adbConnections.get(selected); + } + + @Override + public DatabaseItem getValue() { + return selected; + } + + @Override + public boolean onlyOneChoice() { + return adbConnections.isEmpty(); + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DatasourceNameStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DatasourceNameStep.java new file mode 100644 index 000000000000..3775286901e7 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DatasourceNameStep.java @@ -0,0 +1,64 @@ +/* + * 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.cloud.oracle.steps; + +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "DatasourceName=Datasource Name", +}) +public class DatasourceNameStep extends AbstractStep { + private String selected = null; + + public DatasourceNameStep() { + } + + @Override + public void prepare(ProgressHandle h, Values values) { + } + + @Override + public NotifyDescriptor createInput() { + return new NotifyDescriptor.InputLine(selected == null ? "" : "DEFAULT", Bundle.DatasourceName()); //NOI18N + } + + @Override + public void setValue(String selected) { + this.selected = selected; + } + + @Override + public String getValue() { + return selected; + } + + @Override + public boolean onlyOneChoice() { + return false; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DevopsStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DevopsStep.java new file mode 100644 index 000000000000..63cfb7742f99 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/DevopsStep.java @@ -0,0 +1,112 @@ +/* + * 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.cloud.oracle.steps; + +import com.oracle.bmc.devops.DevopsClient; +import com.oracle.bmc.devops.model.ProjectSummary; +import com.oracle.bmc.devops.requests.ListProjectsRequest; +import com.oracle.bmc.devops.responses.ListProjectsResponse; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.OCIManager; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem; +import org.netbeans.modules.cloud.oracle.devops.DevopsProjectItem; +import org.netbeans.modules.cloud.oracle.devops.DevopsProjectService; +import org.netbeans.modules.cloud.oracle.items.OCID; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "FetchingDevopsProjects=Fetching DevOps projects", + "NoDevopsProjects=There are no Devops Projects in selected Compartment", + "SelectDevopsProject=Select Devops Project" +}) +public class DevopsStep extends AbstractStep { + + private Map devopsProjects; + private DevopsProjectItem selected; + + @Override + public void prepare(ProgressHandle h, Values values) { + h.progress(Bundle.FetchingDevopsProjects()); + List devops = DevopsProjectService.getDevopsProjectOcid(); + CompartmentItem compartment = values.getValueForStep(CompartmentStep.class); + Map allProjectsInCompartment = getDevopsProjects(compartment.getKey().getValue()); + Map filtered = allProjectsInCompartment.entrySet().stream().filter(e -> devops.contains(e.getValue().getKey().getValue())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + if (!filtered.isEmpty()) { + devopsProjects = filtered; + } else { + devopsProjects = allProjectsInCompartment; + } + if (devopsProjects.size() == 1) { + selected = devopsProjects.values().iterator().next(); + } + } + + @Override + public NotifyDescriptor createInput() { + if (devopsProjects.size() > 1) { + return Steps.createQuickPick(devopsProjects, Bundle.SelectDevopsProject()); + } + if (devopsProjects.isEmpty()) { + return new NotifyDescriptor.QuickPick("", Bundle.NoDevopsProjects(), Collections.emptyList(), false); + } + throw new IllegalStateException("No data to create input"); // NOI18N + } + + @Override + public boolean onlyOneChoice() { + return devopsProjects.size() == 1; + } + + @Override + public void setValue(String projectName) { + selected = devopsProjects.get(projectName); + } + + @Override + public DevopsProjectItem getValue() { + return selected; + } + + protected static Map getDevopsProjects(String compartmentId) { + try (DevopsClient client = new DevopsClient(OCIManager.getDefault().getConfigProvider())) { + ListProjectsRequest request = ListProjectsRequest.builder().compartmentId(compartmentId).build(); + ListProjectsResponse response = client.listProjects(request); + List projects = response.getProjectCollection().getItems(); + for (ProjectSummary project : projects) { + project.getNotificationConfig().getTopicId(); + } + return projects.stream().map(p -> new DevopsProjectItem(OCID.of(p.getId(), "DevopsProject"), // NOI18N + compartmentId, p.getName())).collect(Collectors.toMap(DevopsProjectItem::getName, Function.identity())); + } + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/ItemTypeStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/ItemTypeStep.java new file mode 100644 index 000000000000..2e4235a076c9 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/ItemTypeStep.java @@ -0,0 +1,79 @@ +/* + * 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.cloud.oracle.steps; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * This step allows the user to select which type of resource will be added. + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "SelectResourceType=Select Resource Type", +}) +public class ItemTypeStep extends AbstractStep { + + private static final Map TYPES = new HashMap() { + { + put(Bundle.Databases(), "Databases"); //NOI18N + put(Bundle.Bucket(), "Bucket"); //NOI18N + put(Bundle.Vault(), "Vault"); //NOI18N + put(Bundle.ContainerRepository(), "ContainerRepository"); //NOI18N + } + }; + private String selected; + + @Override + public void prepare(ProgressHandle h, Values values) { + } + + @Override + public NotifyDescriptor createInput() { + List items = new ArrayList<>(TYPES.size()); + for (Map.Entry itemType : TYPES.entrySet()) { + items.add(new NotifyDescriptor.QuickPick.Item(itemType.getKey(), "")); + } + return new NotifyDescriptor.QuickPick(Bundle.SelectResourceType(), Bundle.SelectResourceType(), items, false); + } + + @Override + public boolean onlyOneChoice() { + return false; + } + + @Override + public void setValue(String selectedName) { + this.selected = TYPES.get(selectedName); + } + + @Override + public String getValue() { + return selected; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/KeyStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/KeyStep.java new file mode 100644 index 000000000000..9ca674e1bb9e --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/KeyStep.java @@ -0,0 +1,108 @@ +/* + * 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.cloud.oracle.steps; + +import com.oracle.bmc.model.BmcException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.netbeans.modules.cloud.oracle.vault.KeyItem; +import org.netbeans.modules.cloud.oracle.vault.KeyNode; +import org.netbeans.modules.cloud.oracle.vault.VaultItem; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "NoKeys=No keys in this Vault. Select another one." +}) +public class KeyStep extends AbstractStep { + private static final Logger LOG = Logger.getLogger(KeyStep.class.getName()); + private Map keys = null; + private KeyItem selected; + private VaultItem vault; + + public KeyStep(VaultItem vault) { + this.vault = vault; + } + + public KeyStep() { + vault = null; + } + + @Override + public void prepare(ProgressHandle h, Values values) { + if (vault == null) { + vault = values.getValueForStep(VaultStep.class); + } + keys = getKeys(vault); + } + + @Override + public boolean onlyOneChoice() { + return keys.size() == 1; + } + + @Override + public NotifyDescriptor createInput() { + if (keys.size() > 1) { + return Steps.createQuickPick(keys, Bundle.SelectKey()); + } + if (keys.isEmpty()) { + return new NotifyDescriptor.QuickPick("", Bundle.NoKeys(), Collections.emptyList(), false); + } + throw new IllegalStateException("No data to create input"); // NOI18N + } + + @Override + public void setValue(String selected) { + this.selected = keys.get(selected); + } + + @Override + public KeyItem getValue() { + if (keys.size() == 1) { + return keys.values().iterator().next(); + } + return selected; + } + + protected Map getKeys(OCIItem parent) { + Map items = new HashMap<>(); + try { + if (parent instanceof VaultItem) { + KeyNode.getKeys().apply((VaultItem) parent).forEach(key -> items.put(key.getName(), key)); + } + } catch (BmcException e) { + LOG.log(Level.SEVERE, "Unable to load key list", e); //NOI18N + } + return items; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/OverwriteStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/OverwriteStep.java new file mode 100644 index 000000000000..bab2f4977818 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/OverwriteStep.java @@ -0,0 +1,102 @@ +/* + * 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.cloud.oracle.steps; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.netbeans.modules.cloud.oracle.vault.SecretItem; +import org.netbeans.modules.cloud.oracle.vault.SecretNode; +import org.netbeans.modules.cloud.oracle.vault.VaultItem; +import org.openide.NotifyDescriptor; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "SecretExists=Secrets with name {0} already exists", + "Cancel=Cancel", + "AddVersion=Add new versions", + "DatasourceEmpty=Datasource name cannot be empty" +}) +public class OverwriteStep extends AbstractStep { + + private Set dsNames; + private String choice; + private Lookup lookup; + private String dsName; + private static final Pattern p = Pattern.compile("[A-Z]*_([a-zA-Z0-9]*)_[A-Z]*"); //NOI18N + + @Override + public void prepare(ProgressHandle h, Values values) { + dsName = values.getValueForStep(DatasourceNameStep.class); + VaultItem vault = values.getValueForStep(VaultStep.class); + if (dsName == null || dsName.isEmpty() || vault == null) { + return; + } + List secrets = SecretNode.getSecrets().apply(vault); + this.dsNames = secrets.stream().map(s -> extractDatasourceName(s.getName())).filter(Objects::nonNull).collect(Collectors.toSet()); + } + + @Override + public NotifyDescriptor createInput() { + if (dsName == null || dsName.isEmpty()) { + return new NotifyDescriptor.QuickPick("", Bundle.DatasourceEmpty(), Collections.emptyList(), false); + } + List yesNo = new ArrayList(); + yesNo.add(new NotifyDescriptor.QuickPick.Item(Bundle.AddVersion(), "")); + yesNo.add(new NotifyDescriptor.QuickPick.Item(Bundle.Cancel(), "")); + return new NotifyDescriptor.QuickPick("", Bundle.SecretExists(dsName), yesNo, false); + } + + @Override + public void setValue(String choice) { + this.choice = choice; + } + + @Override + public Boolean getValue() { + return Bundle.AddVersion().equals(choice) || onlyOneChoice(); + } + + @Override + public boolean onlyOneChoice() { + return dsNames == null || !dsNames.contains(dsName); + } + + protected static String extractDatasourceName(String value) { + Matcher m = p.matcher(value); + if (m.matches()) { + return m.group(1); + } + return null; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/PasswordStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/PasswordStep.java new file mode 100644 index 000000000000..2bac42b5a62b --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/PasswordStep.java @@ -0,0 +1,70 @@ +/* + * 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.cloud.oracle.steps; + +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * + * @author honza + */ +@NbBundle.Messages({ + "Password=Enter password for Database user {0}", +}) +public class PasswordStep extends AbstractStep { + + private boolean ask; + private String password; + private final String username; + + public PasswordStep(String password, String username) { + this.password = password; + this.username = username; + } + + @Override + public void prepare(ProgressHandle h, Values values) { + ask = password == null || password.isEmpty(); + } + + @Override + public NotifyDescriptor createInput() { + return new NotifyDescriptor.PasswordLine("DEFAULT", Bundle.Password(username)); //NOI18N + } + + @Override + public boolean onlyOneChoice() { + return !ask; + } + + @Override + public void setValue(String password) { + this.password = password; + } + + @Override + public String getValue() { + return password; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/ProjectStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/ProjectStep.java new file mode 100644 index 000000000000..5cd9ce751e95 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/ProjectStep.java @@ -0,0 +1,99 @@ +/* + * 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.cloud.oracle.steps; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectInformation; +import org.netbeans.api.project.ProjectUtils; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.OpenProjectsFinder; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.openide.NotifyDescriptor; +import org.openide.util.Exceptions; +import org.openide.util.NbBundle; + +/** + * The purpose of this step is to select a project to update dependencies. + */ +@NbBundle.Messages({ + "SelectProject=Select Project to Update Dependencies", + "NoProjects=No Project Found",}) +public class ProjectStep extends AbstractStep { + + private final CompletableFuture projectsFuture; + private final Map projects; + private Project selectedProject; + + public ProjectStep() { + projectsFuture = OpenProjectsFinder.getDefault().findTopLevelProjects(); + this.projects = new HashMap<>(); + } + + @Override + public void prepare(ProgressHandle h, Values values) { + try { + Project[] p = projectsFuture.get(); + for (int i = 0; i < p.length; i++) { + ProjectInformation pi = ProjectUtils.getInformation(p[i]); + projects.put(pi.getDisplayName(), p[i]); + } + } catch (InterruptedException | ExecutionException ex) { + Exceptions.printStackTrace(ex); + } + } + + @Override + public NotifyDescriptor createInput() { + List items = new ArrayList<>(projects.size()); + for (Map.Entry entry : projects.entrySet()) { + items.add(new NotifyDescriptor.QuickPick.Item(entry.getKey(), entry.getValue().getProjectDirectory().getName())); + } + String title = Bundle.SelectProject(); + if (projects.isEmpty()) { + title = Bundle.NoProjects(); + } + return new NotifyDescriptor.QuickPick(title, title, items, false); + } + + @Override + public boolean onlyOneChoice() { + return projects.size() == 1; + } + + @Override + public void setValue(String selected) { + selectedProject = projects.get(selected); + } + + @Override + public Project getValue() { + if (projects.size() == 1) { + return (Project) projects.values().toArray()[0]; + } + return selectedProject; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/SuggestedStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/SuggestedStep.java new file mode 100644 index 000000000000..52a673cdacdf --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/SuggestedStep.java @@ -0,0 +1,151 @@ +/* + * 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.cloud.oracle.steps; + +import com.oracle.bmc.model.BmcException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.netbeans.modules.cloud.oracle.bucket.BucketNode; +import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem; +import org.netbeans.modules.cloud.oracle.compute.ClusterNode; +import org.netbeans.modules.cloud.oracle.compute.ComputeInstanceNode; +import org.netbeans.modules.cloud.oracle.database.DatabaseNode; +import org.netbeans.modules.cloud.oracle.developer.ContainerRepositoryNode; +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.netbeans.modules.cloud.oracle.vault.VaultNode; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * Show list of items for a suggested type. + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "Databases=Oracle Autonomous Database", + "Vault=OCI Vault", + "Bucket=Object Storage Bucket", + "Cluster=Oracle Container Engine", + "Compute=Compute Instance", + "SelectItem=Select {0}", + "ContainerRepository=Container Repository", +}) +public class SuggestedStep extends AbstractStep { + private static final Logger LOG = Logger.getLogger(SuggestedStep.class.getName()); + private final Map items = new HashMap<>(); + private OCIItem selected; + private String suggestedType; + + public SuggestedStep(String suggestedType) { + this.suggestedType = suggestedType; + } + + @Override + public void prepare(ProgressHandle h, Values values) { + h.progress(Bundle.CollectingItems_Text()); + if (suggestedType == null) { + suggestedType = values.getValueForStep(ItemTypeStep.class); + } + CompartmentItem compartment = values.getValueForStep(CompartmentStep.class); + getItemsByPath(compartment, suggestedType) + .forEach(db -> items.put(db.getName(), db)); + } + + private String getSuggestedItemName() { + switch (suggestedType) { + case "Databases": + return Bundle.Databases(); + case "Vault": + return Bundle.Vault(); + case "Bucket": + return Bundle.Bucket(); + case "Cluster": + return Bundle.Cluster(); + case "ComputeInstance": + return Bundle.Compute(); + case "ContainerRepository": + return Bundle.ContainerRepository(); + } + throw new MissingResourceException("Missing OCI type", null, suggestedType); + } + + @Override + public NotifyDescriptor createInput() { + return Steps.createQuickPick(items, Bundle.SelectItem(getSuggestedItemName())); + } + + @Override + public void setValue(String selected) { + this.selected = items.get(selected); + } + + @Override + public OCIItem getValue() { + if (onlyOneChoice()) { + selected = items.values().iterator().next(); + } + return selected; + } + + @Override + public boolean onlyOneChoice() { + return false; + } + + /** + * Retrieve items of a given type from a specified compartment. + * @param parent Compartment to search for items + * @param path Type of the items + * @return List of items found + */ + protected static List getItemsByPath(CompartmentItem parent, String path) { + Map items = new HashMap<>(); + try { + switch (path) { + case "Databases": //NOI18N + return DatabaseNode.getDatabases().apply(parent); + case "Vault": //NOI18N + return VaultNode.getVaults().apply(parent); + case "Bucket": //NOI18N + return BucketNode.getBuckets().apply(parent); + case "Cluster": //NOI18N + return ClusterNode.getClusters().apply(parent); + case "ComputeInstance": //NOI18N + return ComputeInstanceNode.getComputeInstances().apply(parent); + case "ContainerRepository": //NOI18N + return ContainerRepositoryNode.getContainerRepositories().apply(parent); + default: + return Collections.emptyList(); + } + } catch (BmcException e) { + LOG.log(Level.SEVERE, "Unable to load vault list", e); //NOI18N + } + return Collections.emptyList(); + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/TenancyStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/TenancyStep.java new file mode 100644 index 000000000000..20964ee79319 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/TenancyStep.java @@ -0,0 +1,101 @@ +/* + * 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.cloud.oracle.steps; + +import com.oracle.bmc.identity.model.Tenancy; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicReference; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.OCIManager; +import org.netbeans.modules.cloud.oracle.OCIProfile; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.netbeans.modules.cloud.oracle.items.TenancyItem; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "SelectProfile=Select OCI Profile", + "SelectProfile_Description={0} (region: {1})", + "NoProfile=There is not any OCI profile in the config", + "CollectingProfiles_Text=Loading OCI Profiles", + "SelectKey=Select Key" +}) +public final class TenancyStep extends AbstractStep { + + private List profiles = new LinkedList<>(); + private final AtomicReference selected = new AtomicReference<>(); + + @Override + public NotifyDescriptor createInput() { + if (onlyOneChoice()) { + throw new IllegalStateException("No data to create input"); // NOI18N + } + String title = Bundle.SelectProfile(); + List items = new ArrayList<>(profiles.size()); + for (OCIProfile p : profiles) { + Tenancy t = p.getTenancyData(); + if (t != null) { + items.add(new NotifyDescriptor.QuickPick.Item(p.getId(), Bundle.SelectProfile_Description(t.getName(), t.getHomeRegionKey()))); + } + } + if (profiles.stream().filter(p -> p.getTenancy().isPresent()).count() == 0) { + title = Bundle.NoProfile(); + } + return new NotifyDescriptor.QuickPick(title, title, items, false); + } + + @Override + public void prepare(ProgressHandle h, Values values) { + h.progress(Bundle.CollectingProfiles_Text()); + profiles = OCIManager.getDefault().getConnectedProfiles(); + } + + @Override + public void setValue(String value) { + for (OCIProfile profile : profiles) { + if (profile.getId().equals(value)) { + profile.getTenancy().ifPresent(t -> this.selected.set(t)); + break; + } + } + } + + @Override + public TenancyItem getValue() { + if (onlyOneChoice()) { + return profiles.stream().map(p -> p.getTenancy()).filter(Optional::isPresent).map(Optional::get).findFirst().get(); + } + return selected.get(); + } + + @Override + public boolean onlyOneChoice() { + return profiles.stream().filter(p -> p.getTenancy().isPresent()).count() == 1; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/VaultStep.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/VaultStep.java new file mode 100644 index 000000000000..2cedd540cc05 --- /dev/null +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/steps/VaultStep.java @@ -0,0 +1,77 @@ +/* + * 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.cloud.oracle.steps; + +import java.util.Map; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.cloud.oracle.assets.AbstractStep; +import org.netbeans.modules.cloud.oracle.assets.Steps; +import org.netbeans.modules.cloud.oracle.assets.Steps.Values; +import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem; +import org.netbeans.modules.cloud.oracle.vault.VaultItem; +import org.netbeans.modules.cloud.oracle.vault.VaultNode; +import org.openide.NotifyDescriptor; +import org.openide.util.NbBundle; + +/** + * + * @author Jan Horvath + */ +@NbBundle.Messages({ + "FetchingVaults=Fetching OCI Vaults", + "SelectVault=Select Vault", +}) +public class VaultStep extends AbstractStep { + private static final Logger LOG = Logger.getLogger(VaultStep.class.getName()); + private Map vaults = null; + private VaultItem selected; + + @Override + public void prepare(ProgressHandle h, Values values) { + h.progress(Bundle.FetchingVaults()); + CompartmentItem compartment = values.getValueForStep(CompartmentStep.class); + vaults = VaultNode.getVaults().apply((CompartmentItem) compartment).stream().collect(Collectors.toMap(VaultItem::getName, vault -> vault)); + } + + @Override + public NotifyDescriptor createInput() { + return Steps.createQuickPick(vaults, Bundle.SelectVault()); + } + + @Override + public void setValue(String selected) { + this.selected = vaults.get(selected); + } + + @Override + public VaultItem getValue() { + if (onlyOneChoice()) { + selected = vaults.values().iterator().next(); + } + return selected; + } + + @Override + public boolean onlyOneChoice() { + return vaults.size() == 1; + } + +} diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java index ca7f5f390bc5..812ffda7e43f 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java @@ -25,7 +25,6 @@ import java.util.stream.Collectors; import org.netbeans.modules.cloud.oracle.ChildrenProvider; import org.netbeans.modules.cloud.oracle.NodeProvider; -import org.netbeans.modules.cloud.oracle.OCIManager; import org.netbeans.modules.cloud.oracle.OCINode; import org.netbeans.modules.cloud.oracle.items.OCID; import org.openide.nodes.Children; @@ -63,7 +62,7 @@ public static ChildrenProvider.SessionAware getKeys() { Vault v = Vault.builder() .compartmentId(vault.getCompartmentId()) .id(vault.getKey().getValue()) - .managementEndpoint(vault.managementEndpoint) + .managementEndpoint(vault.getManagementEndpoint()) .build(); KmsManagementClient client = KmsManagementClient.builder() .vault(v) diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java index ca3e0b729541..d6c8da3d22c1 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java @@ -26,7 +26,7 @@ * @author Jan Horvath */ public class VaultItem extends OCIItem { - String managementEndpoint; + private String managementEndpoint; public VaultItem(OCID id, String compartment, String name, String managementEndpoint) { super(id, compartment, name); @@ -43,7 +43,7 @@ public String getManagementEndpoint() { @Override public int maxInProject() { - return Integer.MAX_VALUE; + return 1; } } diff --git a/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVaultTest.java b/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVaultTest.java index 9f79e00d2db0..9a9782d2aa7c 100644 --- a/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVaultTest.java +++ b/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVaultTest.java @@ -50,20 +50,6 @@ public void setUp() { public void tearDown() { } - /** - * Test of extractDatasourceName method, of class AddDbConnectionToVault. - */ - @Test - public void datasourceName() { - String input = "DATASOURCES_DEFAULT_USERNAME"; - String ds = AddDbConnectionToVault.extractDatasourceName(input); - assertEquals("DEFAULT", ds); - - input = "DATASOURCES_DEF3_USERNAME"; - ds = AddDbConnectionToVault.extractDatasourceName(input); - assertEquals("DEF3", ds); - } - @Test public void testConfigMap() { String cm = "apiVersion: v1\n" + diff --git a/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/assets/CloudAssetsTest.java b/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/assets/CloudAssetsTest.java index 1a8e085bb4ad..4f96801180a0 100644 --- a/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/assets/CloudAssetsTest.java +++ b/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/assets/CloudAssetsTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.*; import org.netbeans.modules.cloud.oracle.compute.ClusterItem; import org.netbeans.modules.cloud.oracle.database.DatabaseItem; +import org.netbeans.modules.cloud.oracle.developer.ContainerRepositoryItem; import org.netbeans.modules.cloud.oracle.items.OCID; /** @@ -37,6 +38,7 @@ public void testStoreLoad() throws URISyntaxException { instance.loadAssets(); instance.addItem(new DatabaseItem(OCID.of("db-ocid", "Databases"), "db-comp-id", "DB1", "http://test", "DB1")); instance.addItem(new ClusterItem(OCID.of("cluster-ocid", "Cluster"), "cluster-comp-id", "Cluster1")); + instance.addItem(new ContainerRepositoryItem(OCID.of("container-repo-ocid", "ContainerRepository"), "container-repo-comp-id", "Repo1", "reg", "namespace", true, 2)); instance.storeAssets(); CloudAssets instance1 = new CloudAssets(); diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/SampleProjectAction.java b/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/steps/OverwriteStepTest.java similarity index 57% rename from nb/welcome/src/org/netbeans/modules/welcome/ui/SampleProjectAction.java rename to enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/steps/OverwriteStepTest.java index f4c595554479..440d34427c16 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/SampleProjectAction.java +++ b/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/steps/OverwriteStepTest.java @@ -16,25 +16,29 @@ * specific language governing permissions and limitations * under the License. */ +package org.netbeans.modules.cloud.oracle.steps; -package org.netbeans.modules.welcome.ui; - -import java.awt.event.ActionEvent; -import javax.swing.AbstractAction; -import javax.swing.Action; -import org.netbeans.modules.project.ui.api.ProjectTemplates; -import org.netbeans.spi.project.ui.support.CommonProjectActions; +import org.junit.Test; +import static org.junit.Assert.*; /** * - * @author S. Aubrecht + * @author Jan Horvath */ -public class SampleProjectAction extends AbstractAction { - - @Override public void actionPerformed(ActionEvent e) { - Action sampleProject = CommonProjectActions.newProjectAction(); - sampleProject.putValue(ProjectTemplates.PRESELECT_CATEGORY, "Samples" ); // NOI18N - sampleProject.actionPerformed( e ); +public class OverwriteStepTest { + + /** + * Test of extractDatasourceName method, of class AddDbConnectionToVault. + */ + @Test + public void datasourceName() { + String input = "DATASOURCES_DEFAULT_USERNAME"; + String ds = OverwriteStep.extractDatasourceName(input); + assertEquals("DEFAULT", ds); + + input = "DATASOURCES_DEF3_USERNAME"; + ds = OverwriteStep.extractDatasourceName(input); + assertEquals("DEF3", ds); } - + } diff --git a/enterprise/el.lexer/manifest.mf b/enterprise/el.lexer/manifest.mf index a4b61f7b83bd..2148851476a5 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.52 +OpenIDE-Module-Specification-Version: 1.53 OpenIDE-Module-Layer: org/netbeans/modules/el/lexer/resources/layer.xml diff --git a/enterprise/glassfish.common/manifest.mf b/enterprise/glassfish.common/manifest.mf index e09ba0561912..c0b973f533fe 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.99 +OpenIDE-Module-Specification-Version: 1.100 OpenIDE-Module-Provides: org.netbeans.modules.glassfish.common 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 7087914838b5..437346786723 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 @@ -181,6 +181,7 @@ 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_7015_SERVER_NAME=GlassFish Server 7.0.15 STR_800_SERVER_NAME=GlassFish Server 8.0.0 # CommonServerSupport.java 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 5737b8d993c2..fc2a47976bfc 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 @@ -446,14 +446,25 @@ public enum ServerDetails { "http://www.eclipse.org/legal/epl-2.0" //NOI18N ), + /** + * details for an instance of GlassFish Server 7.0.15 + */ + GLASSFISH_SERVER_7_0_15(NbBundle.getMessage(ServerDetails.class, "STR_7015_SERVER_NAME", new Object[]{}), // NOI18N + GlassfishInstanceProvider.JAKARTAEE10_DEPLOYER_FRAGMENT, + GlassFishVersion.GF_7_0_15, + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.15/glassfish-7.0.15.zip", // NOI18N + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.15/glassfish-7.0.15.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 + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/8.0.0-M6/glassfish-8.0.0-M6.zip", // NOI18N + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/8.0.0-M6/glassfish-8.0.0-M6.zip", // NOI18N "http://www.eclipse.org/legal/epl-2.0" //NOI18N ); 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 bb5d8172963b..64bdddd991e8 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 @@ -182,6 +182,7 @@ 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_7015_SERVER_NAME=GlassFish Server 7.0.15 STR_V8_FAMILY_NAME=GlassFish Server STR_800_SERVER_NAME=GlassFish Server 8.0.0 diff --git a/enterprise/glassfish.eecommon/nbproject/project.properties b/enterprise/glassfish.eecommon/nbproject/project.properties index 3da983e65c1d..68738021cc08 100644 --- a/enterprise/glassfish.eecommon/nbproject/project.properties +++ b/enterprise/glassfish.eecommon/nbproject/project.properties @@ -17,7 +17,7 @@ is.autoload=true javac.release=11 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.62.0 +spec.version.base=1.63.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/enterprise/glassfish.javaee/manifest.mf b/enterprise/glassfish.javaee/manifest.mf index 7ef8943b0656..b17e89004c58 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.66 +OpenIDE-Module-Specification-Version: 1.67 diff --git a/enterprise/glassfish.tooling/manifest.mf b/enterprise/glassfish.tooling/manifest.mf index 0a8fd416b5c1..a7f98fa80aa9 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.32 +OpenIDE-Module-Specification-Version: 1.33 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 0affc06f8268..2e2f2cd05d8c 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 @@ -127,6 +127,8 @@ public enum GlassFishVersion { 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 7.0.15 */ + GF_7_0_15 ((short) 7, (short) 0, (short) 15, (short) 0, GlassFishVersion.GF_7_0_15_STR), /** GlassFish 8.0.0 */ GF_8_0_0 ((short) 8, (short) 0, (short) 0, (short) 0, GlassFishVersion.GF_8_0_0_STR); //////////////////////////////////////////////////////////////////////////// @@ -354,6 +356,11 @@ public enum GlassFishVersion { /** 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_7_0_15 value. */ + static final String GF_7_0_15_STR = "7.0.15"; + /** Additional {@code String} representations of GF_7_0_15 value. */ + static final String GF_7_0_15_STR_NEXT[] = {"7.0.15", "7.0.15.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. */ @@ -410,6 +417,7 @@ public enum GlassFishVersion { 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_7_0_15, GF_7_0_15_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 a44b7584cd3a..fa1813be6b4a 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 @@ -189,6 +189,11 @@ public class ConfigBuilderProvider { = new Config.Next(GlassFishVersion.GF_7_0_14, ConfigBuilderProvider.class.getResource("GlassFishV7_0_9.xml")); + /** Library builder configuration since GlassFish 7.0.15. */ + private static final Config.Next CONFIG_V7_0_15 + = new Config.Next(GlassFishVersion.GF_7_0_15, + 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, @@ -205,7 +210,7 @@ public class ConfigBuilderProvider { 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_12, CONFIG_V7_0_13, CONFIG_V7_0_14, - CONFIG_V8_0_0); + CONFIG_V7_0_15, 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 index 02a55b5eef3e..fde4105b0269 100644 --- 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 @@ -27,6 +27,7 @@ + diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java index dd3d055a5103..205a32f1c3f1 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java @@ -73,7 +73,9 @@ public enum JavaSEPlatform { /** JavaSE 22. */ v22, /** JavaSE 23. */ - v23; + v23, + /** JavaSE 24. */ + v24; //////////////////////////////////////////////////////////////////////////// // Class attributes // 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 6e2d1ab002a7..b21758be8016 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.14 + * Test factory functionality for GlassFish v. 7.0.15 *

* Factory should initialize REST {@code Runner} and point it to * provided {@code Command} instance. @@ -176,7 +176,7 @@ public void testGetInstanceforVersionGF6() { @Test public void testGetInstanceforVersionGF7() { GlassFishServerEntity srv = new GlassFishServerEntity(); - srv.setVersion(GlassFishVersion.GF_7_0_14); + srv.setVersion(GlassFishVersion.GF_7_0_15); 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 44dde392c56a..5abd9e769820 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 @@ -127,6 +127,8 @@ public void testToValue() { GlassFishVersion.GF_7_0_13_STR_NEXT); verifyToValueFromAdditionalArray(GlassFishVersion.GF_7_0_14, GlassFishVersion.GF_7_0_14_STR_NEXT); + verifyToValueFromAdditionalArray(GlassFishVersion.GF_7_0_15, + GlassFishVersion.GF_7_0_15_STR_NEXT); verifyToValueFromAdditionalArray(GlassFishVersion.GF_8_0_0, GlassFishVersion.GF_8_0_0_STR_NEXT); } @@ -157,7 +159,8 @@ public void testToValueIncomplete() { GlassFishVersion.GF_7_0_8, GlassFishVersion.GF_7_0_9, 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 + GlassFishVersion.GF_7_0_14, GlassFishVersion.GF_7_0_15, + GlassFishVersion.GF_8_0_0 }; String strings[] = { "1.0.1.4", "2.0.1.5", "2.1.0.3", "2.1.1.7", @@ -170,7 +173,7 @@ public void testToValueIncomplete() { "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.12.0", "7.0.13.0", - "7.0.14.0", "8.0.0.0" + "7.0.14.0", "7.0.15.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 a2b7204f93eb..8bfc3af209f4 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,7 @@ 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_14; +import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_7_0_15; 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; @@ -48,10 +48,10 @@ public class EnumUtilsTest { */ @Test public void testEq() { - assertFalse(EnumUtils.eq(GF_8_0_0, GF_7_0_14), "Equals for a > b shall be false."); + assertFalse(EnumUtils.eq(GF_8_0_0, GF_7_0_15), "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_7_0_15, GF_6_2_5), "Equals for a > b shall be false."); + assertTrue(EnumUtils.eq(GF_7_0_15, GF_7_0_15), "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."); @@ -72,10 +72,10 @@ public void testEq() { */ @Test public void testNe() { - assertTrue(EnumUtils.ne(GF_8_0_0, GF_7_0_14), "Not equals for a > b shall be true."); + assertTrue(EnumUtils.ne(GF_8_0_0, GF_7_0_15), "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_7_0_15, GF_6_2_5), "Not equals for a > b shall be true."); + assertFalse(EnumUtils.ne(GF_7_0_15, GF_7_0_15), "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."); @@ -96,10 +96,10 @@ public void testNe() { */ @Test public void testLt() { - 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_7_0_15), "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_7_0_15, GF_6_2_5), "Less than for a > b shall be false."); + assertFalse(EnumUtils.lt(GF_7_0_15, GF_7_0_15), "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."); @@ -120,10 +120,10 @@ public void testLt() { */ @Test public void testLe() { - assertFalse(EnumUtils.le(GF_8_0_0, GF_7_0_14), "Less than or equal for a > b shall be false."); + assertFalse(EnumUtils.le(GF_8_0_0, GF_7_0_15), "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_7_0_15, GF_6_2_5), "Less than or equal for a > b shall be false."); + assertTrue(EnumUtils.le(GF_7_0_15, GF_7_0_15), "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."); @@ -144,10 +144,10 @@ public void testLe() { */ @Test public void testGt() { - assertTrue(EnumUtils.gt(GF_8_0_0, GF_7_0_14), "Greater than for a > b shall be true."); + assertTrue(EnumUtils.gt(GF_8_0_0, GF_7_0_15), "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_7_0_15, GF_6_2_5), "Greater than for a > b shall be true."); + assertFalse(EnumUtils.gt(GF_7_0_15, GF_7_0_15), "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."); @@ -168,10 +168,10 @@ public void testGt() { */ @Test public void testGe() { - 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_7_0_15), "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_7_0_15, GF_6_2_5), "Greater than or equal for a > b shall be true."); + assertTrue(EnumUtils.ge(GF_7_0_15, GF_7_0_15), "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 aab366fc5992..da8740e75d09 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.20 +OpenIDE-Module-Specification-Version: 1.21 diff --git a/enterprise/j2ee.ant/nbproject/project.properties b/enterprise/j2ee.ant/nbproject/project.properties index 44ecc45045ac..7a55bf96ded1 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.59.0 +spec.version.base=1.60.0 diff --git a/enterprise/j2ee.api.ejbmodule/manifest.mf b/enterprise/j2ee.api.ejbmodule/manifest.mf index ead89a7e3935..b6ad342f1b7a 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.62 +OpenIDE-Module-Specification-Version: 1.63 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/ejbjar/Bundle.properties diff --git a/enterprise/j2ee.clientproject/nbproject/project.properties b/enterprise/j2ee.clientproject/nbproject/project.properties index 18ef632b61be..02138d388c0c 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.71.0 +spec.version.base=1.72.0 javadoc.arch=${basedir}/arch.xml javadoc.preview=true javac.compilerargs=-Xlint -Xlint:-serial diff --git a/enterprise/j2ee.common/manifest.mf b/enterprise/j2ee.common/manifest.mf index 5490cc5a9eec..5ac8916c1399 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.128 +OpenIDE-Module-Specification-Version: 1.129 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.core/manifest.mf b/enterprise/j2ee.core/manifest.mf index 83cd53905b27..a403ecd7646e 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.50 +OpenIDE-Module-Specification-Version: 1.51 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.dd.webservice/manifest.mf b/enterprise/j2ee.dd.webservice/manifest.mf index 4807490979ee..71fb1ebf7959 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.56 +OpenIDE-Module-Specification-Version: 1.57 diff --git a/enterprise/j2ee.dd/nbproject/project.properties b/enterprise/j2ee.dd/nbproject/project.properties index 9fcd3a8a745c..e41a8141a359 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.65.0 +spec.version.base=1.66.0 is.autoload=true javadoc.arch=${basedir}/arch.xml diff --git a/enterprise/j2ee.dd/nbproject/project.xml b/enterprise/j2ee.dd/nbproject/project.xml index fdd319301fea..1a501bc06bbc 100644 --- a/enterprise/j2ee.dd/nbproject/project.xml +++ b/enterprise/j2ee.dd/nbproject/project.xml @@ -248,10 +248,6 @@ org.netbeans.modules.j2ee.dd.spi.ejb org.netbeans.modules.j2ee.dd.spi.web - - ext/javaee-api-5.jar - external/javaee-api-5.jar - diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/ResourceImpl.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/ResourceImpl.java index 8b1a7cc4ecc9..195c8be6d431 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/ResourceImpl.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/annotation/ResourceImpl.java @@ -21,7 +21,6 @@ import java.util.List; import java.util.Map; -import javax.annotation.Resource.AuthenticationType; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; diff --git a/enterprise/j2ee.ddloaders/nbproject/project.properties b/enterprise/j2ee.ddloaders/nbproject/project.properties index 3d220e48b9ff..30049f132dd7 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.62.0 +spec.version.base=1.63.0 javadoc.arch=${basedir}/arch.xml diff --git a/enterprise/j2ee.earproject/manifest.mf b/enterprise/j2ee.earproject/manifest.mf index 2f7ef38ea9cd..191c4e7b8640 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.76 +OpenIDE-Module-Specification-Version: 1.77 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.ejbcore/manifest.mf b/enterprise/j2ee.ejbcore/manifest.mf index 945b5d294ddf..7212b54eac4f 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.76 +OpenIDE-Module-Specification-Version: 1.77 AutoUpdate-Show-In-Client: false 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 b443e325d4c3..6cbf9cf420e2 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,15 +94,17 @@ 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.isAtLeast(Profile.JAKARTA_EE_9_WEB)) { + if (j2eeProfile != null && j2eeProfile.isAtLeast(Profile.JAKARTA_EE_9_WEB)) { resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-4.0.xml"; - } else if (j2eeProfile.isAtLeast(Profile.JAVA_EE_7_WEB)) { + } else if (j2eeProfile != null && j2eeProfile.isAtLeast(Profile.JAVA_EE_7_WEB)) { resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-3.2.xml"; - } else if (j2eeProfile.isAtLeast(Profile.JAVA_EE_6_WEB)) { + } else if (j2eeProfile != null && 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 { + } else if (j2eeModule != null) { resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-" + j2eeModule.getModuleVersion() + ".xml"; + } else { + return Collections.EMPTY_SET; } FileObject source = FileUtil.getConfigFile(resource); if (source == null) { diff --git a/enterprise/j2ee.ejbjarproject/manifest.mf b/enterprise/j2ee.ejbjarproject/manifest.mf index 047a0bc4e62b..898ac5558d0a 100644 --- a/enterprise/j2ee.ejbjarproject/manifest.mf +++ b/enterprise/j2ee.ejbjarproject/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.ejbjarproject OpenIDE-Module-Layer: org/netbeans/modules/j2ee/ejbjarproject/ui/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/ejbjarproject/Bundle.properties -OpenIDE-Module-Specification-Version: 1.78 +OpenIDE-Module-Specification-Version: 1.79 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java index 10008b397192..32246b994fa2 100644 --- a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java @@ -86,7 +86,7 @@ protected FileObject getXmlArtifactsRoot() { @Override protected String getProjectJavaEEVersion() { EjbJar ejbModule = EjbJar.getEjbJar(project.getProjectDirectory()); - if (ejbModule != null) { + if (ejbModule != null && ejbModule.getJ2eeProfile() != null) { switch (ejbModule.getJ2eeProfile()) { case JAVA_EE_6_WEB: case JAVA_EE_6_FULL: diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSSupport.java b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSSupport.java index e823628ee346..42288b0d4f28 100644 --- a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSSupport.java +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSSupport.java @@ -157,7 +157,7 @@ private void logWsDetected() { @Override protected String getProjectJavaEEVersion() { EjbJar ejbModule = EjbJar.getEjbJar(project.getProjectDirectory()); - if (ejbModule != null) { + if (ejbModule != null && ejbModule.getJ2eeProfile() != null) { switch (ejbModule.getJ2eeProfile()) { case JAVA_EE_6_WEB: case JAVA_EE_6_FULL: diff --git a/enterprise/j2ee.ejbrefactoring/manifest.mf b/enterprise/j2ee.ejbrefactoring/manifest.mf index 7182455e23df..6792648c34e5 100644 --- a/enterprise/j2ee.ejbrefactoring/manifest.mf +++ b/enterprise/j2ee.ejbrefactoring/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.ejbrefactoring OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/ejbrefactoring/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.ejbverification/manifest.mf b/enterprise/j2ee.ejbverification/manifest.mf index ab4488cc7fe0..0333e33d57c3 100644 --- a/enterprise/j2ee.ejbverification/manifest.mf +++ b/enterprise/j2ee.ejbverification/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.ejbverification OpenIDE-Module-Layer: org/netbeans/modules/j2ee/ejbverification/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/ejbverification/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLite.java b/enterprise/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLite.java index 7e657ad48aca..fdd24a526709 100644 --- a/enterprise/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLite.java +++ b/enterprise/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLite.java @@ -84,9 +84,9 @@ public static Collection run(HintContext hintContext) { final EJBProblemContext ctx = HintsUtils.getOrCacheContext(hintContext); if (ctx != null && ctx.getEjb() instanceof Session) { final Profile profile = ctx.getEjbModule().getJ2eeProfile(); - boolean ee9lite = profile.isAtLeast(Profile.JAKARTA_EE_9_WEB); - boolean ee7lite = profile.isAtLeast(Profile.JAVA_EE_7_WEB); - boolean ee6lite = (profile == Profile.JAVA_EE_6_WEB); + boolean ee9lite = profile != null && profile.isAtLeast(Profile.JAKARTA_EE_9_WEB); + boolean ee7lite = profile != null && profile.isAtLeast(Profile.JAVA_EE_7_WEB); + boolean ee6lite = profile == Profile.JAVA_EE_6_WEB; J2eePlatform platform = ProjectUtil.getPlatform(ctx.getProject()); if ((ee6lite || ee7lite || ee9lite) && nonEeFullServer(platform)) { for (Element element : ctx.getClazz().getEnclosedElements()) { diff --git a/enterprise/j2ee.genericserver/manifest.mf b/enterprise/j2ee.genericserver/manifest.mf index 2ad5ffa5d9a2..727e6af46143 100644 --- a/enterprise/j2ee.genericserver/manifest.mf +++ b/enterprise/j2ee.genericserver/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.genericserver -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/genericserver/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/j2ee/genericserver/resources/layer.xml AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.kit/manifest.mf b/enterprise/j2ee.kit/manifest.mf index ea32bdf0aeae..24bd6ae59fff 100644 --- a/enterprise/j2ee.kit/manifest.mf +++ b/enterprise/j2ee.kit/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 OpenIDE-Module-Recommends: jakartaee10.api, jakartaee10.platform diff --git a/enterprise/j2ee.platform/manifest.mf b/enterprise/j2ee.platform/manifest.mf index 5c92151506a9..419275a6af5f 100644 --- a/enterprise/j2ee.platform/manifest.mf +++ b/enterprise/j2ee.platform/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.platform/1 -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/platform/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/enterprise/j2ee.sun.appsrv/nbproject/project.properties b/enterprise/j2ee.sun.appsrv/nbproject/project.properties index 30d98cb3a23e..61615ad55055 100644 --- a/enterprise/j2ee.sun.appsrv/nbproject/project.properties +++ b/enterprise/j2ee.sun.appsrv/nbproject/project.properties @@ -17,6 +17,6 @@ javac.source=1.8 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.60.0 +spec.version.base=1.61.0 test.config.stableBTD.includes=**/*Test.class diff --git a/enterprise/j2ee.sun.dd/nbproject/project.properties b/enterprise/j2ee.sun.dd/nbproject/project.properties index be2b6c36e4e2..24aa78e53ce6 100644 --- a/enterprise/j2ee.sun.dd/nbproject/project.properties +++ b/enterprise/j2ee.sun.dd/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. is.autoload=true -spec.version.base=1.58.0 +spec.version.base=1.59.0 javac.source=1.8 diff --git a/enterprise/j2ee.sun.ddui/nbproject/project.properties b/enterprise/j2ee.sun.ddui/nbproject/project.properties index 662f4b23d017..55e7893c3306 100644 --- a/enterprise/j2ee.sun.ddui/nbproject/project.properties +++ b/enterprise/j2ee.sun.ddui/nbproject/project.properties @@ -19,6 +19,6 @@ javac.source=1.8 ###is.autoload=true javadoc.arch=${basedir}/arch.xml -spec.version.base=1.61.0 +spec.version.base=1.62.0 test.config.stableBTD.includes=**/*Test.class diff --git a/enterprise/j2eeapis/manifest.mf b/enterprise/j2eeapis/manifest.mf index 2e34c8349e9a..c811c07831cc 100644 --- a/enterprise/j2eeapis/manifest.mf +++ b/enterprise/j2eeapis/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2eeapis/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2eeapis/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 diff --git a/enterprise/j2eeserver/nbproject/project.properties b/enterprise/j2eeserver/nbproject/project.properties index 45144bc18d0a..2037ed057f48 100644 --- a/enterprise/j2eeserver/nbproject/project.properties +++ b/enterprise/j2eeserver/nbproject/project.properties @@ -18,7 +18,7 @@ is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.136.0 +spec.version.base=1.137.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml diff --git a/enterprise/jakarta.transformer/manifest.mf b/enterprise/jakarta.transformer/manifest.mf index d5cc4e0e6651..7cad12261554 100644 --- a/enterprise/jakarta.transformer/manifest.mf +++ b/enterprise/jakarta.transformer/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.jakarta.transformer/0 OpenIDE-Module-Layer: org/netbeans/modules/fish/payara/jakarta/transformer/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/fish/payara/jakarta/transformer/Bundle.properties AutoUpdate-Show-In-Client: true -OpenIDE-Module-Specification-Version: 2.19 +OpenIDE-Module-Specification-Version: 2.20 diff --git a/enterprise/jakarta.web.beans/manifest.mf b/enterprise/jakarta.web.beans/manifest.mf index 8e60289566eb..a4fe2f5570eb 100644 --- a/enterprise/jakarta.web.beans/manifest.mf +++ b/enterprise/jakarta.web.beans/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jakarta.web.beans/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakarta/web/beans/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/jakarta/web/beans/resources/layer.xml -OpenIDE-Module-Specification-Version: 2.44 +OpenIDE-Module-Specification-Version: 2.45 AutoUpdate-Show-In-Client: false diff --git a/enterprise/jakarta.web.beans/src/org/netbeans/modules/jakarta/web/beans/CdiUtil.java b/enterprise/jakarta.web.beans/src/org/netbeans/modules/jakarta/web/beans/CdiUtil.java index e71c949e1cc7..b1637583d913 100644 --- a/enterprise/jakarta.web.beans/src/org/netbeans/modules/jakarta/web/beans/CdiUtil.java +++ b/enterprise/jakarta.web.beans/src/org/netbeans/modules/jakarta/web/beans/CdiUtil.java @@ -156,7 +156,8 @@ public boolean isCdiEnabled(){ * @return */ public static boolean isCdi11OrLater(Project p) { - if(! hasResource(p, "javax/enterprise/inject/spi/AfterTypeDiscovery.class") ) { + if(! (hasResource(p, "javax/enterprise/inject/spi/AfterTypeDiscovery.class") + || hasResource(p, "jakarta/enterprise/inject/spi/AfterTypeDiscovery.class"))) { return false; } else { FileObject beans = getBeansXmlExists(p); @@ -177,7 +178,8 @@ public static boolean isCdi11OrLater(Project p) { } public boolean isCdi11OrLater() { - if(! hasResource(getProject(), "javax/enterprise/inject/spi/AfterTypeDiscovery.class") ) { + if (!(hasResource(getProject(), "javax/enterprise/inject/spi/AfterTypeDiscovery.class") + || hasResource(getProject(), "jakarta/enterprise/inject/spi/AfterTypeDiscovery.class"))) { return false; } else { FileObject beans = getBeansXmlExists(); diff --git a/enterprise/jakarta.web.beans/src/org/netbeans/modules/jakarta/web/beans/completion/CCPaintComponent.java b/enterprise/jakarta.web.beans/src/org/netbeans/modules/jakarta/web/beans/completion/CCPaintComponent.java index 70e764a25f15..dfc68ff5f57b 100644 --- a/enterprise/jakarta.web.beans/src/org/netbeans/modules/jakarta/web/beans/completion/CCPaintComponent.java +++ b/enterprise/jakarta.web.beans/src/org/netbeans/modules/jakarta/web/beans/completion/CCPaintComponent.java @@ -215,7 +215,7 @@ protected void drawStringToGraphics(Graphics g, String s, Font font, boolean str } protected int getWidth(String s) { - Integer i = (Integer)widths.get(s); + Integer i = widths.get(s); if (i != null) { return i; } else { diff --git a/enterprise/jakartaee10.api/manifest.mf b/enterprise/jakartaee10.api/manifest.mf index 03c5f921c0a9..a75090aca2f5 100644 --- a/enterprise/jakartaee10.api/manifest.mf +++ b/enterprise/jakartaee10.api/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.jakartaee10.api OpenIDE-Module-Layer: org/netbeans/modules/jakartaee10/api/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee10/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Specification-Version: 1.25 OpenIDE-Module-Provides: jakartaee10.api diff --git a/enterprise/jakartaee10.platform/manifest.mf b/enterprise/jakartaee10.platform/manifest.mf index 3b625074fba7..26a35c130374 100644 --- a/enterprise/jakartaee10.platform/manifest.mf +++ b/enterprise/jakartaee10.platform/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jakartaee10.platform/1 -OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Specification-Version: 1.25 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee10/platform/Bundle.properties AutoUpdate-Show-In-Client: false OpenIDE-Module-Provides: jakartaee10.platform diff --git a/enterprise/jakartaee11.api/manifest.mf b/enterprise/jakartaee11.api/manifest.mf index 3693fb509db4..bc0a5fc37bf9 100644 --- a/enterprise/jakartaee11.api/manifest.mf +++ b/enterprise/jakartaee11.api/manifest.mf @@ -3,5 +3,5 @@ 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-Specification-Version: 1.25 OpenIDE-Module-Provides: jakartaee11.api diff --git a/enterprise/jakartaee11.platform/manifest.mf b/enterprise/jakartaee11.platform/manifest.mf index 47e65a275712..2d06420b4ee1 100644 --- a/enterprise/jakartaee11.platform/manifest.mf +++ b/enterprise/jakartaee11.platform/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jakartaee11.platform/1 -OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Specification-Version: 1.25 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee11/platform/Bundle.properties AutoUpdate-Show-In-Client: false OpenIDE-Module-Provides: jakartaee11.platform diff --git a/enterprise/jakartaee8.api/manifest.mf b/enterprise/jakartaee8.api/manifest.mf index 401e2977680e..aafe606008a4 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.26 +OpenIDE-Module-Specification-Version: 1.27 diff --git a/enterprise/jakartaee8.platform/manifest.mf b/enterprise/jakartaee8.platform/manifest.mf index f9a02e4a98f8..93a3239c9a26 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.26 +OpenIDE-Module-Specification-Version: 1.27 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 1c6ffa565695..e8ec202a3fe9 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.25 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/enterprise/jakartaee9.platform/manifest.mf b/enterprise/jakartaee9.platform/manifest.mf index 0b4465385092..202535609681 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.25 +OpenIDE-Module-Specification-Version: 1.26 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 5d54cb8b7514..e1a5782e07ca 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.45 +OpenIDE-Module-Specification-Version: 1.46 diff --git a/enterprise/javaee.beanvalidation/manifest.mf b/enterprise/javaee.beanvalidation/manifest.mf index ebac9270e182..3d2e2107cfec 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.44 +OpenIDE-Module-Specification-Version: 1.45 diff --git a/enterprise/javaee.project/manifest.mf b/enterprise/javaee.project/manifest.mf index d7d36456bacc..d4c6631347fd 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.44 +OpenIDE-Module-Specification-Version: 1.45 AutoUpdate-Show-In-Client: false diff --git a/enterprise/javaee.resources/manifest.mf b/enterprise/javaee.resources/manifest.mf index 75449bc30e29..ea27cd588956 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.35 +OpenIDE-Module-Specification-Version: 1.36 diff --git a/enterprise/javaee.specs.support/manifest.mf b/enterprise/javaee.specs.support/manifest.mf index d79222ae578f..5756646441a7 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.50 +OpenIDE-Module-Specification-Version: 1.51 diff --git a/enterprise/javaee.wildfly/manifest.mf b/enterprise/javaee.wildfly/manifest.mf index 58ceea6df0be..0d016ca636a6 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.17 +OpenIDE-Module-Specification-Version: 2.18 diff --git a/enterprise/javaee7.api/manifest.mf b/enterprise/javaee7.api/manifest.mf index fbc0ecf5c1cc..464cbcdcbb65 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.29 +OpenIDE-Module-Specification-Version: 1.30 diff --git a/enterprise/javaee8.api/manifest.mf b/enterprise/javaee8.api/manifest.mf index 0362b233fcc9..659422beae4f 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.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/enterprise/jellytools.enterprise/manifest.mf b/enterprise/jellytools.enterprise/manifest.mf index a3524e6a80c3..56f5ec02dcdc 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.51 +OpenIDE-Module-Specification-Version: 3.52 diff --git a/enterprise/jsp.lexer/manifest.mf b/enterprise/jsp.lexer/manifest.mf index 78d4d6574803..a514dbe8008e 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.50 +OpenIDE-Module-Specification-Version: 1.51 OpenIDE-Module-Layer: org/netbeans/lib/jsp/lexer/layer.xml diff --git a/enterprise/libs.amazon/manifest.mf b/enterprise/libs.amazon/manifest.mf index 367f0b3dacf4..e055356c5d71 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.35 +OpenIDE-Module-Specification-Version: 1.36 diff --git a/enterprise/libs.commons_fileupload/manifest.mf b/enterprise/libs.commons_fileupload/manifest.mf index 5f86004023f5..ea60a5378dbc 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.51 +OpenIDE-Module-Specification-Version: 1.52 diff --git a/enterprise/libs.elimpl/nbproject/project.properties b/enterprise/libs.elimpl/nbproject/project.properties index bc53ce059a28..81e5e1ced694 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.44.0 +spec.version.base=1.45.0 sigtest.gen.fail.on.error=false diff --git a/enterprise/libs.glassfish_logging/nbproject/project.properties b/enterprise/libs.glassfish_logging/nbproject/project.properties index 0899613a556c..43f474270fd1 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.50.0 +spec.version.base=1.51.0 diff --git a/enterprise/libs.jackson/external/binaries-list b/enterprise/libs.jackson/external/binaries-list index 073162777d51..4d3771196497 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. -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 +147B7B9412FFFF24339F8ABA080B292448E08698 com.fasterxml.jackson.core:jackson-annotations:2.17.2 +969A35CB35C86512ACBADCDBBBFB044C877DB814 com.fasterxml.jackson.core:jackson-core:2.17.2 +E6DEB029E5901E027C129341FAC39E515066B68C com.fasterxml.jackson.core:jackson-databind:2.17.2 +57FA7C1B5104BBC4599278D13933A937EE058E68 com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.17.2 +267B85E9BA2892A37BE6D80AA9CA1438A0D8C210 com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2 +C2978B818EF2F2B2738B387C143624EAB611D917 com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.17.2 diff --git a/enterprise/libs.jackson/external/jackson-2.17.0-license.txt b/enterprise/libs.jackson/external/jackson-2.17.2-license.txt similarity index 98% rename from enterprise/libs.jackson/external/jackson-2.17.0-license.txt rename to enterprise/libs.jackson/external/jackson-2.17.2-license.txt index 991f005e790b..6aeb0ab71d77 100644 --- a/enterprise/libs.jackson/external/jackson-2.17.0-license.txt +++ b/enterprise/libs.jackson/external/jackson-2.17.2-license.txt @@ -2,8 +2,8 @@ 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 +Version: 2.17.2 +Files: jackson-annotations-2.17.2.jar, jackson-core-2.17.2.jar, jackson-databind-2.17.2.jar, jackson-dataformat-cbor-2.17.2.jar, jackson-datatype-jsr310-2.17.2.jar, jackson-module-jaxb-annotations-2.17.2.jar Apache License diff --git a/enterprise/libs.jackson/manifest.mf b/enterprise/libs.jackson/manifest.mf index 5a221440bb8e..ef3259eb4477 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.23 +OpenIDE-Module-Specification-Version: 2.24 diff --git a/enterprise/libs.jackson/nbproject/project.properties b/enterprise/libs.jackson/nbproject/project.properties index acdfd70b3111..8cd7a8a0055c 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.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 +release.external/jackson-annotations-2.17.2.jar=modules/ext/jackson/jackson-annotations-2.17.2.jar +release.external/jackson-core-2.17.2.jar=modules/ext/jackson/jackson-core-2.17.2.jar +release.external/jackson-databind-2.17.2.jar=modules/ext/jackson/jackson-databind-2.17.2.jar +release.external/jackson-dataformat-cbor-2.17.2.jar=modules/ext/jackson/jackson-dataformat-cbor-2.17.2.jar +release.external/jackson-datatype-jsr310-2.17.2.jar=modules/ext/jackson/jackson-datatype-jsr310-2.17.2.jar +release.external/jackson-module-jaxb-annotations-2.17.2.jar=modules/ext/jackson/jackson-module-jaxb-annotations-2.17.2.jar diff --git a/enterprise/libs.jackson/nbproject/project.xml b/enterprise/libs.jackson/nbproject/project.xml index c12f13cacdcd..9b324e26bbec 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.17.0.jar - external/jackson-annotations-2.17.0.jar + ext/jackson/jackson-annotations-2.17.2.jar + external/jackson-annotations-2.17.2.jar - ext/jackson/jackson-core-2.17.0.jar - external/jackson-core-2.17.0.jar + ext/jackson/jackson-core-2.17.2.jar + external/jackson-core-2.17.2.jar - ext/jackson/jackson-databind-2.17.0.jar - external/jackson-databind-2.17.0.jar + ext/jackson/jackson-databind-2.17.2.jar + external/jackson-databind-2.17.2.jar - ext/jackson/jackson-dataformat-cbor-2.17.0.jar - external/jackson-dataformat-cbor-2.17.0.jar + ext/jackson/jackson-dataformat-cbor-2.17.2.jar + external/jackson-dataformat-cbor-2.17.2.jar - ext/jackson/jackson-datatype-jsr310-2.17.0.jar - external/jackson-datatype-jsr310-2.17.0.jar + ext/jackson/jackson-datatype-jsr310-2.17.2.jar + external/jackson-datatype-jsr310-2.17.2.jar - ext/jackson/jackson-module-jaxb-annotations-2.17.0.jar - external/jackson-module-jaxb-annotations-2.17.0.jar + ext/jackson/jackson-module-jaxb-annotations-2.17.2.jar + external/jackson-module-jaxb-annotations-2.17.2.jar diff --git a/enterprise/libs.jstl/nbproject/project.properties b/enterprise/libs.jstl/nbproject/project.properties index 3fbaa293107b..1201fe8556e8 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.59.0 +spec.version.base=2.60.0 diff --git a/enterprise/maven.j2ee/manifest.mf b/enterprise/maven.j2ee/manifest.mf index a8afb4b6c03d..712b5f730b57 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.86 +OpenIDE-Module-Specification-Version: 1.87 diff --git a/enterprise/maven.jaxws/manifest.mf b/enterprise/maven.jaxws/manifest.mf index 8fc79818955b..466fbef1e641 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.53 +OpenIDE-Module-Specification-Version: 1.54 diff --git a/enterprise/micronaut/nbproject/project.properties b/enterprise/micronaut/nbproject/project.properties index fdee4fdc7950..a5be14c4d579 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.14.0 +spec.version.base=1.15.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/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolFinder.java b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolFinder.java index a7390b0b941b..701dd22d1fc5 100644 --- a/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolFinder.java +++ b/enterprise/micronaut/src/org/netbeans/modules/micronaut/symbol/MicronautSymbolFinder.java @@ -59,6 +59,7 @@ import javax.lang.model.util.ElementFilter; import javax.lang.model.util.Elements; import javax.lang.model.util.Types; +import javax.swing.event.ChangeListener; import javax.tools.JavaFileObject; import org.netbeans.api.editor.mimelookup.MimeRegistration; import org.netbeans.api.java.classpath.ClassPath; @@ -111,6 +112,11 @@ public final class MicronautSymbolFinder extends EmbeddingIndexer implements Pro private final Map map = new WeakHashMap<>(); private final Map> cache = new WeakHashMap<>(); + private final ChangeListener cacheCleaner = (evt) -> { + if (cache.keySet().contains(evt.getSource())) { + cache.clear(); + } + }; @Override protected void index(Indexable indexable, Parser.Result parserResult, Context context) { @@ -510,6 +516,7 @@ private static String flatName(TypeElement te) { public static List getSymbolsFromDependencies(ClasspathInfo info, String textForQuery) { List cached = INSTANCE.cache.get(info); if (cached == null) { + info.addChangeListener(INSTANCE.cacheCleaner); List ret = new ArrayList<>(); ClassIndex ci = info.getClassIndex(); Set> beanHandles = new HashSet<>(); diff --git a/enterprise/payara.common/manifest.mf b/enterprise/payara.common/manifest.mf index 4c96873e1fc8..3689ff8c27da 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.20 +OpenIDE-Module-Specification-Version: 2.21 OpenIDE-Module-Provides: org.netbeans.modules.payara.common diff --git a/enterprise/payara.eecommon/nbproject/project.properties b/enterprise/payara.eecommon/nbproject/project.properties index 05c31404c977..18049be82291 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.21.0 +spec.version.base=2.22.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 04b5e9715266..8bb0a9a5daa4 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 @@ -481,7 +481,7 @@ public HashMap getSunDatasourcesFromXml(){ private Map getPoolValues(Map cpMap, String poolName) { Map pValues = new HashMap<>(); - Node cpNode = (Node) cpMap.get(poolName); + Node cpNode = cpMap.get(poolName); NamedNodeMap cpAttrMap = cpNode.getAttributes(); Node dsClassName = cpAttrMap.getNamedItem(CONST_DS_CLASS); Node resType = cpAttrMap.getNamedItem(CONST_RES_TYPE); diff --git a/enterprise/payara.jakartaee/manifest.mf b/enterprise/payara.jakartaee/manifest.mf index df778b295158..e4bc9bbf86ec 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.20 +OpenIDE-Module-Specification-Version: 2.21 diff --git a/enterprise/payara.micro/manifest.mf b/enterprise/payara.micro/manifest.mf index 3bc5198c7948..a40277cb5088 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.20 +OpenIDE-Module-Specification-Version: 2.21 diff --git a/enterprise/payara.tooling/manifest.mf b/enterprise/payara.tooling/manifest.mf index 3a9d608bdbbf..a64c5768255e 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.20 +OpenIDE-Module-Specification-Version: 2.21 diff --git a/enterprise/profiler.j2ee/manifest.mf b/enterprise/profiler.j2ee/manifest.mf index 6c359837fa8d..19dba07bf5e0 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.59 +OpenIDE-Module-Specification-Version: 1.60 diff --git a/enterprise/projectimport.eclipse.web/nbproject/project.properties b/enterprise/projectimport.eclipse.web/nbproject/project.properties index 7da726cf5cf2..fbdb50d66150 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.49.0 +spec.version.base=1.50.0 diff --git a/enterprise/servletjspapi/nbproject/project.properties b/enterprise/servletjspapi/nbproject/project.properties index da099bc66cde..485bf7b6a517 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.55.0 +spec.version.base=1.56.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 43331f778ced..ccdd5723c303 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.61 +OpenIDE-Module-Specification-Version: 1.62 OpenIDE-Module-Provides: org.netbeans.modules.web.project.framework diff --git a/enterprise/tomcat5/manifest.mf b/enterprise/tomcat5/manifest.mf index c213acd5dd26..2522e35d8bdb 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.67 +OpenIDE-Module-Specification-Version: 1.68 diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/TomcatFactory.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/TomcatFactory.java index 6aa05e729b72..28d0f9e0ac1b 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/TomcatFactory.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/TomcatFactory.java @@ -465,6 +465,8 @@ private static TomEEVersion getTomEEVersion(String version, TomEEVersion default return TomcatManager.TomEEVersion.TOMEE_80; } else if (version.startsWith("9.")) { // NOI18N return TomcatManager.TomEEVersion.TOMEE_90; + } else if (version.startsWith("10.")) { // NOI18N + return TomcatManager.TomEEVersion.TOMEE_100; } return defaultVersion; } 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 0147f5eae1a8..72f9d6246a66 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java @@ -520,11 +520,11 @@ public boolean isJpa30() { } public boolean isJpa31() { - return false; + return isTomEE10(); } public boolean isJpa32() { - return isTomEE10(); + return false; } public boolean isJpa22() { 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 ce4aacb48671..c0524e950475 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java @@ -465,7 +465,7 @@ public Set getSupportedProfiles() { if (manager.getTomEEType().ordinal() >= 3 ) { switch (manager.getTomEEVersion()) { case TOMEE_100: - profiles.add(Profile.JAKARTA_EE_11_FULL); + profiles.add(Profile.JAKARTA_EE_10_FULL); case TOMEE_90: profiles.add(Profile.JAKARTA_EE_9_1_FULL); break; @@ -481,7 +481,7 @@ public Set getSupportedProfiles() { } switch (manager.getTomEEVersion()) { case TOMEE_100: - profiles.add(Profile.JAKARTA_EE_11_WEB); + profiles.add(Profile.JAKARTA_EE_10_WEB); case TOMEE_90: profiles.add(Profile.JAKARTA_EE_9_1_WEB); break; @@ -556,13 +556,11 @@ public Set getSupportedJavaPlatformVersions() { if (manager.isTomEE()) { switch (manager.getTomEEVersion()) { case TOMEE_100: - versions = versionRange(21, 23); - break; case TOMEE_90: - versions = versionRange(11, 23); + versions = versionRange(11, 24); break; case TOMEE_80: - versions = versionRange(8, 23); + versions = versionRange(8, 24); break; case TOMEE_71: case TOMEE_70: @@ -579,20 +577,20 @@ public Set getSupportedJavaPlatformVersions() { } else { switch (manager.getTomcatVersion()) { case TOMCAT_110: - versions = versionRange(21, 23); + versions = versionRange(21, 24); break; case TOMCAT_101: - versions = versionRange(11, 23); + versions = versionRange(11, 24); break; case TOMCAT_100: case TOMCAT_90: - versions = versionRange(8, 23); + versions = versionRange(8, 24); break; case TOMCAT_80: - versions = versionRange(7, 23); + versions = versionRange(7, 24); break; case TOMCAT_70: - versions = versionRange(6, 23); + versions = versionRange(6, 24); break; case TOMCAT_60: versions = versionRange(5, 8); diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java index 1b18039d85a0..442ebc06f239 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java @@ -772,7 +772,7 @@ private static NbProcessDescriptor defaultDebugStartDesc(String command, String } private String getJavaHome(JavaPlatform platform) { - FileObject fo = (FileObject)platform.getInstallFolders().iterator().next(); + FileObject fo = platform.getInstallFolders().iterator().next(); return FileUtil.toFile(fo).getAbsolutePath(); } diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/LogManager.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/LogManager.java index 7965d70b7cd8..0200212ad727 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/LogManager.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/LogManager.java @@ -268,7 +268,7 @@ public void openContextLog(TomcatModule module) { if (!moduleConfig.hasLogger()) { return; } - contextLog = (LogViewer)contextLogViewers.get(moduleID); + contextLog = contextLogViewers.get(moduleID); LogViewer newContextLog = null; try { newContextLog = new LogViewer( diff --git a/enterprise/web.beans/manifest.mf b/enterprise/web.beans/manifest.mf index e9c164b1475c..72fc0c0c3ebd 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.44 +OpenIDE-Module-Specification-Version: 2.45 AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.bootsfaces/manifest.mf b/enterprise/web.bootsfaces/manifest.mf index 947064dfdc6f..6461d5d1b53d 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.96 +OpenIDE-Module-Specification-Version: 1.97 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 39bbe31406b2..c14772c8192b 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.39 +OpenIDE-Module-Specification-Version: 1.40 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 fb179dac9ace..fcf5385632a7 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.69.0 +spec.version.base=2.70.0 test.config.validation.includes=\ **/AutoCompletionTest.class,**/CompletionTest.class diff --git a/enterprise/web.core/licenseinfo.xml b/enterprise/web.core/licenseinfo.xml index b871fdf31163..c4ea4d098b44 100644 --- a/enterprise/web.core/licenseinfo.xml +++ b/enterprise/web.core/licenseinfo.xml @@ -103,6 +103,10 @@ src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_0.xsd src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_0.mdd + src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.xsd + src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.mdd + src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.xsd + src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.mdd Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved. diff --git a/enterprise/web.core/nbproject/project.properties b/enterprise/web.core/nbproject/project.properties index 6c7b85dd797b..4fb066f63947 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.57.0 +spec.version.base=2.58.0 requires.nb.javac=true test.config.stableBTD.includes=**/*Test.class diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/TaglibCatalog.java b/enterprise/web.core/src/org/netbeans/modules/web/taglib/TaglibCatalog.java index 366a7279af55..5321b80f6e17 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/taglib/TaglibCatalog.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/TaglibCatalog.java @@ -19,41 +19,67 @@ package org.netbeans.modules.web.taglib; +import java.beans.PropertyChangeListener; +import java.io.IOException; +import java.io.StringReader; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; -import org.netbeans.modules.xml.catalog.spi.CatalogDescriptor; +import org.netbeans.modules.xml.catalog.spi.CatalogDescriptor2; import org.netbeans.modules.xml.catalog.spi.CatalogListener; import org.netbeans.modules.xml.catalog.spi.CatalogReader; -import org.openide.util.ImageUtilities; import org.openide.util.NbBundle; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; /** Catalog for taglib DTDs and schemas that enables code completion and XML validation in editor. * * @author Milan Kuchtiak */ -public class TaglibCatalog implements CatalogReader, CatalogDescriptor, org.xml.sax.EntityResolver { +public class TaglibCatalog implements CatalogReader, CatalogDescriptor2, EntityResolver { private static final String TAGLIB_1_1="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"; // NOI18N private static final String TAGLIB_1_2="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"; // NOI18N 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 JAKARTAEE_NS = "http://jakarta.ee/xml/ns/jakartaee"; // NOI18N private static final String TAGLIB_2_0_XSD="web-jsptaglibrary_2_0.xsd"; // NOI18N private static final String TAGLIB_2_1_XSD="web-jsptaglibrary_2_1.xsd"; // NOI18N + private static final String TAGLIB_3_0_XSD="web-jsptaglibrary_3_0.xsd"; // NOI18N + private static final String TAGLIB_3_1_XSD="web-jsptaglibrary_3_1.xsd"; // NOI18N + private static final String TAGLIB_4_0_XSD="web-jsptaglibrary_4_0.xsd"; // NOI18N private static final String TAGLIB_2_0=J2EE_NS+"/"+TAGLIB_2_0_XSD; // NOI18N private static final String TAGLIB_2_1=JAVAEE_NS+"/"+TAGLIB_2_1_XSD; // NOI18N + private static final String TAGLIB_3_0=JAKARTAEE_NS+"/"+TAGLIB_3_0_XSD; // NOI18N + private static final String TAGLIB_3_1=JAKARTAEE_NS+"/"+TAGLIB_3_1_XSD; // NOI18N + private static final String TAGLIB_4_0=JAKARTAEE_NS+"/"+TAGLIB_4_0_XSD; // NOI18N public static final String TAGLIB_2_0_ID="SCHEMA:"+TAGLIB_2_0; // NOI18N public static final String TAGLIB_2_1_ID="SCHEMA:"+TAGLIB_2_1; // NOI18N - private static final String WEB_SERVICES_CLIENT_XSD = "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"; // NOI18N + public static final String TAGLIB_3_0_ID="SCHEMA:"+TAGLIB_3_0; // NOI18N + public static final String TAGLIB_3_1_ID="SCHEMA:"+TAGLIB_3_1; // NOI18N + public static final String TAGLIB_4_0_ID="SCHEMA:"+TAGLIB_4_0; // NOI18N + + private static final String URL_WEB_SERVICES_CLIENT_IBM = "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"; // NOI18N + private static final String URL_WEB_SERVICES_CLIENT_1_1 = "nbres:/org/netbeans/modules/web/taglib/resources/j2ee_web_services_client_1_1.xsd"; // NOI18N + private static final String URL_WEB_SERVICES_CLIENT_1_2 = "nbres:/org/netbeans/modules/web/taglib/resources/javaee_web_services_client_1_2.xsd"; // NOI18N private static final String URL_TAGLIB_1_1="nbres:/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_1_1.dtd"; // NOI18N private static final String URL_TAGLIB_1_2="nbres:/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_1_2.dtd"; // NOI18N private static final String URL_TAGLIB_2_0="nbres:/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_2_0.xsd"; // NOI18N private static final String URL_TAGLIB_2_1="nbres:/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_2_1.xsd"; // NOI18N - private static final String URL_WEB_SERVICES_CLIENT = "nbres:/org/netbeans/modules/web/taglib/resources/j2ee_web_services_client_1_1.xsd"; // NOI18N + private static final String URL_TAGLIB_3_0="nbres:/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_0.xsd"; // NOI18N + private static final String URL_TAGLIB_3_1="nbres:/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.xsd"; // NOI18N + private static final String URL_TAGLIB_4_0="nbres:/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.xsd"; // NOI18N 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 XML_XSD_DEF="" + + "" + + "" + + "" + + "In due course, we should install the relevant ISO 2- and 3-letter codes as the enumerated possible values . . ." + + ""; // NOI18N /** Creates a new instance of TaglibCatalog */ public TaglibCatalog() { @@ -63,12 +89,16 @@ public TaglibCatalog() { * Get String iterator representing all public IDs registered in catalog. * @return null if cannot proceed, try later. */ - public java.util.Iterator getPublicIDs() { - List list = new ArrayList<>(); + @Override + public Iterator getPublicIDs() { + List list = new ArrayList<>(16); list.add(TAGLIB_1_1); list.add(TAGLIB_1_2); list.add(TAGLIB_2_0_ID); list.add(TAGLIB_2_1_ID); + list.add(TAGLIB_3_0_ID); + list.add(TAGLIB_3_1_ID); + list.add(TAGLIB_4_0_ID); return list.listIterator(); } @@ -76,21 +106,36 @@ public java.util.Iterator getPublicIDs() { * Get registered systemid for given public Id or null if not registered. * @return null if not registered */ + @Override public String getSystemID(String publicId) { - if (TAGLIB_1_2.equals(publicId)) - return URL_TAGLIB_1_2; - else if (TAGLIB_1_1.equals(publicId)) - return URL_TAGLIB_1_1; - else if (TAGLIB_2_0_ID.equals(publicId)) - return URL_TAGLIB_2_0; - else if (TAGLIB_2_1_ID.equals(publicId)) - return URL_TAGLIB_2_1; - else return null; + if (null == publicId) { + return null; + } else { + switch (publicId) { + case TAGLIB_1_1: + return URL_TAGLIB_1_1; + case TAGLIB_1_2: + return URL_TAGLIB_1_2; + case TAGLIB_2_0_ID: + return URL_TAGLIB_2_0; + case TAGLIB_2_1_ID: + return URL_TAGLIB_2_1; + case TAGLIB_3_0_ID: + return URL_TAGLIB_3_0; + case TAGLIB_3_1_ID: + return URL_TAGLIB_3_1; + case TAGLIB_4_0_ID: + return URL_TAGLIB_4_0; + default: + return null; + } + } } /** * Refresh content according to content of mounted catalog. */ + @Override public void refresh() { } @@ -98,64 +143,89 @@ public void refresh() { * Optional operation allowing to listen at catalog for changes. * @throws UnsupportedOpertaionException if not supported by the implementation. */ + @Override public void addCatalogListener(CatalogListener l) { } /** - * Optional operation couled with addCatalogListener. + * Optional operation could with addCatalogListener. * @throws UnsupportedOpertaionException if not supported by the implementation. */ + @Override public void removeCatalogListener(CatalogListener l) { } /** Registers new listener. */ - public void addPropertyChangeListener(java.beans.PropertyChangeListener l) { + @Override + public void addPropertyChangeListener(PropertyChangeListener l) { } /** * @return I18N display name */ + @Override public String getDisplayName() { return NbBundle.getMessage (TaglibCatalog.class, "LBL_TaglibCatalog"); } /** - * Return visuaized state of given catalog. + * Return visualized state of given catalog. * @param type of icon defined by JavaBeans specs * @return icon representing current state or null */ - public java.awt.Image getIcon(int type) { - return ImageUtilities.loadImage("org/netbeans/modules/web/taglib/resources/TaglibCatalog.gif"); // NOI18N + @Override + public String getIconResource(int type) { + return "org/netbeans/modules/web/taglib/resources/TaglibCatalog.gif"; // NOI18N } /** * @return I18N short description */ + @Override public String getShortDescription() { return NbBundle.getMessage (TaglibCatalog.class, "DESC_TaglibCatalog"); } /** Unregister the listener. */ - public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { + @Override + public void removePropertyChangeListener(PropertyChangeListener l) { } /** - * Resolves schema definition file for taglib descriptor (spec.1_1, 1_2, 2_0) + * Resolves schema definition file for taglib descriptor + * (spec. 1_1, 1_2, 2_0, 2_1, 3_0, 3_1, 4_0) * @param publicId publicId for resolved entity (null in our case) * @param systemId systemId for resolved entity * @return InputSource for publisId, */ - public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException, java.io.IOException { + @Override + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { if (TAGLIB_2_0.equals(systemId)) { - return new org.xml.sax.InputSource(URL_TAGLIB_2_0); + return new InputSource(URL_TAGLIB_2_0); } else if (TAGLIB_2_1.equals(systemId)) { - return new org.xml.sax.InputSource(URL_TAGLIB_2_1); + return new InputSource(URL_TAGLIB_2_1); + } else if (TAGLIB_3_0.equals(systemId)) { + return new InputSource(URL_TAGLIB_3_0); + } else if (TAGLIB_3_1.equals(systemId)) { + return new InputSource(URL_TAGLIB_3_1); + } else if (TAGLIB_4_0.equals(systemId)) { + return new InputSource(URL_TAGLIB_4_0); } else if (systemId!=null && systemId.endsWith(TAGLIB_2_0_XSD)) { - return new org.xml.sax.InputSource(URL_TAGLIB_2_0); - } else if (WEB_SERVICES_CLIENT_XSD.equals(systemId)) { - return new org.xml.sax.InputSource(URL_WEB_SERVICES_CLIENT); + return new InputSource(URL_TAGLIB_2_0); + } else if (systemId!=null && systemId.endsWith(TAGLIB_2_1_XSD)) { + return new InputSource(URL_TAGLIB_2_1); + } else if (systemId!=null && systemId.endsWith(TAGLIB_3_0_XSD)) { + return new InputSource(URL_TAGLIB_3_0); + } else if (systemId!=null && systemId.endsWith(TAGLIB_3_1_XSD)) { + return new InputSource(URL_TAGLIB_3_1); + } else if (systemId!=null && systemId.endsWith(TAGLIB_4_0_XSD)) { + return new InputSource(URL_TAGLIB_4_0); + } else if (URL_WEB_SERVICES_CLIENT_IBM.equals(systemId)) { + return new InputSource(URL_WEB_SERVICES_CLIENT_1_1); + } else if (URL_WEB_SERVICES_CLIENT_1_2.equals(systemId)) { + return new InputSource(URL_WEB_SERVICES_CLIENT_1_2); } else if (XML_XSD.equals(systemId)) { - return new org.xml.sax.InputSource(new java.io.StringReader(XML_XSD_DEF)); + return new InputSource(new StringReader(XML_XSD_DEF)); } else { return null; } @@ -165,6 +235,7 @@ public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) t * Get registered URI for the given name or null if not registered. * @return null if not registered */ + @Override public String resolveURI(String name) { return null; } @@ -172,6 +243,7 @@ public String resolveURI(String name) { * Get registered URI for the given publicId or null if not registered. * @return null if not registered */ + @Override public String resolvePublic(String publicId) { return null; } diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.mdd b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.mdd new file mode 100644 index 000000000000..ad9a3ae3eb4d --- /dev/null +++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.mdd @@ -0,0 +1,745 @@ + + + + + taglib + https://jakarta.ee/xml/ns/jakartaee + Taglib + + Description + + + DisplayName + + + Icon + + + TlibVersion + + + ShortName + + + Uri + + + Validator + + + Listener + + + Tag + + + TagFile + + + Function + + + TaglibExtension + + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + DeweyVersionType + java.math.BigDecimal + + + tld-canonical-nameType + https://jakarta.ee/xml/ns/jakartaee + TldCanonicalNameType + java.lang.String + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.lang.String + + + validatorType + https://jakarta.ee/xml/ns/jakartaee + ValidatorType + + Description + + + ValidatorClass + + + InitParam + + + + listenerType + https://jakarta.ee/xml/ns/jakartaee + ListenerType + + Description + + + DisplayName + + + Icon + + + ListenerClass + + + + tagType + https://jakarta.ee/xml/ns/jakartaee + TagType + + Description + + + DisplayName + + + Icon + + + Name + + + TagClass + + + TeiClass + + + BodyContent + + + Variable + + + Attribute + + + DynamicAttributes + + + Example + + + TagExtension + + + + tagFileType + https://jakarta.ee/xml/ns/jakartaee + TagFileType + + Description + + + DisplayName + + + Icon + + + Name + + + Path + + + Example + + + TagExtension + + + + functionType + https://jakarta.ee/xml/ns/jakartaee + FunctionType + + Description + + + DisplayName + + + Icon + + + Name + + + FunctionClass + + + FunctionSignature + + + Example + + + FunctionExtension + + + + tld-extensionType + https://jakarta.ee/xml/ns/jakartaee + TldExtensionType + + ExtensionElement + + + + extensibleType + https://jakarta.ee/xml/ns/jakartaee + ExtensibleType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClassType + java.lang.String + + + 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 + IconType + + SmallIcon + + + LargeIcon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + body-contentType + https://jakarta.ee/xml/ns/jakartaee + BodyContentType + java.lang.String + + + variableType + https://jakarta.ee/xml/ns/jakartaee + VariableType + + Description + + + NameGiven + + + NameFromAttribute + + + VariableClass + + + Declare + + + Scope + + + + tld-attributeType + https://jakarta.ee/xml/ns/jakartaee + TldAttributeType + + Description + + + Name + + + Required + + + Rtexprvalue + + + Type + + + Fragment + + + + generic-booleanType + https://jakarta.ee/xml/ns/jakartaee + GenericBooleanType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + variable-scopeType + https://jakarta.ee/xml/ns/jakartaee + VariableScopeType + java.lang.String + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + ParamValueType + + Description + + + ParamName + + + ParamValue + + + + emptyType + https://jakarta.ee/xml/ns/jakartaee + EmptyType + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRefType + + Description + + + EjbRefName + + + EjbRefType + + + Home + + + Remote + + + EjbLink + + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + xsdIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdIntegerType + java.math.BigInteger + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRefType + + Description + + + ResourceEnvRefName + + + ResourceEnvRefType + + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationType + + Description + + + DisplayName + + + Icon + + + MessageDestinationName + + + + xsdBooleanType + https://jakarta.ee/xml/ns/jakartaee + XsdBooleanType + boolean + + + run-asType + https://jakarta.ee/xml/ns/jakartaee + RunAsType + + Description + + + RoleName + + + + localType + https://jakarta.ee/xml/ns/jakartaee + LocalType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRefType + + ServiceEndpointInterface + + + PortComponentLink + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRefType + + Description + + + MessageDestinationRefName + + + MessageDestinationType + + + MessageDestinationUsage + + + MessageDestinationLink + + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + local-homeType + https://jakarta.ee/xml/ns/jakartaee + LocalHomeType + java.lang.String + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRefType + + Description + + + ResRefName + + + ResType + + + ResAuth + + + ResSharingScope + + + + xsdNMTOKENType + https://jakarta.ee/xml/ns/jakartaee + XsdNMTOKENType + java.lang.String + + + ejb-local-refType + https://jakarta.ee/xml/ns/jakartaee + EjbLocalRefType + + Description + + + EjbRefName + + + EjbRefType + + + LocalHome + + + Local + + + EjbLink + + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + xsdPositiveIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdPositiveIntegerType + long + + + xsdNonNegativeIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdNonNegativeIntegerType + java.math.BigInteger + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + url-patternType + https://jakarta.ee/xml/ns/jakartaee + UrlPatternType + java.lang.String + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleType + + Description + + + RoleName + + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefType + + Description + + + DisplayName + + + Icon + + + ServiceRefName + + + ServiceInterface + + + WsdlFile + + + JaxrpcMappingFile + + + ServiceQname + + + PortComponentRef + + + Handler + + + + java-typeType + https://jakarta.ee/xml/ns/jakartaee + JavaTypeType + java.lang.String + + + security-role-refType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleRefType + + Description + + + RoleName + + + RoleLink + + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryType + + Description + + + EnvEntryName + + + EnvEntryType + + + EnvEntryValue + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerType + + Description + + + DisplayName + + + Icon + + + HandlerName + + + HandlerClass + + + InitParam + + + SoapHeader + + + SoapRole + + + PortName + + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleNameType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.xsd b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.xsd new file mode 100644 index 000000000000..e0dde1a814a8 --- /dev/null +++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.xsd @@ -0,0 +1,1109 @@ + + + + + + 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 xsi:schemaLocation attribute + for Jakarta EE namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-jsptaglibrary_3_1.xsd + + ]]> + + + + + + + + + + + + + The taglib tag is the document root. + The definition of taglib is provided + by the tldTaglibType. + + + + + + + + The taglib element contains, among other things, tag and + tag-file elements. + The name subelements of these elements must each be unique. + + + + + + + + + + + The taglib element contains function elements. + The name subelements of these elements must each be unique. + + + + + + + + + + + + + + + + Specifies the type of body that is valid for a tag. + This value is used by the JSP container to validate + that a tag invocation has the correct body syntax and + by page composition tools to assist the page author + in providing a valid tag body. + + There are currently four values specified: + + tagdependent The body of the tag is interpreted by the tag + implementation itself, and is most likely + in a different "language", e.g embedded SQL + statements. + + JSP The body of the tag contains nested JSP + syntax. + + empty The body must be empty + + scriptless The body accepts only template text, EL + Expressions, and JSP action elements. No + scripting elements are allowed. + + + + + + + + + + + + + + + + + + + + + Defines the canonical name of a tag or attribute being + defined. + + The name must conform to the lexical rules for an NMTOKEN. + + + + + + + + + + + + + + + + A validator that can be used to validate + the conformance of a JSP page to using this tag library is + defined by a validatorType. + + + + + + + + + + Defines the TagLibraryValidator class that can be used + to validate the conformance of a JSP page to using this + tag library. + + + + + + + + + The init-param element contains a name/value pair as an + initialization param. + + + + + + + + + + + + + + + + The tag defines a unique tag in this tag library. It has one + attribute, id. + + The tag element may have several subelements defining: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name The unique action name + + tag-class The tag handler class implementing + jakarta.servlet.jsp.tagext.JspTag + + tei-class An optional subclass of + jakarta.servlet.jsp.tagext.TagExtraInfo + + body-content The body content type + + variable Optional scripting variable information + + attribute All attributes of this action that are + evaluated prior to invocation. + + dynamic-attributes Whether this tag supports additional + attributes with dynamic names. If + true, the tag-class must implement the + jakarta.servlet.jsp.tagext.DynamicAttributes + interface. Defaults to false. + + example Optional informal description of an + example of a use of this tag + + tag-extension Zero or more extensions that provide extra + information about this tag, for tool + consumption + + + + + + + + + + + Defines the subclass of jakarta.servlet.jsp.tagext.JspTag + that implements the request time semantics for + this tag. (required) + + + + + + + + + Defines the subclass of jakarta.servlet.jsp.tagext.TagExtraInfo + for this tag. (optional) + + If this is not given, the class is not consulted at + translation time. + + + + + + + + + Specifies the format for the body of this tag. + The default in JSP 1.2 was "JSP" but because this + is an invalid setting for simple tag handlers, there + is no longer a default in JSP 2.0. A reasonable + default for simple tag handlers is "scriptless" if + the tag can have a body. + + + + + + + + + + + + The example element contains an informal description + of an example of the use of a tag. + + + + + + + + + Tag extensions are for tool use only and must not affect + the behavior of a container. + + + + + + + + + + + + + + + + Defines an action in this tag library that is implemented + as a .tag file. + + The tag-file element has two required subelements: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name The unique action name + + path Where to find the .tag file implementing this + action, relative to the root of the web + application or the root of the JAR file for a + tag library packaged in a JAR. This must + begin with /WEB-INF/tags if the .tag file + resides in the WAR, or /META-INF/tags if the + .tag file resides in a JAR. + + example Optional informal description of an + example of a use of this tag + + tag-extension Zero or more extensions that provide extra + information about this tag, for tool + consumption + + + + + + + + + + + + The example element contains an informal description + of an example of the use of a tag. + + + + + + + + + Tag extensions are for tool use only and must not affect + the behavior of a container. + + + + + + + + + + + + + + + + The function element is used to provide information on each + function in the tag library that is to be exposed to the EL. + + The function element may have several subelements defining: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name A unique name for this function + + function-class Provides the name of the Java class that + implements the function + + function-signature Provides the signature, as in the Java + Language Specification, of the Java + method that is to be used to implement + the function. + + example Optional informal description of an + example of a use of this function + + function-extension Zero or more extensions that provide extra + information about this function, for tool + consumption + + + + + + + + + + A unique name for this function. + + + + + + + + + Provides the fully-qualified class name of the Java + class containing the static method that implements + the function. + + + + + + + + + Provides the signature, of the static Java method that is + to be used to implement the function. The syntax of the + function-signature element is as follows: + + FunctionSignature ::= ReturnType S MethodName S? + '(' S? Parameters? S? ')' + + ReturnType ::= Type + + MethodName ::= Identifier + + Parameters ::= Parameter + | ( Parameter S? ',' S? Parameters ) + + Parameter ::= Type + + Where: + + * Type is a basic type or a fully qualified + Java class name (including package name), + as per the 'Type' production in the Java + Language Specification, Second Edition, + Chapter 18. + + * Identifier is a Java identifier, as per + the 'Identifier' production in the Java + Language Specification, Second + Edition, Chapter 18. + + Example: + + java.lang.String nickName( java.lang.String, int ) + + + + + + + + + The example element contains an informal description + of an example of the use of this function. + + + + + + + + + Function extensions are for tool use only and must not + affect the behavior of a container. + + + + + + + + + + + + + + + + The taglib tag is the document root, it defines: + + description a simple string describing the "use" of this + taglib, should be user discernable + + display-name the display-name element contains a + short name that is intended to be displayed + by tools + + icon optional icon that can be used by tools + + tlib-version the version of the tag library implementation + + short-name a simple default short name that could be + used by a JSP authoring tool to create + names with a mnemonic value; for example, + the it may be used as the prefered prefix + value in taglib directives + + uri a uri uniquely identifying this taglib + + validator optional TagLibraryValidator information + + listener optional event listener specification + + tag tags in this tag library + + tag-file tag files in this tag library + + function zero or more EL functions defined in this + tag library + + taglib-extension zero or more extensions that provide extra + information about this taglib, for tool + consumption + + + + + + + + + + Describes this version (number) of the taglibrary. + It is described as a dewey decimal. + + + + + + + + + Defines a simple default name that could be used by + a JSP authoring tool to create names with a + mnemonicvalue; for example, it may be used as the + preferred prefix value in taglib directives. Do + not use white space, and do not start with digits + or underscore. + + + + + + + + + Defines a public URI that uniquely identifies this + version of the taglibrary. Leave it empty if it + does not apply. + + + + + + + + + + + + + + + + Taglib extensions are for tool use only and must not + affect the behavior of a container. + + + + + + + + + + Describes the JSP version (number) this taglibrary + requires in order to function (dewey decimal) + + + + + + + + + + + + + + + The variableType provides information on the scripting + variables defined by using this tag. It is a (translation + time) error for a tag that has one or more variable + subelements to have a TagExtraInfo class that returns a + non-null value from a call to getVariableInfo(). + + The subelements of variableType are of the form: + + description Optional description of this + variable + + name-given The variable name as a constant + + name-from-attribute The name of an attribute whose + (translation time) value will + give the name of the + variable. One of name-given or + name-from-attribute is required. + + variable-class Name of the class of the variable. + java.lang.String is default. + + declare Whether the variable is declared + or not. True is the default. + + scope The scope of the scripting varaible + defined. NESTED is default. + + + + + + + + + + + The name for the scripting variable. + + + + + + + + + The name of an attribute whose + (translation-time) value will give the name of + the variable. + + + + + + + + + + The optional name of the class for the scripting + variable. The default is java.lang.String. + + + + + + + + + Whether the scripting variable is to be defined + or not. See TagExtraInfo for details. This + element is optional and "true" is the default. + + + + + + + + + The element is optional and "NESTED" is the default. + + + + + + + + + + + + + + + + This type defines scope of the scripting variable. See + TagExtraInfo for details. The allowed values are, + "NESTED", "AT_BEGIN" and "AT_END". + + + + + + + + + + + + + + + + + + + + The attribute element defines an attribute for the nesting + tag. The attribute element may have several subelements + defining: + + description a description of the attribute + + name the name of the attribute + + required whether the attribute is required or + optional + + rtexprvalue whether the attribute is a runtime attribute + + type the type of the attributes + + fragment whether this attribute is a fragment + + deferred-value present if this attribute is to be parsed as a + jakarta.el.ValueExpression + + deferred-method present if this attribute is to be parsed as a + jakarta.el.MethodExpression + + + + + + + + + + + Defines if the nesting attribute is required or + optional. + + If not present then the default is "false", i.e + the attribute is optional. + + + + + + + + + + + + Defines if the nesting attribute can have scriptlet + expressions as a value, i.e the value of the + attribute may be dynamically calculated at request + time, as opposed to a static value determined at + translation time. + If not present then the default is "false", i.e the + attribute has a static value + + + + + + + + + Defines the Java type of the attributes value. + If this element is omitted, the expected type is + assumed to be "java.lang.Object". + + + + + + + + + + + Present if the value for this attribute is to be + passed to the tag handler as a + jakarta.el.ValueExpression. This allows for deferred + evaluation of EL expressions. An optional subelement + will contain the expected type that the value will + be coerced to after evaluation of the expression. + The type defaults to Object if one is not provided. + + + + + + + + + Present if the value for this attribute is to be + passed to the tag handler as a + jakarta.el.MethodExpression. This allows for deferred + evaluation of an EL expression that identifies a + method to be invoked on an Object. An optional + subelement will contain the expected method + signature. The signature defaults to "void method()" + if one is not provided. + + + + + + + + + + + "true" if this attribute is of type + jakarta.servlet.jsp.tagext.JspFragment, representing dynamic + content that can be re-evaluated as many times + as needed by the tag handler. If omitted or "false", + the default is still type="java.lang.String" + + + + + + + + + + + + + + + + + Defines information about how to provide the value for a + tag handler attribute that accepts a jakarta.el.ValueExpression. + + The deferred-value element has one optional subelement: + + type the expected type of the attribute + + + + + + + + + The fully-qualified name of the Java type that is the + expected type for this deferred expression. If this + element is omitted, the expected type is assumed to be + "java.lang.Object". + + + + + + + + + + + + + + + + Defines information about how to provide the value for a + tag handler attribute that accepts a jakarta.el.MethodExpression. + + The deferred-method element has one optional subelement: + + method-signature Provides the signature, as in the Java + Language Specifies, that is expected for + the method being identified by the + expression. + + + + + + + + + Provides the expected signature of the method identified + by the jakarta.el.MethodExpression. + + This disambiguates overloaded methods and ensures that + the return value is of the expected type. + + The syntax of the method-signature element is identical + to that of the function-signature element. See the + documentation for function-signature for more details. + + The name of the method is for documentation purposes only + and is ignored by the JSP container. + + Example: + + boolean validate(java.lang.String) + + + + + + + + + + + + + + + + The tld-extensionType is used to indicate + extensions to a specific TLD element. + + It is used by elements to designate an extension block + that is targeted to a specific extension designated by + a set of extension elements that are declared by a + namespace. The namespace identifies the extension to + the tool that processes the extension. + + The type of the extension-element is abstract. Therefore, + a concrete type must be specified by the TLD using + xsi:type attribute for each extension-element. + + + + + + + + + + + + + + + + + + The extensibleType is an abstract base type that is used to + define the type of extension-elements. Instance documents + must substitute a known type to define the extension by + using xsi:type attribute to define the actual type of + extension-elements. + + + + + + + diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.mdd b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.mdd new file mode 100644 index 000000000000..ad9a3ae3eb4d --- /dev/null +++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.mdd @@ -0,0 +1,745 @@ + + + + + taglib + https://jakarta.ee/xml/ns/jakartaee + Taglib + + Description + + + DisplayName + + + Icon + + + TlibVersion + + + ShortName + + + Uri + + + Validator + + + Listener + + + Tag + + + TagFile + + + Function + + + TaglibExtension + + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + DeweyVersionType + java.math.BigDecimal + + + tld-canonical-nameType + https://jakarta.ee/xml/ns/jakartaee + TldCanonicalNameType + java.lang.String + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.lang.String + + + validatorType + https://jakarta.ee/xml/ns/jakartaee + ValidatorType + + Description + + + ValidatorClass + + + InitParam + + + + listenerType + https://jakarta.ee/xml/ns/jakartaee + ListenerType + + Description + + + DisplayName + + + Icon + + + ListenerClass + + + + tagType + https://jakarta.ee/xml/ns/jakartaee + TagType + + Description + + + DisplayName + + + Icon + + + Name + + + TagClass + + + TeiClass + + + BodyContent + + + Variable + + + Attribute + + + DynamicAttributes + + + Example + + + TagExtension + + + + tagFileType + https://jakarta.ee/xml/ns/jakartaee + TagFileType + + Description + + + DisplayName + + + Icon + + + Name + + + Path + + + Example + + + TagExtension + + + + functionType + https://jakarta.ee/xml/ns/jakartaee + FunctionType + + Description + + + DisplayName + + + Icon + + + Name + + + FunctionClass + + + FunctionSignature + + + Example + + + FunctionExtension + + + + tld-extensionType + https://jakarta.ee/xml/ns/jakartaee + TldExtensionType + + ExtensionElement + + + + extensibleType + https://jakarta.ee/xml/ns/jakartaee + ExtensibleType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClassType + java.lang.String + + + 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 + IconType + + SmallIcon + + + LargeIcon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + body-contentType + https://jakarta.ee/xml/ns/jakartaee + BodyContentType + java.lang.String + + + variableType + https://jakarta.ee/xml/ns/jakartaee + VariableType + + Description + + + NameGiven + + + NameFromAttribute + + + VariableClass + + + Declare + + + Scope + + + + tld-attributeType + https://jakarta.ee/xml/ns/jakartaee + TldAttributeType + + Description + + + Name + + + Required + + + Rtexprvalue + + + Type + + + Fragment + + + + generic-booleanType + https://jakarta.ee/xml/ns/jakartaee + GenericBooleanType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + variable-scopeType + https://jakarta.ee/xml/ns/jakartaee + VariableScopeType + java.lang.String + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + ParamValueType + + Description + + + ParamName + + + ParamValue + + + + emptyType + https://jakarta.ee/xml/ns/jakartaee + EmptyType + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRefType + + Description + + + EjbRefName + + + EjbRefType + + + Home + + + Remote + + + EjbLink + + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + xsdIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdIntegerType + java.math.BigInteger + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRefType + + Description + + + ResourceEnvRefName + + + ResourceEnvRefType + + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationType + + Description + + + DisplayName + + + Icon + + + MessageDestinationName + + + + xsdBooleanType + https://jakarta.ee/xml/ns/jakartaee + XsdBooleanType + boolean + + + run-asType + https://jakarta.ee/xml/ns/jakartaee + RunAsType + + Description + + + RoleName + + + + localType + https://jakarta.ee/xml/ns/jakartaee + LocalType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRefType + + ServiceEndpointInterface + + + PortComponentLink + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRefType + + Description + + + MessageDestinationRefName + + + MessageDestinationType + + + MessageDestinationUsage + + + MessageDestinationLink + + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + local-homeType + https://jakarta.ee/xml/ns/jakartaee + LocalHomeType + java.lang.String + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRefType + + Description + + + ResRefName + + + ResType + + + ResAuth + + + ResSharingScope + + + + xsdNMTOKENType + https://jakarta.ee/xml/ns/jakartaee + XsdNMTOKENType + java.lang.String + + + ejb-local-refType + https://jakarta.ee/xml/ns/jakartaee + EjbLocalRefType + + Description + + + EjbRefName + + + EjbRefType + + + LocalHome + + + Local + + + EjbLink + + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + xsdPositiveIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdPositiveIntegerType + long + + + xsdNonNegativeIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdNonNegativeIntegerType + java.math.BigInteger + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + url-patternType + https://jakarta.ee/xml/ns/jakartaee + UrlPatternType + java.lang.String + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleType + + Description + + + RoleName + + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefType + + Description + + + DisplayName + + + Icon + + + ServiceRefName + + + ServiceInterface + + + WsdlFile + + + JaxrpcMappingFile + + + ServiceQname + + + PortComponentRef + + + Handler + + + + java-typeType + https://jakarta.ee/xml/ns/jakartaee + JavaTypeType + java.lang.String + + + security-role-refType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleRefType + + Description + + + RoleName + + + RoleLink + + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryType + + Description + + + EnvEntryName + + + EnvEntryType + + + EnvEntryValue + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerType + + Description + + + DisplayName + + + Icon + + + HandlerName + + + HandlerClass + + + InitParam + + + SoapHeader + + + SoapRole + + + PortName + + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleNameType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.xsd b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.xsd new file mode 100644 index 000000000000..4c210ddd4f41 --- /dev/null +++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.xsd @@ -0,0 +1,1109 @@ + + + + + + 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 xsi:schemaLocation attribute + for Jakarta EE namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-jsptaglibrary_4_0.xsd + + ]]> + + + + + + + + + + + + + The taglib tag is the document root. + The definition of taglib is provided + by the tldTaglibType. + + + + + + + + The taglib element contains, among other things, tag and + tag-file elements. + The name subelements of these elements must each be unique. + + + + + + + + + + + The taglib element contains function elements. + The name subelements of these elements must each be unique. + + + + + + + + + + + + + + + + Specifies the type of body that is valid for a tag. + This value is used by the JSP container to validate + that a tag invocation has the correct body syntax and + by page composition tools to assist the page author + in providing a valid tag body. + + There are currently four values specified: + + tagdependent The body of the tag is interpreted by the tag + implementation itself, and is most likely + in a different "language", e.g embedded SQL + statements. + + JSP The body of the tag contains nested JSP + syntax. + + empty The body must be empty + + scriptless The body accepts only template text, EL + Expressions, and JSP action elements. No + scripting elements are allowed. + + + + + + + + + + + + + + + + + + + + + Defines the canonical name of a tag or attribute being + defined. + + The name must conform to the lexical rules for an NMTOKEN. + + + + + + + + + + + + + + + + A validator that can be used to validate + the conformance of a JSP page to using this tag library is + defined by a validatorType. + + + + + + + + + + Defines the TagLibraryValidator class that can be used + to validate the conformance of a JSP page to using this + tag library. + + + + + + + + + The init-param element contains a name/value pair as an + initialization param. + + + + + + + + + + + + + + + + The tag defines a unique tag in this tag library. It has one + attribute, id. + + The tag element may have several subelements defining: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name The unique action name + + tag-class The tag handler class implementing + jakarta.servlet.jsp.tagext.JspTag + + tei-class An optional subclass of + jakarta.servlet.jsp.tagext.TagExtraInfo + + body-content The body content type + + variable Optional scripting variable information + + attribute All attributes of this action that are + evaluated prior to invocation. + + dynamic-attributes Whether this tag supports additional + attributes with dynamic names. If + true, the tag-class must implement the + jakarta.servlet.jsp.tagext.DynamicAttributes + interface. Defaults to false. + + example Optional informal description of an + example of a use of this tag + + tag-extension Zero or more extensions that provide extra + information about this tag, for tool + consumption + + + + + + + + + + + Defines the subclass of jakarta.servlet.jsp.tagext.JspTag + that implements the request time semantics for + this tag. (required) + + + + + + + + + Defines the subclass of jakarta.servlet.jsp.tagext.TagExtraInfo + for this tag. (optional) + + If this is not given, the class is not consulted at + translation time. + + + + + + + + + Specifies the format for the body of this tag. + The default in JSP 1.2 was "JSP" but because this + is an invalid setting for simple tag handlers, there + is no longer a default in JSP 2.0. A reasonable + default for simple tag handlers is "scriptless" if + the tag can have a body. + + + + + + + + + + + + The example element contains an informal description + of an example of the use of a tag. + + + + + + + + + Tag extensions are for tool use only and must not affect + the behavior of a container. + + + + + + + + + + + + + + + + Defines an action in this tag library that is implemented + as a .tag file. + + The tag-file element has two required subelements: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name The unique action name + + path Where to find the .tag file implementing this + action, relative to the root of the web + application or the root of the JAR file for a + tag library packaged in a JAR. This must + begin with /WEB-INF/tags if the .tag file + resides in the WAR, or /META-INF/tags if the + .tag file resides in a JAR. + + example Optional informal description of an + example of a use of this tag + + tag-extension Zero or more extensions that provide extra + information about this tag, for tool + consumption + + + + + + + + + + + + The example element contains an informal description + of an example of the use of a tag. + + + + + + + + + Tag extensions are for tool use only and must not affect + the behavior of a container. + + + + + + + + + + + + + + + + The function element is used to provide information on each + function in the tag library that is to be exposed to the EL. + + The function element may have several subelements defining: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name A unique name for this function + + function-class Provides the name of the Java class that + implements the function + + function-signature Provides the signature, as in the Java + Language Specification, of the Java + method that is to be used to implement + the function. + + example Optional informal description of an + example of a use of this function + + function-extension Zero or more extensions that provide extra + information about this function, for tool + consumption + + + + + + + + + + A unique name for this function. + + + + + + + + + Provides the fully-qualified class name of the Java + class containing the static method that implements + the function. + + + + + + + + + Provides the signature, of the static Java method that is + to be used to implement the function. The syntax of the + function-signature element is as follows: + + FunctionSignature ::= ReturnType S MethodName S? + '(' S? Parameters? S? ')' + + ReturnType ::= Type + + MethodName ::= Identifier + + Parameters ::= Parameter + | ( Parameter S? ',' S? Parameters ) + + Parameter ::= Type + + Where: + + * Type is a basic type or a fully qualified + Java class name (including package name), + as per the 'Type' production in the Java + Language Specification, Second Edition, + Chapter 18. + + * Identifier is a Java identifier, as per + the 'Identifier' production in the Java + Language Specification, Second + Edition, Chapter 18. + + Example: + + java.lang.String nickName( java.lang.String, int ) + + + + + + + + + The example element contains an informal description + of an example of the use of this function. + + + + + + + + + Function extensions are for tool use only and must not + affect the behavior of a container. + + + + + + + + + + + + + + + + The taglib tag is the document root, it defines: + + description a simple string describing the "use" of this + taglib, should be user discernable + + display-name the display-name element contains a + short name that is intended to be displayed + by tools + + icon optional icon that can be used by tools + + tlib-version the version of the tag library implementation + + short-name a simple default short name that could be + used by a JSP authoring tool to create + names with a mnemonic value; for example, + the it may be used as the prefered prefix + value in taglib directives + + uri a uri uniquely identifying this taglib + + validator optional TagLibraryValidator information + + listener optional event listener specification + + tag tags in this tag library + + tag-file tag files in this tag library + + function zero or more EL functions defined in this + tag library + + taglib-extension zero or more extensions that provide extra + information about this taglib, for tool + consumption + + + + + + + + + + Describes this version (number) of the taglibrary. + It is described as a dewey decimal. + + + + + + + + + Defines a simple default name that could be used by + a JSP authoring tool to create names with a + mnemonicvalue; for example, it may be used as the + preferred prefix value in taglib directives. Do + not use white space, and do not start with digits + or underscore. + + + + + + + + + Defines a public URI that uniquely identifies this + version of the taglibrary. Leave it empty if it + does not apply. + + + + + + + + + + + + + + + + Taglib extensions are for tool use only and must not + affect the behavior of a container. + + + + + + + + + + Describes the JSP version (number) this taglibrary + requires in order to function (dewey decimal) + + + + + + + + + + + + + + + The variableType provides information on the scripting + variables defined by using this tag. It is a (translation + time) error for a tag that has one or more variable + subelements to have a TagExtraInfo class that returns a + non-null value from a call to getVariableInfo(). + + The subelements of variableType are of the form: + + description Optional description of this + variable + + name-given The variable name as a constant + + name-from-attribute The name of an attribute whose + (translation time) value will + give the name of the + variable. One of name-given or + name-from-attribute is required. + + variable-class Name of the class of the variable. + java.lang.String is default. + + declare Whether the variable is declared + or not. True is the default. + + scope The scope of the scripting varaible + defined. NESTED is default. + + + + + + + + + + + The name for the scripting variable. + + + + + + + + + The name of an attribute whose + (translation-time) value will give the name of + the variable. + + + + + + + + + + The optional name of the class for the scripting + variable. The default is java.lang.String. + + + + + + + + + Whether the scripting variable is to be defined + or not. See TagExtraInfo for details. This + element is optional and "true" is the default. + + + + + + + + + The element is optional and "NESTED" is the default. + + + + + + + + + + + + + + + + This type defines scope of the scripting variable. See + TagExtraInfo for details. The allowed values are, + "NESTED", "AT_BEGIN" and "AT_END". + + + + + + + + + + + + + + + + + + + + The attribute element defines an attribute for the nesting + tag. The attribute element may have several subelements + defining: + + description a description of the attribute + + name the name of the attribute + + required whether the attribute is required or + optional + + rtexprvalue whether the attribute is a runtime attribute + + type the type of the attributes + + fragment whether this attribute is a fragment + + deferred-value present if this attribute is to be parsed as a + jakarta.el.ValueExpression + + deferred-method present if this attribute is to be parsed as a + jakarta.el.MethodExpression + + + + + + + + + + + Defines if the nesting attribute is required or + optional. + + If not present then the default is "false", i.e + the attribute is optional. + + + + + + + + + + + + Defines if the nesting attribute can have scriptlet + expressions as a value, i.e the value of the + attribute may be dynamically calculated at request + time, as opposed to a static value determined at + translation time. + If not present then the default is "false", i.e the + attribute has a static value + + + + + + + + + Defines the Java type of the attributes value. + If this element is omitted, the expected type is + assumed to be "java.lang.Object". + + + + + + + + + + + Present if the value for this attribute is to be + passed to the tag handler as a + jakarta.el.ValueExpression. This allows for deferred + evaluation of EL expressions. An optional subelement + will contain the expected type that the value will + be coerced to after evaluation of the expression. + The type defaults to Object if one is not provided. + + + + + + + + + Present if the value for this attribute is to be + passed to the tag handler as a + jakarta.el.MethodExpression. This allows for deferred + evaluation of an EL expression that identifies a + method to be invoked on an Object. An optional + subelement will contain the expected method + signature. The signature defaults to "void method()" + if one is not provided. + + + + + + + + + + + "true" if this attribute is of type + jakarta.servlet.jsp.tagext.JspFragment, representing dynamic + content that can be re-evaluated as many times + as needed by the tag handler. If omitted or "false", + the default is still type="java.lang.String" + + + + + + + + + + + + + + + + + Defines information about how to provide the value for a + tag handler attribute that accepts a jakarta.el.ValueExpression. + + The deferred-value element has one optional subelement: + + type the expected type of the attribute + + + + + + + + + The fully-qualified name of the Java type that is the + expected type for this deferred expression. If this + element is omitted, the expected type is assumed to be + "java.lang.Object". + + + + + + + + + + + + + + + + Defines information about how to provide the value for a + tag handler attribute that accepts a jakarta.el.MethodExpression. + + The deferred-method element has one optional subelement: + + method-signature Provides the signature, as in the Java + Language Specifies, that is expected for + the method being identified by the + expression. + + + + + + + + + Provides the expected signature of the method identified + by the jakarta.el.MethodExpression. + + This disambiguates overloaded methods and ensures that + the return value is of the expected type. + + The syntax of the method-signature element is identical + to that of the function-signature element. See the + documentation for function-signature for more details. + + The name of the method is for documentation purposes only + and is ignored by the JSP container. + + Example: + + boolean validate(java.lang.String) + + + + + + + + + + + + + + + + The tld-extensionType is used to indicate + extensions to a specific TLD element. + + It is used by elements to designate an extension block + that is targeted to a specific extension designated by + a set of extension elements that are declared by a + namespace. The namespace identifies the extension to + the tool that processes the extension. + + The type of the extension-element is abstract. Therefore, + a concrete type must be specified by the TLD using + xsi:type attribute for each extension-element. + + + + + + + + + + + + + + + + + + The extensibleType is an abstract base type that is used to + define the type of extension-elements. Instance documents + must substitute a known type to define the extension by + using xsi:type attribute to define the actual type of + extension-elements. + + + + + + + diff --git a/enterprise/web.debug/manifest.mf b/enterprise/web.debug/manifest.mf index c27acaf9ce9e..c35b56a2e7a4 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.61 +OpenIDE-Module-Specification-Version: 2.62 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 af05e58aed52..79336145b4b8 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.77 +OpenIDE-Module-Specification-Version: 1.78 diff --git a/enterprise/web.freeform/manifest.mf b/enterprise/web.freeform/manifest.mf index 5517ddf50fc7..b79b0fa01311 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.57 +OpenIDE-Module-Specification-Version: 1.58 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.jsf.editor/manifest.mf b/enterprise/web.jsf.editor/manifest.mf index 7dc4209e7357..61377fa18ec1 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.4 +OpenIDE-Module-Specification-Version: 2.5 AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.jsf.icefaces/manifest.mf b/enterprise/web.jsf.icefaces/manifest.mf index 464c60883636..8df5fed2b83b 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.41 +OpenIDE-Module-Specification-Version: 1.42 AutoUpdate-Show-In-Client: true OpenIDE-Module-Provides: org.netbeans.modules.web.jsf.complib diff --git a/enterprise/web.jsf.kit/manifest.mf b/enterprise/web.jsf.kit/manifest.mf index 14dbe015e69f..8ce4cf8f77ec 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.52 +OpenIDE-Module-Specification-Version: 1.53 OpenIDE-Module-Provides: org.netbeans.modules.web.project.framework diff --git a/enterprise/web.jsf.navigation/manifest.mf b/enterprise/web.jsf.navigation/manifest.mf index d37494be729e..5da5685cb340 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.51 +OpenIDE-Module-Specification-Version: 2.52 AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/actions/SystemFileSystemSupport.java b/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/actions/SystemFileSystemSupport.java index 067637774ee7..0d16d09718c6 100644 --- a/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/actions/SystemFileSystemSupport.java +++ b/enterprise/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/graph/actions/SystemFileSystemSupport.java @@ -88,7 +88,7 @@ private static ActionsProvider getActionProvider(String folderPath) { } synchronized (dataFolder2actionsProvider) { - ActionsProvider actionsProvider = (ActionsProvider)dataFolder2actionsProvider.get(dataFolder); + ActionsProvider actionsProvider = dataFolder2actionsProvider.get(dataFolder); if (actionsProvider == null) { actionsProvider = new DefaultActionsProvider(dataFolder); dataFolder2actionsProvider.put(dataFolder, actionsProvider); diff --git a/enterprise/web.jsf.richfaces/manifest.mf b/enterprise/web.jsf.richfaces/manifest.mf index 53e13b85d442..b85993f1a1d4 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.53 +OpenIDE-Module-Specification-Version: 1.54 AutoUpdate-Show-In-Client: true OpenIDE-Module-Provides: org.netbeans.modules.web.jsf.complib diff --git a/enterprise/web.jsf/nbproject/project.properties b/enterprise/web.jsf/nbproject/project.properties index a25bc471a290..bb4aab6f1dcf 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.5.0 +spec.version.base=2.6.0 test.config.default.excludes=\ **/JSFEditorUtilitiesTest.class,\ diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/create.ftl b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/create.ftl index a77eea59b5e7..23b225f7f85b 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/create.ftl +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/create.ftl @@ -50,11 +50,17 @@ +<#if nsLocation?starts_with("http://")> - +<#else> + + diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/crudtemplate.ftl b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/crudtemplate.ftl index 8f9cd7931b84..7304c0b3a3f9 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/crudtemplate.ftl +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/crudtemplate.ftl @@ -50,10 +50,15 @@ <#setting number_format="0"> +<#if nsLocation?starts_with("http://")> - +<#else> + + <ui:insert name="title">Default Title</ui:insert> diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/edit.ftl b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/edit.ftl index 5441e70a1809..1c8ffd2aa355 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/edit.ftl +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/edit.ftl @@ -50,10 +50,17 @@ +<#if nsLocation?starts_with("http://")> +<#else> + + diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/list.ftl b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/list.ftl index e44d1382991a..c2db422361b9 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/list.ftl +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/list.ftl @@ -50,10 +50,17 @@ +<#if nsLocation?starts_with("http://")> +<#else> + + diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/view.ftl b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/view.ftl index 0df2fffdedf0..e079ac64a18a 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/view.ftl +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/view.ftl @@ -50,10 +50,17 @@ +<#if nsLocation?starts_with("http://")> +<#else> + + diff --git a/enterprise/web.jsf20/nbproject/project.properties b/enterprise/web.jsf20/nbproject/project.properties index 37622e3ce94d..547efc6e00f5 100644 --- a/enterprise/web.jsf20/nbproject/project.properties +++ b/enterprise/web.jsf20/nbproject/project.properties @@ -19,7 +19,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 release.external/javax.faces-2.3.9.jar=modules/ext/jsf-2_2/javax.faces.jar release.external/javax.faces-2.3.9-license.txt=modules/ext/jsf-2_2/license.txt -spec.version.base=1.58.0 +spec.version.base=1.59.0 # Old library with too broadly defined API - sigtest would give more noise than benefit # (legacy behavior of sigtest ignored subpackages) diff --git a/enterprise/web.jsfapi/manifest.mf b/enterprise/web.jsfapi/manifest.mf index 11e1237ef0d3..28d30d7bd65d 100644 --- a/enterprise/web.jsfapi/manifest.mf +++ b/enterprise/web.jsfapi/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.web.jsfapi/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jsfapi/Bundle.properties -OpenIDE-Module-Specification-Version: 2.4 +OpenIDE-Module-Specification-Version: 2.5 diff --git a/enterprise/web.jspparser/build.xml b/enterprise/web.jspparser/build.xml index fb343475a46d..9e1ab51ddd2f 100644 --- a/enterprise/web.jspparser/build.xml +++ b/enterprise/web.jspparser/build.xml @@ -29,9 +29,14 @@ + + + + + - - + + @@ -49,12 +54,26 @@ + includes="org/apache/jasper/**, com/sun/el/**, com/sun/appserv/server/util/PreprocessorUtil.class, org/glassfish/jsp/api/**" + zipfile="./external/generated-glassfish-jspparser-5.1.0.jar" /> + + + + + + + + + + + + + + diff --git a/enterprise/web.jspparser/external/binaries-list b/enterprise/web.jspparser/external/binaries-list index 56df76326266..9e1b7b61a0e3 100644 --- a/enterprise/web.jspparser/external/binaries-list +++ b/enterprise/web.jspparser/external/binaries-list @@ -19,3 +19,9 @@ F48473482C0E3E714F87186D9305BCAE30B7F5CB org.glassfish:jakarta.el:3.0.4 9A3D933B7B079AD73C43878BF09AC47586FAC897 org.glassfish.main.common:glassfish-ee-api:5.1.0 CED8804F81DB0C9099786472C615A12EA592C44B org.glassfish.main.common:common-util:5.1.0 +# Binary dependencies required for the unittest data (test projects). Only +# required at build/test time. Don't change/update unless unittest changes are +# intended. +34A035507F0270F1C6B7722D728BD7B5A9BBAC4C jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:1.2.7 +F5A092DE3B2B087C14CA4B8D6F2C77A1F6802828 org.glassfish.web:jakarta.servlet.jsp.jstl:1.2.6 +8CFF7DC1E492911F3DD7640EBFB60D6206A1DD40 commons-logging:commons-logging:1.3.1 diff --git a/platform/o.apache.commons.logging/external/commons-logging-1.3.1-license.txt b/enterprise/web.jspparser/external/commons-logging-1.3.1-license.txt similarity index 99% rename from platform/o.apache.commons.logging/external/commons-logging-1.3.1-license.txt rename to enterprise/web.jspparser/external/commons-logging-1.3.1-license.txt index 9f33aab7f4f8..9d40ee4d11c9 100644 --- a/platform/o.apache.commons.logging/external/commons-logging-1.3.1-license.txt +++ b/enterprise/web.jspparser/external/commons-logging-1.3.1-license.txt @@ -4,6 +4,7 @@ Version: 1.3.1 License: Apache-2.0 Description: Logging component URL: https://commons.apache.org/proper/commons-logging/ +Type: compile-time Apache License Version 2.0, January 2004 diff --git a/platform/o.apache.commons.logging/external/commons-logging-1.3.1-notice.txt b/enterprise/web.jspparser/external/commons-logging-1.3.1-notice.txt similarity index 100% rename from platform/o.apache.commons.logging/external/commons-logging-1.3.1-notice.txt rename to enterprise/web.jspparser/external/commons-logging-1.3.1-notice.txt diff --git a/enterprise/web.jspparser/external/jakarta.servlet.jsp.jstl-1.2-license.txt b/enterprise/web.jspparser/external/jakarta.servlet.jsp.jstl-1.2-license.txt new file mode 100644 index 000000000000..f8726ad9ddb4 --- /dev/null +++ b/enterprise/web.jspparser/external/jakarta.servlet.jsp.jstl-1.2-license.txt @@ -0,0 +1,94 @@ +Name: Jakarta Standard Tag Library +Version: 1.2 +License: EPL-v20 +Description: Jakarta Standard Tag Library +Origin: Eclipse Foundation (https://projects.eclipse.org/projects/ee4j.jstl) +Files: jakarta.servlet.jsp.jstl-1.2.6.jar, jakarta.servlet.jsp.jstl-api-1.2.7.jar +Type: compile-time + +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/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java b/enterprise/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java index b1aea9fb50c3..d4fd828f4b01 100644 --- a/enterprise/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java +++ b/enterprise/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java @@ -46,6 +46,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import java.util.logging.*; import java.util.zip.ZipException; import javax.servlet.ServletContext; @@ -81,6 +82,7 @@ import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; +import org.openide.util.Utilities; import org.openide.util.WeakListeners; /** @@ -122,22 +124,18 @@ public class WebAppParseSupport implements WebAppParseProxy, PropertyChangeListe final FileObject webInf; private final FileSystemListener fileSystemListener; - OptionsImpl editorOptions; - OptionsImpl diskOptions; - ServletContext editorContext; - ServletContext diskContext; + private OptionsImpl editorOptions; + private OptionsImpl diskOptions; + private ServletContext editorContext; + private ServletContext diskContext; private JspRuntimeContext rctxt; - private ParserClassLoader waClassLoader; - private ParserClassLoader waContextClassLoader; - - // This is intended for tests exclusively!!! - private static boolean noReset = false; + private URL[][] classLoaderSources = null; // @GuardedBy(this) /** * The library mappings are cashed here. */ - final Map mappings = new HashMap(); + final Map mappings = new HashMap<>(); /** * Flag whether class path is current. @@ -160,6 +158,7 @@ public class WebAppParseSupport implements WebAppParseProxy, PropertyChangeListe private final RequestProcessor.Task tldChangeTask; // #152482 - this escaped from constructor + @SuppressWarnings("AccessingNonPublicFieldOfAnotherObject") public static WebAppParseProxy create(JspParserImpl jspParser, WebModule wm) { WebAppParseSupport instance = new WebAppParseSupport(jspParser, wm); @@ -188,7 +187,7 @@ public static WebAppParseProxy create(JspParserImpl jspParser, WebModule wm) { private WebAppParseSupport(JspParserImpl jspParser, WebModule wm) { this.jspParser = jspParser; - this.wm = new WeakReference(wm); + this.wm = new WeakReference<>(wm); wmRoot = wm.getDocumentBase(); webInf = wm.getWebInf(); if (LOG.isLoggable(Level.FINE)) { @@ -210,6 +209,7 @@ private WebAppParseSupport(JspParserImpl jspParser, WebModule wm) { initOptions(true); } + @Override public JspParserAPI.JspOpenInfo getJspOpenInfo(FileObject jspFile, boolean useEditor /*, URLClassLoader waClassLoader*/) { // PENDING - do caching for individual JSPs @@ -219,10 +219,8 @@ public JspParserAPI.JspOpenInfo getJspOpenInfo(FileObject jspFile, boolean useEd ExtractPageData epd = new ExtractPageData(ctxt); try { return new JspParserAPI.JspOpenInfo(epd.isXMLSyntax(), epd.getEncoding()); - } catch (Exception e) { + } catch (IOException | JasperException | RuntimeException e) { LOG.fine(e.getMessage()); - } finally { - resetClassLoaders(); } return DEFAULT_JSP_OPEN_INFO; } @@ -263,17 +261,9 @@ private synchronized void initOptions(boolean firstTime) { } } - // #134455 (see #67017 and #128360 as well) - // commenting for NB 6.5M1, let's see whether some issues caused by this change will happen or whether this code can be removed - private boolean isUnexpectedLibrary(URL url) { - return false; -// Matcher m = RE_PATTERN_COMMONS_LOGGING.matcher(url.getFile()); -// return m.matches(); - } - private void createClassLoaders() { - Map tomcatTable = new HashMap(); - Map loadingTable = new HashMap(); + Map tomcatTable = new HashMap<>(); + Map loadingTable = new HashMap<>(); URL helpurl; FileObject actualWebInf = getWebInf(); @@ -286,7 +276,7 @@ private void createClassLoaders() { if (cp != null) { for (FileObject root : cp.getRoots()) { helpurl = findInternalURL(root); - if (loadingTable.get(helpurl) == null && !isUnexpectedLibrary(helpurl)) { + if (loadingTable.get(helpurl) == null) { loadingTable.put(helpurl, helpurl); tomcatTable.put(helpurl, findExternalURL(root)); } @@ -297,7 +287,7 @@ private void createClassLoaders() { if (cp != null) { for (FileObject root : cp.getRoots()) { helpurl = findInternalURL(root); - if (loadingTable.get(helpurl) == null && !isUnexpectedLibrary(helpurl)) { + if (loadingTable.get(helpurl) == null) { loadingTable.put(helpurl, helpurl); tomcatTable.put(helpurl, findExternalURL(root)); } @@ -315,33 +305,15 @@ private void createClassLoaders() { } } - URL[] loadingURLs = loadingTable.values().toArray(new URL[0]); - URL[] tomcatURLs = tomcatTable.values().toArray(new URL[0]); + @SuppressWarnings("CollectionsToArray") + URL[][] urls = { + loadingTable.values().toArray(new URL[0]), + tomcatTable.values().toArray(new URL[0]) + }; - waClassLoader = new ParserClassLoader(loadingURLs, tomcatURLs, getClass().getClassLoader()); - waContextClassLoader = new ParserClassLoader(loadingURLs, tomcatURLs, getClass().getClassLoader()); + this.classLoaderSources = urls; } - // #128360 - private void resetClassLoaders() { - if (noReset) { - return; - } - URL[] loadingURLs = waClassLoader.getLoadingURLs(); - URL[] tomcatURLs = waClassLoader.getTomcatURLs(); - URL[] loadingContextURLs = waContextClassLoader.getLoadingURLs(); - URL[] tomcatContextURLs = waContextClassLoader.getTomcatURLs(); - - try { - waClassLoader.close(); - waContextClassLoader.close(); - } catch (Exception e) { - LOG.log(Level.WARNING, null, e); - } - waClassLoader = new ParserClassLoader(loadingURLs, tomcatURLs, waClassLoader.getParent()); - waContextClassLoader = new ParserClassLoader(loadingContextURLs, tomcatContextURLs, waContextClassLoader.getParent()); - } - // #127379 - XXX review after listening on a web module is possible private FileObject getWebInf() { if (wmRoot == null) { @@ -372,10 +344,8 @@ private void putWebInfLibraries(FileObject webInf, Map tomcatTable, Ma FileObject elem = libDirKids.nextElement(); if (elem.getExt().equals("jar")) { // NOI18N helpurl = findInternalURL(elem); - if (!isUnexpectedLibrary(helpurl)) { - tomcatTable.put(helpurl, helpurl); - loadingTable.put(helpurl, helpurl); - } + tomcatTable.put(helpurl, helpurl); + loadingTable.put(helpurl, helpurl); } } } @@ -390,7 +360,7 @@ private URL findExternalURL(FileObject fo) { File f = FileUtil.toFile(fo); if ((f != null)/* && (f.isDirectory())*/) { try { - return f.toURI().toURL(); + return Utilities.toURI(f).toURL(); } catch (MalformedURLException e) { LOG.log(Level.INFO, null, e); } @@ -416,21 +386,16 @@ private synchronized JspCompilationContext createCompilationContext(FileObject j } else { clctxt = new JspCompilationContext(jspUri, false, options, context, null, rctxt); } + clctxt.setClassLoader(getWAClassLoader()); } catch (JasperException ex) { LOG.log(Level.INFO, null, ex); } - clctxt.setClassLoader(getWAClassLoader()); return clctxt; } boolean determineIsTagFile(FileObject fo) { - if (fo.getExt().startsWith("tag")) { // NOI18N - all tag, tagx and even tagf are considered tag files - return true; - } - if (JspParserAPI.TAG_MIME_TYPE.equals(fo.getMIMEType())) { - return true; - } - return false; + return fo.getExt().startsWith("tag") // NOI18N - all tag, tagx and even tagf are considered tag files + || JspParserAPI.TAG_MIME_TYPE.equals(fo.getMIMEType()); } private String getJSPUri(FileObject jsp) { @@ -443,16 +408,17 @@ private String getJSPUri(FileObject jsp) { } // from JspCompileUtil + @Override public JspParserAPI.ParseResult analyzePage(FileObject jspFile, /*String compilationURI, */ int errorReportingMode) { // PENDING - do caching for individual JSPs checkReinitCachesTask(); JspCompilationContext ctxt = createCompilationContext(jspFile, true); - try { - return callTomcatParser(jspFile, ctxt, waContextClassLoader, errorReportingMode); - } finally { - resetClassLoaders(); + try (URLClassLoader cl = new ParserClassLoader(this.classLoaderSources[0], this.classLoaderSources[1], getClass().getClassLoader())) { + return callTomcatParser(jspFile, ctxt, cl, errorReportingMode); + } catch (IOException ex) { + throw new RuntimeException(ex); } } @@ -462,27 +428,35 @@ public JspParserAPI.ParseResult analyzePage(FileObject jspFile, /*String compila * returned as a String array: * [0] The location * [1] If the location is a jar file, this is the location of the tld. + * + * @param useEditor + * @return + * @throws java.io.IOException */ + @Override public synchronized Map getTaglibMap(boolean useEditor) throws IOException { // useEditor not needed, both caches are the same // we have to clear all the caches when the class path is not current or the taglibmap is not initialized yet checkReinitCachesTask(); // XXX return deep copy (not needed now, only jsp editor uses it) - return new HashMap(mappings); + return new HashMap<>(mappings); } /** * Returns the classloader to be used by the JSP parser. * This classloader loads the classes belonging to the application * from both expanded directory structures and jar files. + * @return */ + @Override public synchronized URLClassLoader getWAClassLoader() { if (cpCurrent.get() != 0L) { reinitOptions(); } // XXX #128360 - classloader is leaking out - no chance to close it - return waClassLoader; + // Callers must close the classloader as soon as possible! + return new ParserClassLoader(this.classLoaderSources[0], this.classLoaderSources[1], getClass().getClassLoader()); } @Override @@ -499,14 +473,10 @@ public boolean isValid(WebModule wm) { return valid; } - public class RRef { - JspParserAPI.ParseResult result; - } - private JspParserAPI.ParseResult callTomcatParser(final FileObject jspFile, final JspCompilationContext ctxt, final ClassLoader contextClassLoader, final int errorReportingMode) { - final RRef resultRef = new RRef(); + final AtomicReference resultRef = new AtomicReference<>(); // calling the parser in a new thread, as per the spec, we need to set the context classloader // to contain the web application classes. Jasper really relies on this @@ -517,18 +487,18 @@ private void setResult(GetParseData gpd){ Node.Nodes nbNodes = gpd.getNbNodes(); Throwable e = gpd.getParseException(); if (e == null) { - resultRef.result = new JspParserAPI.ParseResult(nbPageInfo, nbNodes); + resultRef.set(new JspParserAPI.ParseResult(nbPageInfo, nbNodes)); } else { // the exceptions we may see here: // JasperException - usual // ArrayIndexOutOfBoundsException - see issue 20919 // Throwable - see issue 21169, related to Tomcat bug 7124 // XXX has to be returned back to track all errors - Exceptions.attachLocalizedMessage(e, NbBundle.getMessage(WebAppParseSupport.class, "MSG_errorDuringJspParsing")); // NOI18N + e = Exceptions.attachLocalizedMessage(e, NbBundle.getMessage(WebAppParseSupport.class, "MSG_errorDuringJspParsing")); // NOI18N LOG.fine(e.getMessage()); LOG.log(Level.FINE, null, e); JspParserAPI.ErrorDescriptor error = constructErrorDescriptor(e, wmRoot, jspFile); - resultRef.result = new JspParserAPI.ParseResult(nbPageInfo, nbNodes, new JspParserAPI.ErrorDescriptor[] {error}); + resultRef.set(new JspParserAPI.ParseResult(nbPageInfo, nbNodes, new JspParserAPI.ErrorDescriptor[] {error})); } } @@ -539,10 +509,6 @@ public void run() { gpd = new GetParseData(ctxt, errorReportingMode); gpd.parse(); setResult(gpd); - - } catch (ThreadDeath td) { - LOG.log(Level.INFO, null, td); - throw td; } catch (Throwable t) { if (gpd != null) { if (gpd.getParseException() == null) { @@ -561,7 +527,7 @@ public void run() { compThread.start(); try { compThread.join(); - return resultRef.result; + return resultRef.get(); } catch (InterruptedException e) { JspParserAPI.ErrorDescriptor error = constructErrorDescriptor(e, wmRoot, jspFile); return new JspParserAPI.ParseResult(new JspParserAPI.ErrorDescriptor[] {error}); @@ -589,6 +555,7 @@ private static JspParserAPI.ErrorDescriptor constructErrorDescriptor(Throwable e /** Returns an ErrorDescriptor for a compilation error if the throwable was thrown by Jakarta, * otherwise returns null. */ + @SuppressWarnings("AssignmentToMethodParameter") private static JspParserAPI.ErrorDescriptor constructJakartaErrorDescriptor(FileObject wmRoot, FileObject jspPage, Throwable ex) throws IOException { @@ -598,7 +565,7 @@ private static JspParserAPI.ErrorDescriptor constructJakartaErrorDescriptor(File last = ex; ex = ((JasperException) ex).getRootCause(); if (ex != null) { - ErrorManager.getDefault().annotate(last, ex); + last = ErrorManager.getDefault().annotate(last, ex); } } @@ -668,7 +635,9 @@ private static JspParserAPI.ErrorDescriptor constructJakartaErrorDescriptor(File /** * Handles the event of property change of class path (source, run). + * @param evt */ + @Override public void propertyChange(PropertyChangeEvent evt) { // classpath has channged => invalidate cache LOG.fine("Class path has changed"); @@ -676,6 +645,7 @@ public void propertyChange(PropertyChangeEvent evt) { reinitCachesTask.schedule(REINIT_OPTIONS_DELAY); } + @SuppressWarnings("unchecked") private void clearTagLibraryInfoCache() { assert Thread.holdsLock(this); // clear the cache of tagLibrary map @@ -690,6 +660,7 @@ private void clearTagLibraryInfoCache() { } } + @SuppressWarnings("unchecked") void reinitTagLibMappings() { assert Thread.holdsLock(this); try { @@ -710,6 +681,7 @@ void reinitTagLibMappings() { mappingsField.setAccessible(true); // Before new parsing, the old mappings in the TldLocationCache has to be cleared. Else there are // stored the old mappings. + @SuppressWarnings("unchecked") Map tmpMappings = (Map) mappingsField.get(lc); // the mapping doesn't have to be initialized yet if (tmpMappings != null) { @@ -717,22 +689,24 @@ void reinitTagLibMappings() { } Thread compThread = new WebAppParseSupport.InitTldLocationCacheThread(lc); - compThread.setContextClassLoader(waContextClassLoader); - long start = 0; - if (LOG.isLoggable(Level.FINE)) { - start = System.currentTimeMillis(); - LOG.fine("InitTldLocationCacheThread start"); //NOI18N - } - compThread.start(); - - try { - compThread.join(); + try (URLClassLoader cl = new ParserClassLoader(this.classLoaderSources[0], this.classLoaderSources[1], getClass().getClassLoader())) { + compThread.setContextClassLoader(cl); + long start = 0; if (LOG.isLoggable(Level.FINE)) { - long end = System.currentTimeMillis(); - LOG.log(Level.FINE, "InitTldLocationCacheThread finished in {0} ms", (end - start)); //NOI18N + start = System.currentTimeMillis(); + LOG.fine("InitTldLocationCacheThread start"); //NOI18N + } + compThread.start(); + + try { + compThread.join(); + if (LOG.isLoggable(Level.FINE)) { + long end = System.currentTimeMillis(); + LOG.log(Level.FINE, "InitTldLocationCacheThread finished in {0} ms", (end - start)); //NOI18N + } + } catch (InterruptedException e) { + LOG.log(Level.INFO, null, e); } - } catch (InterruptedException e) { - LOG.log(Level.INFO, null, e); } // obtain the current mappings after parsing @@ -754,9 +728,7 @@ void reinitTagLibMappings() { } // cache tld files under WEB-INF directory as well mappings.putAll(getImplicitLocation()); - } catch (NoSuchFieldException e) { - LOG.log(Level.INFO, null, e); - } catch (IllegalAccessException e) { + } catch (NoSuchFieldException | IllegalAccessException | IOException e) { LOG.log(Level.INFO, null, e); } } @@ -766,7 +738,7 @@ void reinitTagLibMappings() { */ private Map getImplicitLocation() { assert Thread.holdsLock(this); - Map returnMap = new HashMap(); + Map returnMap = new HashMap<>(); // Obtain all tld files under WEB-INF folder FileObject fo; if (webInf != null && webInf.isFolder() && webInf.isValid()) { @@ -810,7 +782,8 @@ void reinitCaches() { tldChangeTask.run(); } - final class ReinitCaches implements Runnable { + private final class ReinitCaches implements Runnable { + @Override public void run() { synchronized (WebAppParseSupport.this) { LOG.fine("ReinitCaches task started"); // NOI18N @@ -820,7 +793,8 @@ public void run() { } } - final class TldChange implements Runnable { + private final class TldChange implements Runnable { + @Override public void run() { WebModule webModule = wm.get(); if (webModule == null) { @@ -872,12 +846,21 @@ public static class ParserClassLoader extends URLClassLoader { private final ClassLoader parent; - /** This constructor and the getURLs() method is one horrible hack. On the one hand, we want to give - * Tomcat a JarURLConnection when it attempts to load classes from jars, on the other hand - * we don't want this classloader to load classes using JarURLConnection, as that's buggy. - * We want it to load classes using internal nb: protocols. So the getURLs() method - * returns an "external" list of URLs for Tomcat, while internally, the classloader uses - * an "internal" list of URLs. + /** + * This constructor and the getURLs() method is one horrible hack. On + * the one hand, we want to give Tomcat a JarURLConnection when it + * attempts to load classes from jars, + * + * On the other hand we don't want this classloader to load classes using + * JarURLConnection, as that's buggy. + * + * We want it to load classes using internal nb: protocols. So the + * getURLs() method returns an "external" list of URLs for Tomcat, while + * internally, the classloader uses an "internal" list of URLs. + * + * @param classLoadingURLs + * @param tomcatURLs + * @param parent */ public ParserClassLoader(URL[] classLoadingURLs, URL[] tomcatURLs, ClassLoader parent) { super(classLoadingURLs, parent); @@ -885,9 +868,13 @@ public ParserClassLoader(URL[] classLoadingURLs, URL[] tomcatURLs, ClassLoader p this.tomcatURLs = tomcatURLs; } - /** See the constructor for explanation of what thie method does. + /** + * See the constructor for explanation of what thie method does. + * + * @return */ @Override + @SuppressWarnings("ReturnOfCollectionOrArrayField") public URL[] getURLs() { return tomcatURLs; } @@ -896,6 +883,7 @@ public URL[] getLoadingURLs() { return super.getURLs(); } + @SuppressWarnings("ReturnOfCollectionOrArrayField") public URL[] getTomcatURLs() { return tomcatURLs; } @@ -991,27 +979,15 @@ private static class InitTldLocationCacheThread extends Thread { @Override public void run() { try { - // #188702 -// Field mappings = TldScanner.class.getDeclaredField("mappings"); // NOI18N -// mappings.setAccessible(true); -// mappings.set(cache, null); -// cache.getLocation(""); // NOI18N - // see #205387 - adjust TldScanner logger updateTldScannerLogger(); Method mappingsMethod = TldScanner.class.getDeclaredMethod("scanTlds"); //NOI18N mappingsMethod.setAccessible(true); mappingsMethod.invoke(cache); - } catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException | NoSuchMethodException | SecurityException | IllegalAccessException ex) { LOG.log(Level.WARNING, null, ex); } catch (InvocationTargetException ex) { LOG.log(Level.INFO, null, ex); - } catch (NoSuchMethodException ex) { - LOG.log(Level.WARNING, null, ex); - } catch (SecurityException ex) { - LOG.log(Level.WARNING, null, ex); - } catch (IllegalAccessException e) { - LOG.log(Level.WARNING, null, e); } } @@ -1044,7 +1020,7 @@ public boolean isLoggable(LogRecord record) { } - final class FileSystemListener extends FileChangeAdapter { + private final class FileSystemListener extends FileChangeAdapter { @Override public void fileChanged(FileEvent fe) { @@ -1088,6 +1064,7 @@ private void processFileChange(final FileEvent fe) { } } + @Override public WebModule getWebModule() { return wm.get(); } diff --git a/enterprise/web.jspparser/manifest.mf b/enterprise/web.jspparser/manifest.mf index 91d259390d88..2137175db944 100644 --- a/enterprise/web.jspparser/manifest.mf +++ b/enterprise/web.jspparser/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.jspparser/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jspparser/Bundle.properties -OpenIDE-Module-Specification-Version: 3.54 +OpenIDE-Module-Specification-Version: 3.55 OpenIDE-Module-Requires: org.openide.windows.IOProvider diff --git a/enterprise/web.jspparser/test/unit/data/emptyWebProject/lib/tags/META-INF/taglib.tld b/enterprise/web.jspparser/test/unit/data/emptyWebProject/lib/tags/META-INF/taglib.tld new file mode 100644 index 000000000000..7e3a8b5d363d --- /dev/null +++ b/enterprise/web.jspparser/test/unit/data/emptyWebProject/lib/tags/META-INF/taglib.tld @@ -0,0 +1,31 @@ + + + + Test tag library. + 1.0 + ttl + /TestTagLibrary + + diff --git a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/FastScanTest.java b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/FastScanTest.java index 368abecd9541..2b63d5a60289 100644 --- a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/FastScanTest.java +++ b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/FastScanTest.java @@ -48,14 +48,6 @@ public void testPage1() throws Exception { doFastScanTest("jspparser-data/wmroot", "subdir/Page1.jsp", new JspParserAPI.JspOpenInfo(false, "ISO-8859-1")); } - public void testXMLFromExamples1() throws Exception { - doFastScanTest("project3/web", "xml/xml.jsp", new JspParserAPI.JspOpenInfo(true, "UTF-8")); - } - - public void testXMLFromExamples2() throws Exception { - doFastScanTest("project3/web", "jsp2/jspx/basic.jspx", new JspParserAPI.JspOpenInfo(true, "UTF-8")); - } - public void testEncodingBug198637() throws Exception { doFastScanTest("project2/web", "encoding198637.jsp", new JspParserAPI.JspOpenInfo(false, "utf-8")); } diff --git a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/ParseTest.java b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/ParseTest.java index e886b00f7f61..8037a0132f7f 100644 --- a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/ParseTest.java +++ b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/ParseTest.java @@ -75,16 +75,6 @@ public void testAnalysisOutsideWM() throws Exception { parserTestInProject("project2", "/outside/outsidewm.jsp"); } - /* Commented out - see bug 194639. - public void testAnalysisFunction() throws Exception { - parserTestInProject("project3", "/web/jsp2/el/functions.jsp"); - } - */ - - public void testAnalysisXMLTextRotate_1_5() throws Exception { - parserTestInProject("project3", "/web/jsp2/jspx/textRotate.jspx"); - } - // TODO: temporarily disabled because of JDK 5 and 6 differences public void disableTestAnalysisTagLibFromTagFiles_1_6() throws Exception { parserTestInProject("project2", "/web/testTagLibs.jsp"); @@ -105,11 +95,6 @@ public void testIncludePreludeCoda() throws Exception { log("Coda: " + result.getPageInfo().getIncludeCoda()); } - public void testTagFileAttribute() throws Exception { - parserTestInProject("project3", "/web/WEB-INF/tags/displayProducts.tag"); - parserTestInProject("project3", "/web/WEB-INF/tags/displayProducts.tag"); - } - public JspParserAPI.ParseResult parserTestInProject(String projectFolderName, String pagePath) throws Exception { FileObject jspFo = TestUtil.getProjectFile(this, projectFolderName, pagePath); WebModule webModule = TestUtil.getWebModule(jspFo); diff --git a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/ParserClassLoaderTest.java b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/ParserClassLoaderTest.java deleted file mode 100644 index acb7e08462df..000000000000 --- a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/ParserClassLoaderTest.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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.web.jspparser; - -import java.lang.reflect.Field; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.web.api.webmodule.WebModule; -import org.netbeans.modules.web.jsps.parserapi.JspParserAPI; -import org.netbeans.modules.web.jsps.parserapi.JspParserFactory; -import org.openide.filesystems.FileObject; - -/** - * - * @author Petr Hejl - */ -public class ParserClassLoaderTest extends NbTestCase { - - private static final String ISSUE_WA_VENDOR = "Sun Microsystems"; - private static final String ISSUE_WA_VENDOR_ALT = "Oracle Corporation"; - private static final int ISSUE_WA_MAJOR_VERSION = 1; - private static final int ISSUE_WA_MINOR_VERSION = 6; - - public ParserClassLoaderTest(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - TestUtil.setup(this); - } - - public void testReusable() throws Exception { - String vendor = System.getProperty("java.vendor"); - if (!vendor.contains(ISSUE_WA_VENDOR) && !vendor.contains(ISSUE_WA_VENDOR_ALT)) { - return; - } - String version = System.getProperty("java.version"); - System.out.println(version); - - String[] parts = version.split("\\."); - if (parts.length < 2 || Integer.parseInt(parts[0]) < ISSUE_WA_MAJOR_VERSION - || (Integer.parseInt(parts[0]) == ISSUE_WA_MAJOR_VERSION && Integer.parseInt(parts[1]) < ISSUE_WA_MINOR_VERSION)) { - return; - } - - FileObject jspFo = TestUtil.getProjectFile(this, "project3", "/web/source.jsp"); - WebModule webModule = TestUtil.getWebModule(jspFo); - JspParserAPI jspParser = JspParserFactory.getJspParser(); - JspParserAPI.ParseResult result = jspParser.analyzePage(jspFo, webModule, JspParserAPI.ERROR_IGNORE); - - if (!(jspParser instanceof JspParserImpl)) { - return; - } - - JspParserImpl jspParserImpl = (JspParserImpl) jspParser; - WebAppParseProxy proxy = jspParserImpl.parseSupports.get(webModule); - - if (!"org.netbeans.modules.web.jspparser_ext.WebAppParseSupport".equals(proxy.getClass().getName())) { - return; - } - - Field waClassLoaderField = proxy.getClass().getDeclaredField("waClassLoader"); - waClassLoaderField.setAccessible(true); - ClassLoader waClassLoader = (ClassLoader) waClassLoaderField.get(proxy); - Field waContextClassLoaderField = proxy.getClass().getDeclaredField("waContextClassLoader"); - waContextClassLoaderField.setAccessible(true); - ClassLoader waContextClassLoader = (ClassLoader) waContextClassLoaderField.get(proxy); - - waClassLoader.loadClass("examples.LogTag"); - waClassLoader.loadClass("javax.servlet.jsp.jstl.sql.Result"); - waContextClassLoader.loadClass("examples.LogTag"); - waContextClassLoader.loadClass("javax.servlet.jsp.jstl.sql.Result"); - } - - public void testPerformanceDifference() throws Exception { - String vendor = System.getProperty("java.vendor"); - if (!vendor.contains(ISSUE_WA_VENDOR) && !vendor.contains(ISSUE_WA_VENDOR_ALT)) { - return; - } - String version = System.getProperty("java.version"); - System.out.println(version); - - String[] parts = version.split("\\."); - if (parts.length < 2 || Integer.parseInt(parts[0]) < ISSUE_WA_MAJOR_VERSION - || (Integer.parseInt(parts[0]) == ISSUE_WA_MAJOR_VERSION && Integer.parseInt(parts[1]) < ISSUE_WA_MINOR_VERSION)) { - return; - } - - FileObject jspFo = TestUtil.getProjectFile(this, "project3", "/web/source.jsp"); - WebModule webModule = TestUtil.getWebModule(jspFo); - JspParserAPI jspParser = JspParserFactory.getJspParser(); - - long startWithReset = System.nanoTime(); - for (int i = 0; i < 500; i++) { - JspParserAPI.ParseResult result = jspParser.analyzePage(jspFo, webModule, JspParserAPI.ERROR_IGNORE); - } - long elapsedWithReset = System.nanoTime() - startWithReset; - - disableReset(jspParser, webModule); - - long startWithoutReset = System.nanoTime(); - for (int i = 0; i < 500; i++) { - JspParserAPI.ParseResult result = jspParser.analyzePage(jspFo, webModule, JspParserAPI.ERROR_IGNORE); - } - long elapsedWithoutReset = System.nanoTime() - startWithoutReset; - - System.out.println("Absolute difference " + ((elapsedWithReset - elapsedWithoutReset) / 1000000) + " ms"); - double perCent = ((double) elapsedWithReset/elapsedWithoutReset) * 100; - System.out.println("Per cent difference " + perCent); - - assertTrue(perCent < 200); - } - - private void disableReset(JspParserAPI jspParser, WebModule webModule) throws NoSuchFieldException, IllegalAccessException { - if (!(jspParser instanceof JspParserImpl)) { - return; - } - - JspParserImpl jspParserImpl = (JspParserImpl) jspParser; - WebAppParseProxy proxy = jspParserImpl.parseSupports.get(webModule); - - if (!"org.netbeans.modules.web.jspparser_ext.WebAppParseSupport".equals(proxy.getClass().getName())) { - return; - } - - Field noResetField = proxy.getClass().getDeclaredField("noReset"); - noResetField.setAccessible(true); - noResetField.set(proxy, Boolean.TRUE); - } -} diff --git a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java index 0eb569d49d8e..109328c4b485 100644 --- a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java +++ b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java @@ -104,8 +104,6 @@ public static void setLookup(Object... instances) { static void setup(NbTestCase test) throws Exception { test.clearWorkDir(); Logger.getLogger("org.netbeans.modules.web.jspparser_ext").setLevel(Level.FINE); - // unzip test project - TestUtil.getProject(test, "project3"); TestUtil.initParserJARs(); } diff --git a/enterprise/web.kit/manifest.mf b/enterprise/web.kit/manifest.mf index 9fe38e9bc1c0..885ab9f5c5cf 100644 --- a/enterprise/web.kit/manifest.mf +++ b/enterprise/web.kit/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.53 +OpenIDE-Module-Specification-Version: 1.54 OpenIDE-Module-Recommends: org.netbeans.modules.web.project.framework diff --git a/enterprise/web.monitor/manifest.mf b/enterprise/web.monitor/manifest.mf index cda895aaefab..067e1a535379 100644 --- a/enterprise/web.monitor/manifest.mf +++ b/enterprise/web.monitor/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.monitor/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/monitor/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/web/monitor/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.68 +OpenIDE-Module-Specification-Version: 1.69 OpenIDE-Module-Requires: org.openide.util.HttpServer$Impl AutoUpdate-Show-In-Client: false diff --git a/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/client/Util.java b/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/client/Util.java index ea499ad77ca3..46157c50fc64 100644 --- a/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/client/Util.java +++ b/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/client/Util.java @@ -112,7 +112,7 @@ static boolean removeParametersFromQuery(RequestData rd) { Enumeration e = ht.keys(); while(e.hasMoreElements()) { - String name = (String)e.nextElement(); + String name = e.nextElement(); try { String[] value = (String[])(ht.get(name)); for(int i=0; i 0) { Enumeration e = ht.keys(); while(e.hasMoreElements()) { - String name = (String)e.nextElement(); + String name = e.nextElement(); String[] value = (String[])(ht.get(name)); for(int i=0; i 0) { diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java b/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java index 0ed936156ba7..c17368708536 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java @@ -55,7 +55,7 @@ public String getVersion() { @Override public Boolean isJPAVersionSupported(String version) { - J2eeModuleProvider j2eeModuleProvider = (J2eeModuleProvider) project.getLookup().lookup(J2eeModuleProvider.class); + J2eeModuleProvider j2eeModuleProvider = project.getLookup().lookup(J2eeModuleProvider.class); J2eePlatform platform = Deployment.getDefault().getJ2eePlatform(j2eeModuleProvider.getServerInstanceID()); if (platform == null) { diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java b/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java index a82de138649b..10cb463febf6 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java @@ -621,7 +621,7 @@ public Void run() throws Exception { ep.setProperty(WebProjectProperties.JAVA_SOURCE_BASED,javaSourceBased+""); - UpdateHelper updateHelper = ((WebProject) p).getUpdateHelper(); + UpdateHelper updateHelper = p.getUpdateHelper(); // this enforcement is valid only for Web project for EE 6; non-EE6 containers may support JDK 7 // // #181215: JDK 6 should be the default source/binary format for Java EE 6 projects @@ -836,7 +836,7 @@ private static AntProjectHelper setupProject(FileObject dirFO, String name, public static void upgradeJ2EEProfile(WebProject project){ Profile profile = project.getAPIEjbJar().getJ2eeProfile(); - if (profile.isWebProfile() && profile.isAtLeast(Profile.JAVA_EE_6_WEB)) { + if (profile != null && profile.isWebProfile() && profile.isAtLeast(Profile.JAVA_EE_6_WEB)) { //check the J2EE 6/7 Full profile specific functionality Boolean isFullRequired = Boolean.FALSE; try{ diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java index adb5439bfd86..49636e6ceae7 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java @@ -109,7 +109,7 @@ protected FileObject getXmlArtifactsRoot() { @Override protected String getProjectJavaEEVersion() { WebModule webModule = WebModule.getWebModule(project.getProjectDirectory()); - if (webModule != null) { + if (webModule != null && webModule.getJ2eeProfile() != null) { switch (webModule.getJ2eeProfile()) { case JAVA_EE_6_WEB: case JAVA_EE_6_FULL: diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java index 8513b5da041e..42ab71f7bc2f 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java @@ -103,7 +103,7 @@ else if (create) { @Override public String getWsdlLocation(String serviceName) { String localWsdl = serviceName+".wsdl"; //NOI18N - JaxWsModel jaxWsModel = (JaxWsModel)project.getLookup().lookup(JaxWsModel.class); + JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class); if (jaxWsModel!=null) { Service service = jaxWsModel.findServiceByName(serviceName); if (service!=null) { @@ -594,7 +594,7 @@ private void logWsDetected() { @Override protected String getProjectJavaEEVersion() { WebModule webModule = WebModule.getWebModule(project.getProjectDirectory()); - if (webModule != null) { + if (webModule != null && webModule.getJ2eeProfile() != null) { switch (webModule.getJ2eeProfile()) { case JAVA_EE_6_WEB: case JAVA_EE_6_FULL: diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/ui/ConfFilesNodeFactory.java b/enterprise/web.project/src/org/netbeans/modules/web/project/ui/ConfFilesNodeFactory.java index da3c43e59b3c..2771bb89aad9 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/ui/ConfFilesNodeFactory.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/ui/ConfFilesNodeFactory.java @@ -98,7 +98,7 @@ public ConfFilesNodeFactory() { } public NodeList createNodes(Project p) { - WebProject project = (WebProject) p.getLookup().lookup(WebProject.class); + WebProject project = p.getLookup().lookup(WebProject.class); assert project != null; return new ConfFilesNodeList(project); } @@ -111,7 +111,7 @@ private static class ConfFilesNodeList implements NodeList, PropertyChan ConfFilesNodeList(WebProject proj) { project = proj; - WebLogicalViewProvider logView = (WebLogicalViewProvider) project.getLookup().lookup(WebLogicalViewProvider.class); + WebLogicalViewProvider logView = project.getLookup().lookup(WebLogicalViewProvider.class); assert logView != null; } @@ -283,7 +283,7 @@ private void setGroups(Collection groups) { Iterator it = groupsListeners.keySet().iterator(); while (it.hasNext()) { SourceGroup group = (SourceGroup) it.next(); - PropertyChangeListener pcl = (PropertyChangeListener) groupsListeners.get(group); + PropertyChangeListener pcl = groupsListeners.get(group); group.removePropertyChangeListener(pcl); } } @@ -306,7 +306,7 @@ protected void setFiles(Set files) { Iterator it = fileSystemListeners.keySet().iterator(); while (it.hasNext()) { FileSystem fs = (FileSystem) it.next(); - FileStatusListener fsl = (FileStatusListener) fileSystemListeners.get(fs); + FileStatusListener fsl = fileSystemListeners.get(fs); fs.removeFileStatusListener(fsl); } } @@ -357,8 +357,7 @@ private ConfFilesChildrenFactory(ProjectWebModule webModule) { } public static ConfFilesChildrenFactory forProject(Project project) { - ProjectWebModule pwm = (ProjectWebModule) project.getLookup().lookup( - ProjectWebModule.class); + ProjectWebModule pwm = project.getLookup().lookup(ProjectWebModule.class); return new ConfFilesChildrenFactory(pwm); } @@ -531,7 +530,7 @@ private boolean addFrameworkFiles( ) { boolean result = false; start : for (int i = 0; i < providers.size(); i++) { - WebFrameworkProvider provider = (WebFrameworkProvider) providers.get(i); + WebFrameworkProvider provider = providers.get(i); FileObject wmBase = getWebModule().getDocumentBase(); File[] files = null; if (wmBase != null) { diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java b/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java index 9e56416f4839..70134d63276a 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java @@ -364,41 +364,43 @@ private void init() { EditableProperties projectProperties = updateHelper.getProperties( AntProjectHelper.PROJECT_PROPERTIES_PATH ); EditableProperties privateProperties = updateHelper.getProperties( AntProjectHelper.PRIVATE_PROPERTIES_PATH ); - JAVAC_CLASSPATH_MODEL = ClassPathTableModel.createTableModel( cs.itemsIterator( (String)projectProperties.get( ProjectProperties.JAVAC_CLASSPATH ), ClassPathSupportCallbackImpl.TAG_WEB_MODULE_LIBRARIES) ); + JAVAC_CLASSPATH_MODEL = ClassPathTableModel.createTableModel( cs.itemsIterator(projectProperties.get( ProjectProperties.JAVAC_CLASSPATH ), ClassPathSupportCallbackImpl.TAG_WEB_MODULE_LIBRARIES) ); String processorPath = projectProperties.get(ProjectProperties.JAVAC_PROCESSORPATH); processorPath = processorPath == null ? "${javac.classpath}" : processorPath; JAVAC_PROCESSORPATH_MODEL = ClassPathUiSupport.createListModel(cs.itemsIterator(processorPath)); - JAVAC_TEST_CLASSPATH_MODEL = ClassPathUiSupport.createListModel( cs.itemsIterator( (String)projectProperties.get( ProjectProperties.JAVAC_TEST_CLASSPATH ), null ) ); - RUN_TEST_CLASSPATH_MODEL = ClassPathUiSupport.createListModel( cs.itemsIterator( (String)projectProperties.get( ProjectProperties.RUN_TEST_CLASSPATH ), null ) ); - ENDORSED_CLASSPATH_MODEL = ClassPathUiSupport.createListModel( cs.itemsIterator( (String)projectProperties.get( ProjectProperties.ENDORSED_CLASSPATH ), null ) ); + JAVAC_TEST_CLASSPATH_MODEL = ClassPathUiSupport.createListModel( cs.itemsIterator(projectProperties.get( ProjectProperties.JAVAC_TEST_CLASSPATH ), null ) ); + RUN_TEST_CLASSPATH_MODEL = ClassPathUiSupport.createListModel( cs.itemsIterator(projectProperties.get( ProjectProperties.RUN_TEST_CLASSPATH ), null ) ); + ENDORSED_CLASSPATH_MODEL = ClassPathUiSupport.createListModel( cs.itemsIterator(projectProperties.get( ProjectProperties.ENDORSED_CLASSPATH ), null ) ); PLATFORM_MODEL = PlatformUiSupport.createPlatformComboBoxModel (evaluator.getProperty(JAVA_PLATFORM)); PLATFORM_LIST_RENDERER = PlatformUiSupport.createPlatformListCellRenderer(); SpecificationVersion minimalSourceLevel = null; Profile profile = Profile.fromPropertiesString(evaluator.getProperty(J2EE_PLATFORM)); - switch (profile) { - case JAKARTA_EE_11_FULL: - minimalSourceLevel = new SpecificationVersion("21"); - break; - case JAKARTA_EE_10_FULL: - case JAKARTA_EE_9_1_FULL: - minimalSourceLevel = new SpecificationVersion("11"); - break; - case JAKARTA_EE_9_FULL: - case JAKARTA_EE_8_FULL: - case JAVA_EE_8_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; + if (profile != null) { + switch (profile) { + case JAKARTA_EE_11_FULL: + minimalSourceLevel = new SpecificationVersion("21"); + break; + case JAKARTA_EE_10_FULL: + case JAKARTA_EE_9_1_FULL: + minimalSourceLevel = new SpecificationVersion("11"); + break; + case JAKARTA_EE_9_FULL: + case JAKARTA_EE_8_FULL: + case JAVA_EE_8_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 (); @@ -427,7 +429,7 @@ private void init() { WAR_NAME_MODEL = projectGroup.createStringDocument( evaluator, WAR_NAME ); BUILD_CLASSES_EXCLUDES_MODEL = projectGroup.createStringDocument( evaluator, BUILD_CLASSES_EXCLUDES ); WAR_COMPRESS_MODEL = projectGroup.createToggleButtonModel( evaluator, WAR_COMPRESS ); - WAR_CONTENT_ADDITIONAL_MODEL = WarIncludesTableModel.createTableModel( cs.itemsIterator( (String)projectProperties.get( WAR_CONTENT_ADDITIONAL ), ClassPathSupportCallbackImpl.TAG_WEB_MODULE__ADDITIONAL_LIBRARIES)); + WAR_CONTENT_ADDITIONAL_MODEL = WarIncludesTableModel.createTableModel( cs.itemsIterator(projectProperties.get( WAR_CONTENT_ADDITIONAL ), ClassPathSupportCallbackImpl.TAG_WEB_MODULE__ADDITIONAL_LIBRARIES)); // CustomizerJavadoc JAVADOC_PRIVATE_MODEL = projectGroup.createToggleButtonModel( evaluator, JAVADOC_PRIVATE ); @@ -483,7 +485,7 @@ public void actionPerformed(ActionEvent e) { try { CONTEXT_PATH_MODEL = new PlainDocument(); CONTEXT_PATH_MODEL.remove(0, CONTEXT_PATH_MODEL.getLength()); - ProjectWebModule wm = (ProjectWebModule) project.getLookup().lookup(ProjectWebModule.class); + ProjectWebModule wm = project.getLookup().lookup(ProjectWebModule.class); String contextPath = wm.getContextPath(); if (contextPath != null) { CONTEXT_PATH_MODEL.insertString(0, contextPath, null); diff --git a/enterprise/web.refactoring/nbproject/project.properties b/enterprise/web.refactoring/nbproject/project.properties index 439d1a9fe558..e2987dc20ccb 100644 --- a/enterprise/web.refactoring/nbproject/project.properties +++ b/enterprise/web.refactoring/nbproject/project.properties @@ -17,4 +17,4 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.51.0 +spec.version.base=1.52.0 diff --git a/enterprise/weblogic.common/manifest.mf b/enterprise/weblogic.common/manifest.mf index 0e491fb5d502..698e265e43c0 100644 --- a/enterprise/weblogic.common/manifest.mf +++ b/enterprise/weblogic.common/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.weblogic.common OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/weblogic/common/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.39 +OpenIDE-Module-Specification-Version: 1.40 diff --git a/enterprise/websocket/manifest.mf b/enterprise/websocket/manifest.mf index 9ef945f18e5c..f798db5feeab 100644 --- a/enterprise/websocket/manifest.mf +++ b/enterprise/websocket/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websocket OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websocket/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/websocket/layer.xml -OpenIDE-Module-Specification-Version: 1.32 +OpenIDE-Module-Specification-Version: 1.33 AutoUpdate-Show-In-Client: false diff --git a/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java b/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java index bad4339d3d69..d0ae40d67979 100644 --- a/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java +++ b/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java @@ -124,7 +124,7 @@ private boolean isApplicable(FileObject fileObject) { return false; } Profile profile = webModule.getJ2eeProfile(); - if (profile.isAtMost(Profile.JAVA_EE_6_FULL)) { + if (profile != null && profile.isAtMost(Profile.JAVA_EE_6_FULL)) { return false; } return true; diff --git a/enterprise/websocket/src/org/netbeans/modules/websocket/wizard/WebSocketPanel.java b/enterprise/websocket/src/org/netbeans/modules/websocket/wizard/WebSocketPanel.java index 00473fb676b3..a3ba4d81d568 100644 --- a/enterprise/websocket/src/org/netbeans/modules/websocket/wizard/WebSocketPanel.java +++ b/enterprise/websocket/src/org/netbeans/modules/websocket/wizard/WebSocketPanel.java @@ -78,7 +78,7 @@ public boolean isValid() { WebModule webModule = WebModule.getWebModule(project.getProjectDirectory()); if (webModule != null) { Profile profile = webModule.getJ2eeProfile(); - if (profile.isAtMost(Profile.JAVA_EE_6_FULL)) { + if (profile != null && profile.isAtMost(Profile.JAVA_EE_6_FULL)) { setErrorMessage(NbBundle.getMessage(WebSocketPanel.class, "MSG_NoJEE7Profile")); // NOI18N return false; diff --git a/enterprise/websvc.clientapi/manifest.mf b/enterprise/websvc.clientapi/manifest.mf index 3e4b3ceb5145..a99c97305ec9 100644 --- a/enterprise/websvc.clientapi/manifest.mf +++ b/enterprise/websvc.clientapi/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.clientapi -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/client/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/api/client/WebServicesClientView.java b/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/api/client/WebServicesClientView.java index 0543c6e2f297..48dd2dc3de69 100644 --- a/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/api/client/WebServicesClientView.java +++ b/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/api/client/WebServicesClientView.java @@ -78,7 +78,7 @@ public static WebServicesClientView getWebServicesClientView(FileObject f) { } } - WebServicesClientViewProvider impl = (WebServicesClientViewProvider) Lookup.getDefault().lookup(WebServicesClientViewProvider.class); + WebServicesClientViewProvider impl = Lookup.getDefault().lookup(WebServicesClientViewProvider.class); if(impl != null) { WebServicesClientView wsv = impl.findWebServicesClientView(f); return wsv; diff --git a/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/api/jaxws/client/JAXWSClientView.java b/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/api/jaxws/client/JAXWSClientView.java index 2cb4cd51e3c7..6053c25f3fbb 100644 --- a/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/api/jaxws/client/JAXWSClientView.java +++ b/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/api/jaxws/client/JAXWSClientView.java @@ -72,7 +72,7 @@ public static JAXWSClientView getJAXWSClientView() { } } - JAXWSClientViewProvider impl = (JAXWSClientViewProvider) Lookup.getDefault().lookup(JAXWSClientViewProvider.class); + JAXWSClientViewProvider impl = Lookup.getDefault().lookup(JAXWSClientViewProvider.class); if(impl != null) { JAXWSClientView wsv = impl.findJAXWSClientView(); return wsv; diff --git a/enterprise/websvc.core/nbproject/project.properties b/enterprise/websvc.core/nbproject/project.properties index 69f7b5d29d91..55323431a62d 100644 --- a/enterprise/websvc.core/nbproject/project.properties +++ b/enterprise/websvc.core/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.69.0 +spec.version.base=1.70.0 javadoc.arch=${basedir}/arch.xml diff --git a/enterprise/websvc.customization/nbproject/project.properties b/enterprise/websvc.customization/nbproject/project.properties index 3534b27912ed..12ca65473ced 100644 --- a/enterprise/websvc.customization/nbproject/project.properties +++ b/enterprise/websvc.customization/nbproject/project.properties @@ -17,4 +17,4 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.51.0 +spec.version.base=1.52.0 diff --git a/enterprise/websvc.design/manifest.mf b/enterprise/websvc.design/manifest.mf index 0bb3328733d8..6efde0f2c9f7 100644 --- a/enterprise/websvc.design/manifest.mf +++ b/enterprise/websvc.design/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.design OpenIDE-Module-Layer: org/netbeans/modules/websvc/design/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/design/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.editor.hints/manifest.mf b/enterprise/websvc.editor.hints/manifest.mf index cbed7dade450..918ba18bb411 100644 --- a/enterprise/websvc.editor.hints/manifest.mf +++ b/enterprise/websvc.editor.hints/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.editor.hints OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/editor/hints/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.jaxws.lightapi/manifest.mf b/enterprise/websvc.jaxws.lightapi/manifest.mf index a8e111087381..67f831aa75aa 100644 --- a/enterprise/websvc.jaxws.lightapi/manifest.mf +++ b/enterprise/websvc.jaxws.lightapi/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.jaxws.lightapi OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/jaxws/light/Bundle.properties -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/enterprise/websvc.jaxwsapi/manifest.mf b/enterprise/websvc.jaxwsapi/manifest.mf index 1f6f1dae3a7f..39b2d4254741 100644 --- a/enterprise/websvc.jaxwsapi/manifest.mf +++ b/enterprise/websvc.jaxwsapi/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.jaxwsapi OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/jaxws/Bundle.properties -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.jaxwsmodel/manifest.mf b/enterprise/websvc.jaxwsmodel/manifest.mf index 9023e688cd31..c8d13048a75f 100644 --- a/enterprise/websvc.jaxwsmodel/manifest.mf +++ b/enterprise/websvc.jaxwsmodel/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.jaxwsmodel/1 OpenIDE-Module-Layer: org/netbeans/modules/websvc/jaxwsmodel/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/jaxwsmodel/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.kit/manifest.mf b/enterprise/websvc.kit/manifest.mf index 051e920879f0..2c3660aca181 100644 --- a/enterprise/websvc.kit/manifest.mf +++ b/enterprise/websvc.kit/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 diff --git a/enterprise/websvc.manager/manifest.mf b/enterprise/websvc.manager/manifest.mf index a8af67341862..71febc462ba9 100644 --- a/enterprise/websvc.manager/manifest.mf +++ b/enterprise/websvc.manager/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.websvc.manager OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/manager/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/websvc/manager/WebServiceModuleInstaller.class -OpenIDE-Module-Specification-Version: 1.53 +OpenIDE-Module-Specification-Version: 1.54 diff --git a/enterprise/websvc.metro.lib/manifest.mf b/enterprise/websvc.metro.lib/manifest.mf index a27f24bf56e1..9a7b47203535 100644 --- a/enterprise/websvc.metro.lib/manifest.mf +++ b/enterprise/websvc.metro.lib/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.metro.lib/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/metro/lib/Bundle.properties -OpenIDE-Module-Specification-Version: 1.53 +OpenIDE-Module-Specification-Version: 1.54 OpenIDE-Module-Layer: org/netbeans/modules/websvc/metro/lib/layer.xml AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.owsm/manifest.mf b/enterprise/websvc.owsm/manifest.mf index f4b2cfc94c9a..0fb112020b3b 100644 --- a/enterprise/websvc.owsm/manifest.mf +++ b/enterprise/websvc.owsm/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.owsm OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/owsm/Bundle.properties -OpenIDE-Module-Specification-Version: 1.38 +OpenIDE-Module-Specification-Version: 1.39 AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.projectapi/manifest.mf b/enterprise/websvc.projectapi/manifest.mf index c3a47b28b013..dbbfbfdcb330 100644 --- a/enterprise/websvc.projectapi/manifest.mf +++ b/enterprise/websvc.projectapi/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.projectapi/0 -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/project/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.rest/manifest.mf b/enterprise/websvc.rest/manifest.mf index 87aea579cbbb..dd350547c59f 100644 --- a/enterprise/websvc.rest/manifest.mf +++ b/enterprise/websvc.rest/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.rest/0 OpenIDE-Module-Layer: org/netbeans/modules/websvc/rest/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/rest/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java index b388923649fc..a1950e4cde4e 100644 --- a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java +++ b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java @@ -95,7 +95,7 @@ boolean isApplicable(FileObject fileObject){ return false; } Profile profile = webModule.getJ2eeProfile(); - if (profile.isAtMost(Profile.JAVA_EE_6_FULL)) { + if (profile != null && profile.isAtMost(Profile.JAVA_EE_6_FULL)) { return false; } return true; diff --git a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/InterceptorPanel.java b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/InterceptorPanel.java index 1ec9ee4a7cc2..e5ce8b53950f 100644 --- a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/InterceptorPanel.java +++ b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/InterceptorPanel.java @@ -80,7 +80,7 @@ public boolean isValid() { WebModule webModule = WebModule.getWebModule(project.getProjectDirectory()); if (webModule != null) { Profile profile = webModule.getJ2eeProfile(); - if (profile.isAtMost(Profile.JAVA_EE_6_FULL)) { + if (profile != null && profile.isAtMost(Profile.JAVA_EE_6_FULL)) { setErrorMessage(NbBundle.getMessage(InterceptorPanel.class, "MSG_NoJEE7Profile")); // NOI18N return false; diff --git a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/JaxRsFilterPanel.java b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/JaxRsFilterPanel.java index acdf7b3f5294..c48c4b279735 100644 --- a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/JaxRsFilterPanel.java +++ b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/JaxRsFilterPanel.java @@ -89,7 +89,7 @@ public boolean isValid() { WebModule webModule = WebModule.getWebModule(project.getProjectDirectory()); if (webModule != null) { Profile profile = webModule.getJ2eeProfile(); - if (profile.isAtMost(Profile.JAVA_EE_6_FULL)) { + if (profile != null && profile.isAtMost(Profile.JAVA_EE_6_FULL)) { setErrorMessage(NbBundle.getMessage(JaxRsFilterPanel.class, "MSG_NoJEE7Profile")); // NOI18N return false; diff --git a/enterprise/websvc.restapi/manifest.mf b/enterprise/websvc.restapi/manifest.mf index 9eaa815528d1..4d6fc37be722 100644 --- a/enterprise/websvc.restapi/manifest.mf +++ b/enterprise/websvc.restapi/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.restapi/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/rest/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.61 +OpenIDE-Module-Specification-Version: 1.62 AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/MiscPrivateUtilities.java b/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/MiscPrivateUtilities.java index 0c23d0effd35..762bf6766745 100644 --- a/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/MiscPrivateUtilities.java +++ b/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/MiscPrivateUtilities.java @@ -289,8 +289,7 @@ static JavaSource getJavaSourceFromClassName(Project p, String qualifiedClassNam } public static boolean supportsTargetProfile(Project project, Profile profile){ - J2eeModuleProvider provider = (J2eeModuleProvider) project.getLookup(). - lookup(J2eeModuleProvider.class); + J2eeModuleProvider provider = project.getLookup().lookup(J2eeModuleProvider.class); String serverInstanceID = provider.getServerInstanceID(); if ( serverInstanceID == null ){ return false; diff --git a/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java b/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java index 2dd61bdd2ba3..5da1857e28f1 100644 --- a/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java +++ b/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java @@ -495,7 +495,8 @@ public boolean isEESpecWithJaxRS(){ boolean isJee6 = Profile.JAVA_EE_6_WEB.equals(profile) || Profile.JAVA_EE_6_FULL.equals(profile); // Fix for BZ#216345: JAVA_EE_6_WEB profile doesn't contain JAX-RS API - return (isJee6 && MiscPrivateUtilities.supportsTargetProfile(project, Profile.JAVA_EE_6_FULL)) || profile.isAtLeast(Profile.JAVA_EE_7_WEB); + return (isJee6 && MiscPrivateUtilities.supportsTargetProfile(project, Profile.JAVA_EE_6_FULL)) + || (profile != null && profile.isAtLeast(Profile.JAVA_EE_7_WEB)); } /** diff --git a/enterprise/websvc.restkit/manifest.mf b/enterprise/websvc.restkit/manifest.mf index 1218ddf5a1dd..587956b276b0 100644 --- a/enterprise/websvc.restkit/manifest.mf +++ b/enterprise/websvc.restkit/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.restkit/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/restkit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 diff --git a/enterprise/websvc.restlib/manifest.mf b/enterprise/websvc.restlib/manifest.mf index d5514c7efa77..b385f1d976dd 100644 --- a/enterprise/websvc.restlib/manifest.mf +++ b/enterprise/websvc.restlib/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.restlib/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/swdp/Bundle.properties -OpenIDE-Module-Specification-Version: 2.33 +OpenIDE-Module-Specification-Version: 2.34 OpenIDE-Module-Layer: org/netbeans/modules/websvc/swdp/layer.xml AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.saas.codegen.j2ee/manifest.mf b/enterprise/websvc.saas.codegen.j2ee/manifest.mf index 34bd03b347a2..c56d58b6f5a5 100644 --- a/enterprise/websvc.saas.codegen.j2ee/manifest.mf +++ b/enterprise/websvc.saas.codegen.j2ee/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.saas.codegen.j2ee OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/codegen/j2ee/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 OpenIDE-Module-Layer: org/netbeans/modules/websvc/saas/codegen/j2ee/layer.xml AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.utilities/manifest.mf b/enterprise/websvc.utilities/manifest.mf index 9599ba394b4c..da42ad98fb6c 100644 --- a/enterprise/websvc.utilities/manifest.mf +++ b/enterprise/websvc.utilities/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.utilities/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/utilities/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.websvcapi/manifest.mf b/enterprise/websvc.websvcapi/manifest.mf index 77e684d36f89..4d2fa3a1bcb0 100644 --- a/enterprise/websvc.websvcapi/manifest.mf +++ b/enterprise/websvc.websvcapi/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.websvcapi -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/webservices/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/enterprise/websvc.wsstackapi/manifest.mf b/enterprise/websvc.wsstackapi/manifest.mf index e331468f61ea..6fb6dfdbd957 100644 --- a/enterprise/websvc.wsstackapi/manifest.mf +++ b/enterprise/websvc.wsstackapi/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.wsstackapi/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/wsstack/Bundle.properties -OpenIDE-Module-Specification-Version: 1.48 +OpenIDE-Module-Specification-Version: 1.49 AutoUpdate-Show-In-Client: false diff --git a/ergonomics/ide.ergonomics/manifest.mf b/ergonomics/ide.ergonomics/manifest.mf index 98ee97e74f19..ca3da1419eda 100644 --- a/ergonomics/ide.ergonomics/manifest.mf +++ b/ergonomics/ide.ergonomics/manifest.mf @@ -3,7 +3,7 @@ OpenIDE-Module: org.netbeans.modules.ide.ergonomics OpenIDE-Module-Install: org/netbeans/modules/ide/ergonomics/Installer.class OpenIDE-Module-Layer: org/netbeans/modules/ide/ergonomics/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/ergonomics/Bundle.properties -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true OpenIDE-Module-Recommends: org.netbeans.modules.server diff --git a/extide/gradle.dists/manifest.mf b/extide/gradle.dists/manifest.mf index a0fa30d51dca..c0766f2c4ade 100644 --- a/extide/gradle.dists/manifest.mf +++ b/extide/gradle.dists/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.gradle.dists OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gradle/dists/Bundle.properties -OpenIDE-Module-Specification-Version: 1.13 +OpenIDE-Module-Specification-Version: 1.14 diff --git a/extide/gradle.editor/manifest.mf b/extide/gradle.editor/manifest.mf index c772a8ce4c4c..0ee7ba5f59c5 100644 --- a/extide/gradle.editor/manifest.mf +++ b/extide/gradle.editor/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.gradle.editor OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gradle/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 diff --git a/extide/gradle/manifest.mf b/extide/gradle/manifest.mf index ae06bdb0d211..1cc6fee80e30 100644 --- a/extide/gradle/manifest.mf +++ b/extide/gradle/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module: org.netbeans.modules.gradle/2 OpenIDE-Module-Layer: org/netbeans/modules/gradle/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gradle/Bundle.properties OpenIDE-Module-Java-Dependencies: Java > 17 -OpenIDE-Module-Specification-Version: 2.41 +OpenIDE-Module-Specification-Version: 2.42 diff --git a/extide/gradle/nbproject/project.properties b/extide/gradle/nbproject/project.properties index aa352d0d3fd9..d22871c0a89b 100644 --- a/extide/gradle/nbproject/project.properties +++ b/extide/gradle/nbproject/project.properties @@ -17,8 +17,7 @@ file.reference.netbeans-gradle-tooling.jar=release/modules/gradle/netbeans-gradle-tooling.jar is.autoload=true -javac.source=1.8 -javac.target=1.8 +javac.release=17 javac.compilerargs=-Xlint -Xlint:-serial javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml @@ -37,4 +36,9 @@ release.build/tooling/nb-tooling.gradle=modules/gradle/nb-tooling.gradle extra.module.files=\ modules/gradle/netbeans-gradle-tooling.jar,\ - modules/gradle/nb-tooling.gradle \ No newline at end of file + modules/gradle/nb-tooling.gradle + +# These properties are used for compiling the netbeans-gradle-tooling library +# It shall be built on the lowest language level that the Gradle integration supports +tooling.javac.release=8 +tooling.gradle.version=7.4 diff --git a/extide/gradle/netbeans-gradle-tooling/build.xml b/extide/gradle/netbeans-gradle-tooling/build.xml index 7c994be3b7f3..96f6bbb3f535 100644 --- a/extide/gradle/netbeans-gradle-tooling/build.xml +++ b/extide/gradle/netbeans-gradle-tooling/build.xml @@ -23,7 +23,7 @@ Builds, tests, and runs the project org.netbeans.modules.gradle - + @@ -33,16 +33,16 @@ - + - + - + diff --git a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/internal/NbProjectInfo.java b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/internal/NbProjectInfo.java index afceb0878207..a5a10170dfa6 100644 --- a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/internal/NbProjectInfo.java +++ b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/internal/NbProjectInfo.java @@ -20,6 +20,7 @@ package org.netbeans.modules.gradle.tooling.internal; import org.netbeans.modules.gradle.tooling.Model; +import org.gradle.tooling.BuildAction; import java.util.Map; import java.util.Set; @@ -68,4 +69,8 @@ enum Severity { public String getDetail(); public Report getCause(); } + + public static BuildAction createAction() { + return new NbProjectInfoAction(); + } } diff --git a/nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxyType.java b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/internal/NbProjectInfoAction.java similarity index 66% rename from nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxyType.java rename to extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/internal/NbProjectInfoAction.java index ec0533bd2cc4..e6de7fc029a3 100644 --- a/nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxyType.java +++ b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/internal/NbProjectInfoAction.java @@ -16,29 +16,20 @@ * specific language governing permissions and limitations * under the License. */ +package org.netbeans.modules.gradle.tooling.internal; -package org.netbeans.installer.downloader.connector; - -import java.net.Proxy; +import java.io.Serializable; +import org.gradle.tooling.BuildAction; +import org.gradle.tooling.BuildController; /** * - * @author Danila_Dugurov + * @author lkishalmi */ +class NbProjectInfoAction implements Serializable, BuildAction{ -public enum MyProxyType { - DIRECT(Proxy.Type.DIRECT), - HTTP(Proxy.Type.HTTP), - SOCKS(Proxy.Type.SOCKS), - FTP(Proxy.Type.SOCKS); - - private Proxy.Type type; - - private MyProxyType(Proxy.Type type) { - this.type = type; - } - - public Proxy.Type getType() { - return type; - } + @Override + public NbProjectInfo execute(BuildController bc) { + return bc.getModel(NbProjectInfo.class); + } } diff --git a/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java b/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java index 024f95a6702b..8b93f19d3208 100644 --- a/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java +++ b/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java @@ -38,9 +38,7 @@ import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; -import java.util.Arrays; import java.util.EnumSet; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -84,7 +82,7 @@ public final class GradleDistributionManager { private static final String DOWNLOAD_URI = "https://services.gradle.org/distributions/gradle-%s-%s.zip"; //NOI18N private static final Pattern DIST_VERSION_PATTERN = Pattern.compile(".*(gradle-(\\d+\\.\\d+.*))-(bin|all)\\.zip"); //NOI18N - private static final Set VERSION_BLACKLIST = new HashSet<>(Arrays.asList("2.3", "2.13")); //NOI18N + private static final Set VERSION_BLACKLIST = Set.of("2.3", "2.13"); //NOI18N private static final Map CACHE = new WeakHashMap<>(); private static final GradleVersion MINIMUM_SUPPORTED_VERSION = GradleVersion.version("3.0"); //NOI18N private static final GradleVersion[] JDK_COMPAT = new GradleVersion[]{ @@ -101,9 +99,10 @@ public final class GradleDistributionManager { GradleVersion.version("7.6"), // JDK-19 GradleVersion.version("8.3"), // JDK-20 GradleVersion.version("8.5"), // JDK-21 + GradleVersion.version("8.8"), // JDK-22 }; - private static final GradleVersion LAST_KNOWN_GRADLE = GradleVersion.version("8.7"); //NOI18N + private static final GradleVersion LAST_KNOWN_GRADLE = GradleVersion.version("8.9"); //NOI18N final File gradleUserHome; diff --git a/extide/gradle/src/org/netbeans/modules/gradle/loaders/ExtensionPropertiesExtractor.java b/extide/gradle/src/org/netbeans/modules/gradle/loaders/ExtensionPropertiesExtractor.java index 10c3ebe9fe36..474b66becda5 100644 --- a/extide/gradle/src/org/netbeans/modules/gradle/loaders/ExtensionPropertiesExtractor.java +++ b/extide/gradle/src/org/netbeans/modules/gradle/loaders/ExtensionPropertiesExtractor.java @@ -44,8 +44,8 @@ public class ExtensionPropertiesExtractor implements ProjectInfoExtractor { public Result fallback(GradleFiles files) { return new Result() { @Override - public Set getExtract() { - return Collections.emptySet(); + public Set getExtract() { + return Set.of(); } @Override @@ -59,18 +59,18 @@ public Set getProblems() { public Result extract(Map props, Map otherInfo) { return new Result() { @Override - public Set getExtract() { + public Set getExtract() { Map values = (Map)props.getOrDefault("extensions.propertyValues", Collections.emptyMap()); // NOI18N Map types = (Map)props.getOrDefault("extensions.propertyTypes", Collections.emptyMap()); // NOI18N Map taskValues = (Map)props.getOrDefault("tasks.propertyValues", Collections.emptyMap()); // NOI18N Map taskTypes = (Map)props.getOrDefault("tasks.propertyTypes", Collections.emptyMap()); // NOI18N PropertyEvaluator a = new PropertyEvaluator(values, types, taskValues, taskTypes); - return Collections.singleton(a); + return Set.of(a); } @Override public Set getProblems() { - return Collections.emptySet(); + return Set.of(); } }; } diff --git a/extide/gradle/src/org/netbeans/modules/gradle/loaders/LegacyProjectLoader.java b/extide/gradle/src/org/netbeans/modules/gradle/loaders/LegacyProjectLoader.java index 518aab7bd6b4..7fdfb72b129f 100644 --- a/extide/gradle/src/org/netbeans/modules/gradle/loaders/LegacyProjectLoader.java +++ b/extide/gradle/src/org/netbeans/modules/gradle/loaders/LegacyProjectLoader.java @@ -481,7 +481,7 @@ private static GradleReport createReport(File p, Throwable e, boolean top, boole } private static BuildActionExecuter createInfoAction(ProjectConnection pconn, GradleCommandLine cmd, CancellationToken token, ProgressListener pl) { - BuildActionExecuter ret = pconn.action(new NbProjectInfoAction()); + BuildActionExecuter ret = pconn.action(NbProjectInfo.createAction()); cmd.configure(ret); if (DEBUG_GRADLE_INFO_ACTION) { // This would start the Gradle Daemon in Debug Mode, so the Tooling API can be debugged as well @@ -652,14 +652,6 @@ public void run() { } } - private static class NbProjectInfoAction implements Serializable, BuildAction { - - @Override - public NbProjectInfo execute(BuildController bc) { - return bc.getModel(NbProjectInfo.class); - } - } - private static class ProjectLoaderTask implements Callable, Cancellable { private final ReloadContext ctx; diff --git a/extide/gradle/src/org/netbeans/modules/gradle/newproject/GradleInitPanelVisual.java b/extide/gradle/src/org/netbeans/modules/gradle/newproject/GradleInitPanelVisual.java index 61e9a964a11b..af9a859de853 100644 --- a/extide/gradle/src/org/netbeans/modules/gradle/newproject/GradleInitPanelVisual.java +++ b/extide/gradle/src/org/netbeans/modules/gradle/newproject/GradleInitPanelVisual.java @@ -228,7 +228,7 @@ void read(WizardDescriptor settings) { if (settings.getProperty(PROP_JAVA_VERSIONS) != null) { List javaVersions = (List) settings.getProperty(PROP_JAVA_VERSIONS); - DefaultComboBoxModel versionModel = new DefaultComboBoxModel<>(javaVersions.toArray(new Integer[0])); + DefaultComboBoxModel versionModel = new DefaultComboBoxModel<>(javaVersions.toArray(Integer[]::new)); cbJavaVersion.setModel(versionModel); if (settings.getProperty(PROP_JAVA_VERSION) != null) { @@ -241,7 +241,7 @@ void read(WizardDescriptor settings) { if (settings.getProperty(PROP_TEST_FRAMEWORKS) != null) { List testframeworks = (List) settings.getProperty(PROP_TEST_FRAMEWORKS); - DefaultComboBoxModel frameworkModel = new DefaultComboBoxModel<>(testframeworks.toArray(new TestFramework[0])); + DefaultComboBoxModel frameworkModel = new DefaultComboBoxModel<>(testframeworks.toArray(TestFramework[]::new)); cbTestFramework.setModel(frameworkModel); if (settings.getProperty(PROP_TEST_FRAMEWORK) != null) { cbTestFramework.setSelectedItem(settings.getProperty(PROP_TEST_FRAMEWORK)); diff --git a/extide/gradle/src/org/netbeans/modules/gradle/output/GradleProcessorFactory.java b/extide/gradle/src/org/netbeans/modules/gradle/output/GradleProcessorFactory.java index fd528f433bbb..d61325d77c47 100644 --- a/extide/gradle/src/org/netbeans/modules/gradle/output/GradleProcessorFactory.java +++ b/extide/gradle/src/org/netbeans/modules/gradle/output/GradleProcessorFactory.java @@ -59,12 +59,12 @@ public class GradleProcessorFactory implements OutputProcessorFactory { @Override public Set createOutputProcessors(RunConfig cfg) { - return Collections.unmodifiableSet(new HashSet<>(Arrays.asList( + return Set.of( GRADLE_PROCESSOR, JAVAC_PROCESSOR, GROOVYC_PROCESSOR, new WarningModeAllProcessor(cfg) - ))); + ); } private static final Pattern GRADLE_ERROR = Pattern.compile("(Build file|Script) '(.*)\\.gradle' line: ([0-9]+)"); diff --git a/extide/gradle/src/org/netbeans/modules/gradle/spi/ProjectInfoExtractor.java b/extide/gradle/src/org/netbeans/modules/gradle/spi/ProjectInfoExtractor.java index 04254082a3af..564e0d8d4fc8 100644 --- a/extide/gradle/src/org/netbeans/modules/gradle/spi/ProjectInfoExtractor.java +++ b/extide/gradle/src/org/netbeans/modules/gradle/spi/ProjectInfoExtractor.java @@ -41,17 +41,17 @@ interface Result { static Result NONE = new Result() { @Override - public Set getExtract() { - return Collections.emptySet(); + public Set getExtract() { + return Set.of(); } @Override public Set getProblems() { - return Collections.emptySet(); + return Set.of(); } }; - Set getExtract(); + Set getExtract(); Set getProblems(); } @@ -72,8 +72,8 @@ public DefaultResult(Object extract, String... problems) { } @Override - public Set getExtract() { - return Collections.singleton(extract); + public Set getExtract() { + return Set.of(extract); } @Override diff --git a/extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/GradleInitWizard.java b/extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/GradleInitWizard.java index 56fdfe17e459..15b861ecbbfa 100644 --- a/extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/GradleInitWizard.java +++ b/extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/GradleInitWizard.java @@ -19,10 +19,8 @@ package org.netbeans.modules.gradle.spi.newproject; import java.io.File; -import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import org.netbeans.modules.gradle.newproject.GradleInitPanel; import org.netbeans.spi.project.ui.support.CommonProjectActions; import org.openide.WizardDescriptor; @@ -51,11 +49,10 @@ public enum GradleDSL { @Override public String toString() { - switch(this) { - case GROOVY: return Bundle.LBL_DSL_GROOVY(); - case KOTLIN: return Bundle.LBL_DSL_KOTLIN(); - default: throw new IllegalStateException("update switch"); - } + return switch(this) { + case GROOVY -> Bundle.LBL_DSL_GROOVY(); + case KOTLIN -> Bundle.LBL_DSL_KOTLIN(); + }; } } @@ -91,17 +88,16 @@ public String getId() { @Override public String toString() { - switch(this) { - case CPP_TEST: return Bundle.LBL_TFW_CPP_TEST(); - case JUNIT: return Bundle.LBL_TFW_JUNIT(); - case JUNIT_5: return Bundle.LBL_TFW_JUNIT_5(); - case KOTLIN_TEST: return Bundle.LBL_TFW_KOTLIN_TEST(); - case SCALA_TEST: return Bundle.LBL_TFW_SCALA_TEST(); - case SPOCK: return Bundle.LBL_TFW_SPOCK(); - case TESTNG: return Bundle.LBL_TFW_TESTNG(); - case XCTEST: return Bundle.LBL_TFW_XCTEST(); - default: throw new IllegalStateException("update switch"); - } + return switch(this) { + case CPP_TEST -> Bundle.LBL_TFW_CPP_TEST(); + case JUNIT -> Bundle.LBL_TFW_JUNIT(); + case JUNIT_5 -> Bundle.LBL_TFW_JUNIT_5(); + case KOTLIN_TEST -> Bundle.LBL_TFW_KOTLIN_TEST(); + case SCALA_TEST -> Bundle.LBL_TFW_SCALA_TEST(); + case SPOCK -> Bundle.LBL_TFW_SPOCK(); + case TESTNG -> Bundle.LBL_TFW_TESTNG(); + case XCTEST-> Bundle.LBL_TFW_XCTEST(); + }; } } @@ -112,7 +108,7 @@ public String toString() { private TestFramework preferredTestFramework; private List javaVersions; private List testFrameworks; - private List important = Collections.emptyList(); + private List important = List.of(); private GradleInitWizard(String type, String title) { this.type = type; @@ -215,14 +211,14 @@ protected void collectOperations(TemplateOperation ops, Map para List open = important.stream() .map((s) -> packageBase != null ? s.replace("${package}", packageBase.replace('.', '/')) : s) //NOI18N .map((s) -> s.replace("${projectName}", name)) //NOI18N - .collect(Collectors.toList()); + .toList(); ops.addProjectPreload(root, open); } @Override protected List> createPanels() { - return Collections.singletonList(new GradleInitPanel()); + return List.of(new GradleInitPanel()); } @Override diff --git a/extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/TemplateOperation.java b/extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/TemplateOperation.java index 8eeadadc7121..32832f8f5fcb 100644 --- a/extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/TemplateOperation.java +++ b/extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/TemplateOperation.java @@ -479,7 +479,7 @@ public final Set execute() { } catch (IOException ex) { } } - return Collections.emptySet(); + return Set.of(); } } @@ -489,7 +489,7 @@ private static final class PreloadProject extends BaseOperationStep { final List importantFiles; public PreloadProject(File dir) { - this(dir, Collections.emptyList()); + this(dir, List.of()); } public PreloadProject(File dir, List importantFiles) { @@ -643,7 +643,7 @@ public Set execute() { } catch (IOException | ScriptException ex) { throw new IOException(ex.getMessage(), ex); } - return important ? Collections.singleton(fo) : null; + return important ? Set.of(fo) : null; } catch (IOException ex) {} } catch (IOException ex) {} return null; @@ -680,7 +680,7 @@ public Set execute() { DataFolder targetFolder = DataFolder.findFolder(targetParent); DataObject o = DataObject.find(template); DataObject newData = o.createFromTemplate(targetFolder, targetName, tokens); - return important ? Collections.singleton(newData.getPrimaryFile()) : null; + return important ? Set.of(newData.getPrimaryFile()) : null; } catch (IOException ex) { } diff --git a/extide/libs.gradle/external/binaries-list b/extide/libs.gradle/external/binaries-list index 2e58f89b85fd..dff2c2265b37 100644 --- a/extide/libs.gradle/external/binaries-list +++ b/extide/libs.gradle/external/binaries-list @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -5F48B9BB9099B900FC33864A3794F31C439D9F73 https://repo.gradle.org/artifactory/libs-releases/org/gradle/gradle-tooling-api/8.7/gradle-tooling-api-8.7.jar gradle-tooling-api-8.7.jar +7BCC4423C529A42ECA9D0CE5B5275369EF4DF55A https://repo.gradle.org/artifactory/libs-releases/org/gradle/gradle-tooling-api/8.9/gradle-tooling-api-8.9.jar gradle-tooling-api-8.9.jar diff --git a/extide/libs.gradle/external/gradle-tooling-api-8.7-license.txt b/extide/libs.gradle/external/gradle-tooling-api-8.9-license.txt similarity index 99% rename from extide/libs.gradle/external/gradle-tooling-api-8.7-license.txt rename to extide/libs.gradle/external/gradle-tooling-api-8.9-license.txt index 84a9de902f75..74cb1addb8d6 100644 --- a/extide/libs.gradle/external/gradle-tooling-api-8.7-license.txt +++ b/extide/libs.gradle/external/gradle-tooling-api-8.9-license.txt @@ -1,7 +1,7 @@ Name: Gradle Tooling API Description: Gradle Tooling API -Version: 8.7 -Files: gradle-tooling-api-8.7.jar +Version: 8.9 +Files: gradle-tooling-api-8.9.jar License: Apache-2.0 Origin: Gradle Inc. URL: https://gradle.org/ diff --git a/extide/libs.gradle/external/gradle-tooling-api-8.7-notice.txt b/extide/libs.gradle/external/gradle-tooling-api-8.9-notice.txt similarity index 100% rename from extide/libs.gradle/external/gradle-tooling-api-8.7-notice.txt rename to extide/libs.gradle/external/gradle-tooling-api-8.9-notice.txt diff --git a/extide/libs.gradle/manifest.mf b/extide/libs.gradle/manifest.mf index 64b5cf508e40..b9148ab1af36 100644 --- a/extide/libs.gradle/manifest.mf +++ b/extide/libs.gradle/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.libs.gradle/8 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/libs/gradle/Bundle.properties -OpenIDE-Module-Specification-Version: 8.8 +OpenIDE-Module-Specification-Version: 8.10 diff --git a/extide/libs.gradle/nbproject/project.properties b/extide/libs.gradle/nbproject/project.properties index 6cd0e22d8315..6e4605fe4922 100644 --- a/extide/libs.gradle/nbproject/project.properties +++ b/extide/libs.gradle/nbproject/project.properties @@ -22,4 +22,4 @@ javac.compilerargs=-Xlint -Xlint:-serial # Sigtest fails to read the classes in the gradle-tooling-api sigtest.skip.gen=true -release.external/gradle-tooling-api-8.7.jar=modules/gradle/gradle-tooling-api.jar +release.external/gradle-tooling-api-8.9.jar=modules/gradle/gradle-tooling-api.jar diff --git a/extide/libs.gradle/nbproject/project.xml b/extide/libs.gradle/nbproject/project.xml index dc58e80a4500..d82027b5e615 100644 --- a/extide/libs.gradle/nbproject/project.xml +++ b/extide/libs.gradle/nbproject/project.xml @@ -39,7 +39,7 @@ gradle/gradle-tooling-api.jar - external/gradle-tooling-api-8.7.jar + external/gradle-tooling-api-8.9.jar diff --git a/extide/o.apache.tools.ant.module/nbproject/project.properties b/extide/o.apache.tools.ant.module/nbproject/project.properties index 36c4978b1f49..c1990a9964f3 100644 --- a/extide/o.apache.tools.ant.module/nbproject/project.properties +++ b/extide/o.apache.tools.ant.module/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=3.109.0 +spec.version.base=3.110.0 compile.ant.jar=${ant.core.lib} compile.ant-launcher.jar=${ant.core.lib}/../ant-launcher.jar src-bridge.cp.extra=build/classes:${compile.ant.jar}:${compile.ant-launcher.jar} diff --git a/extide/options.java/manifest.mf b/extide/options.java/manifest.mf index 619205dc34d3..ef37005dac43 100644 --- a/extide/options.java/manifest.mf +++ b/extide/options.java/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module: org.netbeans.modules.options.java OpenIDE-Module-Layer: org/netbeans/modules/options/java/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/java/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.options.java -OpenIDE-Module-Specification-Version: 1.39 +OpenIDE-Module-Specification-Version: 1.40 diff --git a/extra/libs.javafx.linux.aarch64/manifest.mf b/extra/libs.javafx.linux.aarch64/manifest.mf index 00b9fb13637c..a33a3d5a1e9e 100644 --- a/extra/libs.javafx.linux.aarch64/manifest.mf +++ b/extra/libs.javafx.linux.aarch64/manifest.mf @@ -3,6 +3,6 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.libs.javafx.linux.aarch64 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/linux/aarch64/Bundle.properties OpenIDE-Module-Fragment-Host: org.netbeans.libs.javafx -OpenIDE-Module-Specification-Version: 17.14 +OpenIDE-Module-Specification-Version: 17.15 OpenIDE-Module-Requires: org.openide.modules.os.Linux, org.openide.modules.arch.aarch64 OpenIDE-Module-Provides: org.openide.modules.jre.JavaFX diff --git a/extra/libs.javafx.linux/manifest.mf b/extra/libs.javafx.linux/manifest.mf index f7336e27b1ea..98dbb94c16d9 100644 --- a/extra/libs.javafx.linux/manifest.mf +++ b/extra/libs.javafx.linux/manifest.mf @@ -3,6 +3,6 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.libs.javafx.linux OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/linux/Bundle.properties OpenIDE-Module-Fragment-Host: org.netbeans.libs.javafx -OpenIDE-Module-Specification-Version: 17.14 +OpenIDE-Module-Specification-Version: 17.15 OpenIDE-Module-Requires: org.openide.modules.os.Linux, org.openide.modules.arch.amd64 OpenIDE-Module-Provides: org.openide.modules.jre.JavaFX diff --git a/extra/libs.javafx.macosx.aarch64/manifest.mf b/extra/libs.javafx.macosx.aarch64/manifest.mf index 40d4d9306322..9b9795cc24b3 100644 --- a/extra/libs.javafx.macosx.aarch64/manifest.mf +++ b/extra/libs.javafx.macosx.aarch64/manifest.mf @@ -3,6 +3,6 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.libs.javafx.macosx.aarch64 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/macosx/aarch64/Bundle.properties OpenIDE-Module-Fragment-Host: org.netbeans.libs.javafx -OpenIDE-Module-Specification-Version: 17.14 +OpenIDE-Module-Specification-Version: 17.15 OpenIDE-Module-Requires: org.openide.modules.os.MacOSX, org.openide.modules.arch.aarch64 OpenIDE-Module-Provides: org.openide.modules.jre.JavaFX diff --git a/extra/libs.javafx.macosx/manifest.mf b/extra/libs.javafx.macosx/manifest.mf index da3c9f3d6682..73d3d0a90fe0 100644 --- a/extra/libs.javafx.macosx/manifest.mf +++ b/extra/libs.javafx.macosx/manifest.mf @@ -3,6 +3,6 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.libs.javafx.macosx OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/macosx/Bundle.properties OpenIDE-Module-Fragment-Host: org.netbeans.libs.javafx -OpenIDE-Module-Specification-Version: 17.14 +OpenIDE-Module-Specification-Version: 17.15 OpenIDE-Module-Requires: org.openide.modules.os.MacOSX, org.openide.modules.arch.x86_64 OpenIDE-Module-Provides: org.openide.modules.jre.JavaFX diff --git a/extra/libs.javafx.win/manifest.mf b/extra/libs.javafx.win/manifest.mf index 72d219257224..e23cbd51911d 100644 --- a/extra/libs.javafx.win/manifest.mf +++ b/extra/libs.javafx.win/manifest.mf @@ -3,6 +3,6 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.libs.javafx.win OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/win/Bundle.properties OpenIDE-Module-Fragment-Host: org.netbeans.libs.javafx -OpenIDE-Module-Specification-Version: 17.14 +OpenIDE-Module-Specification-Version: 17.15 OpenIDE-Module-Requires: org.openide.modules.os.Windows, org.openide.modules.arch.amd64 OpenIDE-Module-Provides: org.openide.modules.jre.JavaFX diff --git a/groovy/gradle.groovy/licenseinfo.xml b/groovy/gradle.groovy/licenseinfo.xml new file mode 100644 index 000000000000..5d85a36f8b49 --- /dev/null +++ b/groovy/gradle.groovy/licenseinfo.xml @@ -0,0 +1,32 @@ + + + + + src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png + src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png + + + Icons are based based on artwork available on the https://gradle.org/brand/ . + More specificly: https://gradle.com/brand_assets/Gradle_Elephant_Icon_Assets.zip + + + diff --git a/groovy/gradle.groovy/manifest.mf b/groovy/gradle.groovy/manifest.mf index 9e3aafecc1b7..e317f65030d8 100644 --- a/groovy/gradle.groovy/manifest.mf +++ b/groovy/gradle.groovy/manifest.mf @@ -1,6 +1,7 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.gradle.groovy +OpenIDE-Module-Layer: org/netbeans/modules/gradle/groovy/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gradle/groovy/Bundle.properties -OpenIDE-Module-Specification-Version: 1.14 +OpenIDE-Module-Specification-Version: 1.15 diff --git a/groovy/gradle.groovy/nbproject/project.properties b/groovy/gradle.groovy/nbproject/project.properties index 20bd560eb6e8..519186637594 100644 --- a/groovy/gradle.groovy/nbproject/project.properties +++ b/groovy/gradle.groovy/nbproject/project.properties @@ -14,6 +14,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -javac.source=1.8 +javac.release=17 javac.compilerargs=-Xlint -Xlint:-serial is.eager=true diff --git a/groovy/gradle.groovy/nbproject/project.xml b/groovy/gradle.groovy/nbproject/project.xml index 73eb85d61fb9..d5fcdb09c71c 100644 --- a/groovy/gradle.groovy/nbproject/project.xml +++ b/groovy/gradle.groovy/nbproject/project.xml @@ -25,13 +25,21 @@ org.netbeans.modules.gradle.groovy + + org.netbeans.api.templates + + + + 1.32 + + org.netbeans.modules.gradle 2 - 2.6 + 2.40 @@ -69,6 +77,22 @@ 1.78 + + org.openide.dialogs + + + + 7.71 + + + + org.openide.util + + + + 9.32 + + diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/Bundle.properties b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/Bundle.properties index 3ccfb20d120a..87bc577eef0e 100644 --- a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/Bundle.properties +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/Bundle.properties @@ -15,3 +15,4 @@ # specific language governing permissions and limitations # under the License. OpenIDE-Module-Name=Gradle Groovy +Templates/Project/GradleGroovy=Groovv with Gradle \ No newline at end of file diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/layer.xml b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/layer.xml new file mode 100644 index 000000000000..719ece5b5bda --- /dev/null +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/layer.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/Welcome.wstcref b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleApplicationDescription.html similarity index 70% rename from nb/welcome/src/org/netbeans/modules/welcome/resources/Welcome.wstcref rename to groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleApplicationDescription.html index 26f1151663d8..eb4cb300c770 100644 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/Welcome.wstcref +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleApplicationDescription.html @@ -1,4 +1,3 @@ - + + + + + + Creates a simple Groovy application Gradle project. An empty main + class is also going to be created in the project. + + - - - - - - - diff --git a/nb/welcome/build.xml b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleLibraryDescription.html similarity index 80% rename from nb/welcome/build.xml rename to groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleLibraryDescription.html index bb20461c740d..5d4fb171c0e0 100644 --- a/nb/welcome/build.xml +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleLibraryDescription.html @@ -1,4 +1,3 @@ - - - - + + + + + + Creates a new Groovy library Gradle project. + + diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/Wizards.java b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/Wizards.java new file mode 100644 index 000000000000..c7b49b20a106 --- /dev/null +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/Wizards.java @@ -0,0 +1,66 @@ +/* + * 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.gradle.groovy.newproject; + +import java.util.List; +import org.netbeans.api.templates.TemplateRegistration; +import org.netbeans.modules.gradle.spi.newproject.BaseGradleWizardIterator; +import org.netbeans.modules.gradle.spi.newproject.GradleInitWizard; +import org.openide.util.NbBundle; + +/** + * + * @author lkishalmi + */ +public class Wizards { + + private Wizards() {} + + private static final List JAVA_VERSIONS = List.of(21, 17, 11, 8); + + @TemplateRegistration(folder="Project/GradleGroovy", position=350, displayName="#template.simpleAppProject", iconBase="org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png", description="SimpleApplicationDescription.html") + @NbBundle.Messages({ + "template.simpleAppProject=Groovy Application", + "LBL_SimpleApplicationProject=Groovy Application with Gradle" + }) + public static BaseGradleWizardIterator createJavaApplication() { + return GradleInitWizard.create("groovy-application", Bundle.LBL_SimpleApplicationProject()) + .withJavaVersions(JAVA_VERSIONS) + .withImportantPaths(List.of( + "app", + "app/src/main/groovy/${package}/App.groovy" + )) + .build(); + } + + @TemplateRegistration(folder="Project/GradleGroovy", position=360, displayName="#template.simpleLibProject", iconBase="org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png", description="SimpleLibraryDescription.html") + @NbBundle.Messages({ + "template.simpleLibProject=Groovy Class Library", + "LBL_SimpleLibraryProject=Groovy Class Library with Gradle" + }) + public static BaseGradleWizardIterator createJavaLibrary() { + return GradleInitWizard.create("groovy-library", Bundle.LBL_SimpleApplicationProject()) + .withJavaVersions(JAVA_VERSIONS) + .withImportantPaths(List.of( + "lib", + "lib/src/main/groovy/${package}/Library.groovy" + )) + .build(); + } +} diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png new file mode 100644 index 000000000000..33c23863a1b3 Binary files /dev/null and b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png differ diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png new file mode 100644 index 000000000000..dd6cb8bcc758 Binary files /dev/null and b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png differ diff --git a/groovy/groovy.antproject/manifest.mf b/groovy/groovy.antproject/manifest.mf index c966b5105a1b..57ddbff0ac36 100644 --- a/groovy/groovy.antproject/manifest.mf +++ b/groovy/groovy.antproject/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.groovy.antproject OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/antproject/Bundle.properties -OpenIDE-Module-Specification-Version: 1.35 +OpenIDE-Module-Specification-Version: 1.36 diff --git a/groovy/groovy.antproject/src/org/netbeans/modules/groovy/antproject/base/AbstractGroovyExtender.java b/groovy/groovy.antproject/src/org/netbeans/modules/groovy/antproject/base/AbstractGroovyExtender.java index 4073c0c84804..48ecda85ea0f 100644 --- a/groovy/groovy.antproject/src/org/netbeans/modules/groovy/antproject/base/AbstractGroovyExtender.java +++ b/groovy/groovy.antproject/src/org/netbeans/modules/groovy/antproject/base/AbstractGroovyExtender.java @@ -208,7 +208,7 @@ private boolean containsClass(Collection classpath, String className) thro try { Enumeration entries = jf.entries(); while (entries.hasMoreElements()) { - JarEntry entry = (JarEntry) entries.nextElement(); + JarEntry entry = entries.nextElement(); if (classFilePath.equals(entry.getName())) { return true; } diff --git a/groovy/groovy.debug/manifest.mf b/groovy/groovy.debug/manifest.mf index 568ea33c8e18..bb79e60510bc 100644 --- a/groovy/groovy.debug/manifest.mf +++ b/groovy/groovy.debug/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.groovy.debug/1 OpenIDE-Module-Layer: org/netbeans/modules/groovy/debug/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/debug/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.8 +OpenIDE-Module-Specification-Version: 1.9 diff --git a/groovy/groovy.editor/manifest.mf b/groovy/groovy.editor/manifest.mf index 053db14a3b0e..100d159a441a 100644 --- a/groovy/groovy.editor/manifest.mf +++ b/groovy/groovy.editor/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.groovy.editor/3 OpenIDE-Module-Layer: org/netbeans/modules/groovy/editor/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.94 +OpenIDE-Module-Specification-Version: 1.95 diff --git a/groovy/groovy.gsp/manifest.mf b/groovy/groovy.gsp/manifest.mf index fa4e00606717..7e955866f141 100644 --- a/groovy/groovy.gsp/manifest.mf +++ b/groovy/groovy.gsp/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.groovy.gsp OpenIDE-Module-Layer: org/netbeans/modules/groovy/gsp/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/gsp/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.59 +OpenIDE-Module-Specification-Version: 1.60 diff --git a/groovy/groovy.kit/manifest.mf b/groovy/groovy.kit/manifest.mf index 41c706c1ea9b..14d7cfd45bfe 100644 --- a/groovy/groovy.kit/manifest.mf +++ b/groovy/groovy.kit/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.groovy.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 diff --git a/groovy/groovy.refactoring/manifest.mf b/groovy/groovy.refactoring/manifest.mf index 6c0c18f7e603..fe735ec97229 100644 --- a/groovy/groovy.refactoring/manifest.mf +++ b/groovy/groovy.refactoring/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.groovy.refactoring OpenIDE-Module-Layer: org/netbeans/modules/groovy/refactoring/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/refactoring/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 diff --git a/groovy/groovy.samples/manifest.mf b/groovy/groovy.samples/manifest.mf index 18970f151dd4..e7b835cc82cb 100644 --- a/groovy/groovy.samples/manifest.mf +++ b/groovy/groovy.samples/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.groovy.samples OpenIDE-Module-Layer: org/netbeans/modules/groovy/samples/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/samples/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 diff --git a/groovy/groovy.support/manifest.mf b/groovy/groovy.support/manifest.mf index 240c69b04962..a7870537050a 100644 --- a/groovy/groovy.support/manifest.mf +++ b/groovy/groovy.support/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.groovy.support OpenIDE-Module-Layer: org/netbeans/modules/groovy/support/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/support/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker diff --git a/groovy/libs.groovy/manifest.mf b/groovy/libs.groovy/manifest.mf index 4102bb2c1991..a205c9e190dd 100644 --- a/groovy/libs.groovy/manifest.mf +++ b/groovy/libs.groovy/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.libs.groovy OpenIDE-Module-Layer: org/netbeans/modules/libs/groovy/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/libs/groovy/Bundle.properties -OpenIDE-Module-Specification-Version: 2.25 +OpenIDE-Module-Specification-Version: 2.26 diff --git a/groovy/maven.groovy/manifest.mf b/groovy/maven.groovy/manifest.mf index d72c8506c0d1..b78bea9ff4b2 100644 --- a/groovy/maven.groovy/manifest.mf +++ b/groovy/maven.groovy/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.maven.groovy OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/groovy/Bundle.properties -OpenIDE-Module-Specification-Version: 1.37 +OpenIDE-Module-Specification-Version: 1.38 diff --git a/harness/apisupport.harness/manifest.mf b/harness/apisupport.harness/manifest.mf index e0b35b358b9a..bf47d8ac41b4 100644 --- a/harness/apisupport.harness/manifest.mf +++ b/harness/apisupport.harness/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.apisupport.harness -OpenIDE-Module-Specification-Version: 1.67 +OpenIDE-Module-Specification-Version: 1.68 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/harness/Bundle.properties diff --git a/harness/jellytools.platform/manifest.mf b/harness/jellytools.platform/manifest.mf index 1a87997ca291..3aa6cd623e54 100644 --- a/harness/jellytools.platform/manifest.mf +++ b/harness/jellytools.platform/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.jellytools.platform/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jellytools/platform/Bundle.properties -OpenIDE-Module-Specification-Version: 3.54 +OpenIDE-Module-Specification-Version: 3.55 diff --git a/harness/jemmy/manifest.mf b/harness/jemmy/manifest.mf index 95042e9e59f9..eb59edfdd1df 100644 --- a/harness/jemmy/manifest.mf +++ b/harness/jemmy/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jemmy/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jemmy/idemodule/Bundle.properties -OpenIDE-Module-Specification-Version: 3.52 +OpenIDE-Module-Specification-Version: 3.53 diff --git a/harness/libs.nbi.ant/manifest.mf b/harness/libs.nbi.ant/manifest.mf index 0cabd6a6bbba..0f1eb5faa068 100644 --- a/harness/libs.nbi.ant/manifest.mf +++ b/harness/libs.nbi.ant/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.libs.nbi.ant OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/nbi/ant/Bundle.properties -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/harness/libs.nbi.engine/manifest.mf b/harness/libs.nbi.engine/manifest.mf index 50a3b4ed9f5f..edfca4e8ce93 100644 --- a/harness/libs.nbi.engine/manifest.mf +++ b/harness/libs.nbi.engine/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.libs.nbi.engine OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/nbi/engine/Bundle.properties -OpenIDE-Module-Specification-Version: 1.46 +OpenIDE-Module-Specification-Version: 1.47 diff --git a/harness/nbjunit/manifest.mf b/harness/nbjunit/manifest.mf index a4467307c9db..d5d64a4f6f75 100644 --- a/harness/nbjunit/manifest.mf +++ b/harness/nbjunit/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.nbjunit/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/junit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.115 +OpenIDE-Module-Specification-Version: 1.116 diff --git a/harness/o.n.insane/nbproject/project.properties b/harness/o.n.insane/nbproject/project.properties index 17babae59c25..64853d712326 100644 --- a/harness/o.n.insane/nbproject/project.properties +++ b/harness/o.n.insane/nbproject/project.properties @@ -18,7 +18,7 @@ is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.54.0 +spec.version.base=1.55.0 cp.extra=build/hookclasses diff --git a/ide/api.debugger/manifest.mf b/ide/api.debugger/manifest.mf index e1b80da67880..4425c84e3cd6 100644 --- a/ide/api.debugger/manifest.mf +++ b/ide/api.debugger/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.debugger/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/Bundle.properties -OpenIDE-Module-Specification-Version: 1.80 +OpenIDE-Module-Specification-Version: 1.81 OpenIDE-Module-Layer: org/netbeans/api/debugger/layer.xml diff --git a/ide/api.java.classpath/manifest.mf b/ide/api.java.classpath/manifest.mf index 1c0afa21d971..3b51705853fe 100644 --- a/ide/api.java.classpath/manifest.mf +++ b/ide/api.java.classpath/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.java.classpath/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/java/classpath/Bundle.properties OpenIDE-Module-Recommends: cnb.org.netbeans.api.java.classpath.nb -OpenIDE-Module-Specification-Version: 1.79 +OpenIDE-Module-Specification-Version: 1.80 diff --git a/ide/api.lsp/manifest.mf b/ide/api.lsp/manifest.mf index 5e3d50bd1c6b..e11e4f0b21b3 100644 --- a/ide/api.lsp/manifest.mf +++ b/ide/api.lsp/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.lsp/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/lsp/Bundle.properties -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 AutoUpdate-Show-In-Client: false diff --git a/ide/api.lsp/src/org/netbeans/api/lsp/WorkspaceEdit.java b/ide/api.lsp/src/org/netbeans/api/lsp/WorkspaceEdit.java index 3aca7ff20321..f72d66546d76 100644 --- a/ide/api.lsp/src/org/netbeans/api/lsp/WorkspaceEdit.java +++ b/ide/api.lsp/src/org/netbeans/api/lsp/WorkspaceEdit.java @@ -60,7 +60,7 @@ public List> getDocumentChanges() { * a {@link WorkspaceEdit} with {@link TextDocumentEdit}s that have empty set of changes. * The implementation must apply edits so they result in the same result as if the contents * of the WorkspaceEdit are applied in the order. - *

+ * * Upon failure, the returned Future completes with {@link ResourceModificationException}. * Completed WorkspaceEdits, the failed one and the index of a failed operation within it should be reported. * If any resource was saved before the failure, it should be reported as saved. diff --git a/ide/api.xml.ui/manifest.mf b/ide/api.xml.ui/manifest.mf index 675803a4bdd8..3c96384f840e 100644 --- a/ide/api.xml.ui/manifest.mf +++ b/ide/api.xml.ui/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.api.xml.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/xml/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.69 +OpenIDE-Module-Specification-Version: 1.70 diff --git a/ide/api.xml/manifest.mf b/ide/api.xml/manifest.mf index 78cb6266f8ad..5aa7ef6be79d 100644 --- a/ide/api.xml/manifest.mf +++ b/ide/api.xml/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.xml/1 -OpenIDE-Module-Specification-Version: 1.69 +OpenIDE-Module-Specification-Version: 1.70 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/xml/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/api/xml/resources/mf-layer.xml diff --git a/ide/bugtracking.bridge/manifest.mf b/ide/bugtracking.bridge/manifest.mf index 8e1c915e5184..27327631dbf5 100644 --- a/ide/bugtracking.bridge/manifest.mf +++ b/ide/bugtracking.bridge/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.bugtracking.bridge OpenIDE-Module-Layer: org/netbeans/modules/bugtracking/bridge/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugtracking/bridge/Bundle.properties -OpenIDE-Module-Specification-Version: 1.71 +OpenIDE-Module-Specification-Version: 1.72 diff --git a/ide/bugtracking.commons/manifest.mf b/ide/bugtracking.commons/manifest.mf index 3f537d602e8d..d825d9addb71 100644 --- a/ide/bugtracking.commons/manifest.mf +++ b/ide/bugtracking.commons/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.bugtracking.commons OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugtracking/commons/Bundle.properties -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.34 diff --git a/ide/bugtracking/manifest.mf b/ide/bugtracking/manifest.mf index b2a4cf1bab0f..e1903c208102 100644 --- a/ide/bugtracking/manifest.mf +++ b/ide/bugtracking/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.bugtracking OpenIDE-Module-Layer: org/netbeans/modules/bugtracking/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugtracking/Bundle.properties -OpenIDE-Module-Specification-Version: 1.134 +OpenIDE-Module-Specification-Version: 1.135 Netigso-Export-Package: org.netbeans.modules.bugtracking.api,org.netbeans.modules.bugtracking.spi diff --git a/ide/bugzilla/manifest.mf b/ide/bugzilla/manifest.mf index d1d70b2c8209..aa178a3374a7 100644 --- a/ide/bugzilla/manifest.mf +++ b/ide/bugzilla/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.bugzilla OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugzilla/Bundle.properties -OpenIDE-Module-Specification-Version: 1.102 +OpenIDE-Module-Specification-Version: 1.103 diff --git a/ide/c.google.gson/external/binaries-list b/ide/c.google.gson/external/binaries-list index 26c51c83ca3e..851549697985 100644 --- a/ide/c.google.gson/external/binaries-list +++ b/ide/c.google.gson/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -8A432C1D6825781E21A02DB2E2C33C5FDE2833B9 com.google.code.gson:gson:2.8.9 +527175CA6D81050B53BDD4C457A6D6E017626B0E com.google.code.gson:gson:2.11.0 diff --git a/java/maven.indexer/external/gson-2.11.0-license.txt b/ide/c.google.gson/external/gson-2.11.0-license.txt similarity index 99% rename from java/maven.indexer/external/gson-2.11.0-license.txt rename to ide/c.google.gson/external/gson-2.11.0-license.txt index cce6b5849fd9..683468f22a25 100644 --- a/java/maven.indexer/external/gson-2.11.0-license.txt +++ b/ide/c.google.gson/external/gson-2.11.0-license.txt @@ -3,7 +3,6 @@ Description: JSon serialization/deserialization library Origin: GitHub Version: 2.11.0 License: Apache-2.0 -Source: https://github.com/google/gson Apache License Version 2.0, January 2004 diff --git a/ide/c.google.gson/nbproject/project.properties b/ide/c.google.gson/nbproject/project.properties index 8390fb7ebc51..b00dad9f6ed1 100644 --- a/ide/c.google.gson/nbproject/project.properties +++ b/ide/c.google.gson/nbproject/project.properties @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -release.external/gson-2.8.9.jar=modules/com-google-gson.jar +release.external/gson-2.11.0.jar=modules/com-google-gson.jar is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 diff --git a/ide/c.google.gson/nbproject/project.xml b/ide/c.google.gson/nbproject/project.xml index c777eee166c7..4b7ad92120b1 100644 --- a/ide/c.google.gson/nbproject/project.xml +++ b/ide/c.google.gson/nbproject/project.xml @@ -28,7 +28,7 @@ com-google-gson.jar - external/gson-2.8.9.jar + external/gson-2.11.0.jar diff --git a/ide/c.google.guava.failureaccess/nbproject/project.properties b/ide/c.google.guava.failureaccess/nbproject/project.properties index 68cfb5ce8306..1b04aea8ea36 100644 --- a/ide/c.google.guava.failureaccess/nbproject/project.properties +++ b/ide/c.google.guava.failureaccess/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.3.0 +spec.version.base=1.4.0 release.external/failureaccess-1.0.2.jar=modules/com-google-guava-failureaccess.jar is.autoload=true nbm.module.author=Tomas Stupka diff --git a/ide/c.google.guava/external/binaries-list b/ide/c.google.guava/external/binaries-list index fb2721be1648..bacafbfb96d9 100644 --- a/ide/c.google.guava/external/binaries-list +++ b/ide/c.google.guava/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -161BA27964A62F241533807A46B8711B13C1D94B com.google.guava:guava:33.0.0-jre +818E780DA2C66C63BBB6480FEF1F3855EEAFA3E4 com.google.guava:guava:33.2.1-jre diff --git a/ide/c.google.guava/external/guava-33.0.0-jre-license.txt b/ide/c.google.guava/external/guava-33.2.1-jre-license.txt similarity index 99% rename from ide/c.google.guava/external/guava-33.0.0-jre-license.txt rename to ide/c.google.guava/external/guava-33.2.1-jre-license.txt index fbfec6c443ee..186f7369f019 100644 --- a/ide/c.google.guava/external/guava-33.0.0-jre-license.txt +++ b/ide/c.google.guava/external/guava-33.2.1-jre-license.txt @@ -1,5 +1,5 @@ Name: Guava -Version: 33.0.0 +Version: 33.2.1 License: Apache-2.0 Origin: https://github.com/google/guava Description: Guava is a set of core libraries that includes new collection types (such as multimap and multiset), immutable collections, a graph library, and utilities for concurrency, I/O, hashing, primitives, strings, and more. diff --git a/ide/c.google.guava/nbproject/project.properties b/ide/c.google.guava/nbproject/project.properties index 75311b1e5641..b922f79425b2 100644 --- a/ide/c.google.guava/nbproject/project.properties +++ b/ide/c.google.guava/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=27.18.0 -release.external/guava-33.0.0-jre.jar=modules/com-google-guava.jar +spec.version.base=27.19.0 +release.external/guava-33.2.1-jre.jar=modules/com-google-guava.jar is.autoload=true nbm.module.author=Tomas Stupka diff --git a/ide/c.google.guava/nbproject/project.xml b/ide/c.google.guava/nbproject/project.xml index 56e34cddfa47..f0576034930a 100644 --- a/ide/c.google.guava/nbproject/project.xml +++ b/ide/c.google.guava/nbproject/project.xml @@ -28,7 +28,7 @@ com-google-guava.jar - external/guava-33.0.0-jre.jar + external/guava-33.2.1-jre.jar diff --git a/ide/c.jcraft.jzlib/nbproject/project.properties b/ide/c.jcraft.jzlib/nbproject/project.properties index d71c241fd8c1..f0e0fef84fbe 100644 --- a/ide/c.jcraft.jzlib/nbproject/project.properties +++ b/ide/c.jcraft.jzlib/nbproject/project.properties @@ -17,5 +17,5 @@ is.autoload=true extra.license.files=external/jzlib-1.1.3-license.txt -spec.version.base=1.49.0 +spec.version.base=1.50.0 sigtest.gen.fail.on.error=false diff --git a/ide/code.analysis/manifest.mf b/ide/code.analysis/manifest.mf index 7ee486ec8b99..c63d1e3e955b 100644 --- a/ide/code.analysis/manifest.mf +++ b/ide/code.analysis/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.code.analysis/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/analysis/Bundle.properties OpenIDE-Module-Recommends: org.openide.windows.WindowManager -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 OpenIDE-Module-Layer: org/netbeans/modules/analysis/resources/layer.xml diff --git a/ide/core.browser.webview/nbproject/project.properties b/ide/core.browser.webview/nbproject/project.properties index b3c4a9569e85..390c8dc7340d 100644 --- a/ide/core.browser.webview/nbproject/project.properties +++ b/ide/core.browser.webview/nbproject/project.properties @@ -16,6 +16,6 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.40.0 +spec.version.base=1.41.0 is.eager=true cp.extra=../libs.javafx/build/openjfx.zip diff --git a/ide/core.browser/nbproject/project.properties b/ide/core.browser/nbproject/project.properties index 4abfb33660af..72bdb636b47f 100644 --- a/ide/core.browser/nbproject/project.properties +++ b/ide/core.browser/nbproject/project.properties @@ -17,4 +17,4 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.53.0 +spec.version.base=1.54.0 diff --git a/ide/core.ide/manifest.mf b/ide/core.ide/manifest.mf index 91836b01ff05..9903c53c3973 100644 --- a/ide/core.ide/manifest.mf +++ b/ide/core.ide/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.core.ide/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/core/ide/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.66 +OpenIDE-Module-Specification-Version: 1.67 AutoUpdate-Show-In-Client: false OpenIDE-Module-Layer: org/netbeans/core/ide/resources/layer.xml diff --git a/ide/core.multitabs.project/nbproject/project.properties b/ide/core.multitabs.project/nbproject/project.properties index 6fb1dc0e44cc..47641095d3c0 100644 --- a/ide/core.multitabs.project/nbproject/project.properties +++ b/ide/core.multitabs.project/nbproject/project.properties @@ -17,4 +17,4 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial nbm.needs.restart=true -spec.version.base=1.35.0 +spec.version.base=1.36.0 diff --git a/ide/csl.api/nbproject/project.properties b/ide/csl.api/nbproject/project.properties index 2a690dc1d0fb..98d31e6c6332 100644 --- a/ide/csl.api/nbproject/project.properties +++ b/ide/csl.api/nbproject/project.properties @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -spec.version.base=2.83.0 +spec.version.base=2.84.0 is.autoload=true javac.source=1.8 diff --git a/ide/csl.types/manifest.mf b/ide/csl.types/manifest.mf index b8c5311454ac..52ad202a32e8 100644 --- a/ide/csl.types/manifest.mf +++ b/ide/csl.types/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.csl.types/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/csl/types/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/ide/css.editor/manifest.mf b/ide/css.editor/manifest.mf index affac8f30504..646d224cd1ea 100644 --- a/ide/css.editor/manifest.mf +++ b/ide/css.editor/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.css.editor/1 OpenIDE-Module-Layer: org/netbeans/modules/css/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/css/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.93 +OpenIDE-Module-Specification-Version: 1.94 AutoUpdate-Show-In-Client: false diff --git a/ide/css.lib/manifest.mf b/ide/css.lib/manifest.mf index 71797b033351..272fbfe69e5d 100644 --- a/ide/css.lib/manifest.mf +++ b/ide/css.lib/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.css.lib/2 OpenIDE-Module-Layer: org/netbeans/modules/css/lib/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/css/lib/Bundle.properties -OpenIDE-Module-Specification-Version: 2.5 +OpenIDE-Module-Specification-Version: 2.6 diff --git a/ide/css.model/manifest.mf b/ide/css.model/manifest.mf index 0ddc46653bbe..6b5f9275f2c8 100644 --- a/ide/css.model/manifest.mf +++ b/ide/css.model/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.css.model OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/css/model/Bundle.properties -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 AutoUpdate-Show-In-Client: true diff --git a/ide/css.prep/manifest.mf b/ide/css.prep/manifest.mf index e125a81ffdce..80add88b0b87 100644 --- a/ide/css.prep/manifest.mf +++ b/ide/css.prep/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.css.prep OpenIDE-Module-Layer: org/netbeans/modules/css/prep/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/css/prep/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 diff --git a/ide/css.visual/manifest.mf b/ide/css.visual/manifest.mf index 0f9a0c98c35a..b92335a593ac 100644 --- a/ide/css.visual/manifest.mf +++ b/ide/css.visual/manifest.mf @@ -5,4 +5,4 @@ OpenIDE-Module-Layer: org/netbeans/modules/css/visual/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/css/visual/Bundle.properties OpenIDE-Module-Requires: org.openide.windows.IOProvider AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 3.57 +OpenIDE-Module-Specification-Version: 3.58 diff --git a/ide/db.core/manifest.mf b/ide/db.core/manifest.mf index 7c4532d31faf..6e86bf2e7b05 100644 --- a/ide/db.core/manifest.mf +++ b/ide/db.core/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.db.core -OpenIDE-Module-Specification-Version: 1.62 +OpenIDE-Module-Specification-Version: 1.63 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/core/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/db/core/resources/layer.xml OpenIDE-Module-Requires: org.openide.windows.IOProvider diff --git a/ide/db.dataview/manifest.mf b/ide/db.dataview/manifest.mf index 30835d9d2b11..092b112143dc 100644 --- a/ide/db.dataview/manifest.mf +++ b/ide/db.dataview/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.db.dataview OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/dataview/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 AutoUpdate-Show-In-Client: false diff --git a/ide/db.drivers/manifest.mf b/ide/db.drivers/manifest.mf index 7fdef822e131..d4dfd78c21e1 100644 --- a/ide/db.drivers/manifest.mf +++ b/ide/db.drivers/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.db.drivers OpenIDE-Module-Layer: org/netbeans/modules/db/drivers/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/drivers/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 AutoUpdate-Show-In-Client: false diff --git a/ide/db.kit/manifest.mf b/ide/db.kit/manifest.mf index 8d952867f4b7..15510c9260e4 100644 --- a/ide/db.kit/manifest.mf +++ b/ide/db.kit/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.db.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 diff --git a/ide/db.metadata.model/manifest.mf b/ide/db.metadata.model/manifest.mf index 3a7f355b4a50..c27ab65ee908 100644 --- a/ide/db.metadata.model/manifest.mf +++ b/ide/db.metadata.model/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.db.metadata.model/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/metadata/model/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.36 +OpenIDE-Module-Specification-Version: 1.37 AutoUpdate-Show-In-Client: false diff --git a/ide/db.mysql/nbproject/project.properties b/ide/db.mysql/nbproject/project.properties index 3dd6c8d54178..c1535e8b407b 100644 --- a/ide/db.mysql/nbproject/project.properties +++ b/ide/db.mysql/nbproject/project.properties @@ -16,6 +16,6 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=0.53.0 +spec.version.base=0.54.0 test.unit.cp.extra=external/mysql-connector-j-8.0.31.jar diff --git a/ide/db.sql.editor/nbproject/project.properties b/ide/db.sql.editor/nbproject/project.properties index acca88fb1660..ab6148341a53 100644 --- a/ide/db.sql.editor/nbproject/project.properties +++ b/ide/db.sql.editor/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.62.0 +spec.version.base=1.63.0 # org-netbeans-core: for /xml/lookups in the default fs # (needed in order to load database connections from the SFS) diff --git a/ide/db.sql.visualeditor/nbproject/project.properties b/ide/db.sql.visualeditor/nbproject/project.properties index a5d1ce226d65..cb81020f6cc0 100644 --- a/ide/db.sql.visualeditor/nbproject/project.properties +++ b/ide/db.sql.visualeditor/nbproject/project.properties @@ -27,4 +27,4 @@ module.javadoc.packages= org.netbeans.modules.db.sql.visualeditor.api #javadoc.title=Creator Designtime API #javadoc.arch=${basedir}/arch.xml #javadoc.arch=${basedir}/arch/arch-designtime.xml -spec.version.base=2.57.0 +spec.version.base=2.58.0 diff --git a/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderMetaData.java b/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderMetaData.java index 0092d39fb19a..4b841639a73f 100644 --- a/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderMetaData.java +++ b/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderMetaData.java @@ -280,9 +280,9 @@ boolean checkColumnNameForTable(Column col, String tableName) { } } else { for (int icnt = 0; icnt < cols.size(); icnt++) { - if (columnName.equalsIgnoreCase((String) cols.get(icnt))) { - col.setColumnName(col.getColumnName(), (String) cols.get(icnt)); - Log.getLogger().finest(" adjust colname to " + (String) cols.get(icnt)); + if (columnName.equalsIgnoreCase(cols.get(icnt))) { + col.setColumnName(col.getColumnName(), cols.get(icnt)); + Log.getLogger().finest(" adjust colname to " + cols.get(icnt)); if (col.getTableSpec() == null) { col.setTableSpec(col.getTableSpec(), checkedTable); Log.getLogger().finest(" adjust table to " + checkedTable); @@ -435,8 +435,8 @@ List getAllTables() throws SQLException { // Convert from List to "table.schema", expected by query editor List result = new ArrayList<>(); for (List fullTable : tables) { - String schema = (String) fullTable.get(0); - String table = (String) fullTable.get(1); + String schema = fullTable.get(0); + String table = fullTable.get(1); result.add(((schema == null) || (schema.equals(""))) ? table : schema + "." + table); } return result; diff --git a/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderResultTable.java b/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderResultTable.java index 3544822aa7b2..e41a13ec2899 100644 --- a/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderResultTable.java +++ b/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderResultTable.java @@ -299,7 +299,7 @@ else if (source.getText().equals(NbBundle.getMessage(QueryBuilderInputTable.clas } private void setClipboard(String contents) { - ExClipboard clipboard = (ExClipboard) Lookup.getDefault().lookup(ExClipboard.class); + ExClipboard clipboard = Lookup.getDefault().lookup(ExClipboard.class); StringSelection strSel = new StringSelection(contents); clipboard.setContents(strSel, strSel); } diff --git a/ide/db/nbproject/project.properties b/ide/db/nbproject/project.properties index 75c0b0c18ac4..c4415bd75890 100644 --- a/ide/db/nbproject/project.properties +++ b/ide/db/nbproject/project.properties @@ -20,7 +20,7 @@ javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.94.0 +spec.version.base=1.95.0 extra.module.files=modules/ext/ddl.jar diff --git a/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddDriverDialog.java b/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddDriverDialog.java index 3a2042bf2780..1de1fbdb1214 100644 --- a/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddDriverDialog.java +++ b/ide/db/src/org/netbeans/modules/db/explorer/dlg/AddDriverDialog.java @@ -574,7 +574,7 @@ public void run() { try (JarFile jf = new JarFile(file)) { Enumeration entries = jf.entries(); while (entries.hasMoreElements()) { - JarEntry entry = (JarEntry) entries.nextElement(); + JarEntry entry = entries.nextElement(); String className = entry.getName(); if (className.endsWith(".class")) { // NOI18N className = className.replace('/', '.'); diff --git a/ide/dbapi/nbproject/project.properties b/ide/dbapi/nbproject/project.properties index 91fff28352cc..18017552c97f 100644 --- a/ide/dbapi/nbproject/project.properties +++ b/ide/dbapi/nbproject/project.properties @@ -19,7 +19,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.59.0 +spec.version.base=1.60.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/defaults/manifest.mf b/ide/defaults/manifest.mf index 61ace249a536..257e75ff24df 100644 --- a/ide/defaults/manifest.mf +++ b/ide/defaults/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.defaults/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/defaults/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/defaults/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 AutoUpdate-Show-In-Client: false diff --git a/ide/derby/manifest.mf b/ide/derby/manifest.mf index af5a616d6a27..d56f1e299f25 100644 --- a/ide/derby/manifest.mf +++ b/ide/derby/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.derby OpenIDE-Module-Layer: org/netbeans/modules/derby/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/derby/Bundle.properties -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 AutoUpdate-Show-In-Client: false diff --git a/ide/diff/nbproject/project.properties b/ide/diff/nbproject/project.properties index 4ddf72612f5f..c94f05518e20 100644 --- a/ide/diff/nbproject/project.properties +++ b/ide/diff/nbproject/project.properties @@ -18,7 +18,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.76.0 +spec.version.base=1.77.0 javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml diff --git a/ide/dlight.nativeexecution.nb/manifest.mf b/ide/dlight.nativeexecution.nb/manifest.mf index 8ee3ef6c37f5..fcf4a7a5bf8d 100644 --- a/ide/dlight.nativeexecution.nb/manifest.mf +++ b/ide/dlight.nativeexecution.nb/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.dlight.nativeexecution.nb OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/nativeexecution/nb/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 OpenIDE-Module-Provides: org.netbeans.modules.nativeexecution.spi.NativeExecutionUIProvider diff --git a/ide/dlight.nativeexecution/nbproject/project.properties b/ide/dlight.nativeexecution/nbproject/project.properties index 690487ddd914..c381f95acba0 100644 --- a/ide/dlight.nativeexecution/nbproject/project.properties +++ b/ide/dlight.nativeexecution/nbproject/project.properties @@ -21,7 +21,7 @@ javadoc.arch=${basedir}/arch.xml project.license=apache20-asf nbm.executable.files=bin/nativeexecution/** jnlp.indirect.files=bin/nativeexecution/** -spec.version.base=1.64.0 +spec.version.base=1.65.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/dlight.terminal/nbproject/project.properties b/ide/dlight.terminal/nbproject/project.properties index adac389ac720..4bb67677e57f 100644 --- a/ide/dlight.terminal/nbproject/project.properties +++ b/ide/dlight.terminal/nbproject/project.properties @@ -16,4 +16,4 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.48.0 +spec.version.base=1.50.0 diff --git a/ide/dlight.terminal/src/org/netbeans/modules/dlight/terminal/action/TerminalSupportImpl.java b/ide/dlight.terminal/src/org/netbeans/modules/dlight/terminal/action/TerminalSupportImpl.java index 4a4bc0592019..8960b709983b 100644 --- a/ide/dlight.terminal/src/org/netbeans/modules/dlight/terminal/action/TerminalSupportImpl.java +++ b/ide/dlight.terminal/src/org/netbeans/modules/dlight/terminal/action/TerminalSupportImpl.java @@ -22,6 +22,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.IOException; +import java.lang.ref.WeakReference; import java.net.ConnectException; import java.text.ParseException; import java.util.concurrent.ExecutionException; @@ -52,16 +53,17 @@ import org.netbeans.modules.nativeexecution.api.util.HostInfoUtils; import org.netbeans.modules.nativeexecution.api.util.PathUtils; import org.netbeans.modules.terminal.api.IONotifier; +import org.netbeans.modules.terminal.api.ui.IOTerm; import org.netbeans.modules.terminal.api.ui.IOVisibility; import org.netbeans.modules.terminal.support.TerminalPinSupport; import org.netbeans.modules.terminal.support.TerminalPinSupport.TerminalCreationDetails; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; +import org.openide.util.BaseUtilities; import org.openide.util.Exceptions; import org.openide.util.ImageUtilities; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; -import org.openide.util.WeakListeners; import org.openide.windows.IOContainer; import org.openide.windows.IOProvider; import org.openide.windows.InputOutput; @@ -70,7 +72,6 @@ import org.openide.windows.OutputWriter; import static org.netbeans.lib.terminalemulator.Term.ExternalCommandsConstants.*; -import org.netbeans.modules.terminal.api.ui.IOTerm; /** * @@ -122,7 +123,7 @@ public static void openTerminalImpl( final long termId) { final IOProvider ioProvider = IOProvider.get("Terminal"); // NOI18N if (ioProvider != null) { - final AtomicReference ioRef = new AtomicReference(); + final AtomicReference ioRef = new AtomicReference<>(); // Create a tab in EDT right after we call the method, don't let this // work to be done in RP in asynchronous manner. We need this to // save tab order @@ -131,17 +132,15 @@ public static void openTerminalImpl( final AtomicBoolean destroyed = new AtomicBoolean(false); final Runnable runnable = new Runnable() { - private final Runnable delegate = new Runnable() { - @Override - public void run() { - if (SwingUtilities.isEventDispatchThread()) { - ioContainer.requestActive(); - } else { - doWork(); - } + private final Runnable delegate = () -> { + if (SwingUtilities.isEventDispatchThread()) { + ioContainer.requestActive(); + } else { + doWork(); } }; + @SuppressWarnings("PackageVisibleField") RequestProcessor.Task task = RP.create(delegate); private final HyperlinkAdapter retryLink = new HyperlinkAdapter() { @@ -177,7 +176,8 @@ private void doWork() { } catch (IOException ignored) { } } - String error = ex.getCause() == null ? ex.getMessage() : ex.getCause().getMessage(); + Throwable cause = ex.getCause(); + String error = cause == null ? ex.getMessage() : cause.getMessage(); String msg = NbBundle.getMessage(TerminalSupportImpl.class, "TerminalAction.FailedToStart.text", error); // NOI18N DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(msg, NotifyDescriptor.ERROR_MESSAGE)); } @@ -217,9 +217,7 @@ private void doWork() { return; } } - } catch (ConnectException ex) { - Exceptions.printStackTrace(ex); - } catch (InterruptedException ex) { + } catch (ConnectException | InterruptedException ex) { Exceptions.printStackTrace(ex); } @@ -240,10 +238,7 @@ private void doWork() { } return; } - } catch (IOException ex) { - Exceptions.printStackTrace(ex); - return; - } catch (CancellationException ex) { + } catch (IOException | CancellationException ex) { Exceptions.printStackTrace(ex); return; } @@ -331,13 +326,9 @@ private void doWork() { NativeExecutionDescriptor descr; descr = new NativeExecutionDescriptor().controllable(true).frontWindow(true).inputVisible(true).inputOutput(ioRef.get()); - descr.postExecution(new Runnable() { - - @Override - public void run() { - ioRef.get().closeInputOutput(); - support.close(term); - } + descr.postExecution(() -> { + ioRef.get().closeInputOutput(); + support.close(term); }); NativeExecutionService es = NativeExecutionService.newService(npb, descr, "Terminal Emulator"); // NOI18N Future result = es.run(); @@ -362,7 +353,8 @@ public void run() { Exceptions.printStackTrace(ex); } catch (ExecutionException ex) { if (!destroyed.get()) { - String error = ex.getCause() == null ? ex.getMessage() : ex.getCause().getMessage(); + Throwable cause = ex.getCause(); + String error = cause == null ? ex.getMessage() : cause.getMessage(); String msg = NbBundle.getMessage(TerminalSupportImpl.class, "TerminalAction.FailedToStart.text", error); // NOI18N DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(msg, NotifyDescriptor.ERROR_MESSAGE)); } @@ -391,8 +383,8 @@ private static final class NativeProcessListener implements ChangeListener, Prop public NativeProcessListener(InputOutput io, AtomicBoolean destroyed) { assert destroyed != null; this.destroyed = destroyed; - this.processRef = new AtomicReference(); - IONotifier.addPropertyChangeListener(io, WeakListeners.propertyChange(NativeProcessListener.this, io)); + this.processRef = new AtomicReference<>(); + IONotifier.addPropertyChangeListener(io, new WeakPropertyChangeListener(NativeProcessListener.this, io)); } @Override @@ -410,14 +402,10 @@ public void propertyChange(PropertyChangeEvent evt) { // term is closing => destroy process final NativeProcess proc = processRef.get(); if (proc != null) { - RP.submit(new Runnable() { - - @Override - public void run() { - try { - proc.destroy(); - } catch (Throwable th) { - } + RP.submit(() -> { + try { + proc.destroy(); + } catch (Throwable th) { } }); } @@ -440,4 +428,38 @@ public void outputLineAction(OutputEvent ev) { public void outputLineCleared(OutputEvent ev) { } } + + private static class WeakPropertyChangeListener extends WeakReference implements PropertyChangeListener, Runnable { + + private final WeakReference ioRef; + + @SuppressWarnings("LeakingThisInConstructor") + public WeakPropertyChangeListener(PropertyChangeListener delegate, InputOutput io) { + super(delegate, BaseUtilities.activeReferenceQueue()); + this.ioRef = new WeakReference<>(io); + } + + @Override + public void propertyChange(PropertyChangeEvent pce) { + PropertyChangeListener target = get(); + if(target != null) { + target.propertyChange(pce); + } else { + unregisterPropertyChangeListener(); + } + } + + @Override + public void run() { + unregisterPropertyChangeListener(); + } + + private void unregisterPropertyChangeListener() { + InputOutput io = ioRef.get(); + if(io != null) { + IONotifier.removePropertyChangeListener(io, this); + } + } + } + } diff --git a/ide/docker.api/manifest.mf b/ide/docker.api/manifest.mf index 668a218a453c..2bf98afa3ff9 100644 --- a/ide/docker.api/manifest.mf +++ b/ide/docker.api/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.docker.api/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/docker/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.45 +OpenIDE-Module-Specification-Version: 1.46 AutoUpdate-Show-In-Client: false diff --git a/ide/docker.api/src/org/netbeans/modules/docker/api/DockerAction.java b/ide/docker.api/src/org/netbeans/modules/docker/api/DockerAction.java index 38f3dac88ba9..b5b7681b15e1 100644 --- a/ide/docker.api/src/org/netbeans/modules/docker/api/DockerAction.java +++ b/ide/docker.api/src/org/netbeans/modules/docker/api/DockerAction.java @@ -148,9 +148,9 @@ public List getImages() { JSONObject json = (JSONObject) o; JSONArray repoTags = (JSONArray) json.get("RepoTags"); String id = (String) json.get("Id"); - long created = (long) json.get("Created"); - long size = (long) json.get("Size"); - long virtualSize = (long) json.get("VirtualSize"); + long created = (long) json.getOrDefault("Created", 0L); + long size = (long) json.getOrDefault("Size", 0L); + long virtualSize = (long) json.getOrDefault("VirtualSize", size); ret.add(new DockerImage(instance, repoTags, id, created, size, virtualSize)); } return ret; diff --git a/ide/docker.api/src/org/netbeans/modules/docker/api/DockerImage.java b/ide/docker.api/src/org/netbeans/modules/docker/api/DockerImage.java index 035eb01613f9..205d2124f6a6 100644 --- a/ide/docker.api/src/org/netbeans/modules/docker/api/DockerImage.java +++ b/ide/docker.api/src/org/netbeans/modules/docker/api/DockerImage.java @@ -88,6 +88,11 @@ public long getSize() { return size; } + /** + * @deprecated Removed from Docker Engine in v1.44. Return size value. + * @return + */ + @Deprecated public long getVirtualSize() { return virtualSize; } diff --git a/ide/docker.editor/manifest.mf b/ide/docker.editor/manifest.mf index cdf0ff157cb1..757f3c2a38ff 100644 --- a/ide/docker.editor/manifest.mf +++ b/ide/docker.editor/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.docker.editor/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/docker/editor/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/docker/editor/layer.xml -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/ide/docker.ui/manifest.mf b/ide/docker.ui/manifest.mf index db5538ac2bec..bab7f8c4c0ca 100644 --- a/ide/docker.ui/manifest.mf +++ b/ide/docker.ui/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.docker.ui/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/docker/ui/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 AutoUpdate-Show-In-Client: true diff --git a/ide/editor.actions/nbproject/project.properties b/ide/editor.actions/nbproject/project.properties index 7caf89d2d828..46e2f6f34df7 100644 --- a/ide/editor.actions/nbproject/project.properties +++ b/ide/editor.actions/nbproject/project.properties @@ -18,7 +18,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.title=Editor Actions -spec.version.base=1.56.0 +spec.version.base=1.57.0 #javadoc.arch=${basedir}/arch.xml #javadoc.apichanges=${basedir}/apichanges.xml diff --git a/ide/editor.autosave/manifest.mf b/ide/editor.autosave/manifest.mf index e1a78dc6e13f..a4de8ac08437 100644 --- a/ide/editor.autosave/manifest.mf +++ b/ide/editor.autosave/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.autosave/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/autosave/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.editor.autosave -OpenIDE-Module-Specification-Version: 1.16 +OpenIDE-Module-Specification-Version: 1.17 AutoUpdate-Show-In-Client: false diff --git a/ide/editor.bookmarks/manifest.mf b/ide/editor.bookmarks/manifest.mf index 95942235ca42..80ed5e9afef6 100644 --- a/ide/editor.bookmarks/manifest.mf +++ b/ide/editor.bookmarks/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.bookmarks/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/bookmarks/Bundle.properties -OpenIDE-Module-Specification-Version: 1.62 +OpenIDE-Module-Specification-Version: 1.63 OpenIDE-Module-Layer: org/netbeans/modules/editor/bookmarks/resources/layer.xml OpenIDE-Module-Install: org/netbeans/modules/editor/bookmarks/EditorBookmarksModule.class AutoUpdate-Show-In-Client: false diff --git a/ide/editor.bracesmatching/nbproject/project.properties b/ide/editor.bracesmatching/nbproject/project.properties index a4bd54572bef..1f947e22aeba 100644 --- a/ide/editor.bracesmatching/nbproject/project.properties +++ b/ide/editor.bracesmatching/nbproject/project.properties @@ -19,7 +19,7 @@ javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.64.0 +spec.version.base=1.65.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ **/MasterMatcherTest.class diff --git a/ide/editor.breadcrumbs/manifest.mf b/ide/editor.breadcrumbs/manifest.mf index 54de7eb29c22..1ecc132a6c0b 100644 --- a/ide/editor.breadcrumbs/manifest.mf +++ b/ide/editor.breadcrumbs/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.breadcrumbs/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/breadcrumbs/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 diff --git a/ide/editor.codetemplates/nbproject/project.properties b/ide/editor.codetemplates/nbproject/project.properties index 4ab7ae9949ab..5ff5f861eb80 100644 --- a/ide/editor.codetemplates/nbproject/project.properties +++ b/ide/editor.codetemplates/nbproject/project.properties @@ -20,6 +20,6 @@ javac.source=1.8 #javadoc.name=EditorCodeTemplates javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml -spec.version.base=1.69.0 +spec.version.base=1.70.0 test.config.stableBTD.includes=**/*Test.class diff --git a/ide/editor.completion/nbproject/project.properties b/ide/editor.completion/nbproject/project.properties index 9752d20101da..ab68f77fa430 100644 --- a/ide/editor.completion/nbproject/project.properties +++ b/ide/editor.completion/nbproject/project.properties @@ -19,4 +19,4 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.70.0 +spec.version.base=1.71.0 diff --git a/ide/editor.deprecated.pre65formatting/nbproject/project.properties b/ide/editor.deprecated.pre65formatting/nbproject/project.properties index a775480bb5d9..55154abad61d 100644 --- a/ide/editor.deprecated.pre65formatting/nbproject/project.properties +++ b/ide/editor.deprecated.pre65formatting/nbproject/project.properties @@ -17,4 +17,4 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.56.0 +spec.version.base=1.57.0 diff --git a/ide/editor.document/nbproject/project.properties b/ide/editor.document/nbproject/project.properties index 283fd5bfeed1..20b7b0d12d9d 100644 --- a/ide/editor.document/nbproject/project.properties +++ b/ide/editor.document/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.34.0 +spec.version.base=1.35.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml is.autoload=true diff --git a/ide/editor.errorstripe.api/nbproject/project.properties b/ide/editor.errorstripe.api/nbproject/project.properties index 914b0f4ff30d..dbec4dda7d18 100644 --- a/ide/editor.errorstripe.api/nbproject/project.properties +++ b/ide/editor.errorstripe.api/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=2.57.0 +spec.version.base=2.58.0 is.autoload=true javadoc.arch=${basedir}/arch.xml diff --git a/ide/editor.errorstripe/nbproject/project.properties b/ide/editor.errorstripe/nbproject/project.properties index a642416a314d..834150236388 100644 --- a/ide/editor.errorstripe/nbproject/project.properties +++ b/ide/editor.errorstripe/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=2.59.0 +spec.version.base=2.60.0 nbm.needs.restart=true test.config.stableBTD.includes=**/*Test.class diff --git a/ide/editor.fold.nbui/nbproject/project.properties b/ide/editor.fold.nbui/nbproject/project.properties index fde50f35af8b..cbfd5a5ed7be 100644 --- a/ide/editor.fold.nbui/nbproject/project.properties +++ b/ide/editor.fold.nbui/nbproject/project.properties @@ -18,4 +18,4 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial javadoc.arch=${basedir}/arch.xml -spec.version.base=1.37.0 +spec.version.base=1.38.0 diff --git a/ide/editor.fold/manifest.mf b/ide/editor.fold/manifest.mf index ebd948c5b44a..e07e1892859e 100644 --- a/ide/editor.fold/manifest.mf +++ b/ide/editor.fold/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.fold/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/fold/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.70 +OpenIDE-Module-Specification-Version: 1.71 diff --git a/ide/editor.global.format/nbproject/project.properties b/ide/editor.global.format/nbproject/project.properties index a9324231f866..823c8e05c862 100644 --- a/ide/editor.global.format/nbproject/project.properties +++ b/ide/editor.global.format/nbproject/project.properties @@ -17,4 +17,4 @@ is.eager=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.40.0 +spec.version.base=1.41.0 diff --git a/ide/editor.guards/manifest.mf b/ide/editor.guards/manifest.mf index cc0db967b6a6..79b715154a3c 100644 --- a/ide/editor.guards/manifest.mf +++ b/ide/editor.guards/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.guards/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/guards/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 diff --git a/ide/editor.indent.project/manifest.mf b/ide/editor.indent.project/manifest.mf index 6177609b408b..192919fa3aea 100644 --- a/ide/editor.indent.project/manifest.mf +++ b/ide/editor.indent.project/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.indent.project/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/indent/project/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.editor.indent.spi.CodeStylePreferences.Provider -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/ide/editor.indent.support/manifest.mf b/ide/editor.indent.support/manifest.mf index 170de5999f9c..9a35a7374e1a 100644 --- a/ide/editor.indent.support/manifest.mf +++ b/ide/editor.indent.support/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.editor.indent.support OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/indent/support/Bundle.properties -OpenIDE-Module-Specification-Version: 1.67 +OpenIDE-Module-Specification-Version: 1.68 diff --git a/ide/editor.indent/manifest.mf b/ide/editor.indent/manifest.mf index 921aaa7d1a7a..6bdf080a76b5 100644 --- a/ide/editor.indent/manifest.mf +++ b/ide/editor.indent/manifest.mf @@ -5,4 +5,4 @@ OpenIDE-Module-Layer: org/netbeans/modules/editor/indent/resources/layer.xml AutoUpdate-Show-In-Client: false OpenIDE-Module-Recommends: org.netbeans.modules.editor.indent.spi.CodeStylePreferences.Provider OpenIDE-Module-Provides: org.netbeans.templates.IndentEngine -OpenIDE-Module-Specification-Version: 1.68 +OpenIDE-Module-Specification-Version: 1.69 diff --git a/ide/editor.kit/manifest.mf b/ide/editor.kit/manifest.mf index 8dc841bde87f..3b27226c4cf3 100644 --- a/ide/editor.kit/manifest.mf +++ b/ide/editor.kit/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.editor.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 diff --git a/ide/editor.lib/nbproject/project.properties b/ide/editor.lib/nbproject/project.properties index a1ec08b8b69d..7740ecd6e52d 100644 --- a/ide/editor.lib/nbproject/project.properties +++ b/ide/editor.lib/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=4.32.0 +spec.version.base=4.33.0 is.autoload=true javadoc.arch=${basedir}/arch.xml diff --git a/ide/editor.lib2/nbproject/project.properties b/ide/editor.lib2/nbproject/project.properties index 605841446b07..318db9a35abb 100644 --- a/ide/editor.lib2/nbproject/project.properties +++ b/ide/editor.lib2/nbproject/project.properties @@ -18,7 +18,7 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint:unchecked -spec.version.base=2.45.0 +spec.version.base=2.46.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml diff --git a/ide/editor.macros/nbproject/project.properties b/ide/editor.macros/nbproject/project.properties index 224f9972bea7..9e4d9c1475fc 100644 --- a/ide/editor.macros/nbproject/project.properties +++ b/ide/editor.macros/nbproject/project.properties @@ -16,6 +16,6 @@ # under the License. javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.56.0 +spec.version.base=1.57.0 test.config.stableBTD.includes=**/*Test.class diff --git a/ide/editor.plain.lib/manifest.mf b/ide/editor.plain.lib/manifest.mf index 787e90280183..116c63824baf 100644 --- a/ide/editor.plain.lib/manifest.mf +++ b/ide/editor.plain.lib/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.plain.lib/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/editor/plain/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 AutoUpdate-Show-In-Client: false diff --git a/ide/editor.plain/manifest.mf b/ide/editor.plain/manifest.mf index 95521b7826b3..9d73ac6e244a 100644 --- a/ide/editor.plain/manifest.mf +++ b/ide/editor.plain/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.plain/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/plain/Bundle.properties -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.61 OpenIDE-Module-Layer: org/netbeans/modules/editor/plain/resources/layer.xml AutoUpdate-Show-In-Client: false diff --git a/ide/editor.search/nbproject/project.properties b/ide/editor.search/nbproject/project.properties index 4bb67677e57f..3d0c94c55d83 100644 --- a/ide/editor.search/nbproject/project.properties +++ b/ide/editor.search/nbproject/project.properties @@ -16,4 +16,4 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.50.0 +spec.version.base=1.51.0 diff --git a/ide/editor.settings.lib/nbproject/project.properties b/ide/editor.settings.lib/nbproject/project.properties index 0e8643b6929a..ba5cff008c5d 100644 --- a/ide/editor.settings.lib/nbproject/project.properties +++ b/ide/editor.settings.lib/nbproject/project.properties @@ -16,4 +16,4 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.76.0 +spec.version.base=1.77.0 diff --git a/ide/editor.settings.storage/nbproject/project.properties b/ide/editor.settings.storage/nbproject/project.properties index 9f6fe4cdbd1c..1ecd8338109e 100644 --- a/ide/editor.settings.storage/nbproject/project.properties +++ b/ide/editor.settings.storage/nbproject/project.properties @@ -20,7 +20,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml -spec.version.base=1.77.0 +spec.version.base=1.78.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/editor.settings/manifest.mf b/ide/editor.settings/manifest.mf index 58252eaed8ac..1258600693ef 100644 --- a/ide/editor.settings/manifest.mf +++ b/ide/editor.settings/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.settings/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/settings/Bundle.properties -OpenIDE-Module-Specification-Version: 1.82 +OpenIDE-Module-Specification-Version: 1.83 OpenIDE-Module-Needs: org.netbeans.api.editor.settings.implementation diff --git a/ide/editor.structure/nbproject/project.properties b/ide/editor.structure/nbproject/project.properties index fb8169ee649c..08cdaebe610b 100644 --- a/ide/editor.structure/nbproject/project.properties +++ b/ide/editor.structure/nbproject/project.properties @@ -21,7 +21,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.72.0 +spec.version.base=1.73.0 javadoc.arch=${basedir}/arch.xml diff --git a/ide/editor.tools.storage/manifest.mf b/ide/editor.tools.storage/manifest.mf index 63b4e5c3a20c..d6ae4c1c2a89 100644 --- a/ide/editor.tools.storage/manifest.mf +++ b/ide/editor.tools.storage/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.editor.tools.storage OpenIDE-Module-Layer: org/netbeans/modules/editor/tools/storage/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/tools/storage/Bundle.properties -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.34 diff --git a/ide/editor.util/manifest.mf b/ide/editor.util/manifest.mf index b5e07fcc23e7..db484a349e84 100644 --- a/ide/editor.util/manifest.mf +++ b/ide/editor.util/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.util/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/editor/util/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.90 +OpenIDE-Module-Specification-Version: 1.91 diff --git a/ide/editor/nbproject/project.properties b/ide/editor/nbproject/project.properties index ab73cfcaabe8..18740a9a2756 100644 --- a/ide/editor/nbproject/project.properties +++ b/ide/editor/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.112.0 +spec.version.base=1.113.0 is.autoload=true javadoc.arch=${basedir}/arch.xml diff --git a/ide/extbrowser/manifest.mf b/ide/extbrowser/manifest.mf index 191e41f94916..ed0ada61ee4a 100644 --- a/ide/extbrowser/manifest.mf +++ b/ide/extbrowser/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.extbrowser/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extbrowser/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/extbrowser/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.78 +OpenIDE-Module-Specification-Version: 1.79 AutoUpdate-Show-In-Client: false diff --git a/ide/extexecution.base/manifest.mf b/ide/extexecution.base/manifest.mf index ba24b86e21b8..d453a5d40907 100644 --- a/ide/extexecution.base/manifest.mf +++ b/ide/extexecution.base/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.extexecution.base/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/base/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 OpenIDE-Module-Recommends: org.netbeans.spi.extexecution.base.ProcessesImplementation diff --git a/ide/extexecution.impl/manifest.mf b/ide/extexecution.impl/manifest.mf index dc6effb09a57..fcc4694c1ea5 100644 --- a/ide/extexecution.impl/manifest.mf +++ b/ide/extexecution.impl/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.extexecution.impl OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/impl/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 OpenIDE-Module-Provides: org.netbeans.spi.extexecution.open.OptionOpenHandler, org.netbeans.spi.extexecution.open.FileOpenHandler, org.netbeans.spi.extexecution.open.HttpOpenHandler diff --git a/ide/extexecution.process.jdk9/manifest.mf b/ide/extexecution.process.jdk9/manifest.mf index 3449a596d7cb..cab129ffdd62 100644 --- a/ide/extexecution.process.jdk9/manifest.mf +++ b/ide/extexecution.process.jdk9/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.extexecution.process.jdk9 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/process/jdk9/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 OpenIDE-Module-Java-Dependencies: Java > 9 OpenIDE-Module-Provides: org.netbeans.spi.extexecution.base.ProcessesImplementation diff --git a/ide/extexecution.process/manifest.mf b/ide/extexecution.process/manifest.mf index 56ac787916e4..b07be329ef36 100644 --- a/ide/extexecution.process/manifest.mf +++ b/ide/extexecution.process/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.extexecution.process OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/process/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 OpenIDE-Module-Provides: org.netbeans.spi.extexecution.base.ProcessesImplementation diff --git a/ide/extexecution/manifest.mf b/ide/extexecution/manifest.mf index 9a9175c03965..d09568f501ff 100644 --- a/ide/extexecution/manifest.mf +++ b/ide/extexecution/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.extexecution/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extexecution/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.74 +OpenIDE-Module-Specification-Version: 1.75 OpenIDE-Module-Recommends: org.netbeans.spi.extexecution.open.OptionOpenHandler, org.netbeans.spi.extexecution.open.FileOpenHandler, org.netbeans.spi.extexecution.open.HttpOpenHandler diff --git a/ide/git/nbproject/project.properties b/ide/git/nbproject/project.properties index d728a6bcd34d..9df54b91c688 100644 --- a/ide/git/nbproject/project.properties +++ b/ide/git/nbproject/project.properties @@ -22,7 +22,7 @@ nbm.needs.restart=true # #178009 # disable.qa-functional.tests=false -spec.version.base=1.48.0 +spec.version.base=1.49.0 test.config.stable.includes=**/*Test.class diff --git a/ide/go.lang/manifest.mf b/ide/go.lang/manifest.mf index f5535f15a3a8..0e7035a85551 100644 --- a/ide/go.lang/manifest.mf +++ b/ide/go.lang/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.go.lang OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/go/lang/Bundle.properties -OpenIDE-Module-Specification-Version: 1.6 +OpenIDE-Module-Specification-Version: 1.7 AutoUpdate-Show-In-Client: false diff --git a/ide/gototest/manifest.mf b/ide/gototest/manifest.mf index 03dd1f6987d3..4681a08ff92a 100644 --- a/ide/gototest/manifest.mf +++ b/ide/gototest/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.gototest/1 OpenIDE-Module-Layer: org/netbeans/modules/gototest/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gototest/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 diff --git a/ide/gsf.codecoverage/manifest.mf b/ide/gsf.codecoverage/manifest.mf index aed18db54386..0c327eb7897c 100644 --- a/ide/gsf.codecoverage/manifest.mf +++ b/ide/gsf.codecoverage/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.gsf.codecoverage OpenIDE-Module-Layer: org/netbeans/modules/gsf/codecoverage/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gsf/codecoverage/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 AutoUpdate-Show-In-Client: false diff --git a/ide/gsf.testrunner.ui/nbproject/project.properties b/ide/gsf.testrunner.ui/nbproject/project.properties index 5ad87ca2ab98..7035482ca611 100644 --- a/ide/gsf.testrunner.ui/nbproject/project.properties +++ b/ide/gsf.testrunner.ui/nbproject/project.properties @@ -18,4 +18,4 @@ is.eager=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.40.0 +spec.version.base=1.41.0 diff --git a/ide/gsf.testrunner/manifest.mf b/ide/gsf.testrunner/manifest.mf index 1805a2f6f422..24fbe0665ff6 100644 --- a/ide/gsf.testrunner/manifest.mf +++ b/ide/gsf.testrunner/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.gsf.testrunner/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gsf/testrunner/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/gsf/testrunner/layer.xml -OpenIDE-Module-Specification-Version: 2.37 +OpenIDE-Module-Specification-Version: 2.38 diff --git a/ide/html.custom/manifest.mf b/ide/html.custom/manifest.mf index 823b58f10648..95938ef106af 100644 --- a/ide/html.custom/manifest.mf +++ b/ide/html.custom/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.html.custom OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/custom/Bundle.properties -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 diff --git a/ide/html.editor.lib/manifest.mf b/ide/html.editor.lib/manifest.mf index de31e5a13e00..06dd5fd96c8a 100644 --- a/ide/html.editor.lib/manifest.mf +++ b/ide/html.editor.lib/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.html.editor.lib/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/editor/lib/Bundle.properties -OpenIDE-Module-Specification-Version: 3.57 +OpenIDE-Module-Specification-Version: 3.58 AutoUpdate-Show-In-Client: false diff --git a/ide/html.editor/manifest.mf b/ide/html.editor/manifest.mf index 0c67870dad14..0aec4013fd93 100644 --- a/ide/html.editor/manifest.mf +++ b/ide/html.editor/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.html.editor/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/editor/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/html/editor/resources/layer.xml -OpenIDE-Module-Specification-Version: 2.81 +OpenIDE-Module-Specification-Version: 2.82 AutoUpdate-Show-In-Client: false diff --git a/ide/html.indexing/manifest.mf b/ide/html.indexing/manifest.mf index 09c2b5d6de52..3651e84f6e2d 100644 --- a/ide/html.indexing/manifest.mf +++ b/ide/html.indexing/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.html.indexing OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/indexing/Bundle.properties -OpenIDE-Module-Specification-Version: 1.17 +OpenIDE-Module-Specification-Version: 1.18 diff --git a/ide/html.lexer/manifest.mf b/ide/html.lexer/manifest.mf index 803566ea7fa1..4a5297a1efc1 100644 --- a/ide/html.lexer/manifest.mf +++ b/ide/html.lexer/manifest.mf @@ -1,5 +1,5 @@ OpenIDE-Module: org.netbeans.modules.html.lexer/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/html/lexer/Bundle.properties -OpenIDE-Module-Specification-Version: 1.63 +OpenIDE-Module-Specification-Version: 1.64 OpenIDE-Module-Layer: org/netbeans/lib/html/lexer/layer.xml AutoUpdate-Show-In-Client: false diff --git a/ide/html.parser/nbproject/project.properties b/ide/html.parser/nbproject/project.properties index 3d7422b34848..eb66d48f298e 100644 --- a/ide/html.parser/nbproject/project.properties +++ b/ide/html.parser/nbproject/project.properties @@ -27,7 +27,7 @@ jnlp.indirect.jars=docs/html5doc.zip # Fatal error: class com.lowagie.text.DocumentException not found # Warning: class com.lowagie.text.DocumentException not found. Please, add required jar or directory to the classpath. sigtest.gen.fail.on.error=false -spec.version.base=1.59.0 +spec.version.base=1.60.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/html.validation/manifest.mf b/ide/html.validation/manifest.mf index ebf71061b1b1..8609a7df99bb 100644 --- a/ide/html.validation/manifest.mf +++ b/ide/html.validation/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.html.validation/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/validation/Bundle.properties -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 diff --git a/ide/html/manifest.mf b/ide/html/manifest.mf index c37a3f324928..31604550d547 100644 --- a/ide/html/manifest.mf +++ b/ide/html/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.html/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/html/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.86 +OpenIDE-Module-Specification-Version: 1.87 OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker AutoUpdate-Show-In-Client: false diff --git a/ide/httpserver/nbproject/project.properties b/ide/httpserver/nbproject/project.properties index 0e7db406da9f..534195b82f9c 100644 --- a/ide/httpserver/nbproject/project.properties +++ b/ide/httpserver/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=2.61.0 +spec.version.base=2.62.0 release.external/tomcat-embed-core-9.0.71.jar=modules/ext/webserver.jar release.external/tomcat-annotations-api-9.0.71.jar=modules/ext/webserver-annotations.jar test-unit-sys-prop.xtest.data=${nb_all}/ide/httpserver/test/unit/testfs diff --git a/ide/hudson.git/manifest.mf b/ide/hudson.git/manifest.mf index 60e77aa6cb33..ef2a990e2c66 100644 --- a/ide/hudson.git/manifest.mf +++ b/ide/hudson.git/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.hudson.git OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/hudson/git/Bundle.properties -OpenIDE-Module-Specification-Version: 1.43 +OpenIDE-Module-Specification-Version: 1.44 diff --git a/ide/hudson.mercurial/manifest.mf b/ide/hudson.mercurial/manifest.mf index c13f0e9a8f4d..d76d308e426d 100644 --- a/ide/hudson.mercurial/manifest.mf +++ b/ide/hudson.mercurial/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.hudson.mercurial OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/hudson/mercurial/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 diff --git a/ide/hudson.subversion/manifest.mf b/ide/hudson.subversion/manifest.mf index daf26e15819f..c58e3490a0d4 100644 --- a/ide/hudson.subversion/manifest.mf +++ b/ide/hudson.subversion/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.hudson.subversion OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/hudson/subversion/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 diff --git a/ide/hudson.tasklist/manifest.mf b/ide/hudson.tasklist/manifest.mf index 844e7526404c..6126bb2f0e62 100644 --- a/ide/hudson.tasklist/manifest.mf +++ b/ide/hudson.tasklist/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.hudson.tasklist OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/hudson/tasklist/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 diff --git a/ide/hudson.ui/manifest.mf b/ide/hudson.ui/manifest.mf index d42b9393fadb..f89def715f91 100644 --- a/ide/hudson.ui/manifest.mf +++ b/ide/hudson.ui/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.hudson.ui OpenIDE-Module-Layer: org/netbeans/modules/hudson/ui/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/hudson/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.36 +OpenIDE-Module-Specification-Version: 1.37 diff --git a/ide/hudson/manifest.mf b/ide/hudson/manifest.mf index 833a273df981..369f505c5a86 100644 --- a/ide/hudson/manifest.mf +++ b/ide/hudson/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.hudson OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/hudson/Bundle.properties -OpenIDE-Module-Specification-Version: 2.38 +OpenIDE-Module-Specification-Version: 2.39 diff --git a/ide/ide.kit/manifest.mf b/ide/ide.kit/manifest.mf index a36131fb459a..65fab963d4f7 100644 --- a/ide/ide.kit/manifest.mf +++ b/ide/ide.kit/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ide.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 OpenIDE-Module-Needs: org.netbeans.Netbinox diff --git a/ide/image/manifest.mf b/ide/image/manifest.mf index 62abee146535..dcffaa200886 100644 --- a/ide/image/manifest.mf +++ b/ide/image/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.image/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/image/Bundle.properties -OpenIDE-Module-Specification-Version: 1.73 +OpenIDE-Module-Specification-Version: 1.74 AutoUpdate-Show-In-Client: false diff --git a/ide/javascript2.debug.ui/manifest.mf b/ide/javascript2.debug.ui/manifest.mf index 7892f437534c..e9c69c2f53e8 100644 --- a/ide/javascript2.debug.ui/manifest.mf +++ b/ide/javascript2.debug.ui/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript2.debug.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/debug/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 AutoUpdate-Show-In-Client: false diff --git a/ide/javascript2.debug/manifest.mf b/ide/javascript2.debug/manifest.mf index d27f87531d6d..8a36935cc141 100644 --- a/ide/javascript2.debug/manifest.mf +++ b/ide/javascript2.debug/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript2.debug/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/debug/Bundle.properties Comment: OpenIDE-Module-Layer: org/netbeans/modules/javascript2/debug/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.43 +OpenIDE-Module-Specification-Version: 1.44 AutoUpdate-Show-In-Client: false diff --git a/ide/jellytools.ide/nbproject/project.properties b/ide/jellytools.ide/nbproject/project.properties index 116dc46c6318..211a1bf801fe 100644 --- a/ide/jellytools.ide/nbproject/project.properties +++ b/ide/jellytools.ide/nbproject/project.properties @@ -17,7 +17,7 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=3.58.0 +spec.version.base=3.59.0 test.config.stable.includes=\ **/IDEBundleKeysTest.class,\ diff --git a/ide/jumpto/nbproject/project.properties b/ide/jumpto/nbproject/project.properties index 490da4f9035d..1b3d3d5a931d 100644 --- a/ide/jumpto/nbproject/project.properties +++ b/ide/jumpto/nbproject/project.properties @@ -20,7 +20,7 @@ javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml nbm.module.author=Andrei Badea, Petr Hrebejk -spec.version.base=1.80.0 +spec.version.base=1.81.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/languages.diff/manifest.mf b/ide/languages.diff/manifest.mf index 5ef21523b799..aa9313f1e6d9 100644 --- a/ide/languages.diff/manifest.mf +++ b/ide/languages.diff/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.languages.diff OpenIDE-Module-Layer: org/netbeans/modules/languages/diff/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/diff/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 AutoUpdate-Show-In-Client: false diff --git a/ide/languages.go/manifest.mf b/ide/languages.go/manifest.mf index 14843ba4553c..b9c6eb69b5f5 100644 --- a/ide/languages.go/manifest.mf +++ b/ide/languages.go/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.languages.go OpenIDE-Module-Layer: org/netbeans/modules/languages/go/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/go/Bundle.properties -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 AutoUpdate-Show-In-Client: true diff --git a/ide/languages.hcl/manifest.mf b/ide/languages.hcl/manifest.mf index 44d55c2adad4..ee2bf9c7fbee 100644 --- a/ide/languages.hcl/manifest.mf +++ b/ide/languages.hcl/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.languages.hcl OpenIDE-Module-Layer: org/netbeans/modules/languages/hcl/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/hcl/Bundle.properties -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 AutoUpdate-Show-In-Client: true diff --git a/ide/languages.manifest/manifest.mf b/ide/languages.manifest/manifest.mf index fd29c7e9349e..09205ed35e35 100644 --- a/ide/languages.manifest/manifest.mf +++ b/ide/languages.manifest/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.languages.manifest OpenIDE-Module-Layer: org/netbeans/modules/languages/manifest/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/manifest/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 AutoUpdate-Show-In-Client: false diff --git a/ide/languages.toml/manifest.mf b/ide/languages.toml/manifest.mf index 76581f67ca9e..2da78366cc62 100644 --- a/ide/languages.toml/manifest.mf +++ b/ide/languages.toml/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.languages.toml OpenIDE-Module-Layer: org/netbeans/modules/languages/toml/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/toml/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 AutoUpdate-Show-In-Client: true diff --git a/ide/languages.yaml/manifest.mf b/ide/languages.yaml/manifest.mf index 539e436284ee..1a67fec0f0b2 100644 --- a/ide/languages.yaml/manifest.mf +++ b/ide/languages.yaml/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.languages.yaml OpenIDE-Module-Layer: org/netbeans/modules/languages/yaml/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/yaml/Bundle.properties -OpenIDE-Module-Specification-Version: 2.57 +OpenIDE-Module-Specification-Version: 2.58 AutoUpdate-Show-In-Client: true diff --git a/ide/languages.yaml/nbproject/project.properties b/ide/languages.yaml/nbproject/project.properties index a3b66e2705aa..573c106751a0 100644 --- a/ide/languages.yaml/nbproject/project.properties +++ b/ide/languages.yaml/nbproject/project.properties @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -javac.source=1.8 +javac.release=17 test-unit-sys-prop.xtest.jruby.home=${netbeans.dest.dir}/ruby/jruby-1.3.1 test-unit-sys-prop.xtest.platform_info.rb=${netbeans.dest.dir}/ruby/platform_info.rb diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmbeddedSectionsHighlighting.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmbeddedSectionsHighlighting.java index 518201974a69..b01e5e91a44d 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmbeddedSectionsHighlighting.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmbeddedSectionsHighlighting.java @@ -26,6 +26,7 @@ import javax.swing.text.BadLocationException; import javax.swing.text.Document; import javax.swing.text.StyleConstants; +import org.netbeans.api.editor.document.LineDocumentUtils; import org.netbeans.api.editor.mimelookup.MimeLookup; import org.netbeans.api.editor.mimelookup.MimeRegistration; import org.netbeans.api.editor.settings.AttributesUtilities; @@ -35,7 +36,6 @@ import org.netbeans.api.lexer.TokenHierarchyListener; import org.netbeans.api.lexer.TokenSequence; import org.netbeans.editor.BaseDocument; -import org.netbeans.editor.Utilities; import org.netbeans.lib.editor.util.swing.DocumentUtilities; import static org.netbeans.modules.languages.yaml.YamlLanguage.MIME_TYPE; import org.netbeans.spi.editor.highlighting.HighlightsLayer; @@ -171,13 +171,13 @@ public boolean moveNext() { try { int docLen = document.getLength(); - int startLine = Utilities.getLineOffset((BaseDocument) document, Math.min(sectionStart, docLen)); - int endLine = Utilities.getLineOffset((BaseDocument) document, Math.min(sectionEnd, docLen)); + int startLine = LineDocumentUtils.getLineIndex((BaseDocument) document, Math.min(sectionStart, docLen)); + int endLine = LineDocumentUtils.getLineIndex((BaseDocument) document, Math.min(sectionEnd, docLen)); if (startLine != endLine) { // multiline scriplet section // adjust the sections start to the beginning of the firts line - int firstLineStartOffset = Utilities.getRowStartFromLineOffset((BaseDocument) document, startLine); + int firstLineStartOffset = LineDocumentUtils.getLineStart((BaseDocument)document, startLine); if (firstLineStartOffset < sectionStart - delimiterSize && isWhitespace(document, firstLineStartOffset, sectionStart - delimiterSize)) // always preceeded by the delimiter { @@ -185,10 +185,10 @@ && isWhitespace(document, firstLineStartOffset, sectionStart - delimiterSize)) / } // adjust the sections end to the end of the last line - int lines = Utilities.getRowCount((BaseDocument) document); + int lines = LineDocumentUtils.getLineCount((BaseDocument) document); int lastLineEndOffset; if (endLine + 1 < lines) { - lastLineEndOffset = Utilities.getRowStartFromLineOffset((BaseDocument) document, endLine + 1); + lastLineEndOffset = LineDocumentUtils.getLineStartFromIndex((BaseDocument) document, endLine + 1); } else { lastLineEndOffset = document.getLength() + 1; } diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/IndentUtils.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/IndentUtils.java deleted file mode 100644 index 27c5bb2a83e4..000000000000 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/IndentUtils.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.languages.yaml; - -import java.util.prefs.Preferences; -import javax.swing.text.Document; -import org.netbeans.api.editor.settings.SimpleValueNames; -import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; - -/** - * - * @author Ondrej Brejla - */ -public class IndentUtils { - - private IndentUtils() { - } - - public static int getIndentSize(Document doc) { - Preferences prefs = CodeStylePreferences.get(doc).getPreferences(); - return prefs.getInt(SimpleValueNames.SPACES_PER_TAB, 2); - } - - private static void indent(final StringBuilder sb, final int indent) { - for (int i = 0; i < indent; i++) { - sb.append(' '); - } - } - - public static String getIndentString(final int indent) { - StringBuilder sb = new StringBuilder(indent); - indent(sb, indent); - return sb.toString(); - } - -} diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/InsertTabAction.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/InsertTabAction.java index e2272ff9b445..2e84ffb38f5a 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/InsertTabAction.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/InsertTabAction.java @@ -19,18 +19,21 @@ package org.netbeans.modules.languages.yaml; import java.awt.event.ActionEvent; -import java.util.LinkedList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Action; import javax.swing.text.BadLocationException; import javax.swing.text.Caret; +import javax.swing.text.Document; import javax.swing.text.JTextComponent; +import org.netbeans.api.editor.document.LineDocumentUtils; +import org.netbeans.api.editor.settings.SimpleValueNames; import org.netbeans.editor.BaseAction; import org.netbeans.editor.BaseDocument; import org.netbeans.editor.BaseKit; import org.netbeans.editor.Utilities; +import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; /** * @@ -38,11 +41,7 @@ */ public class InsertTabAction extends BaseAction { - private static final List CUSTOM_ACTIONS = new LinkedList(); - - static { - CUSTOM_ACTIONS.add(new InsertTabAction()); - } + private static final List CUSTOM_ACTIONS = List.of(new InsertTabAction()); public InsertTabAction() { super(BaseKit.insertTabAction); @@ -91,11 +90,11 @@ private void tryReplaceTab() throws BadLocationException { } private void replaceTab() throws BadLocationException { - final int rowStart = Utilities.getRowStart(baseDocument, caretOffset); + final int rowStart = LineDocumentUtils.getLineStart(baseDocument, caretOffset); assert caretOffset >= rowStart : "Caret: " + caretOffset + " rowStart: " + rowStart; final String indentString = baseDocument.getText(rowStart, caretOffset - rowStart); if (indentString.contains(TAB_CHARACTER)) { - final String newIndentString = indentString.replace(TAB_CHARACTER, IndentUtils.getIndentString(IndentUtils.getIndentSize(baseDocument))); + final String newIndentString = indentString.replace(TAB_CHARACTER, " ".repeat(getSpacesPerTab(baseDocument))); baseDocument.replace(rowStart, caretOffset - rowStart, newIndentString, null); } } @@ -106,6 +105,11 @@ private static boolean shouldBeReplaced(final int firstNonWhiteCharOffset, final } + private static int getSpacesPerTab(Document doc) { + return CodeStylePreferences.get(doc).getPreferences() + .getInt(SimpleValueNames.SPACES_PER_TAB, 2); + } + public static List createCustomActions() { return CUSTOM_ACTIONS; } diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlKeystrokeHandler.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlKeystrokeHandler.java index a6c1e8f28811..4005df2c73fd 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlKeystrokeHandler.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlKeystrokeHandler.java @@ -26,6 +26,7 @@ import javax.swing.text.Document; import javax.swing.text.JTextComponent; import org.netbeans.api.editor.document.LineDocumentUtils; +import org.netbeans.api.editor.settings.SimpleValueNames; import org.netbeans.api.lexer.Token; import org.netbeans.api.lexer.TokenHierarchy; import org.netbeans.api.lexer.TokenSequence; @@ -37,6 +38,7 @@ import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.csl.api.StructureItem; import org.netbeans.modules.csl.spi.ParserResult; +import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; import org.openide.util.Exceptions; /** @@ -226,7 +228,6 @@ public boolean afterCharInserted(Document doc, int caretOffset, JTextComponent t @Override public boolean charBackspaced(Document doc, int dotPos, JTextComponent target, char ch) throws BadLocationException { - Caret caret = target.getCaret(); if (ch == '%' && dotPos > 0 && dotPos <= doc.getLength() - 2) { String s = doc.getText(dotPos - 1, 3); if ("<%>".equals(s)) { // NOI18N @@ -289,9 +290,9 @@ public int beforeBreak(Document document, int offset, JTextComponent target) thr int indent = getLineIndent(doc, offset); String linePrefix = doc.getText(lineBegin, offset - lineBegin); String lineSuffix = doc.getText(offset, lineEnd + 1 - offset); - if (linePrefix.trim().endsWith(":") && lineSuffix.trim().length() == 0) { + if (linePrefix.stripTrailing().endsWith(":") && lineSuffix.isBlank()) { // Yes, new key: increase indent - indent += IndentUtils.getIndentSize(doc); + indent += getIndentSize(doc); } else { // No, just use same indent as parent } @@ -310,7 +311,7 @@ public int beforeBreak(Document document, int offset, JTextComponent target) thr if (remove > 0) { doc.remove(offset, remove); } - String str = IndentUtils.getIndentString(indent); + String str = " ".repeat(indent); int newPos = offset + str.length(); doc.insertString(offset, str, null); caret.setDot(offset); @@ -386,4 +387,9 @@ public static int getLineIndent(BaseDocument doc, int offset) { } } + private static int getIndentSize(Document doc) { + return CodeStylePreferences.get(doc).getPreferences() + .getInt(SimpleValueNames.INDENT_SHIFT_WIDTH, 2); + } + } diff --git a/ide/languages/nbproject/project.properties b/ide/languages/nbproject/project.properties index e0104faf7029..de7552ebfd03 100644 --- a/ide/languages/nbproject/project.properties +++ b/ide/languages/nbproject/project.properties @@ -19,7 +19,7 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.146.0 +spec.version.base=1.147.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=org/netbeans/test/**/* diff --git a/ide/lexer.antlr4/nbproject/project.properties b/ide/lexer.antlr4/nbproject/project.properties index 3f5838bb0ba7..4520dbc18b3f 100644 --- a/ide/lexer.antlr4/nbproject/project.properties +++ b/ide/lexer.antlr4/nbproject/project.properties @@ -20,5 +20,5 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.7.0 +spec.version.base=1.8.0 diff --git a/ide/lexer.nbbridge/nbproject/project.properties b/ide/lexer.nbbridge/nbproject/project.properties index 3dc3206c392c..f0155e407909 100644 --- a/ide/lexer.nbbridge/nbproject/project.properties +++ b/ide/lexer.nbbridge/nbproject/project.properties @@ -18,4 +18,4 @@ is.eager=true javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.57.0 +spec.version.base=1.58.0 diff --git a/ide/lexer/nbproject/project.properties b/ide/lexer/nbproject/project.properties index 5897dba7ddfb..9a439f8ed1cc 100644 --- a/ide/lexer/nbproject/project.properties +++ b/ide/lexer/nbproject/project.properties @@ -20,7 +20,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.88.0 +spec.version.base=1.89.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/lib.terminalemulator/manifest.mf b/ide/lib.terminalemulator/manifest.mf index 35ff43d6ab7f..007edfb33c57 100644 --- a/ide/lib.terminalemulator/manifest.mf +++ b/ide/lib.terminalemulator/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.lib.terminalemulator OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/terminalemulator/Bundle.properties -OpenIDE-Module-Specification-Version: 1.62 +OpenIDE-Module-Specification-Version: 1.63 diff --git a/ide/libs.antlr3.runtime/nbproject/project.properties b/ide/libs.antlr3.runtime/nbproject/project.properties index 4bba2f5c2c6e..40405d840021 100644 --- a/ide/libs.antlr3.runtime/nbproject/project.properties +++ b/ide/libs.antlr3.runtime/nbproject/project.properties @@ -23,4 +23,4 @@ release.external/antlr-runtime-3.5.3.jar=modules/ext/antlr-runtime-3.5.3.jar license.file=../external/antlr-3.5.3-license.txt nbm.homepage=http://www.antlr.org/ sigtest.gen.fail.on.error=false -spec.version.base=1.46.0 +spec.version.base=1.47.0 diff --git a/ide/libs.antlr4.runtime/nbproject/project.properties b/ide/libs.antlr4.runtime/nbproject/project.properties index 26b9e83db757..34109af414ab 100644 --- a/ide/libs.antlr4.runtime/nbproject/project.properties +++ b/ide/libs.antlr4.runtime/nbproject/project.properties @@ -24,4 +24,4 @@ release.external/antlr4-runtime-4.13.1.jar=modules/ext/antlr4-runtime-4.13.1.jar license.file=../external/antlr4-runtime-4.13.1-license.txt nbm.homepage=https://www.antlr.org/ sigtest.gen.fail.on.error=false -spec.version.base=1.26.0 +spec.version.base=1.27.0 diff --git a/ide/libs.c.kohlschutter.junixsocket/manifest.mf b/ide/libs.c.kohlschutter.junixsocket/manifest.mf index 1ddb41606725..bc7c168b47eb 100644 --- a/ide/libs.c.kohlschutter.junixsocket/manifest.mf +++ b/ide/libs.c.kohlschutter.junixsocket/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: libs.c.kohlschutter.junixsocket/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/c/kohlschutter/junixsocket/Bundle.properties -OpenIDE-Module-Specification-Version: 3.7 +OpenIDE-Module-Specification-Version: 3.8 diff --git a/ide/libs.commons_compress/external/binaries-list b/ide/libs.commons_compress/external/binaries-list index 6cdaeaf340c8..9653d3168f42 100644 --- a/ide/libs.commons_compress/external/binaries-list +++ b/ide/libs.commons_compress/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -44331C1130C370E726A2E1A3E6FBA6D2558EF04A org.apache.commons:commons-compress:1.26.1 +EB1F823447AF685208E684FCE84783B43517960C org.apache.commons:commons-compress:1.26.2 diff --git a/ide/libs.commons_compress/external/commons-compress-1.26.1-license.txt b/ide/libs.commons_compress/external/commons-compress-1.26.2-license.txt similarity index 99% rename from ide/libs.commons_compress/external/commons-compress-1.26.1-license.txt rename to ide/libs.commons_compress/external/commons-compress-1.26.2-license.txt index 7bd2796ce6fc..27a7b1be300f 100644 --- a/ide/libs.commons_compress/external/commons-compress-1.26.1-license.txt +++ b/ide/libs.commons_compress/external/commons-compress-1.26.2-license.txt @@ -1,5 +1,5 @@ Name: Commons Compress -Version: 1.26.1 +Version: 1.26.2 Description: The Apache Commons Compress library defines an API for working with ar, cpio, Unix dump, tar, zip, gzip, XZ, Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4, Brotli, Zstandard, DEFLATE64 and Z files. Origin: https://commons.apache.org/proper/commons-compress/index.html License: Apache-2.0 diff --git a/ide/libs.commons_compress/external/commons-compress-1.26.1-notice.txt b/ide/libs.commons_compress/external/commons-compress-1.26.2-notice.txt similarity index 100% rename from ide/libs.commons_compress/external/commons-compress-1.26.1-notice.txt rename to ide/libs.commons_compress/external/commons-compress-1.26.2-notice.txt diff --git a/ide/libs.commons_compress/nbproject/project.properties b/ide/libs.commons_compress/nbproject/project.properties index f57758c714df..43881fd5eb25 100644 --- a/ide/libs.commons_compress/nbproject/project.properties +++ b/ide/libs.commons_compress/nbproject/project.properties @@ -18,5 +18,5 @@ is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -release.external/commons-compress-1.26.1.jar=modules/ext/commons-compress-1.26.1.jar -spec.version.base=0.31.0 +release.external/commons-compress-1.26.2.jar=modules/ext/commons-compress-1.26.2.jar +spec.version.base=0.32.0 diff --git a/ide/libs.commons_compress/nbproject/project.xml b/ide/libs.commons_compress/nbproject/project.xml index 578d351b36d8..ebe01df2bf98 100644 --- a/ide/libs.commons_compress/nbproject/project.xml +++ b/ide/libs.commons_compress/nbproject/project.xml @@ -45,8 +45,8 @@ org.apache.commons.compress.utils - ext/commons-compress-1.26.1.jar - external/commons-compress-1.26.1.jar + ext/commons-compress-1.26.2.jar + external/commons-compress-1.26.2.jar diff --git a/ide/libs.commons_compress/src/org/netbeans/libs/commons_compress/mf-layer.xml b/ide/libs.commons_compress/src/org/netbeans/libs/commons_compress/mf-layer.xml index a38cfb4d61d9..04a31a871cbb 100644 --- a/ide/libs.commons_compress/src/org/netbeans/libs/commons_compress/mf-layer.xml +++ b/ide/libs.commons_compress/src/org/netbeans/libs/commons_compress/mf-layer.xml @@ -27,7 +27,7 @@ - + diff --git a/ide/libs.commons_net/external/binaries-list b/ide/libs.commons_net/external/binaries-list index ea0bcdc17354..4c49eef9f17d 100644 --- a/ide/libs.commons_net/external/binaries-list +++ b/ide/libs.commons_net/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -86762EA0AC98FD41C91745A32D496A985E2BD5E7 commons-net:commons-net:3.10.0 +F0689B01D2E3EF4B316BCC87360849A22F05D06D commons-net:commons-net:3.11.1 diff --git a/ide/libs.commons_net/external/commons-net-3.10.0-license.txt b/ide/libs.commons_net/external/commons-net-3.11.1-license.txt similarity index 99% rename from ide/libs.commons_net/external/commons-net-3.10.0-license.txt rename to ide/libs.commons_net/external/commons-net-3.11.1-license.txt index bdfe0231e451..3e88a7422963 100644 --- a/ide/libs.commons_net/external/commons-net-3.10.0-license.txt +++ b/ide/libs.commons_net/external/commons-net-3.11.1-license.txt @@ -1,5 +1,5 @@ Name: Commons Net -Version: 3.10.0 +Version: 3.11.1 OSR: 3487 Description: Apache Commons Net implements the client side of many basic Internet protocols. Origin: https://commons.apache.org/proper/commons-net/index.html diff --git a/ide/libs.commons_net/external/commons-net-3.10.0-notice.txt b/ide/libs.commons_net/external/commons-net-3.11.1-notice.txt similarity index 100% rename from ide/libs.commons_net/external/commons-net-3.10.0-notice.txt rename to ide/libs.commons_net/external/commons-net-3.11.1-notice.txt diff --git a/ide/libs.commons_net/nbproject/project.properties b/ide/libs.commons_net/nbproject/project.properties index 03d7283e51ae..52363d76a85e 100644 --- a/ide/libs.commons_net/nbproject/project.properties +++ b/ide/libs.commons_net/nbproject/project.properties @@ -16,5 +16,5 @@ # under the License. is.autoload=true -release.external/commons-net-3.10.0.jar=modules/ext/commons-net-3.10.0.jar -spec.version.base=2.47.0 +release.external/commons-net-3.11.1.jar=modules/ext/commons-net-3.11.1.jar +spec.version.base=2.48.0 diff --git a/ide/libs.commons_net/nbproject/project.xml b/ide/libs.commons_net/nbproject/project.xml index 94bbcafd14ee..04e99e10cf7d 100644 --- a/ide/libs.commons_net/nbproject/project.xml +++ b/ide/libs.commons_net/nbproject/project.xml @@ -31,8 +31,8 @@ org.apache.commons.net.util - ext/commons-net-3.10.0.jar - external/commons-net-3.10.0.jar + ext/commons-net-3.11.1.jar + external/commons-net-3.11.1.jar diff --git a/ide/libs.commons_net/src/org/netbeans/libs/commons_net/mf-layer.xml b/ide/libs.commons_net/src/org/netbeans/libs/commons_net/mf-layer.xml index f57759525bf8..d8a2e27811c6 100644 --- a/ide/libs.commons_net/src/org/netbeans/libs/commons_net/mf-layer.xml +++ b/ide/libs.commons_net/src/org/netbeans/libs/commons_net/mf-layer.xml @@ -27,7 +27,7 @@ - + diff --git a/ide/libs.flexmark/manifest.mf b/ide/libs.flexmark/manifest.mf index 161dcd7d31d9..220e012557b3 100644 --- a/ide/libs.flexmark/manifest.mf +++ b/ide/libs.flexmark/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.libs.flexmark OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/flexmark/Bundle.properties -OpenIDE-Module-Specification-Version: 1.18 +OpenIDE-Module-Specification-Version: 1.19 diff --git a/ide/libs.freemarker/external/binaries-list b/ide/libs.freemarker/external/binaries-list index deb82f64d100..9d310234b841 100644 --- a/ide/libs.freemarker/external/binaries-list +++ b/ide/libs.freemarker/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -8607259125D4FBE982754227EA4F75DD513C6D19 org.freemarker:freemarker:2.3.32 +FECAEB606993FC9FD0F95FE5A644048A69C39474 org.freemarker:freemarker:2.3.33 diff --git a/ide/libs.freemarker/external/freemarker-2.3.32-license.txt b/ide/libs.freemarker/external/freemarker-2.3.33-license.txt similarity index 99% rename from ide/libs.freemarker/external/freemarker-2.3.32-license.txt rename to ide/libs.freemarker/external/freemarker-2.3.33-license.txt index fbca2b93d0aa..6030c6366bca 100644 --- a/ide/libs.freemarker/external/freemarker-2.3.32-license.txt +++ b/ide/libs.freemarker/external/freemarker-2.3.33-license.txt @@ -1,5 +1,5 @@ Name: Apache FreeMarker -Version: 2.3.32 +Version: 2.3.33 Origin: Apache Software Foundation License: Apache-2.0-freemarker Description: Template engine diff --git a/ide/libs.freemarker/external/freemarker-2.3.32-notice.txt b/ide/libs.freemarker/external/freemarker-2.3.33-notice.txt similarity index 100% rename from ide/libs.freemarker/external/freemarker-2.3.32-notice.txt rename to ide/libs.freemarker/external/freemarker-2.3.33-notice.txt diff --git a/ide/libs.freemarker/nbproject/project.properties b/ide/libs.freemarker/nbproject/project.properties index 860bd766623a..a202ee12f9c2 100644 --- a/ide/libs.freemarker/nbproject/project.properties +++ b/ide/libs.freemarker/nbproject/project.properties @@ -18,10 +18,10 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked -javac.source=1.8 -release.external/freemarker-2.3.32.jar=modules/ext/freemarker-2.3.32.jar +javac.release=17 +release.external/freemarker-2.3.33.jar=modules/ext/freemarker-2.3.33.jar module.jar.verifylinkageignores=freemarker.((ext.ant.FreemarkerXmlTask)|(template.DefaultObjectWrapper)) -spec.version.base=2.59.0 +spec.version.base=2.60.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/libs.freemarker/nbproject/project.xml b/ide/libs.freemarker/nbproject/project.xml index ffc03f2c4869..bb440c516f3c 100644 --- a/ide/libs.freemarker/nbproject/project.xml +++ b/ide/libs.freemarker/nbproject/project.xml @@ -119,8 +119,8 @@ - ext/freemarker-2.3.32.jar - external/freemarker-2.3.32.jar + ext/freemarker-2.3.33.jar + external/freemarker-2.3.33.jar diff --git a/ide/libs.freemarker/src/org/netbeans/libs/freemarker/FreemarkerEngine.java b/ide/libs.freemarker/src/org/netbeans/libs/freemarker/FreemarkerEngine.java index 3c804ae32c23..5009a0e374f1 100644 --- a/ide/libs.freemarker/src/org/netbeans/libs/freemarker/FreemarkerEngine.java +++ b/ide/libs.freemarker/src/org/netbeans/libs/freemarker/FreemarkerEngine.java @@ -120,8 +120,8 @@ public Object eval(Reader reader, ScriptContext ctx) if (template == null) { template = new MyTemplate(fo, fileName, reader, conf); Object exceptionHandler = ctx.getAttribute(FREEMARKER_EXCEPTION_HANDLER); - if (exceptionHandler instanceof TemplateExceptionHandler) { - template.setTemplateExceptionHandler((TemplateExceptionHandler) exceptionHandler); + if (exceptionHandler instanceof TemplateExceptionHandler templateEH) { + template.setTemplateExceptionHandler(templateEH); } } else { ((MyTemplate)template).conf = conf; @@ -155,8 +155,8 @@ public Bindings createBindings() { // internals only below this point private static String getFilename(ScriptContext ctx) { Object tfo = ctx.getAttribute(FREEMARKER_TEMPLATE); - if (tfo instanceof FileObject) { - return ((FileObject)tfo).getPath(); + if (tfo instanceof FileObject fo) { + return fo.getPath(); } Object fileName = ctx.getAttribute(ScriptEngine.FILENAME); if (fileName != null) { @@ -167,11 +167,7 @@ private static String getFilename(ScriptContext ctx) { private static boolean isStringOutputMode(ScriptContext ctx) { Object flag = ctx.getAttribute(STRING_OUTPUT_MODE); - if (flag != null) { - return flag.equals(Boolean.TRUE); - } else { - return false; - } + return flag != null ? flag.equals(Boolean.TRUE) : false; } private void initFreeMarkerConfiguration(ScriptContext ctx) { @@ -180,9 +176,9 @@ private void initFreeMarkerConfiguration(ScriptContext ctx) { if (conf != null) { return; } - Object cfg = ctx.getAttribute(FREEMARKER_CONFIG); - if (cfg instanceof Configuration) { - conf = (Configuration) cfg; + Object obj = ctx.getAttribute(FREEMARKER_CONFIG); + if (obj instanceof Configuration configuration) { + conf = configuration; return; } @@ -225,8 +221,8 @@ private static void initConfProps(Configuration conf, ScriptContext ctx) { Set keys = props.keySet(); for (Object obj : keys) { String key; - if (obj instanceof String) { - key = (String) obj; + if (obj instanceof String str) { + key = str; } else { continue; } diff --git a/ide/libs.freemarker/src/org/netbeans/libs/freemarker/FreemarkerFactory.java b/ide/libs.freemarker/src/org/netbeans/libs/freemarker/FreemarkerFactory.java index 6524797b4d88..1669fca75976 100644 --- a/ide/libs.freemarker/src/org/netbeans/libs/freemarker/FreemarkerFactory.java +++ b/ide/libs.freemarker/src/org/netbeans/libs/freemarker/FreemarkerFactory.java @@ -21,8 +21,6 @@ */ package org.netbeans.libs.freemarker; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; import javax.script.ScriptEngine; import javax.script.ScriptEngineFactory; @@ -38,7 +36,7 @@ public String getEngineName() { @Override public String getEngineVersion() { - return "2.3.32"; + return "2.3.33"; } @Override @@ -53,7 +51,7 @@ public String getLanguageName() { @Override public String getLanguageVersion() { - return "2.3.32"; + return "2.3.33"; } @Override @@ -94,15 +92,9 @@ public String getOutputStatement(String toDisplay) { for (int i = 0; i < len; i++) { char ch = toDisplay.charAt(i); switch (ch) { - case '"': - buf.append("\\\""); - break; - case '\\': - buf.append("\\\\"); - break; - default: - buf.append(ch); - break; + case '"' -> buf.append("\\\""); + case '\\' -> buf.append("\\\\"); + default -> buf.append(ch); } } buf.append("\")}"); @@ -111,21 +103,15 @@ public String getOutputStatement(String toDisplay) { @Override public String getParameter(String key) { - if (key.equals(ScriptEngine.NAME)) { - return getLanguageName(); - } else if (key.equals(ScriptEngine.ENGINE)) { - return getEngineName(); - } else if (key.equals(ScriptEngine.ENGINE_VERSION)) { - return getEngineVersion(); - } else if (key.equals(ScriptEngine.LANGUAGE)) { - return getLanguageName(); - } else if (key.equals(ScriptEngine.LANGUAGE_VERSION)) { - return getLanguageVersion(); - } else if (key.equals("THREADING")) { - return "MULTITHREADED"; - } else { - return null; - } + return switch (key) { + case ScriptEngine.NAME -> getLanguageName(); + case ScriptEngine.ENGINE -> getEngineName(); + case ScriptEngine.ENGINE_VERSION -> getEngineVersion(); + case ScriptEngine.LANGUAGE -> getLanguageName(); + case ScriptEngine.LANGUAGE_VERSION -> getLanguageVersion(); + case "THREADING" -> "MULTITHREADED"; + default -> null; + }; } @Override @@ -143,20 +129,8 @@ public ScriptEngine getScriptEngine() { return new FreemarkerEngine(this); } - private static final List names; - private static final List extensions; - private static final List mimeTypes; - static { - ArrayList n = new ArrayList<>(2); - n.add("FreeMarker"); - n.add("freemarker"); - names = Collections.unmodifiableList(n); - ArrayList e = new ArrayList<>(2); - e.add("fm"); - e.add("ftl"); - extensions = Collections.unmodifiableList(e); - ArrayList m = new ArrayList<>(1); - m.add("text/x-freemarker"); - mimeTypes = Collections.unmodifiableList(m); - } + private static final List names = List.of("FreeMarker", "freemarker"); + private static final List extensions = List.of("fm", "ftl"); + private static final List mimeTypes = List.of("text/x-freemarker"); + } diff --git a/ide/libs.freemarker/src/org/netbeans/libs/freemarker/RsrcLoader.java b/ide/libs.freemarker/src/org/netbeans/libs/freemarker/RsrcLoader.java index db9cce6a9ff2..843a78e14a64 100644 --- a/ide/libs.freemarker/src/org/netbeans/libs/freemarker/RsrcLoader.java +++ b/ide/libs.freemarker/src/org/netbeans/libs/freemarker/RsrcLoader.java @@ -89,9 +89,7 @@ private FileObject getFile(String name) { if (tmp == null) { try { tmp = FileUtil.toFileObject(FileUtil.normalizeFile(Utilities.toFile(new URI(name)))); - } catch (URISyntaxException ex) { - } catch (IllegalArgumentException iae) { - } + } catch (URISyntaxException | IllegalArgumentException ignore) {} } return tmp; } diff --git a/ide/libs.git/manifest.mf b/ide/libs.git/manifest.mf index beeebb24dbe5..10eb8d0cf861 100644 --- a/ide/libs.git/manifest.mf +++ b/ide/libs.git/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.git/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/git/Bundle.properties -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.61 diff --git a/ide/libs.graalsdk.system/manifest.mf b/ide/libs.graalsdk.system/manifest.mf index 3bb53f75123f..dbb81f44eb1b 100644 --- a/ide/libs.graalsdk.system/manifest.mf +++ b/ide/libs.graalsdk.system/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.libs.graalsdk.system OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/graalsdk/system/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 OpenIDE-Module-Provides: org.netbeans.spi.scripting.EngineProvider OpenIDE-Module-Package-Dependencies: org.graalvm.polyglot[Engine] diff --git a/ide/libs.graalsdk/manifest.mf b/ide/libs.graalsdk/manifest.mf index 45c6f6290d02..51b2e9365a28 100644 --- a/ide/libs.graalsdk/manifest.mf +++ b/ide/libs.graalsdk/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.libs.graalsdk OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/graalsdk/Bundle.properties -OpenIDE-Module-Specification-Version: 1.26 +OpenIDE-Module-Specification-Version: 1.27 OpenIDE-Module-Provides: org.netbeans.spi.scripting.EngineProvider OpenIDE-Module-Recommends: com.oracle.truffle.polyglot.PolyglotImpl OpenIDE-Module-Install: org/netbeans/libs/graalsdk/impl/Installer.class diff --git a/ide/libs.ini4j/manifest.mf b/ide/libs.ini4j/manifest.mf index de72dffda4e8..27a3fbc01703 100644 --- a/ide/libs.ini4j/manifest.mf +++ b/ide/libs.ini4j/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.ini4j/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/ini4j/Bundle.properties -OpenIDE-Module-Specification-Version: 1.59 +OpenIDE-Module-Specification-Version: 1.60 diff --git a/ide/libs.jaxb/manifest.mf b/ide/libs.jaxb/manifest.mf index 5249070f61c6..c04e530dd27f 100644 --- a/ide/libs.jaxb/manifest.mf +++ b/ide/libs.jaxb/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.jaxb/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jaxb/Bundle.properties -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 OpenIDE-Module-Layer: org/netbeans/libs/jaxb/layer.xml OpenIDE-Module-Provides: com.sun.xml.bind OpenIDE-Module-Requires: org.openide.modules.ModuleFormat2 diff --git a/ide/libs.jcodings/manifest.mf b/ide/libs.jcodings/manifest.mf index e639135b0e1c..909a9617afad 100644 --- a/ide/libs.jcodings/manifest.mf +++ b/ide/libs.jcodings/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.jcodings/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jcodings/Bundle.properties -OpenIDE-Module-Specification-Version: 0.14 +OpenIDE-Module-Specification-Version: 0.15 diff --git a/ide/libs.jsch.agentproxy/manifest.mf b/ide/libs.jsch.agentproxy/manifest.mf index 0b33950dbaf6..a7e57816e961 100644 --- a/ide/libs.jsch.agentproxy/manifest.mf +++ b/ide/libs.jsch.agentproxy/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.jsch.agentproxy/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jsch/agentproxy/Bundle.properties -OpenIDE-Module-Specification-Version: 1.9 +OpenIDE-Module-Specification-Version: 1.10 diff --git a/ide/libs.json_simple/manifest.mf b/ide/libs.json_simple/manifest.mf index bf568ce420a3..4d3de8a6097a 100644 --- a/ide/libs.json_simple/manifest.mf +++ b/ide/libs.json_simple/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.json_simple/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/json_simple/Bundle.properties -OpenIDE-Module-Specification-Version: 0.37 +OpenIDE-Module-Specification-Version: 0.38 AutoUpdate-Show-In-Client: false diff --git a/ide/libs.lucene/manifest.mf b/ide/libs.lucene/manifest.mf index 1a04175c45b1..babd812e04c2 100644 --- a/ide/libs.lucene/manifest.mf +++ b/ide/libs.lucene/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.lucene/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/lucene/Bundle.properties -OpenIDE-Module-Specification-Version: 3.44 +OpenIDE-Module-Specification-Version: 3.45 diff --git a/ide/libs.snakeyaml_engine/manifest.mf b/ide/libs.snakeyaml_engine/manifest.mf index 4fcef4d45465..0b7e806427ae 100644 --- a/ide/libs.snakeyaml_engine/manifest.mf +++ b/ide/libs.snakeyaml_engine/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.snakeyaml_engine/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/snakeyaml_engine/Bundle.properties -OpenIDE-Module-Specification-Version: 2.14 +OpenIDE-Module-Specification-Version: 2.15 diff --git a/ide/libs.svnClientAdapter.javahl/manifest.mf b/ide/libs.svnClientAdapter.javahl/manifest.mf index 6195fb263686..84e58eef7457 100644 --- a/ide/libs.svnClientAdapter.javahl/manifest.mf +++ b/ide/libs.svnClientAdapter.javahl/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.svnClientAdapter.javahl/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/svnclientadapter/javahl/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 diff --git a/ide/libs.svnClientAdapter/manifest.mf b/ide/libs.svnClientAdapter/manifest.mf index 4e974fd1fb4a..b3e8e1b51a80 100644 --- a/ide/libs.svnClientAdapter/manifest.mf +++ b/ide/libs.svnClientAdapter/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.svnClientAdapter/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/svnclientadapter/Bundle.properties -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 diff --git a/ide/libs.tomlj/manifest.mf b/ide/libs.tomlj/manifest.mf index b7ee13783592..01c8642cddfe 100644 --- a/ide/libs.tomlj/manifest.mf +++ b/ide/libs.tomlj/manifest.mf @@ -1,5 +1,5 @@ OpenIDE-Module: org.netbeans.libs.tomlj/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/tomlj/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 OpenIDE-Module-Deprecated: true OpenIDE-Module-Deprecation-Message: Module ide/libs.tomlj is deprecated, use module ide/libs.tomljava instead. diff --git a/ide/libs.tomljava/manifest.mf b/ide/libs.tomljava/manifest.mf index 18106bcf3c1f..2da9b760608d 100644 --- a/ide/libs.tomljava/manifest.mf +++ b/ide/libs.tomljava/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.tomljava/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/tomljava/Bundle.properties -OpenIDE-Module-Specification-Version: 1.1 +OpenIDE-Module-Specification-Version: 1.2 diff --git a/ide/libs.truffleapi/manifest.mf b/ide/libs.truffleapi/manifest.mf index 9c0b9623d7b9..68f44937d35a 100644 --- a/ide/libs.truffleapi/manifest.mf +++ b/ide/libs.truffleapi/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.libs.truffleapi OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/truffle/Bundle.properties -OpenIDE-Module-Specification-Version: 1.26 +OpenIDE-Module-Specification-Version: 1.27 OpenIDE-Module-Provides: com.oracle.truffle.polyglot.PolyglotImpl OpenIDE-Module-Hide-Classpath-Packages: com.oracle.truffle.**,jdk.vm.ci.services.**, org.graalvm.shadowed.org.jcodings.** diff --git a/ide/libs.xerces/nbproject/project.properties b/ide/libs.xerces/nbproject/project.properties index 90c211de54cf..b0dd448c9157 100644 --- a/ide/libs.xerces/nbproject/project.properties +++ b/ide/libs.xerces/nbproject/project.properties @@ -18,7 +18,7 @@ is.autoload=true release.external/xercesImpl-2.8.0.jar=modules/ext/xerces-2.8.0.jar module.jar.verifylinkageignores=org.apache.xerces.util.XMLCatalogResolver -spec.version.base=1.63.0 +spec.version.base=1.64.0 # This is an very old library, the complete dependencies were never explored. # Since subpackage-s are working in new sigtest version, generation of the diff --git a/ide/localhistory/manifest.mf b/ide/localhistory/manifest.mf index 1a89219e546e..7644deee21b6 100644 --- a/ide/localhistory/manifest.mf +++ b/ide/localhistory/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.localhistory OpenIDE-Module-Install: org/netbeans/modules/localhistory/ModuleLifecycleManager.class OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/localhistory/Bundle.properties -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.61 diff --git a/ide/localtasks/manifest.mf b/ide/localtasks/manifest.mf index 22865786cc52..4bb7797bdc2b 100644 --- a/ide/localtasks/manifest.mf +++ b/ide/localtasks/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.localtasks OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/localtasks/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 diff --git a/ide/lsp.client/nbproject/project.properties b/ide/lsp.client/nbproject/project.properties index 4a5ab5626a0a..a4e606ad33a7 100644 --- a/ide/lsp.client/nbproject/project.properties +++ b/ide/lsp.client/nbproject/project.properties @@ -26,4 +26,4 @@ release.external/org.eclipse.lsp4j.jsonrpc.debug-0.13.0.jar=modules/ext/org.ecli release.external/org.eclipse.xtend.lib-2.24.0.jar=modules/ext/org.eclipse.xtend.lib-2.24.0.jar release.external/org.eclipse.xtend.lib.macro-2.24.0.jar=modules/ext/org.eclipse.xtend.lib.macro-2.24.0.jar release.external/org.eclipse.xtext.xbase.lib-2.24.0.jar=modules/ext/org.eclipse.xtext.xbase.lib-2.24.0.jar -spec.version.base=1.26.0 +spec.version.base=1.27.0 diff --git a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/ErrorProviderBridge.java b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/ErrorProviderBridge.java new file mode 100644 index 000000000000..cf6778f073d1 --- /dev/null +++ b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/ErrorProviderBridge.java @@ -0,0 +1,115 @@ +/* + * 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.lsp.client.bindings; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.Document; +import org.netbeans.api.lsp.Diagnostic; +import org.netbeans.spi.editor.hints.ErrorDescription; +import org.netbeans.spi.editor.hints.ErrorDescriptionFactory; +import org.netbeans.spi.editor.hints.HintsController; +import org.netbeans.spi.editor.hints.Severity; +import org.netbeans.spi.lsp.ErrorProvider; +import org.openide.filesystems.FileObject; +import org.openide.util.RequestProcessor; +import org.openide.util.WeakListeners; + +class ErrorProviderBridge implements Runnable, DocumentListener { + + private final FileObject file; + private final RequestProcessor.Task task; + private final Collection errorProviders; + private final DocumentListener listener; + + ErrorProviderBridge(Document doc, FileObject file, Collection errorProviders, RequestProcessor rp) { + this.file = file; + this.errorProviders = errorProviders; + this.task = rp.create(this); + this.listener = WeakListeners.create(DocumentListener.class, this, doc); + doc.addDocumentListener(listener); + } + + final void start() { + task.schedule(0); + } + + final void waitFinished() { + task.waitFinished(); + } + + @Override + public final void run() { + for (ErrorProvider p : errorProviders) { + computeHints(ErrorProvider.Kind.ERRORS, p, "lsp:errors"); + computeHints(ErrorProvider.Kind.HINTS, p, "lsp:hints"); + } + } + + private void computeHints(final ErrorProvider.Kind type, ErrorProvider p, final String prefix) { + List arr = new ArrayList<>(); + ErrorProvider.Context errorCtx = new ErrorProvider.Context(file, type); + List errors = p.computeErrors(errorCtx); + if (errors != null) { + for (Diagnostic e : errors) { + final Severity s; + switch(e.getSeverity()) { + case Error: + s = Severity.ERROR; break; + case Warning: + s = Severity.WARNING; break; + case Information: + case Hint: + default: + s = Severity.HINT; break; + } + ErrorDescription descr = ErrorDescriptionFactory.createErrorDescription(s, + e.getDescription(), + file, + e.getStartPosition().getOffset(), + e.getEndPosition().getOffset() + ); + arr.add(descr); + } + applyHints(prefix, p, arr); + } + } + + protected void applyHints(final String prefix, ErrorProvider p, List arr) { + HintsController.setErrors(file, prefix + ":" + p.getClass().getName(), arr); + } + + @Override + public final void insertUpdate(DocumentEvent e) { + start(); + } + + @Override + public final void removeUpdate(DocumentEvent e) { + start(); + } + + @Override + public final void changedUpdate(DocumentEvent e) { + start(); + } +} diff --git a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/LspCompletionItem.java b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/LspCompletionItem.java index 65380c36a03b..606d413faab5 100644 --- a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/LspCompletionItem.java +++ b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/LspCompletionItem.java @@ -112,22 +112,26 @@ Supplier resolveDocumentation(Document doc, int caretOffset) { } if (resolved.getDocumentation() != null || resolved.getDetail() != null) { return () -> { - MarkupContent content; - if (resolved.getDocumentation().isLeft()) { - content = new MarkupContent(); - content.setKind("plaintext"); - content.setValue(resolved.getDocumentation().getLeft()); - } else { - content = resolved.getDocumentation().getRight(); - } String txt; - switch (content.getKind()) { - case "markdown": - txt = HtmlRenderer.builder().build().render(Parser.builder().build().parse(content.getValue())); - break; - default: - txt = "
\n" + content.getValue() + "\n
"; - break; + if (resolved.getDocumentation() != null) { + MarkupContent content; + if (resolved.getDocumentation().isLeft()) { + content = new MarkupContent(); + content.setKind("plaintext"); + content.setValue(resolved.getDocumentation().getLeft()); + } else { + content = resolved.getDocumentation().getRight(); + } + switch (content.getKind()) { + case "markdown": + txt = HtmlRenderer.builder().build().render(Parser.builder().build().parse(content.getValue())); + break; + default: + txt = "
\n" + content.getValue() + "\n
"; + break; + } + } else { + txt = null; } return new String[] { resolved.getDetail(), txt }; }; diff --git a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/LspCompletionProviderImpl.java b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/LspCompletionProviderImpl.java index bb8a549e5893..36444e3d5f19 100644 --- a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/LspCompletionProviderImpl.java +++ b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/LspCompletionProviderImpl.java @@ -52,6 +52,7 @@ protected void query(CompletionResultSet resultSet, Document doc, int caretOffse FileObject file = NbEditorUtilities.getFileObject(doc); if (file == null) { //TODO: beep + resultSet.finish(); return; } final String mime = file.getMIMEType(); diff --git a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/NavigatorPanelImpl.java b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/NavigatorPanelImpl.java index bde41feae455..c03162f7fbd9 100644 --- a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/NavigatorPanelImpl.java +++ b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/NavigatorPanelImpl.java @@ -18,19 +18,13 @@ */ package org.netbeans.modules.lsp.client.bindings; -import java.awt.BorderLayout; import java.awt.event.ActionEvent; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.AbstractAction; import javax.swing.Action; -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; import org.eclipse.lsp4j.DocumentSymbol; import org.eclipse.lsp4j.DocumentSymbolParams; import org.eclipse.lsp4j.Range; @@ -40,17 +34,10 @@ import org.netbeans.modules.lsp.client.LSPBindings; import org.netbeans.modules.lsp.client.LSPBindings.BackgroundTask; import org.netbeans.modules.lsp.client.Utils; -import org.netbeans.spi.navigator.NavigatorPanel; -import org.openide.explorer.ExplorerManager; -import org.openide.explorer.view.BeanTreeView; import org.openide.filesystems.FileObject; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Node; -import org.openide.util.Lookup; -import org.openide.util.LookupEvent; -import org.openide.util.LookupListener; -import org.openide.util.NbBundle.Messages; /** * diff --git a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java index 2659afddcf67..496828357f67 100644 --- a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java +++ b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.IdentityHashMap; @@ -47,16 +48,24 @@ import org.eclipse.lsp4j.VersionedTextDocumentIdentifier; import org.eclipse.lsp4j.jsonrpc.messages.Either; import org.netbeans.api.editor.EditorRegistry; +import org.netbeans.api.editor.mimelookup.MimeLookup; +import org.netbeans.api.lsp.Diagnostic; import org.netbeans.editor.BaseDocumentEvent; import org.netbeans.lib.editor.util.swing.DocumentUtilities; import org.netbeans.modules.editor.*; import org.netbeans.modules.lsp.client.LSPBindings; import org.netbeans.modules.lsp.client.Utils; +import org.netbeans.spi.editor.hints.ErrorDescription; +import org.netbeans.spi.editor.hints.ErrorDescriptionFactory; +import org.netbeans.spi.editor.hints.HintsController; +import org.netbeans.spi.editor.hints.Severity; +import org.netbeans.spi.lsp.ErrorProvider; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.modules.OnStart; import org.openide.text.NbDocument; import org.openide.util.Exceptions; +import org.openide.util.Lookup; import org.openide.util.RequestProcessor; /** @@ -322,8 +331,16 @@ private void registerBackgroundTasks(JTextComponent c) { LSPBindings server = LSPBindings.getBindings(file); - if (server == null) - return ; //ignore + if (server == null) { + Lookup lkp = MimeLookup.getLookup(file.getMIMEType()); + Collection errorProviders = lkp.lookupAll(ErrorProvider.class); + if (!errorProviders.isEmpty()) { + ErrorProviderBridge b = new ErrorProviderBridge(doc, file, errorProviders, WORKER); + b.start(); + c.putClientProperty(ErrorProviderBridge.class, b); + } + return; + } SwingUtilities.invokeLater(() -> { if (c.getClientProperty(MarkOccurrences.class) == null) { diff --git a/ide/lsp.client/test/unit/src/org/netbeans/modules/lsp/client/bindings/ErrorProviderBridgeTest.java b/ide/lsp.client/test/unit/src/org/netbeans/modules/lsp/client/bindings/ErrorProviderBridgeTest.java new file mode 100644 index 000000000000..287ed3dde392 --- /dev/null +++ b/ide/lsp.client/test/unit/src/org/netbeans/modules/lsp/client/bindings/ErrorProviderBridgeTest.java @@ -0,0 +1,139 @@ +/* + * 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.lsp.client.bindings; + +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.swing.JTextArea; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.JTextComponent; +import org.junit.Test; +import static org.junit.Assert.*; +import org.netbeans.api.lsp.Diagnostic; +import org.netbeans.junit.NbTestCase; +import org.netbeans.spi.editor.hints.ErrorDescription; +import org.netbeans.spi.lsp.ErrorProvider; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.util.RequestProcessor; + +public class ErrorProviderBridgeTest { + + public ErrorProviderBridgeTest() { + } + + @Test + public void testListeningAndLifecycle() throws Exception { + JTextComponent c = new JTextArea(); + FileObject file = FileUtil.createMemoryFileSystem().getRoot().createData("c.txt"); + RequestProcessor rp = new RequestProcessor("ErrorProviderBridgeTest"); + MockErrorProvider mp = new MockErrorProvider(c); + + List> appliedDescriptions = new ArrayList<>(); + ErrorProviderBridge b = new ErrorProviderBridge(c.getDocument(), file, Collections.singleton(mp), rp) { + @Override + protected void applyHints(String prefix, org.netbeans.spi.lsp.ErrorProvider p, List arr) { + if (prefix.equals("lsp:errors")) { + appliedDescriptions.add(arr); + } + } + }; + + b.start(); + b.waitFinished(); + + assertEquals("One set of errors reported", 1, appliedDescriptions.size()); + assertTrue("It is empty so far", appliedDescriptions.remove(0).isEmpty()); + + c.getDocument().insertString(0, "Ahoj\nERR\nOK", null); + b.waitFinished(); + + { + assertEquals("Another set of errors reported", 1, appliedDescriptions.size()); + final List errors = appliedDescriptions.remove(0); + assertEquals("There is one error", 1, errors.size()); + ErrorDescription descr = errors.get(0); + assertEquals("Starts right", 5, descr.getRange().getBegin().getOffset()); + assertEquals("Ends right", 8, descr.getRange().getEnd().getOffset()); + } + + c.getDocument().remove(0, 5); + b.waitFinished(); + + { + assertEquals("Yet another set of errors reported", 1, appliedDescriptions.size()); + final List errors = appliedDescriptions.remove(0); + assertEquals("There is one error", 1, errors.size()); + ErrorDescription descr = errors.get(0); + assertEquals("Starts right", 0, descr.getRange().getBegin().getOffset()); + assertEquals("Ends right", 3, descr.getRange().getEnd().getOffset()); + } + + Reference ref = new WeakReference<>(c); + c = null; + mp = null; + + NbTestCase.assertGC("Component can disappear", ref); + + ref = new WeakReference<>(b); + b = null; + NbTestCase.assertGC("Bridge can disappear", ref); + } + + private static final class MockErrorProvider implements ErrorProvider { + + private final Reference c; + + MockErrorProvider(JTextComponent c) { + this.c = new WeakReference<>(c); + } + + @Override + public List computeErrors(Context context) { + List arr = new ArrayList<>(); + JTextComponent tmp = c.get(); + if (tmp == null) { + return arr; + } + Document doc = tmp.getDocument(); + try { + String txt = doc.getText(0, doc.getLength()); + for (int from = -1;;) { + int at = txt.indexOf("ERR", from + 1); + if (at == -1) { + break; + } + Diagnostic d = Diagnostic.Builder.create(() -> at, () -> at + 3, "at" + at) + .setSeverity(Diagnostic.Severity.Error) + .build(); + arr.add(d); + from = at; + } + } catch (BadLocationException ex) { + throw new IllegalStateException(ex); + } + return arr; + } + + } +} diff --git a/ide/markdown/manifest.mf b/ide/markdown/manifest.mf index 5b7a9b7c3d8d..d371ff06433b 100644 --- a/ide/markdown/manifest.mf +++ b/ide/markdown/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.markdown OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/markdown/Bundle.properties -OpenIDE-Module-Specification-Version: 1.13 +OpenIDE-Module-Specification-Version: 1.14 diff --git a/ide/mercurial/nbproject/project.properties b/ide/mercurial/nbproject/project.properties index a63ad069fd74..c56e68ee7196 100644 --- a/ide/mercurial/nbproject/project.properties +++ b/ide/mercurial/nbproject/project.properties @@ -19,7 +19,7 @@ javac.source=1.8 nbm.homepage=http://wiki.netbeans.org/wiki/view/MercurialVersionControl nbm.module.author=John Rice and Padraig O'Briain nbm.needs.restart=true -spec.version.base=2.1.0 +spec.version.base=2.2.0 #qa-functional test.qa-functional.cp.extra=${openide.nodes.dir}/modules/org-openide-nodes.jar:\${openide.util.dir}/lib/org-openide-util.jar:${openide.util.ui.dir}/lib/org-openide-util-ui.jar diff --git a/ide/mylyn.util/manifest.mf b/ide/mylyn.util/manifest.mf index 5e80ad2f29ec..751db89f7728 100644 --- a/ide/mylyn.util/manifest.mf +++ b/ide/mylyn.util/manifest.mf @@ -3,6 +3,6 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.mylyn.util OpenIDE-Module-Layer: org/netbeans/modules/mylyn/util/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/mylyn/util/Bundle.properties -OpenIDE-Module-Specification-Version: 1.61 +OpenIDE-Module-Specification-Version: 1.62 OpenIDE-Module-Install: org/netbeans/modules/mylyn/util/internal/ModuleLifecycleManager.class diff --git a/ide/nativeimage.api/manifest.mf b/ide/nativeimage.api/manifest.mf index e54d81507710..de62b853a042 100644 --- a/ide/nativeimage.api/manifest.mf +++ b/ide/nativeimage.api/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.nativeimage.api/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/nativeimage/api/Bundle.properties -OpenIDE-Module-Specification-Version: 0.17 +OpenIDE-Module-Specification-Version: 0.18 diff --git a/ide/notifications/manifest.mf b/ide/notifications/manifest.mf index 0f02778cdfa7..24a52fd3eb62 100644 --- a/ide/notifications/manifest.mf +++ b/ide/notifications/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.notifications OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/notifications/Bundle.properties OpenIDE-Module-Requires: org.openide.windows.WindowManager -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.34 diff --git a/ide/o.apache.commons.httpclient/manifest.mf b/ide/o.apache.commons.httpclient/manifest.mf index 1189bffae676..97f417456ca9 100644 --- a/ide/o.apache.commons.httpclient/manifest.mf +++ b/ide/o.apache.commons.httpclient/manifest.mf @@ -1,2 +1,2 @@ OpenIDE-Module: org.apache.commons.httpclient -OpenIDE-Module-Specification-Version: 3.30 +OpenIDE-Module-Specification-Version: 3.31 diff --git a/ide/o.apache.xml.resolver/nbproject/project.properties b/ide/o.apache.xml.resolver/nbproject/project.properties index dd53189b3664..1e085fb15aff 100644 --- a/ide/o.apache.xml.resolver/nbproject/project.properties +++ b/ide/o.apache.xml.resolver/nbproject/project.properties @@ -17,4 +17,4 @@ is.autoload=true release.external/resolver-1.2.jar=modules/ext/resolver-1.2.jar -spec.version.base=1.56.0 +spec.version.base=1.57.0 diff --git a/ide/o.eclipse.jgit.gpg.bc/external/binaries-list b/ide/o.eclipse.jgit.gpg.bc/external/binaries-list index 7c18fdeb3d70..56b76abd1127 100644 --- a/ide/o.eclipse.jgit.gpg.bc/external/binaries-list +++ b/ide/o.eclipse.jgit.gpg.bc/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -BC86EE20219825813A6834D01290F50D01EB1992 org.eclipse.jgit:org.eclipse.jgit.gpg.bc:6.9.0.202403050737-r +B957A281EF7E8C6578601F6327BB12F7C5C2C17C org.eclipse.jgit:org.eclipse.jgit.gpg.bc:6.10.0.202406032230-r diff --git a/ide/o.eclipse.jgit.gpg.bc/external/org.eclipse.jgit.gpg.bc-6.9.0.202403050737-r-license.txt b/ide/o.eclipse.jgit.gpg.bc/external/org.eclipse.jgit.gpg.bc-6.10.0.202406032230-r-license.txt similarity index 99% rename from ide/o.eclipse.jgit.gpg.bc/external/org.eclipse.jgit.gpg.bc-6.9.0.202403050737-r-license.txt rename to ide/o.eclipse.jgit.gpg.bc/external/org.eclipse.jgit.gpg.bc-6.10.0.202406032230-r-license.txt index 8f332dbfe3aa..a9e04ec8dd7d 100644 --- a/ide/o.eclipse.jgit.gpg.bc/external/org.eclipse.jgit.gpg.bc-6.9.0.202403050737-r-license.txt +++ b/ide/o.eclipse.jgit.gpg.bc/external/org.eclipse.jgit.gpg.bc-6.10.0.202406032230-r-license.txt @@ -1,6 +1,6 @@ Name: JGit Library Origin: Eclipse -Version: 6.9.0.202403050737-r +Version: 6.10.0.202406032230-r Description: Integration library for Git client License: EDL-1.0-jgit URL: http://www.eclipse.org/jgit/download/ diff --git a/ide/o.eclipse.jgit.gpg.bc/nbproject/project.properties b/ide/o.eclipse.jgit.gpg.bc/nbproject/project.properties index 2912037e5cbd..8a3e1b3257e2 100644 --- a/ide/o.eclipse.jgit.gpg.bc/nbproject/project.properties +++ b/ide/o.eclipse.jgit.gpg.bc/nbproject/project.properties @@ -17,4 +17,4 @@ is.autoload=true -release.external/org.eclipse.jgit.gpg.bc-6.9.0.202403050737-r.jar=modules/org-eclipse-jgit-gpg-bc.jar +release.external/org.eclipse.jgit.gpg.bc-6.10.0.202406032230-r.jar=modules/org-eclipse-jgit-gpg-bc.jar diff --git a/ide/o.eclipse.jgit.gpg.bc/nbproject/project.xml b/ide/o.eclipse.jgit.gpg.bc/nbproject/project.xml index 9469bf07b522..556c829aca97 100644 --- a/ide/o.eclipse.jgit.gpg.bc/nbproject/project.xml +++ b/ide/o.eclipse.jgit.gpg.bc/nbproject/project.xml @@ -65,7 +65,7 @@ org-eclipse-jgit-gpg-bc.jar - external/org.eclipse.jgit.gpg.bc-6.9.0.202403050737-r.jar + external/org.eclipse.jgit.gpg.bc-6.10.0.202406032230-r.jar diff --git a/ide/o.eclipse.jgit.lfs/external/binaries-list b/ide/o.eclipse.jgit.lfs/external/binaries-list index 3c092b6b29c0..0f7c5ac56ac6 100644 --- a/ide/o.eclipse.jgit.lfs/external/binaries-list +++ b/ide/o.eclipse.jgit.lfs/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -334BD6230555DD1EB8ABD00FF4D704274E66F2FD org.eclipse.jgit:org.eclipse.jgit.lfs:6.9.0.202403050737-r +10F9FEEBA165C96C899B0181A1ECA7AE18B7DA81 org.eclipse.jgit:org.eclipse.jgit.lfs:6.10.0.202406032230-r diff --git a/ide/o.eclipse.jgit.lfs/external/org.eclipse.jgit.lfs-6.9.0.202403050737-r-license.txt b/ide/o.eclipse.jgit.lfs/external/org.eclipse.jgit.lfs-6.10.0.202406032230-r-license.txt similarity index 99% rename from ide/o.eclipse.jgit.lfs/external/org.eclipse.jgit.lfs-6.9.0.202403050737-r-license.txt rename to ide/o.eclipse.jgit.lfs/external/org.eclipse.jgit.lfs-6.10.0.202406032230-r-license.txt index 8f332dbfe3aa..a9e04ec8dd7d 100644 --- a/ide/o.eclipse.jgit.lfs/external/org.eclipse.jgit.lfs-6.9.0.202403050737-r-license.txt +++ b/ide/o.eclipse.jgit.lfs/external/org.eclipse.jgit.lfs-6.10.0.202406032230-r-license.txt @@ -1,6 +1,6 @@ Name: JGit Library Origin: Eclipse -Version: 6.9.0.202403050737-r +Version: 6.10.0.202406032230-r Description: Integration library for Git client License: EDL-1.0-jgit URL: http://www.eclipse.org/jgit/download/ diff --git a/ide/o.eclipse.jgit.lfs/nbproject/project.properties b/ide/o.eclipse.jgit.lfs/nbproject/project.properties index 66693e8480bf..e3c10a2ead9b 100644 --- a/ide/o.eclipse.jgit.lfs/nbproject/project.properties +++ b/ide/o.eclipse.jgit.lfs/nbproject/project.properties @@ -17,4 +17,4 @@ is.autoload=true -release.external/org.eclipse.jgit.lfs-6.9.0.202403050737-r.jar=modules/org-eclipse-jgit-lfs.jar +release.external/org.eclipse.jgit.lfs-6.10.0.202406032230-r.jar=modules/org-eclipse-jgit-lfs.jar diff --git a/ide/o.eclipse.jgit.lfs/nbproject/project.xml b/ide/o.eclipse.jgit.lfs/nbproject/project.xml index 41b70fe89796..89fd17b3a6bc 100644 --- a/ide/o.eclipse.jgit.lfs/nbproject/project.xml +++ b/ide/o.eclipse.jgit.lfs/nbproject/project.xml @@ -60,7 +60,7 @@ org-eclipse-jgit-lfs.jar - external/org.eclipse.jgit.lfs-6.9.0.202403050737-r.jar + external/org.eclipse.jgit.lfs-6.10.0.202406032230-r.jar diff --git a/ide/o.eclipse.jgit.ssh.jsch/external/binaries-list b/ide/o.eclipse.jgit.ssh.jsch/external/binaries-list index 16cd3e0d8441..78f338052ff9 100644 --- a/ide/o.eclipse.jgit.ssh.jsch/external/binaries-list +++ b/ide/o.eclipse.jgit.ssh.jsch/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -75E642C3FB1D054B2C3B39BF32578EC4DFDA816E org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:6.9.0.202403050737-r +B6A43BB49E2BD61F5BB0A1DBAE1D8F7883B2BA9D org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:6.10.0.202406032230-r diff --git a/ide/o.eclipse.jgit/external/org.eclipse.jgit-6.9.0.202403050737-r-license.txt b/ide/o.eclipse.jgit.ssh.jsch/external/org.eclipse.jgit.ssh.jsch-6.10.0.202406032230-r-license.txt similarity index 99% rename from ide/o.eclipse.jgit/external/org.eclipse.jgit-6.9.0.202403050737-r-license.txt rename to ide/o.eclipse.jgit.ssh.jsch/external/org.eclipse.jgit.ssh.jsch-6.10.0.202406032230-r-license.txt index 8f332dbfe3aa..a9e04ec8dd7d 100644 --- a/ide/o.eclipse.jgit/external/org.eclipse.jgit-6.9.0.202403050737-r-license.txt +++ b/ide/o.eclipse.jgit.ssh.jsch/external/org.eclipse.jgit.ssh.jsch-6.10.0.202406032230-r-license.txt @@ -1,6 +1,6 @@ Name: JGit Library Origin: Eclipse -Version: 6.9.0.202403050737-r +Version: 6.10.0.202406032230-r Description: Integration library for Git client License: EDL-1.0-jgit URL: http://www.eclipse.org/jgit/download/ diff --git a/ide/o.eclipse.jgit.ssh.jsch/nbproject/project.properties b/ide/o.eclipse.jgit.ssh.jsch/nbproject/project.properties index 18545f522899..a27cd0e0cbc0 100644 --- a/ide/o.eclipse.jgit.ssh.jsch/nbproject/project.properties +++ b/ide/o.eclipse.jgit.ssh.jsch/nbproject/project.properties @@ -17,4 +17,4 @@ is.autoload=true -release.external/org.eclipse.jgit.ssh.jsch-6.9.0.202403050737-r.jar=modules/org-eclipse-jgit-ssh-jsch.jar +release.external/org.eclipse.jgit.ssh.jsch-6.10.0.202406032230-r.jar=modules/org-eclipse-jgit-ssh-jsch.jar diff --git a/ide/o.eclipse.jgit.ssh.jsch/nbproject/project.xml b/ide/o.eclipse.jgit.ssh.jsch/nbproject/project.xml index 84a76c7ee0ab..761515bf2097 100644 --- a/ide/o.eclipse.jgit.ssh.jsch/nbproject/project.xml +++ b/ide/o.eclipse.jgit.ssh.jsch/nbproject/project.xml @@ -54,7 +54,7 @@ org-eclipse-jgit-ssh-jsch.jar - external/org.eclipse.jgit.ssh.jsch-6.9.0.202403050737-r.jar + external/org.eclipse.jgit.ssh.jsch-6.10.0.202406032230-r.jar diff --git a/ide/o.eclipse.jgit/external/binaries-list b/ide/o.eclipse.jgit/external/binaries-list index 28249eeb0978..17b8c009e7a4 100644 --- a/ide/o.eclipse.jgit/external/binaries-list +++ b/ide/o.eclipse.jgit/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -E4DA064611794C35CBF80A720A3F813285D5CCBA org.eclipse.jgit:org.eclipse.jgit:6.9.0.202403050737-r +E1166B8B313939890F29A5C611614B67E396B07E org.eclipse.jgit:org.eclipse.jgit:6.10.0.202406032230-r diff --git a/ide/o.eclipse.jgit.ssh.jsch/external/org.eclipse.jgit.ssh.jsch-6.9.0.202403050737-r-license.txt b/ide/o.eclipse.jgit/external/org.eclipse.jgit-6.10.0.202406032230-r-license.txt similarity index 99% rename from ide/o.eclipse.jgit.ssh.jsch/external/org.eclipse.jgit.ssh.jsch-6.9.0.202403050737-r-license.txt rename to ide/o.eclipse.jgit/external/org.eclipse.jgit-6.10.0.202406032230-r-license.txt index 8f332dbfe3aa..a9e04ec8dd7d 100644 --- a/ide/o.eclipse.jgit.ssh.jsch/external/org.eclipse.jgit.ssh.jsch-6.9.0.202403050737-r-license.txt +++ b/ide/o.eclipse.jgit/external/org.eclipse.jgit-6.10.0.202406032230-r-license.txt @@ -1,6 +1,6 @@ Name: JGit Library Origin: Eclipse -Version: 6.9.0.202403050737-r +Version: 6.10.0.202406032230-r Description: Integration library for Git client License: EDL-1.0-jgit URL: http://www.eclipse.org/jgit/download/ diff --git a/ide/o.eclipse.jgit/nbproject/project.properties b/ide/o.eclipse.jgit/nbproject/project.properties index 0b02fbdae0fe..99a7a099b627 100644 --- a/ide/o.eclipse.jgit/nbproject/project.properties +++ b/ide/o.eclipse.jgit/nbproject/project.properties @@ -17,4 +17,4 @@ is.autoload=true -release.external/org.eclipse.jgit-6.9.0.202403050737-r.jar=modules/org-eclipse-jgit.jar +release.external/org.eclipse.jgit-6.10.0.202406032230-r.jar=modules/org-eclipse-jgit.jar diff --git a/ide/o.eclipse.jgit/nbproject/project.xml b/ide/o.eclipse.jgit/nbproject/project.xml index a1c1321b97ef..ddc48797cf81 100644 --- a/ide/o.eclipse.jgit/nbproject/project.xml +++ b/ide/o.eclipse.jgit/nbproject/project.xml @@ -52,7 +52,7 @@ org-eclipse-jgit.jar - external/org.eclipse.jgit-6.9.0.202403050737-r.jar + external/org.eclipse.jgit-6.10.0.202406032230-r.jar diff --git a/ide/o.n.swing.dirchooser/manifest.mf b/ide/o.n.swing.dirchooser/manifest.mf index 495a94d08dac..062ffc291c3b 100644 --- a/ide/o.n.swing.dirchooser/manifest.mf +++ b/ide/o.n.swing.dirchooser/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.swing.dirchooser OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/dirchooser/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 OpenIDE-Module-Install: org/netbeans/swing/dirchooser/Module.class AutoUpdate-Show-In-Client: false diff --git a/ide/o.openidex.util/manifest.mf b/ide/o.openidex.util/manifest.mf index e5913b605b2a..4eab41651c72 100644 --- a/ide/o.openidex.util/manifest.mf +++ b/ide/o.openidex.util/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openidex.util/3 OpenIDE-Module-Localizing-Bundle: org/openidex/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 3.72 +OpenIDE-Module-Specification-Version: 3.73 OpenIDE-Module-Deprecated: true OpenIDE-Module-Deprecation-Message: Module o.openidex.util is deprecated, use module api.search instead. AutoUpdate-Essential-Module: true diff --git a/ide/options.editor/manifest.mf b/ide/options.editor/manifest.mf index 172c36541729..8a520939611d 100644 --- a/ide/options.editor/manifest.mf +++ b/ide/options.editor/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.options.editor/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/editor/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/options/editor/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.85 +OpenIDE-Module-Specification-Version: 1.86 AutoUpdate-Show-In-Client: false diff --git a/ide/parsing.api/nbproject/project.properties b/ide/parsing.api/nbproject/project.properties index 96bbb987ad1a..f4e7542d9817 100644 --- a/ide/parsing.api/nbproject/project.properties +++ b/ide/parsing.api/nbproject/project.properties @@ -19,7 +19,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml -spec.version.base=9.32.0 +spec.version.base=9.33.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/parsing.indexing/nbproject/project.properties b/ide/parsing.indexing/nbproject/project.properties index 2f44e3fa5e3b..80e978414e3c 100644 --- a/ide/parsing.indexing/nbproject/project.properties +++ b/ide/parsing.indexing/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=9.34.0 +spec.version.base=9.35.0 is.autoload=true javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml diff --git a/ide/parsing.lucene/nbproject/project.properties b/ide/parsing.lucene/nbproject/project.properties index 940b8b4ed0bb..f8d987c82647 100644 --- a/ide/parsing.lucene/nbproject/project.properties +++ b/ide/parsing.lucene/nbproject/project.properties @@ -19,7 +19,7 @@ javac.source=1.8 javadoc.apichanges=${basedir}/apichanges.xml javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=2.61.0 +spec.version.base=2.62.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ **/LuceneIndexTest.class diff --git a/ide/parsing.nb/nbproject/project.properties b/ide/parsing.nb/nbproject/project.properties index ef06985205ef..eeb28896fbb0 100644 --- a/ide/parsing.nb/nbproject/project.properties +++ b/ide/parsing.nb/nbproject/project.properties @@ -17,6 +17,6 @@ is.eager=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.29.0 +spec.version.base=1.30.0 #javadoc.apichanges=${basedir}/apichanges.xml #javadoc.files= diff --git a/ide/parsing.ui/nbproject/project.properties b/ide/parsing.ui/nbproject/project.properties index 5f116d868b1f..7fdc78adc640 100644 --- a/ide/parsing.ui/nbproject/project.properties +++ b/ide/parsing.ui/nbproject/project.properties @@ -17,4 +17,4 @@ is.eager=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.39.0 +spec.version.base=1.40.0 diff --git a/ide/print.editor/manifest.mf b/ide/print.editor/manifest.mf index 63965f608291..738c4dc44a09 100644 --- a/ide/print.editor/manifest.mf +++ b/ide/print.editor/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 7.51 +OpenIDE-Module-Specification-Version: 7.52 OpenIDE-Module: org.netbeans.modules.print.editor OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/print/editor/resources/Bundle.properties diff --git a/ide/project.ant.compat8/manifest.mf b/ide/project.ant.compat8/manifest.mf index ef436fc42995..fc5020a4f04d 100644 --- a/ide/project.ant.compat8/manifest.mf +++ b/ide/project.ant.compat8/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.ant.compat8/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/compat8/Bundle.properties -OpenIDE-Module-Specification-Version: 1.92 +OpenIDE-Module-Specification-Version: 1.93 OpenIDE-Module-Fragment-Host: org.netbeans.modules.project.ant diff --git a/ide/project.ant.ui/manifest.mf b/ide/project.ant.ui/manifest.mf index 314925477b1a..c6f126a21737 100644 --- a/ide/project.ant.ui/manifest.mf +++ b/ide/project.ant.ui/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.ant.ui/1 -OpenIDE-Module-Specification-Version: 1.90 +OpenIDE-Module-Specification-Version: 1.91 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/ui/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/project/ant/ui/AntProjectModule.class diff --git a/ide/project.ant/manifest.mf b/ide/project.ant/manifest.mf index 57162669db1c..122b1f3d7562 100644 --- a/ide/project.ant/manifest.mf +++ b/ide/project.ant/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.ant/1 -OpenIDE-Module-Specification-Version: 1.92 +OpenIDE-Module-Specification-Version: 1.93 OpenIDE-Module-Layer: org/netbeans/modules/project/ant/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bundle.properties diff --git a/ide/project.dependency/nbproject/project.properties b/ide/project.dependency/nbproject/project.properties index b1708caaf03b..375079510bfc 100644 --- a/ide/project.dependency/nbproject/project.properties +++ b/ide/project.dependency/nbproject/project.properties @@ -19,4 +19,4 @@ is.autoload=true javac.source=11 javac.target=11 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.9.0 +spec.version.base=1.10.0 diff --git a/ide/project.indexingbridge/manifest.mf b/ide/project.indexingbridge/manifest.mf index 3a9ff96588be..11b7bba28f55 100644 --- a/ide/project.indexingbridge/manifest.mf +++ b/ide/project.indexingbridge/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.indexingbridge OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/indexingbridge/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 diff --git a/ide/project.libraries.ui/manifest.mf b/ide/project.libraries.ui/manifest.mf index 347fc34cb36e..0511366b60eb 100644 --- a/ide/project.libraries.ui/manifest.mf +++ b/ide/project.libraries.ui/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.libraries.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/libraries/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.77 +OpenIDE-Module-Specification-Version: 1.78 diff --git a/ide/project.libraries/manifest.mf b/ide/project.libraries/manifest.mf index db9e98713eb1..7f55f88082c6 100644 --- a/ide/project.libraries/manifest.mf +++ b/ide/project.libraries/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.libraries/1 OpenIDE-Module-Layer: org/netbeans/modules/project/libraries/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.78 +OpenIDE-Module-Specification-Version: 1.79 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/libraries/resources/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/ide/project.spi.intern.impl/manifest.mf b/ide/project.spi.intern.impl/manifest.mf index 4f1f32d10461..d190b48d3349 100644 --- a/ide/project.spi.intern.impl/manifest.mf +++ b/ide/project.spi.intern.impl/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.spi.intern.impl OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/spi/intern/impl/Bundle.properties -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/ide/project.spi.intern/manifest.mf b/ide/project.spi.intern/manifest.mf index 18071dbabd3b..a6063ae609af 100644 --- a/ide/project.spi.intern/manifest.mf +++ b/ide/project.spi.intern/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.spi.intern OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/spi/intern/Bundle.properties -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/ide/projectapi.nb/manifest.mf b/ide/projectapi.nb/manifest.mf index 9e6eda09f4fc..184722824b74 100644 --- a/ide/projectapi.nb/manifest.mf +++ b/ide/projectapi.nb/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.projectapi.nb OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectapi/nb/Bundle.properties OpenIDE-Module-Provides: org.netbeans.spi.project.ProjectManagerImplementation -OpenIDE-Module-Specification-Version: 1.29 +OpenIDE-Module-Specification-Version: 1.30 AutoUpdate-Show-In-Client: false diff --git a/ide/projectapi/manifest.mf b/ide/projectapi/manifest.mf index 290b191798a3..f8119783bc13 100644 --- a/ide/projectapi/manifest.mf +++ b/ide/projectapi/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.projectapi/1 -OpenIDE-Module-Specification-Version: 1.96 +OpenIDE-Module-Specification-Version: 1.97 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectapi/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/projectapi/layer.xml OpenIDE-Module-Needs: org.netbeans.spi.project.ProjectManagerImplementation diff --git a/ide/projectui.buildmenu/nbproject/project.properties b/ide/projectui.buildmenu/nbproject/project.properties index 7cef2d9917de..1e1e57f4ec5d 100644 --- a/ide/projectui.buildmenu/nbproject/project.properties +++ b/ide/projectui.buildmenu/nbproject/project.properties @@ -19,4 +19,4 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.51.0 +spec.version.base=1.52.0 diff --git a/ide/projectui/nbproject/project.properties b/ide/projectui/nbproject/project.properties index 0301e503139e..4e8d82ed6e16 100644 --- a/ide/projectui/nbproject/project.properties +++ b/ide/projectui/nbproject/project.properties @@ -16,8 +16,8 @@ # under the License. javac.compilerargs=-Xlint:unchecked -javac.source=1.8 -spec.version.base=1.84.0 +javac.release=17 +spec.version.base=1.85.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml diff --git a/ide/projectui/nbproject/project.xml b/ide/projectui/nbproject/project.xml index cc48b846ca49..6fe03beedfb3 100644 --- a/ide/projectui/nbproject/project.xml +++ b/ide/projectui/nbproject/project.xml @@ -34,6 +34,15 @@ 1.13 + + org.netbeans.api.dashboard + + + + 0 + 0.2 + + org.netbeans.api.progress @@ -301,10 +310,8 @@ com.oracle.tools.ide.welcome com.sun.tools.swdev.sunstudio org.netbeans.modules.apisupport.ant - org.netbeans.modules.ide.dashboard org.netbeans.modules.java.j2seproject org.netbeans.modules.maven - org.netbeans.modules.welcome org.netbeans.modules.project.ui.api org.netbeans.modules.project.ui.spi diff --git a/nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/RecentProjectsWidget.java b/ide/projectui/src/org/netbeans/modules/project/ui/RecentProjectsWidget.java similarity index 99% rename from nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/RecentProjectsWidget.java rename to ide/projectui/src/org/netbeans/modules/project/ui/RecentProjectsWidget.java index fdea5ceadc65..885e662b3631 100644 --- a/nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/RecentProjectsWidget.java +++ b/ide/projectui/src/org/netbeans/modules/project/ui/RecentProjectsWidget.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.netbeans.modules.ide.dashboard; +package org.netbeans.modules.project.ui; import java.awt.EventQueue; import java.awt.event.ActionEvent; diff --git a/ide/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml b/ide/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml index c94adacd7f47..cfcb8b01328f 100644 --- a/ide/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml +++ b/ide/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml @@ -122,6 +122,14 @@ + + + + + + + + diff --git a/ide/projectuiapi.base/nbproject/project.properties b/ide/projectuiapi.base/nbproject/project.properties index 8eea6c94d6c0..0e21876053a7 100644 --- a/ide/projectuiapi.base/nbproject/project.properties +++ b/ide/projectuiapi.base/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.111.0 +spec.version.base=1.112.0 is.autoload=true javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml diff --git a/ide/projectuiapi/nbproject/project.properties b/ide/projectuiapi/nbproject/project.properties index 84571a6c7d14..6aa8e6189210 100644 --- a/ide/projectuiapi/nbproject/project.properties +++ b/ide/projectuiapi/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.114.0 +spec.version.base=1.115.0 is.autoload=true javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml diff --git a/ide/properties.syntax/manifest.mf b/ide/properties.syntax/manifest.mf index 88ce2348c7a5..2a8802844063 100644 --- a/ide/properties.syntax/manifest.mf +++ b/ide/properties.syntax/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.properties.syntax/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/properties/syntax/Bundle.properties -OpenIDE-Module-Specification-Version: 1.75 +OpenIDE-Module-Specification-Version: 1.76 OpenIDE-Module-Install: org/netbeans/modules/properties/syntax/RestoreColoring.class OpenIDE-Module-Layer: org/netbeans/modules/properties/syntax/Layer.xml diff --git a/ide/properties/manifest.mf b/ide/properties/manifest.mf index e60bef18b68c..b0d0c88ab072 100644 --- a/ide/properties/manifest.mf +++ b/ide/properties/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.properties/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/properties/Bundle.properties -OpenIDE-Module-Specification-Version: 1.80 +OpenIDE-Module-Specification-Version: 1.81 OpenIDE-Module-Layer: org/netbeans/modules/properties/Layer.xml AutoUpdate-Show-In-Client: false diff --git a/ide/refactoring.api/nbproject/project.properties b/ide/refactoring.api/nbproject/project.properties index ff2dd859cf42..28353fae02e1 100644 --- a/ide/refactoring.api/nbproject/project.properties +++ b/ide/refactoring.api/nbproject/project.properties @@ -20,5 +20,5 @@ javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml javadoc.title=Refactoring API -spec.version.base=1.72.0 +spec.version.base=1.73.0 test.config.stableBTD.includes=**/*Test.class diff --git a/ide/schema2beans/manifest.mf b/ide/schema2beans/manifest.mf index f012cf1fe541..479a4820ac0a 100644 --- a/ide/schema2beans/manifest.mf +++ b/ide/schema2beans/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/schema2beans/Bundle.properties OpenIDE-Module: org.netbeans.modules.schema2beans/1 -OpenIDE-Module-Specification-Version: 1.72 +OpenIDE-Module-Specification-Version: 1.73 diff --git a/ide/selenium2.server/manifest.mf b/ide/selenium2.server/manifest.mf index f30e2d266579..79bf849d7505 100644 --- a/ide/selenium2.server/manifest.mf +++ b/ide/selenium2.server/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.selenium2.server OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/selenium2/server/Bundle.properties -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/ide/selenium2/manifest.mf b/ide/selenium2/manifest.mf index 54e7aea82a97..b9bf1e598e41 100644 --- a/ide/selenium2/manifest.mf +++ b/ide/selenium2/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.selenium2 OpenIDE-Module-Layer: org/netbeans/modules/selenium2/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/selenium2/Bundle.properties -OpenIDE-Module-Specification-Version: 1.30 +OpenIDE-Module-Specification-Version: 1.31 diff --git a/ide/server/manifest.mf b/ide/server/manifest.mf index e0081deb88b5..22e28c8ba2df 100644 --- a/ide/server/manifest.mf +++ b/ide/server/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.server/0 OpenIDE-Module-Layer: org/netbeans/modules/server/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/server/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 AutoUpdate-Show-In-Client: false OpenIDE-Module-Provides: org.netbeans.modules.server diff --git a/ide/servletapi/manifest.mf b/ide/servletapi/manifest.mf index d6ba9c8bb122..63f9c661343c 100644 --- a/ide/servletapi/manifest.mf +++ b/ide/servletapi/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.servletapi/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/servletapi/Bundle.properties -OpenIDE-Module-Specification-Version: 1.64 +OpenIDE-Module-Specification-Version: 1.65 diff --git a/ide/spellchecker.apimodule/manifest.mf b/ide/spellchecker.apimodule/manifest.mf index a2cd2767e048..eb570c0d5344 100644 --- a/ide/spellchecker.apimodule/manifest.mf +++ b/ide/spellchecker.apimodule/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.spellchecker.apimodule XOpenIDE-Module-Layer: org/netbeans/modules/spellchecker/apimodule/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/spellchecker/apimodule/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 AutoUpdate-Show-In-Client: false diff --git a/ide/spellchecker.bindings.htmlxml/manifest.mf b/ide/spellchecker.bindings.htmlxml/manifest.mf index 3aa0553cf408..fa1e1ad864e9 100644 --- a/ide/spellchecker.bindings.htmlxml/manifest.mf +++ b/ide/spellchecker.bindings.htmlxml/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.spellchecker.bindings.htmlxml OpenIDE-Module-Layer: org/netbeans/modules/spellchecker/bindings/htmlxml/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/spellchecker/bindings/htmlxml/Bundle.properties -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 diff --git a/ide/spellchecker.bindings.properties/manifest.mf b/ide/spellchecker.bindings.properties/manifest.mf index f429b9c7c898..844b0625ddb4 100644 --- a/ide/spellchecker.bindings.properties/manifest.mf +++ b/ide/spellchecker.bindings.properties/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.spellchecker.bindings.properties OpenIDE-Module-Layer: org/netbeans/modules/spellchecker/bindings/properties/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/spellchecker/bindings/properties/Bundle.properties -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/ide/spellchecker.dictionary_en/manifest.mf b/ide/spellchecker.dictionary_en/manifest.mf index 6ec26460c2cd..04a8cc45cdbc 100644 --- a/ide/spellchecker.dictionary_en/manifest.mf +++ b/ide/spellchecker.dictionary_en/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.spellchecker.dictionary_en XOpenIDE-Module-Layer: org/netbeans/modules/spellchecker/dictionary_en/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/spellchecker/dictionary_en/Bundle.properties -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/ide/spellchecker.kit/manifest.mf b/ide/spellchecker.kit/manifest.mf index 2185ebee1955..ada65faed78c 100644 --- a/ide/spellchecker.kit/manifest.mf +++ b/ide/spellchecker.kit/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.spellchecker.kit XOpenIDE-Module-Layer: org/netbeans/modules/spellchecker/kit/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/spellchecker/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 diff --git a/ide/spellchecker/nbproject/project.properties b/ide/spellchecker/nbproject/project.properties index bb13380def22..b251dc5f1f4a 100644 --- a/ide/spellchecker/nbproject/project.properties +++ b/ide/spellchecker/nbproject/project.properties @@ -20,7 +20,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 nbm.homepage=http://spellchecker.netbeans.org nbm.module.author=Jan Lahoda -spec.version.base=1.60.0 +spec.version.base=1.61.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/spi.debugger.ui/manifest.mf b/ide/spi.debugger.ui/manifest.mf index 9a7f819f42f0..c631276acc86 100644 --- a/ide/spi.debugger.ui/manifest.mf +++ b/ide/spi.debugger.ui/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.spi.debugger.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/ui/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 2.83 +OpenIDE-Module-Specification-Version: 2.84 OpenIDE-Module-Provides: org.netbeans.spi.debugger.ui OpenIDE-Module-Install: org/netbeans/modules/debugger/ui/DebuggerModule.class diff --git a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/evaluator/code_evaluator.wsmode b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/evaluator/code_evaluator.wsmode index 0130b00e1039..5237b3e169a2 100644 --- a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/evaluator/code_evaluator.wsmode +++ b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/evaluator/code_evaluator.wsmode @@ -24,15 +24,17 @@ "-//NetBeans//DTD Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/mode-properties2_0.dtd"> - + + - - - + + + + - + diff --git a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/groups/debugger/evaluator.wstcgrp b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/groups/debugger/evaluator.wstcgrp index c64bb65dd72e..423180292603 100644 --- a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/groups/debugger/evaluator.wstcgrp +++ b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/groups/debugger/evaluator.wstcgrp @@ -27,5 +27,5 @@ - + diff --git a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/mf-layer.xml b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/mf-layer.xml index d511056629f5..11d482fba6cf 100644 --- a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/mf-layer.xml +++ b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/mf-layer.xml @@ -346,9 +346,6 @@ - - - @@ -367,6 +364,11 @@ + + + + + diff --git a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/modes/output/breakpoints.wstcref b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/modes/navigator/breakpoints.wstcref similarity index 100% rename from ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/modes/output/breakpoints.wstcref rename to ide/spi.debugger.ui/src/org/netbeans/modules/debugger/resources/modes/navigator/breakpoints.wstcref diff --git a/ide/spi.editor.hints.projects/nbproject/project.properties b/ide/spi.editor.hints.projects/nbproject/project.properties index f4eba2fe4cff..b968453f283a 100644 --- a/ide/spi.editor.hints.projects/nbproject/project.properties +++ b/ide/spi.editor.hints.projects/nbproject/project.properties @@ -18,5 +18,5 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.36.0 +spec.version.base=1.37.0 spec.version.base.fatal.warning=false diff --git a/ide/spi.editor.hints/nbproject/project.properties b/ide/spi.editor.hints/nbproject/project.properties index 00344f9e6587..5025f75d900d 100644 --- a/ide/spi.editor.hints/nbproject/project.properties +++ b/ide/spi.editor.hints/nbproject/project.properties @@ -18,6 +18,6 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.67.0 +spec.version.base=1.68.0 test.config.stableBTD.includes=**/*Test.class diff --git a/ide/spi.editor.hints/src/org/netbeans/modules/editor/hints/lsp/HintsDiagnosticsProvider.java b/ide/spi.editor.hints/src/org/netbeans/modules/editor/hints/lsp/HintsDiagnosticsProvider.java index bb44116320d2..2ddfc5cfc3e8 100644 --- a/ide/spi.editor.hints/src/org/netbeans/modules/editor/hints/lsp/HintsDiagnosticsProvider.java +++ b/ide/spi.editor.hints/src/org/netbeans/modules/editor/hints/lsp/HintsDiagnosticsProvider.java @@ -22,7 +22,6 @@ import java.util.List; import javax.swing.text.Document; import org.netbeans.api.editor.document.LineDocument; -import org.netbeans.api.editor.mimelookup.MimeRegistration; import org.netbeans.api.lsp.Diagnostic; import org.netbeans.modules.editor.hints.AnnotationHolder; import org.netbeans.spi.editor.hints.ErrorDescription; @@ -34,14 +33,15 @@ /** * A simple implementation of {@link ErrorProvider} that converts errors + hints collected by * {@link HintsController} to LSP {@link Diagnostic}. The implementation does not support code actions yet. + * The implementation is registered by + * {@code java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml}. *

* As {@link ErrorProvider}s are registered in MIME Lookup, this implementation is enumerated after those * possibly registered for specific MIME types. * * @author sdedic */ -@MimeRegistration(mimeType = "", service = ErrorProvider.class) -public class HintsDiagnosticsProvider implements ErrorProvider { +public final class HintsDiagnosticsProvider implements ErrorProvider { public HintsDiagnosticsProvider() { } diff --git a/ide/spi.editor.hints/src/org/netbeans/spi/editor/hints/Fix.java b/ide/spi.editor.hints/src/org/netbeans/spi/editor/hints/Fix.java index 2d9fab1996ca..934c23a4dcb8 100644 --- a/ide/spi.editor.hints/src/org/netbeans/spi/editor/hints/Fix.java +++ b/ide/spi.editor.hints/src/org/netbeans/spi/editor/hints/Fix.java @@ -19,6 +19,8 @@ package org.netbeans.spi.editor.hints; +import org.netbeans.modules.editor.hints.HintsControllerImpl; + /** * Allows to perform a change when the user selects the hint. * @author Jan Lahoda @@ -39,4 +41,8 @@ public interface Fix { * determined. */ public abstract ChangeInfo implement() throws Exception; + + default Iterable getSubfixes() { + return HintsControllerImpl.getSubfixes(this); + } } diff --git a/ide/spi.navigator/manifest.mf b/ide/spi.navigator/manifest.mf index 79dbf4232465..badd66e9bd31 100644 --- a/ide/spi.navigator/manifest.mf +++ b/ide/spi.navigator/manifest.mf @@ -2,4 +2,4 @@ Manifest-version: 1.0 OpenIDE-Module: org.netbeans.spi.navigator/1 OpenIDE-Module-Layer: org/netbeans/modules/navigator/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/navigator/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.63 +OpenIDE-Module-Specification-Version: 1.64 diff --git a/ide/spi.palette/manifest.mf b/ide/spi.palette/manifest.mf index 647cdfc01e17..f5f3ac9f550e 100644 --- a/ide/spi.palette/manifest.mf +++ b/ide/spi.palette/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.spi.palette/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/palette/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.71 +OpenIDE-Module-Specification-Version: 1.72 OpenIDE-Module-Layer: org/netbeans/modules/palette/resources/layer.xml diff --git a/ide/spi.tasklist/nbproject/project.properties b/ide/spi.tasklist/nbproject/project.properties index 39daafc8d35a..07dd5d467c5f 100644 --- a/ide/spi.tasklist/nbproject/project.properties +++ b/ide/spi.tasklist/nbproject/project.properties @@ -19,6 +19,6 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.60.0 +spec.version.base=1.61.0 test.config.stableBTD.includes=**/*Test.class diff --git a/ide/spi.viewmodel/manifest.mf b/ide/spi.viewmodel/manifest.mf index 71bc16080946..dba2cdf787c1 100644 --- a/ide/spi.viewmodel/manifest.mf +++ b/ide/spi.viewmodel/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.spi.viewmodel/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/viewmodel/Bundle.properties -OpenIDE-Module-Specification-Version: 1.76 +OpenIDE-Module-Specification-Version: 1.77 diff --git a/ide/subversion/nbproject/project.properties b/ide/subversion/nbproject/project.properties index b00826d21961..808e56a2e562 100644 --- a/ide/subversion/nbproject/project.properties +++ b/ide/subversion/nbproject/project.properties @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -spec.version.base=1.67.0 +spec.version.base=1.68.0 javac.compilerargs=-Xlint:unchecked javac.source=1.8 diff --git a/ide/swing.validation/manifest.mf b/ide/swing.validation/manifest.mf index 151f26147a0e..8acf59a367d9 100644 --- a/ide/swing.validation/manifest.mf +++ b/ide/swing.validation/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.swing.validation/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/swing/validation/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 diff --git a/ide/target.iterator/manifest.mf b/ide/target.iterator/manifest.mf index bd91347c8c70..93214c2703ee 100644 --- a/ide/target.iterator/manifest.mf +++ b/ide/target.iterator/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.target.iterator/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/target/iterator/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 AutoUpdate-Show-In-Client: false diff --git a/ide/tasklist.kit/manifest.mf b/ide/tasklist.kit/manifest.mf index c1c33e380bfb..76e43c54e30b 100644 --- a/ide/tasklist.kit/manifest.mf +++ b/ide/tasklist.kit/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.tasklist.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/tasklist/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.53 +OpenIDE-Module-Specification-Version: 1.54 diff --git a/ide/tasklist.projectint/manifest.mf b/ide/tasklist.projectint/manifest.mf index 20668bc7f288..74c23ad9ad58 100644 --- a/ide/tasklist.projectint/manifest.mf +++ b/ide/tasklist.projectint/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.tasklist.projectint/1 OpenIDE-Module-Layer: org/netbeans/modules/tasklist/projectint/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/tasklist/projectint/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 AutoUpdate-Show-In-Client: false diff --git a/ide/tasklist.todo/nbproject/project.properties b/ide/tasklist.todo/nbproject/project.properties index 45c6d2eca031..876beb53655b 100644 --- a/ide/tasklist.todo/nbproject/project.properties +++ b/ide/tasklist.todo/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.56.0 +spec.version.base=1.57.0 #hook for apisupport TestBase test-unit-sys-prop.test.nbcvsroot=${nb_all} test-unit-sys-prop.xtest.netbeans.dest.dir=${netbeans.dest.dir} diff --git a/ide/tasklist.ui/nbproject/project.properties b/ide/tasklist.ui/nbproject/project.properties index 0719d0e225c4..1694d26c026c 100644 --- a/ide/tasklist.ui/nbproject/project.properties +++ b/ide/tasklist.ui/nbproject/project.properties @@ -16,6 +16,6 @@ # under the License. javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.56.0 +spec.version.base=1.57.0 test.config.stableBTD.includes=**/*Test.class diff --git a/ide/team.commons/manifest.mf b/ide/team.commons/manifest.mf index 1583e4e0a948..315d5553c749 100644 --- a/ide/team.commons/manifest.mf +++ b/ide/team.commons/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.team.commons OpenIDE-Module-Layer: org/netbeans/modules/team/commons/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/team/commons/Bundle.properties -OpenIDE-Module-Specification-Version: 1.75 +OpenIDE-Module-Specification-Version: 1.76 diff --git a/ide/team.ide/manifest.mf b/ide/team.ide/manifest.mf index 6ff61fdb414f..cb857e5d9874 100644 --- a/ide/team.ide/manifest.mf +++ b/ide/team.ide/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.team.ide OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/team/ide/Bundle.properties -OpenIDE-Module-Specification-Version: 1.39 +OpenIDE-Module-Specification-Version: 1.40 diff --git a/ide/terminal.nb/manifest.mf b/ide/terminal.nb/manifest.mf index 13a7ce6100d3..60f2ab0a1a68 100644 --- a/ide/terminal.nb/manifest.mf +++ b/ide/terminal.nb/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.terminal.nb OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/terminal/nb/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/terminal/nb/layer.xml -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/ide/terminal.nb/src/org/netbeans/modules/terminal/iocontainer/TerminalContainerTabbed.java b/ide/terminal.nb/src/org/netbeans/modules/terminal/iocontainer/TerminalContainerTabbed.java index 6101d07a5c73..4fb3a0530e53 100644 --- a/ide/terminal.nb/src/org/netbeans/modules/terminal/iocontainer/TerminalContainerTabbed.java +++ b/ide/terminal.nb/src/org/netbeans/modules/terminal/iocontainer/TerminalContainerTabbed.java @@ -268,8 +268,18 @@ private class PopupListener extends MouseUtils.PopupMouseAdapter { @Override protected void showPopup(MouseEvent e) { - Terminal selected = (Terminal) getSelected(); - + Terminal selected = null; + if (e.getSource() == tabbedPane) { + int tabIndex = tabbedPane.indexAtLocation(e.getX(), e.getY()); + if(tabIndex >= 0) { + selected = (Terminal) tabbedPane.getComponentAt(tabIndex); + } + } + + if (selected == null) { + selected = (Terminal) getSelected(); + } + Action close = ActionFactory.forID(ActionFactory.CLOSE_ACTION_ID); Action setTitle = ActionFactory.forID(ActionFactory.SET_TITLE_ACTION_ID); Action pin = ActionFactory.forID(ActionFactory.PIN_TAB_ACTION_ID); @@ -285,7 +295,7 @@ protected void showPopup(MouseEvent e) { null, setTitle, pin - }, Lookups.fixed(getSelected()) + }, Lookups.fixed(selected) ); menu.show(TerminalContainerTabbed.this, e.getX(), e.getY()); } diff --git a/ide/terminal/manifest.mf b/ide/terminal/manifest.mf index 01fdcd799a0f..8959aa04bb8a 100644 --- a/ide/terminal/manifest.mf +++ b/ide/terminal/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.terminal OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/terminal/Bundle.properties OpenIDE-Module-Provides: org.openide.windows.IOProvider -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 diff --git a/ide/textmate.lexer/nbproject/project.properties b/ide/textmate.lexer/nbproject/project.properties index aefc19a7b36c..d31cadc606ce 100644 --- a/ide/textmate.lexer/nbproject/project.properties +++ b/ide/textmate.lexer/nbproject/project.properties @@ -21,4 +21,4 @@ javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml release.external/joni-2.1.11.jar=modules/ext/joni-2.1.11.jar release.external/org.eclipse.tm4e.core-0.4.1-pack1.jar=modules/ext/org.eclipse.tm4e.core-0.4.1-pack1.jar -spec.version.base=1.25.0 +spec.version.base=1.26.0 diff --git a/ide/usersguide/manifest.mf b/ide/usersguide/manifest.mf index 467e743ef971..5d4e80becaf5 100644 --- a/ide/usersguide/manifest.mf +++ b/ide/usersguide/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.usersguide/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/usersguide/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/usersguide/layer.xml -OpenIDE-Module-Specification-Version: 1.73 +OpenIDE-Module-Specification-Version: 1.74 AutoUpdate-Show-In-Client: false diff --git a/ide/utilities.project/manifest.mf b/ide/utilities.project/manifest.mf index 393ac806840d..3b0d9055751d 100644 --- a/ide/utilities.project/manifest.mf +++ b/ide/utilities.project/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.utilities.project/1 OpenIDE-Module-Layer: org/netbeans/modules/search/project/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/search/project/Bundle.properties -OpenIDE-Module-Specification-Version: 1.63 +OpenIDE-Module-Specification-Version: 1.64 diff --git a/ide/utilities/manifest.mf b/ide/utilities/manifest.mf index aed54ef77f53..de8e649894c4 100644 --- a/ide/utilities/manifest.mf +++ b/ide/utilities/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.utilities/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/utilities/Bundle.properties -OpenIDE-Module-Specification-Version: 1.86 +OpenIDE-Module-Specification-Version: 1.87 OpenIDE-Module-Install: org/netbeans/modules/utilities/Installer.class OpenIDE-Module-Layer: org/netbeans/modules/utilities/Layer.xml OpenIDE-Module-Requires: org.openide.modules.InstalledFileLocator diff --git a/ide/utilities/nbproject/project.properties b/ide/utilities/nbproject/project.properties index c00868d2965b..2fdb0bcfdb08 100644 --- a/ide/utilities/nbproject/project.properties +++ b/ide/utilities/nbproject/project.properties @@ -17,7 +17,7 @@ #javac.compilerargs=-Xlint:unchecked -javac.source=1.8 +javac.release=17 javadoc.arch=${basedir}/arch.xml test.config.stableBTD.includes=**/*Test.class diff --git a/ide/utilities/nbproject/project.xml b/ide/utilities/nbproject/project.xml index 74917c757dee..e4846b0bdb8d 100644 --- a/ide/utilities/nbproject/project.xml +++ b/ide/utilities/nbproject/project.xml @@ -25,6 +25,15 @@ org.netbeans.modules.utilities + + org.netbeans.api.dashboard + + + + 0 + 0.2 + + org.netbeans.modules.queries @@ -176,7 +185,6 @@ org.netbeans.modules.cnd.utils org.netbeans.modules.dlight.remote.impl - org.netbeans.modules.ide.dashboard org.netbeans.modules.utilities.project org.netbeans.modules.visualweb.gravy io.github.jeddict.jpa.modeler diff --git a/nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/RecentFilesWidget.java b/ide/utilities/src/org/netbeans/modules/openfile/RecentFilesWidget.java similarity index 97% rename from nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/RecentFilesWidget.java rename to ide/utilities/src/org/netbeans/modules/openfile/RecentFilesWidget.java index d0e614963618..223ef1b14ab4 100644 --- a/nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/RecentFilesWidget.java +++ b/ide/utilities/src/org/netbeans/modules/openfile/RecentFilesWidget.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.netbeans.modules.ide.dashboard; +package org.netbeans.modules.openfile; import java.awt.EventQueue; import java.awt.event.ActionEvent; @@ -29,8 +29,6 @@ import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.Icon; -import org.netbeans.modules.openfile.OpenFile; -import org.netbeans.modules.openfile.RecentFiles; import org.netbeans.spi.dashboard.DashboardDisplayer; import org.netbeans.spi.dashboard.DashboardWidget; import org.netbeans.spi.dashboard.WidgetElement; diff --git a/ide/utilities/src/org/netbeans/modules/utilities/Layer.xml b/ide/utilities/src/org/netbeans/modules/utilities/Layer.xml index cb0abefd4001..d87fd69ff2f1 100644 --- a/ide/utilities/src/org/netbeans/modules/utilities/Layer.xml +++ b/ide/utilities/src/org/netbeans/modules/utilities/Layer.xml @@ -166,7 +166,13 @@ - + + + + + + + diff --git a/ide/versioning.core/nbproject/project.properties b/ide/versioning.core/nbproject/project.properties index 9068d79fac19..21f0fcc0899b 100644 --- a/ide/versioning.core/nbproject/project.properties +++ b/ide/versioning.core/nbproject/project.properties @@ -19,7 +19,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.name=Versioning -spec.version.base=1.56.0 +spec.version.base=1.57.0 is.autoload=true javadoc.arch=${basedir}/arch.xml diff --git a/ide/versioning.indexingbridge/manifest.mf b/ide/versioning.indexingbridge/manifest.mf index 2f12c4869102..993a8d853b84 100644 --- a/ide/versioning.indexingbridge/manifest.mf +++ b/ide/versioning.indexingbridge/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.versioning.indexingbridge/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/versioning/indexingbridge/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.versioning.indexingbridge -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 diff --git a/ide/versioning.masterfs/manifest.mf b/ide/versioning.masterfs/manifest.mf index 24c35bcecef6..8cb6f9349dff 100644 --- a/ide/versioning.masterfs/manifest.mf +++ b/ide/versioning.masterfs/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.versioning.masterfs OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/versioning/masterfs/Bundle.properties -OpenIDE-Module-Specification-Version: 1.39 +OpenIDE-Module-Specification-Version: 1.40 diff --git a/ide/versioning.system.cvss.installer/manifest.mf b/ide/versioning.system.cvss.installer/manifest.mf index 87da8f749bb3..03c4c87f2a4f 100644 --- a/ide/versioning.system.cvss.installer/manifest.mf +++ b/ide/versioning.system.cvss.installer/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.versioning.system.cvss.installer OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/versioning/system/cvss/installer/Bundle.properties -OpenIDE-Module-Specification-Version: 1.41 +OpenIDE-Module-Specification-Version: 1.42 AutoUpdate-Essential-Module: false diff --git a/ide/versioning.ui/nbproject/project.properties b/ide/versioning.ui/nbproject/project.properties index 9cfcb5fb0f3b..a529e1263807 100644 --- a/ide/versioning.ui/nbproject/project.properties +++ b/ide/versioning.ui/nbproject/project.properties @@ -19,4 +19,4 @@ is.eager=true javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.48.0 +spec.version.base=1.49.0 diff --git a/ide/versioning.util/nbproject/project.properties b/ide/versioning.util/nbproject/project.properties index 4ed336354c2b..56c6b59e516a 100644 --- a/ide/versioning.util/nbproject/project.properties +++ b/ide/versioning.util/nbproject/project.properties @@ -19,7 +19,7 @@ javac.compilerargs=-Xlint:unchecked javac.release=11 javadoc.name=Versioning Support Utilities -spec.version.base=2.1.0 +spec.version.base=2.2.0 is.autoload=true # Fatal error: Fatal error: class javax.net.SocketFactory not found diff --git a/ide/versioning/nbproject/project.properties b/ide/versioning/nbproject/project.properties index 9f08cc50e6c0..a867758cf6c3 100644 --- a/ide/versioning/nbproject/project.properties +++ b/ide/versioning/nbproject/project.properties @@ -19,7 +19,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.name=Versioning -spec.version.base=1.72.0 +spec.version.base=1.73.0 is.autoload=true javadoc.arch=${basedir}/arch.xml diff --git a/ide/web.browser.api/manifest.mf b/ide/web.browser.api/manifest.mf index b30cbd3f1f04..06eba5b6f83c 100644 --- a/ide/web.browser.api/manifest.mf +++ b/ide/web.browser.api/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module: org.netbeans.modules.web.browser.api OpenIDE-Module-Layer: org/netbeans/modules/web/browser/ui/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/browser/api/Bundle.properties OpenIDE-Module-Recommends: org.openide.windows.WindowManager -OpenIDE-Module-Specification-Version: 1.70 +OpenIDE-Module-Specification-Version: 1.71 diff --git a/ide/web.common.ui/manifest.mf b/ide/web.common.ui/manifest.mf index 805d032ec162..9b96a46c639b 100644 --- a/ide/web.common.ui/manifest.mf +++ b/ide/web.common.ui/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.common.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/common/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.26 +OpenIDE-Module-Specification-Version: 1.27 diff --git a/ide/web.common/manifest.mf b/ide/web.common/manifest.mf index fef7154101ac..8f47c61c9261 100644 --- a/ide/web.common/manifest.mf +++ b/ide/web.common/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.common OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/common/Bundle.properties -OpenIDE-Module-Specification-Version: 1.124 +OpenIDE-Module-Specification-Version: 1.125 diff --git a/ide/web.indent/manifest.mf b/ide/web.indent/manifest.mf index 9d79c57b3606..2e157d88d5db 100644 --- a/ide/web.indent/manifest.mf +++ b/ide/web.indent/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.web.indent OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/indent/Bundle.properties -OpenIDE-Module-Specification-Version: 1.45 +OpenIDE-Module-Specification-Version: 1.46 diff --git a/ide/web.webkit.debugging/manifest.mf b/ide/web.webkit.debugging/manifest.mf index 4368915ace46..121d002fb7af 100644 --- a/ide/web.webkit.debugging/manifest.mf +++ b/ide/web.webkit.debugging/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.web.webkit.debugging OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/webkit/debugging/Bundle.properties -OpenIDE-Module-Specification-Version: 1.78 +OpenIDE-Module-Specification-Version: 1.79 diff --git a/ide/xml.axi/manifest.mf b/ide/xml.axi/manifest.mf index 0e8e80c0c2ba..c409535ebcf9 100644 --- a/ide/xml.axi/manifest.mf +++ b/ide/xml.axi/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.xml.axi OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/axi/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 diff --git a/ide/xml.catalog.ui/nbproject/project.properties b/ide/xml.catalog.ui/nbproject/project.properties index 5578e9f768b7..fe00d9f37e62 100644 --- a/ide/xml.catalog.ui/nbproject/project.properties +++ b/ide/xml.catalog.ui/nbproject/project.properties @@ -16,4 +16,4 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=2.28.0 +spec.version.base=2.29.0 diff --git a/ide/xml.catalog/nbproject/project.properties b/ide/xml.catalog/nbproject/project.properties index 4480bafbc13c..655da59a5b98 100644 --- a/ide/xml.catalog/nbproject/project.properties +++ b/ide/xml.catalog/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.source=1.8 -spec.version.base=3.29.0 +spec.version.base=3.30.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/xml.core/nbproject/project.properties b/ide/xml.core/nbproject/project.properties index aae5105fb912..2e437fbba105 100644 --- a/ide/xml.core/nbproject/project.properties +++ b/ide/xml.core/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.68.0 +spec.version.base=1.69.0 is.autoload=true javadoc.packages=\ diff --git a/ide/xml.core/src/org/netbeans/modules/xml/dtd/grammar/ContentModel.java b/ide/xml.core/src/org/netbeans/modules/xml/dtd/grammar/ContentModel.java index 18fb3228ff5a..9f33bc194cf2 100644 --- a/ide/xml.core/src/org/netbeans/modules/xml/dtd/grammar/ContentModel.java +++ b/ide/xml.core/src/org/netbeans/modules/xml/dtd/grammar/ContentModel.java @@ -598,7 +598,7 @@ public String next() { public boolean hasNext() { if (list.size() > current) return true; if (en.hasMoreElements()) { - String next = (String) en.nextElement(); + String next = en.nextElement(); return list.add(next); } else { return false; diff --git a/ide/xml.jaxb.api/manifest.mf b/ide/xml.jaxb.api/manifest.mf index 8c87f685b460..1565bb315299 100644 --- a/ide/xml.jaxb.api/manifest.mf +++ b/ide/xml.jaxb.api/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.xml.jaxb.api/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/jaxb/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 OpenIDE-Module-Needs: com.sun.xml.bind OpenIDE-Module-Hide-Classpath-Packages: javax.xml.bind.** diff --git a/ide/xml.lexer/manifest.mf b/ide/xml.lexer/manifest.mf index 566adefd4a2f..3dc9930a5d82 100644 --- a/ide/xml.lexer/manifest.mf +++ b/ide/xml.lexer/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.xml.lexer OpenIDE-Module-Localizing-Bundle: org/netbeans/api/xml/lexer/Bundle.properties OpenIDE-Module-Layer: org/netbeans/lib/xml/lexer/layer.xml -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 AutoUpdate-Show-In-Client: false diff --git a/ide/xml.multiview/nbproject/project.properties b/ide/xml.multiview/nbproject/project.properties index 70b297f277fa..6341dd5759e9 100644 --- a/ide/xml.multiview/nbproject/project.properties +++ b/ide/xml.multiview/nbproject/project.properties @@ -18,7 +18,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.63.0 +spec.version.base=1.64.0 is.autoload=true test.unit.cp.extra= diff --git a/ide/xml.multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewDataObject.java b/ide/xml.multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewDataObject.java index 764071c1af6e..1bb1e7892fb6 100644 --- a/ide/xml.multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewDataObject.java +++ b/ide/xml.multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewDataObject.java @@ -504,7 +504,7 @@ public FileLock lock() throws IOException { private synchronized FileLock getLock() { // How this week reference can be useful ? - FileLock l = lockReference == null ? null : (FileLock) lockReference.get(); + FileLock l = lockReference == null ? null : lockReference.get(); if (l != null && !l.isValid()) { l = null; } diff --git a/ide/xml.multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewEditorSupport.java b/ide/xml.multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewEditorSupport.java index f4ef073a3db8..7db3e8ad4f7b 100644 --- a/ide/xml.multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewEditorSupport.java +++ b/ide/xml.multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewEditorSupport.java @@ -801,7 +801,7 @@ public void propertyChange(PropertyChangeEvent evt) { if (mvtc == topComponent) { if (en.hasMoreElements()) { // Remember next cloned top component - mvtc = (CloneableTopComponent) en.nextElement(); + mvtc = en.nextElement(); } else { // All cloned top components are closed notifyClosed(); diff --git a/ide/xml.retriever/manifest.mf b/ide/xml.retriever/manifest.mf index 68561119c3fe..643596d294fc 100644 --- a/ide/xml.retriever/manifest.mf +++ b/ide/xml.retriever/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 OpenIDE-Module: org.netbeans.modules.xml.retriever/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/retriever/Bundle.properties diff --git a/ide/xml.schema.completion/manifest.mf b/ide/xml.schema.completion/manifest.mf index fbc505f316d7..679c5db18995 100644 --- a/ide/xml.schema.completion/manifest.mf +++ b/ide/xml.schema.completion/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.xml.schema.completion OpenIDE-Module-Layer: org/netbeans/modules/xml/schema/completion/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/schema/completion/Bundle.properties -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 AutoUpdate-Show-In-Client: false diff --git a/ide/xml.schema.model/nbproject/project.properties b/ide/xml.schema.model/nbproject/project.properties index b8714325e205..dd6db083d480 100644 --- a/ide/xml.schema.model/nbproject/project.properties +++ b/ide/xml.schema.model/nbproject/project.properties @@ -21,7 +21,7 @@ is.autoload=true javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.57.0 +spec.version.base=1.58.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/ide/xml.tax/nbproject/project.properties b/ide/xml.tax/nbproject/project.properties index 812140f18f83..029d4ee9f57f 100644 --- a/ide/xml.tax/nbproject/project.properties +++ b/ide/xml.tax/nbproject/project.properties @@ -19,6 +19,6 @@ extra.module.files=modules/ext/org-netbeans-tax.jar is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.69.0 +spec.version.base=1.70.0 # Apache's XNI API - parser implementation used internally by module xni-impl.jar=${libs.xerces.dir}/modules/ext/xerces-2.8.0.jar diff --git a/ide/xml.tax/src/org/netbeans/modules/xml/tax/cookies/TreeEditorCookieImpl.java b/ide/xml.tax/src/org/netbeans/modules/xml/tax/cookies/TreeEditorCookieImpl.java index 9ec7fa6e2818..8354e8ee8af4 100644 --- a/ide/xml.tax/src/org/netbeans/modules/xml/tax/cookies/TreeEditorCookieImpl.java +++ b/ide/xml.tax/src/org/netbeans/modules/xml/tax/cookies/TreeEditorCookieImpl.java @@ -591,7 +591,7 @@ private synchronized TreeEditorCookieImpl createEditor() { // atomic test and se if (editor == null) { return prepareEditor(); } else { - TreeEditorCookieImpl cached = (TreeEditorCookieImpl) editor.get(); + TreeEditorCookieImpl cached = editor.get(); if (cached == null) { return prepareEditor(); } else { diff --git a/ide/xml.text.obsolete90/nbproject/project.properties b/ide/xml.text.obsolete90/nbproject/project.properties index 3501a6ca2fb2..d0561a2b33b6 100644 --- a/ide/xml.text.obsolete90/nbproject/project.properties +++ b/ide/xml.text.obsolete90/nbproject/project.properties @@ -18,4 +18,4 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.25.0 +spec.version.base=1.26.0 diff --git a/ide/xml.text/nbproject/project.properties b/ide/xml.text/nbproject/project.properties index ef6258db4f84..5e5557894ecb 100644 --- a/ide/xml.text/nbproject/project.properties +++ b/ide/xml.text/nbproject/project.properties @@ -27,5 +27,5 @@ test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ org/netbeans/modules/xml/text/completion/CompletionJTest.class,\ org/netbeans/modules/xml/text/syntax/ColoringTest.class -spec.version.base=1.84.0 +spec.version.base=1.85.0 diff --git a/ide/xml.tools/manifest.mf b/ide/xml.tools/manifest.mf index 2bf1178e966a..c525000eca8e 100644 --- a/ide/xml.tools/manifest.mf +++ b/ide/xml.tools/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.xml.tools/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/tools/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/xml/tools/resources/mf-layer.xml AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.68 +OpenIDE-Module-Specification-Version: 1.69 diff --git a/ide/xml.wsdl.model/nbproject/project.properties b/ide/xml.wsdl.model/nbproject/project.properties index 0122908431b8..1878c529896c 100644 --- a/ide/xml.wsdl.model/nbproject/project.properties +++ b/ide/xml.wsdl.model/nbproject/project.properties @@ -20,7 +20,7 @@ is.autoload=true javac.source=1.8 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.58.0 +spec.version.base=1.59.0 release.external/generated-wsdl-xsd-2004.08.24.jar=modules/ext/generated-wsdl-xsd-2004.08.24.jar test.config.stableBTD.includes=**/*Test.class diff --git a/ide/xml.xam/nbproject/project.properties b/ide/xml.xam/nbproject/project.properties index dbba64e286b2..fa6c40fa48f0 100644 --- a/ide/xml.xam/nbproject/project.properties +++ b/ide/xml.xam/nbproject/project.properties @@ -21,6 +21,6 @@ is.autoload=true javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.57.0 +spec.version.base=1.58.0 test.config.stableBTD.includes=**/*Test.class diff --git a/ide/xml.xdm/nbproject/project.properties b/ide/xml.xdm/nbproject/project.properties index 8a427da1eea9..5ed934b6f9e5 100644 --- a/ide/xml.xdm/nbproject/project.properties +++ b/ide/xml.xdm/nbproject/project.properties @@ -20,6 +20,6 @@ is.autoload=true javac.source=1.8 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.59.0 +spec.version.base=1.60.0 test.config.stableBTD.includes=**/*Test.class diff --git a/ide/xml/manifest.mf b/ide/xml/manifest.mf index 3888b6b47569..4a2bd2ea60c2 100644 --- a/ide/xml/manifest.mf +++ b/ide/xml/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/resources/Bundle.prop OpenIDE-Module-Install: org/netbeans/modules/xml/CoreModuleInstall.class OpenIDE-Module-Layer: org/netbeans/modules/xml/resources/mf-layer.xml AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 diff --git a/ide/xsl/manifest.mf b/ide/xsl/manifest.mf index 60116b1b2c79..9cdb5eb6a475 100644 --- a/ide/xsl/manifest.mf +++ b/ide/xsl/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xsl/resources/Bundle.prop OpenIDE-Module-Layer: org/netbeans/modules/xsl/resources/mf-layer.xml OpenIDE-Module-Requires: org.openide.util.HttpServer$Impl AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.69 +OpenIDE-Module-Specification-Version: 1.70 diff --git a/ide/xsl/src/org/netbeans/modules/xsl/grammar/XSLGrammarQuery.java b/ide/xsl/src/org/netbeans/modules/xsl/grammar/XSLGrammarQuery.java index 1deab5362d7f..3b002a0f97b0 100644 --- a/ide/xsl/src/org/netbeans/modules/xsl/grammar/XSLGrammarQuery.java +++ b/ide/xsl/src/org/netbeans/modules/xsl/grammar/XSLGrammarQuery.java @@ -450,7 +450,7 @@ public Enumeration queryElements(HintContext ctx) { // Finally we add xsl namespace elements with other prefixes than the first one for (int prefixInd = 1; prefixInd < prefixList.size(); prefixInd++) { - String curPrefix = (String)prefixList.get(prefixInd) + ":"; // NOI18N + String curPrefix = prefixList.get(prefixInd) + ":"; // NOI18N Node curNode = el; String curName = null; while(curNode != null && null != (curName = curNode.getNodeName()) && !curName.startsWith(curPrefix)) { @@ -496,8 +496,8 @@ public Enumeration queryAttributes(HintContext ctx) { String curXslPrefix = null; for (int ind = 0; ind < prefixList.size(); ind++) { - if (elTagName.startsWith((String)prefixList.get(ind) + ":")){ // NOI18N - curXslPrefix = (String)prefixList.get(ind) + ":"; // NOI18N + if (elTagName.startsWith(prefixList.get(ind) + ":")){ // NOI18N + curXslPrefix = prefixList.get(ind) + ":"; // NOI18N break; } } @@ -512,7 +512,7 @@ public Enumeration queryAttributes(HintContext ctx) { if (prefixList.size() > 0) { Iterator it = getResultElementAttr().iterator(); while ( it.hasNext()) { - possibleAttributes.add((String)prefixList.get(0) + ":" + (String) it.next()); // NOI18N + possibleAttributes.add(prefixList.get(0) + ":" + (String) it.next()); // NOI18N } } } @@ -874,7 +874,7 @@ private void updateProperties(Node curNode) { boolean outputFound = false; if (prefixList.size() > 0) { - String outputElName = (String)prefixList.get(0) + ":output"; // NOI18N + String outputElName = prefixList.get(0) + ":output"; // NOI18N Node childOfRoot = rootNode.getFirstChild(); while (childOfRoot != null) { String childNodeName = childOfRoot.getNodeName(); diff --git a/java/ant.browsetask/manifest.mf b/java/ant.browsetask/manifest.mf index 3deb027702bc..8b8d422d02e7 100644 --- a/java/ant.browsetask/manifest.mf +++ b/java/ant.browsetask/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ant.browsetask -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ant/browsetask/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/java/ant.debugger/nbproject/project.properties b/java/ant.debugger/nbproject/project.properties index 75da631f4053..693b9906d3b7 100644 --- a/java/ant.debugger/nbproject/project.properties +++ b/java/ant.debugger/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.62.0 +spec.version.base=1.63.0 test.unit.run.cp.extra=${tools.jar} # Make the debugger find it, even if it is not on the startup debug classpath: # (note: first entry is for accuracy in case you customize it; second for convenience) diff --git a/java/ant.freeform/manifest.mf b/java/ant.freeform/manifest.mf index 85279d88c5d2..4dbdcc7abb57 100644 --- a/java/ant.freeform/manifest.mf +++ b/java/ant.freeform/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ant.freeform/1 -OpenIDE-Module-Specification-Version: 1.71 +OpenIDE-Module-Specification-Version: 1.72 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ant/freeform/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/ant/freeform/resources/layer.xml AutoUpdate-Show-In-Client: false diff --git a/java/ant.grammar/manifest.mf b/java/ant.grammar/manifest.mf index 0c96069bb6de..da75c114bd04 100644 --- a/java/ant.grammar/manifest.mf +++ b/java/ant.grammar/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ant.grammar/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ant/grammar/Bundle.properties -OpenIDE-Module-Specification-Version: 1.69 +OpenIDE-Module-Specification-Version: 1.70 diff --git a/java/ant.grammar/src/org/netbeans/modules/ant/grammar/AntGrammarQueryProvider.java b/java/ant.grammar/src/org/netbeans/modules/ant/grammar/AntGrammarQueryProvider.java index b1e0024e67c9..5b86015376cc 100644 --- a/java/ant.grammar/src/org/netbeans/modules/ant/grammar/AntGrammarQueryProvider.java +++ b/java/ant.grammar/src/org/netbeans/modules/ant/grammar/AntGrammarQueryProvider.java @@ -45,7 +45,7 @@ public Enumeration enabled(GrammarEnvironment ctx) { } Enumeration en = ctx.getDocumentChildren(); while (en.hasMoreElements()) { - Node next = (Node) en.nextElement(); + Node next = en.nextElement(); if (next.getNodeType() == Node.ELEMENT_NODE) { Element root = (Element) next; if ("project".equals(root.getNodeName())) { // NOI18N diff --git a/java/ant.hints/manifest.mf b/java/ant.hints/manifest.mf index adbd807999d8..a3147c0ef834 100644 --- a/java/ant.hints/manifest.mf +++ b/java/ant.hints/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ant.hints/1 -OpenIDE-Module-Specification-Version: 1.19 +OpenIDE-Module-Specification-Version: 1.20 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ant/hints/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/java/ant.kit/manifest.mf b/java/ant.kit/manifest.mf index 248b76f05f93..19d4cac0d2bb 100644 --- a/java/ant.kit/manifest.mf +++ b/java/ant.kit/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.ant.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ant/kit/Bundle.properties OpenIDE-Module-Requires: BuildActions OpenIDE-Module-Recommends: org.netbeans.modules.testng.ant.AntTestNGSupport,org.netbeans.modules.junit.ant.JUnitAntLogger,org.netbeans.modules.junit.ant.ui.AntJUnitManagerProvider -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 diff --git a/java/api.debugger.jpda/manifest.mf b/java/api.debugger.jpda/manifest.mf index c9abb85ded9c..0d93ca580c61 100644 --- a/java/api.debugger.jpda/manifest.mf +++ b/java/api.debugger.jpda/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.debugger.jpda/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties -OpenIDE-Module-Specification-Version: 3.35 +OpenIDE-Module-Specification-Version: 3.36 OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] diff --git a/java/api.java/manifest.mf b/java/api.java/manifest.mf index 1c9b76387829..7babac4f83de 100644 --- a/java/api.java/manifest.mf +++ b/java/api.java/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.java/1 -OpenIDE-Module-Specification-Version: 1.92 +OpenIDE-Module-Specification-Version: 1.93 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/java/queries/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/java/api.maven/manifest.mf b/java/api.maven/manifest.mf index 9003b4d6eb3c..8570da958ba3 100644 --- a/java/api.maven/manifest.mf +++ b/java/api.maven/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.maven -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/maven/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/java/beans/nbproject/project.properties b/java/beans/nbproject/project.properties index e5a2115370ac..05e8391eeeb7 100644 --- a/java/beans/nbproject/project.properties +++ b/java/beans/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.76.0 +spec.version.base=1.77.0 test.config.stable.includes=\ diff --git a/java/classfile/manifest.mf b/java/classfile/manifest.mf index 66629feb30b3..0c804faaa4ec 100644 --- a/java/classfile/manifest.mf +++ b/java/classfile/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.classfile/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/classfile/Bundle.properties -OpenIDE-Module-Specification-Version: 1.77 +OpenIDE-Module-Specification-Version: 1.78 diff --git a/java/dbschema/nbproject/project.properties b/java/dbschema/nbproject/project.properties index 1fec98239493..744c962f69a3 100644 --- a/java/dbschema/nbproject/project.properties +++ b/java/dbschema/nbproject/project.properties @@ -17,6 +17,6 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.66.0 +spec.version.base=1.67.0 test.config.stable.includes=**/XMLGraphSerializerTest.class diff --git a/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java b/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java index ec3f0aaa05e2..5ecf63b48122 100644 --- a/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java +++ b/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java @@ -564,7 +564,7 @@ private void initPK(ConnectionProvider cp, DDLBridge bridge, String shortTableNa if (bridge != null) { rset = bridge.getDriverSpecification().getRow(); keySeq = rset.get(new Integer(5)); - colName = (String) rset.get(new Integer(4)); + colName = rset.get(new Integer(4)); rset.clear(); } else { keySeq = rs.getObject("KEY_SEQ"); //NOI18N diff --git a/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesPanel.java b/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesPanel.java index 4c5f11ff26f7..a2ee763d18d2 100644 --- a/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesPanel.java +++ b/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesPanel.java @@ -344,7 +344,7 @@ private int invokeHandlers(List handlers, int start, Parameters params, int i; for (i = start; i < handlers.size(); i++) { - Handler h = (Handler)handlers.get(i); + Handler h = handlers.get(i); if (!h.isRunnable()) { if (LOG) { LOGGER.log(Level.FINE, "Skipping " + h); diff --git a/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/RecaptureSchema.java b/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/RecaptureSchema.java index 1bdc028c9d66..717cf621ecb0 100644 --- a/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/RecaptureSchema.java +++ b/java/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/RecaptureSchema.java @@ -62,7 +62,7 @@ public RecaptureSchema(Node dbSchemaNode) { } public void start() throws ClassNotFoundException, SQLException { - final DBschemaDataObject dobj = (DBschemaDataObject)dbSchemaNode.getCookie(DBschemaDataObject.class); + final DBschemaDataObject dobj = dbSchemaNode.getCookie(DBschemaDataObject.class); final SchemaElement elem = dobj.getSchema(); //elem. //ConnectionProvider cp = new ConnectionProvider(elem.getDriver(), elem.getUrl(), elem.getUsername(), null); diff --git a/java/debugger.jpda.ant/manifest.mf b/java/debugger.jpda.ant/manifest.mf index 7b56dade25d6..002ee625ae58 100644 --- a/java/debugger.jpda.ant/manifest.mf +++ b/java/debugger.jpda.ant/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.debugger.jpda.ant -OpenIDE-Module-Specification-Version: 1.63 +OpenIDE-Module-Specification-Version: 1.64 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/ant/Bundle.properties OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] diff --git a/java/debugger.jpda.js/manifest.mf b/java/debugger.jpda.js/manifest.mf index 6e47ab9a1a94..73936aa2612a 100644 --- a/java/debugger.jpda.js/manifest.mf +++ b/java/debugger.jpda.js/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.debugger.jpda.js/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/js/Bundle.properties -OpenIDE-Module-Specification-Version: 1.35 +OpenIDE-Module-Specification-Version: 1.36 OpenIDE-Module-Requires: org.netbeans.api.debugger.jpda.JPDADebuggerEngineImpl, org.netbeans.spi.debugger.ui OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] diff --git a/java/debugger.jpda.jsui/manifest.mf b/java/debugger.jpda.jsui/manifest.mf index f0b6f7eee72d..5ecf23f108f7 100644 --- a/java/debugger.jpda.jsui/manifest.mf +++ b/java/debugger.jpda.jsui/manifest.mf @@ -3,7 +3,7 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.debugger.jpda.jsui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/jsui/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/jsui/layer.xml -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 OpenIDE-Module-Requires: org.netbeans.spi.debugger.ui OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] diff --git a/java/debugger.jpda.kit/manifest.mf b/java/debugger.jpda.kit/manifest.mf index 0fcb0a4b2216..a46764e0baf7 100644 --- a/java/debugger.jpda.kit/manifest.mf +++ b/java/debugger.jpda.kit/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.debugger.jpda.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.40 +OpenIDE-Module-Specification-Version: 1.41 OpenIDE-Module-Provides: org.netbeans.modules.debugger.jpda.kit diff --git a/java/debugger.jpda.projects/manifest.mf b/java/debugger.jpda.projects/manifest.mf index 70546f5e68b1..6668f0800b54 100644 --- a/java/debugger.jpda.projects/manifest.mf +++ b/java/debugger.jpda.projects/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module: org.netbeans.modules.debugger.jpda.projects OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/projects/Bundle.properties OpenIDE-Module-Provides: org.netbeans.spi.debugger.jpda.SourcePathProvider OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 diff --git a/java/debugger.jpda.projectsui/manifest.mf b/java/debugger.jpda.projectsui/manifest.mf index 15cb24436c89..a41322dca922 100644 --- a/java/debugger.jpda.projectsui/manifest.mf +++ b/java/debugger.jpda.projectsui/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/projectsui/ OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/projectsui/resources/mf-layer.xml OpenIDE-Module-Provides: org.netbeans.spi.debugger.jpda.EditorContext OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/java/debugger.jpda.truffle/manifest.mf b/java/debugger.jpda.truffle/manifest.mf index 13511f41ec77..d7ecc7d89329 100644 --- a/java/debugger.jpda.truffle/manifest.mf +++ b/java/debugger.jpda.truffle/manifest.mf @@ -3,7 +3,7 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.debugger.jpda.truffle/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/truffle/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/truffle/layer.xml -OpenIDE-Module-Specification-Version: 1.22 +OpenIDE-Module-Specification-Version: 1.23 OpenIDE-Module-Provides: org.netbeans.modules.debugger.jpda.truffle OpenIDE-Module-Requires: org.netbeans.api.debugger.jpda.JPDADebuggerEngineImpl, org.netbeans.spi.debugger.ui diff --git a/java/debugger.jpda.truffle/nbproject/project.properties b/java/debugger.jpda.truffle/nbproject/project.properties index 06747ea9f86f..8e7e11308a78 100644 --- a/java/debugger.jpda.truffle/nbproject/project.properties +++ b/java/debugger.jpda.truffle/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.compilerargs=-Xlint:unchecked -javac.source=1.8 +javac.release=11 javadoc.arch=${basedir}/arch.xml nbm.module.author=Martin Entlicher requires.nb.javac=true diff --git a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java index 7c18aeb95f63..9cfb63cd488f 100644 --- a/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java +++ b/java/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/RemoteServices.java @@ -180,11 +180,7 @@ private static ObjectReference getContextClassLoader(ThreadReference tawt, Virtu private static int getTargetMajorVersion(VirtualMachine vm) throws InternalExceptionWrapper, VMDisconnectedExceptionWrapper { String version = VirtualMachineWrapper.version(vm); - int dot = version.indexOf("."); - if (dot < 0) { - dot = version.length(); - } - return Integer.parseInt(version.substring(0, dot)); + return Runtime.Version.parse(version).feature(); } public static ClassObjectReference uploadBasicClasses(JPDAThreadImpl t, String basicClassName) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException, IOException, PropertyVetoException, InternalExceptionWrapper, VMDisconnectedExceptionWrapper, ObjectCollectedExceptionWrapper, UnsupportedOperationExceptionWrapper, ClassNotPreparedExceptionWrapper { diff --git a/java/debugger.jpda.trufflenode/manifest.mf b/java/debugger.jpda.trufflenode/manifest.mf index cf5fb99a28ec..687874102b81 100644 --- a/java/debugger.jpda.trufflenode/manifest.mf +++ b/java/debugger.jpda.trufflenode/manifest.mf @@ -3,6 +3,6 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.debugger.jpda.trufflenode/1 OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/truffle/node/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/truffle/node/Bundle.properties -OpenIDE-Module-Specification-Version: 1.22 +OpenIDE-Module-Specification-Version: 1.23 OpenIDE-Module-Recommends: org.netbeans.modules.debugger.jpda.truffle OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] diff --git a/java/debugger.jpda.ui/manifest.mf b/java/debugger.jpda.ui/manifest.mf index 43391b299c50..19c508d0ad0a 100644 --- a/java/debugger.jpda.ui/manifest.mf +++ b/java/debugger.jpda.ui/manifest.mf @@ -3,7 +3,7 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.debugger.jpda.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/ui/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.79 +OpenIDE-Module-Specification-Version: 1.80 OpenIDE-Module-Requires: org.netbeans.api.debugger.jpda.JPDADebuggerEngineImpl, org.netbeans.spi.debugger.ui OpenIDE-Module-Provides: org.netbeans.modules.debugger.jpda.ui diff --git a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/views/JPDAEngineComponentsProvider.java b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/views/JPDAEngineComponentsProvider.java index ccdd39d031d5..0c2a647e6124 100644 --- a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/views/JPDAEngineComponentsProvider.java +++ b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/views/JPDAEngineComponentsProvider.java @@ -45,10 +45,10 @@ public class JPDAEngineComponentsProvider implements EngineComponentsProvider { private static final String PROPERTY_BASE_NAME = "netbeans-JPDASession.EngineComponentsProvider"; // NOI18N private static final String[] DBG_COMPONENTS_OPENED = { - "localsView", "watchesView", "breakpointsView", "debuggingView" // NOI18N + "localsView", "watchesView", "breakpointsView", "debuggingView", "evaluatorPane" // NOI18N }; private static final String[] DBG_COMPONENTS_CLOSED = { - "callstackView", "evaluatorPane", "resultsView", "sessionsView", // NOI18N + "callstackView", "resultsView", "sessionsView", // NOI18N "sources", "threadsView", "classes" // NOI18N }; diff --git a/java/debugger.jpda.visual/manifest.mf b/java/debugger.jpda.visual/manifest.mf index 23a3957a6153..cfd9b6b45d64 100644 --- a/java/debugger.jpda.visual/manifest.mf +++ b/java/debugger.jpda.visual/manifest.mf @@ -3,7 +3,7 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.debugger.jpda.visual/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/visual/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/visual/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 OpenIDE-Module-Requires: org.netbeans.modules.debugger.jpda.ui OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] diff --git a/java/debugger.jpda/nbproject/org-netbeans-modules-debugger-jpda.sig b/java/debugger.jpda/nbproject/org-netbeans-modules-debugger-jpda.sig index ff7e81c19f7c..b9e4f7f67c2e 100644 --- a/java/debugger.jpda/nbproject/org-netbeans-modules-debugger-jpda.sig +++ b/java/debugger.jpda/nbproject/org-netbeans-modules-debugger-jpda.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.133.0 +#Version 1.134.0 CLSS public abstract interface com.sun.source.tree.TreeVisitor<%0 extends java.lang.Object, %1 extends java.lang.Object> meth public abstract {com.sun.source.tree.TreeVisitor%0} visitAnnotatedType(com.sun.source.tree.AnnotatedTypeTree,{com.sun.source.tree.TreeVisitor%1}) @@ -56,7 +56,6 @@ meth public abstract {com.sun.source.tree.TreeVisitor%0} visitPrimitiveType(com. meth public abstract {com.sun.source.tree.TreeVisitor%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.tree.TreeVisitor%1}) -meth public abstract {com.sun.source.tree.TreeVisitor%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.tree.TreeVisitor%1}) @@ -140,7 +139,6 @@ meth public {com.sun.source.util.TreeScanner%0} visitPrimitiveType(com.sun.sourc meth public {com.sun.source.util.TreeScanner%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.util.TreeScanner%1}) -meth public {com.sun.source.util.TreeScanner%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.util.TreeScanner%1}) diff --git a/java/debugger.jpda/nbproject/project.properties b/java/debugger.jpda/nbproject/project.properties index 94e72cf16615..1d03bea8b34e 100644 --- a/java/debugger.jpda/nbproject/project.properties +++ b/java/debugger.jpda/nbproject/project.properties @@ -23,7 +23,7 @@ javac.source=1.8 javadoc.arch=${basedir}/arch.xml jpda.classes.dir=${build.dir}/jpda/classes/ requires.nb.javac=true -spec.version.base=1.134.0 +spec.version.base=1.135.0 test-unit-sys-prop.test.dir.src=${basedir}/test/unit/src/ test-unit-sys-prop.netbeans.user=${basedir}/work/nb_user_dir test.unit.cp.extra=../java.source.nbjavac/build/test-nb-javac/cluster/modules/org-netbeans-modules-java-source-nbjavac-test.jar diff --git a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/formatters/VariablesFormatter.java b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/formatters/VariablesFormatter.java index 7359dbbd56b9..3691c387d458 100644 --- a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/formatters/VariablesFormatter.java +++ b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/formatters/VariablesFormatter.java @@ -37,7 +37,7 @@ public final class VariablesFormatter implements Cloneable { private boolean includeSubTypes = true; private String valueFormatCode = ""; // NOI18N private String childrenFormatCode = ""; // NOI18N - private Map childrenVariables = new LinkedHashMap(); + private Map childrenVariables = new LinkedHashMap<>(); private boolean useChildrenVariables = false; private String childrenExpandTestCode = ""; // NOI18N private boolean isDefault = false; @@ -117,7 +117,7 @@ public void setClassTypes(String[] classTypes) { /** * Set the value of classTypes * - * @param classTypes new value of classTypes + * @param classTypesCommaSeparated new value of classTypes */ public void setClassTypes(String classTypesCommaSeparated) { this.classTypes = classTypesCommaSeparated.split("[, ]+"); @@ -135,7 +135,7 @@ public boolean isIncludeSubTypes() { /** * Set the value of includeSubtypes * - * @param includeSubtypes new value of includeSubtypes + * @param includeSubTypes new value of includeSubtypes */ public void setIncludeSubTypes(boolean includeSubTypes) { this.includeSubTypes = includeSubTypes; @@ -253,7 +253,7 @@ public VariablesFormatter clone() { VariablesFormatter f = new VariablesFormatter(name); f.childrenExpandTestCode = childrenExpandTestCode; f.childrenFormatCode = childrenFormatCode; - f.childrenVariables = new LinkedHashMap(childrenVariables); + f.childrenVariables = new LinkedHashMap<>(childrenVariables); f.classTypes = classTypes.clone(); f.enabled = enabled; f.includeSubTypes = includeSubTypes; @@ -271,7 +271,7 @@ public static VariablesFormatter[] loadFormatters() { if (formatters == null) { formatters = defaultFormatters; } else { - Map fm = new LinkedHashMap(defaultFormatters.length); + Map fm = new LinkedHashMap<>(defaultFormatters.length); for (VariablesFormatter vf : defaultFormatters) { fm.put(vf.getName(), vf); } @@ -299,6 +299,8 @@ public static VariablesFormatter[] loadFormatters() { "MSG_MapFormatter=Default Map Formatter", "MSG_MapEntryFormatter=Default Map.Entry Formatter", "MSG_EnumFormatter=Default Enum Formatter", + "MSG_BigDecimalFormatter=Default BigDecimal Formatter", + "MSG_BigIntegerFormatter=Default BigInteger Formatter", }) private static VariablesFormatter[] createDefaultFormatters() { VariablesFormatter charSequence = new VariablesFormatter(Bundle.MSG_CharSequenceFormatter()); @@ -340,22 +342,37 @@ private static VariablesFormatter[] createDefaultFormatters() { enumFormatter.setValueFormatCode("toString()"); enumFormatter.isDefault = true; - return new VariablesFormatter[] { charSequence, collection, map, mapEntry, enumFormatter }; + VariablesFormatter bigDecimalFormatter = new VariablesFormatter(Bundle.MSG_BigDecimalFormatter()); + bigDecimalFormatter.setClassTypes("java.math.BigDecimal"); + bigDecimalFormatter.setIncludeSubTypes(true); + bigDecimalFormatter.setValueFormatCode("toPlainString()"); + bigDecimalFormatter.isDefault = true; + + VariablesFormatter bigIntegerFormatter = new VariablesFormatter(Bundle.MSG_BigIntegerFormatter()); + bigIntegerFormatter.setClassTypes("java.math.BigInteger"); + bigIntegerFormatter.setIncludeSubTypes(true); + bigIntegerFormatter.setValueFormatCode("toString()"); + bigIntegerFormatter.isDefault = true; + + return new VariablesFormatter[] { charSequence, collection, map, mapEntry, enumFormatter, + bigDecimalFormatter, bigIntegerFormatter }; } @DebuggerServiceRegistration(types=Properties.Reader.class) public static class ReaderWriter implements Properties.Reader { - + private static final String OLD_VariablesFormatter_CLASS_NAME = "org.netbeans.modules.debugger.jpda.ui.VariablesFormatter"; // NOI18N + @Override public String[] getSupportedClassNames() { return new String[] { OLD_VariablesFormatter_CLASS_NAME, VariablesFormatter.class.getName() }; } + @Override public Object read(String className, Properties properties) { String name = properties.getString("name", ""); VariablesFormatter f = new VariablesFormatter(name); @@ -371,6 +388,7 @@ public Object read(String className, Properties properties) { return f; } + @Override public void write(Object object, Properties properties) { VariablesFormatter f = (VariablesFormatter) object; properties.setString("name", f.getName()); @@ -384,6 +402,6 @@ public void write(Object object, Properties properties) { properties.setString("childrenExpandTestCode", f.getChildrenExpandTestCode()); properties.setBoolean("isDefault", f.isDefault); } - + } } diff --git a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/VariableMirrorTranslator.java b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/VariableMirrorTranslator.java index be74e4d2453d..b544af8ea94b 100644 --- a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/VariableMirrorTranslator.java +++ b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/VariableMirrorTranslator.java @@ -49,7 +49,7 @@ import java.io.InvalidObjectException; import java.lang.reflect.Array; import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.InaccessibleObjectException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -250,7 +250,12 @@ private static Object setFieldsValues(Object newInstance, Class clazz, Map= 0 ; i-- ) { - Vector item = (Vector)rootsModel.getDataVector().elementAt(si[i]); + Vector item = rootsModel.getDataVector().elementAt(si[i]); int newIndex = si[i] + 1; rootsModel.removeRow( si[i] ); rootsModel.insertRow( newIndex, item ); diff --git a/java/java.completion/nbproject/project.properties b/java/java.completion/nbproject/project.properties index 4ff60ccca306..3e43bd7573e8 100644 --- a/java/java.completion/nbproject/project.properties +++ b/java/java.completion/nbproject/project.properties @@ -17,7 +17,7 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=2.11.0 +spec.version.base=2.12.0 #test configs test.config.jet-main.includes=\ diff --git a/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java b/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java index 9a2d8de48307..9ec7273f86f6 100644 --- a/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java +++ b/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java @@ -500,9 +500,6 @@ protected void resolve(CompilationController controller) throws IOException { case DECONSTRUCTION_PATTERN: insideDeconstructionRecordPattern(env); break; - case TEMPLATE: - insideStringTemplate(env); - break; } } @@ -3395,16 +3392,6 @@ private boolean isSealedSupported(final Env env) { return env.getController().getSourceVersion().compareTo(SourceVersion.RELEASE_15) >= 0; } - private void insideStringTemplate(Env env) throws IOException { - final int offset = env.getOffset(); - final TreePath path = env.getPath(); - TokenSequence ts = findLastNonWhitespaceToken(env, path.getLeaf(), offset); - if (ts.token().id() == JavaTokenId.STRING_LITERAL || ts.token().id() == JavaTokenId.MULTILINE_STRING_LITERAL) { - localResult(env); - addValueKeywords(env); - } - } - private void localResult(Env env) throws IOException { addLocalMembersAndVars(env); addClassTypes(env, null); @@ -6186,10 +6173,6 @@ public boolean accept(Element e, TypeMirror t) { break; case BLOCK: return null; - case TEMPLATE: - //TODO:can there be good smart types? - //(how about incomplete String templates?) - return null; } lastTree = tree; path = path.getParentPath(); diff --git a/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/StringTemplatesTest.java b/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/StringTemplatesTest.java deleted file mode 100644 index b6c74e9fdb5b..000000000000 --- a/java/java.completion/test/unit/src/org/netbeans/modules/java/completion/StringTemplatesTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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.java.completion; - -import java.util.ArrayList; -import java.util.List; -import javax.lang.model.SourceVersion; -import javax.swing.event.ChangeListener; -import org.netbeans.modules.java.source.parsing.JavacParser; -import org.netbeans.spi.java.queries.CompilerOptionsQueryImplementation; -import org.openide.filesystems.FileObject; -import org.openide.util.lookup.ServiceProvider; - -public class StringTemplatesTest extends CompletionTestBase { - - public StringTemplatesTest(String testName) { - super(testName); - } - - public void testStringTemplates1() throws Exception { - TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview"); - performTest("StringTemplates", 922, "\"\\{str.", "stringContent.pass", getLatestSource()); - } - - public void testStringTemplates2() throws Exception { - TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview"); - performTest("StringTemplates", 999, "str.", "stringContent.pass", getLatestSource()); - } - - public void testStringTemplates3() throws Exception { - TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview"); - performTest("StringTemplates", 922, "\"\\{\"\\{str.", "stringContent.pass", getLatestSource()); - } - - public void testStringTemplates4() throws Exception { - TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview"); - performTest("StringTemplates", 922, "\"\\{", "templateStart.pass", getLatestSource()); - } - - public void testStringTemplatesBlock1() throws Exception { - TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview"); - performTest("StringTemplates", 922, "\"\"\"\n\\{str.", "stringContent.pass", getLatestSource()); - } - - public void testStringTemplatesBlock2() throws Exception { - TestCompilerOptionsQueryImplementation.EXTRA_OPTIONS.add("--enable-preview"); - performTest("StringTemplates", 1101, "str.", "stringContent.pass", getLatestSource()); - } - - private String getLatestSource() { - return SourceVersion.latest().name().substring(SourceVersion.latest().name().indexOf("_") + 1); - } - - static { - JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = true; - } - - @ServiceProvider(service = CompilerOptionsQueryImplementation.class, position = 100) - public static class TestCompilerOptionsQueryImplementation implements CompilerOptionsQueryImplementation { - - private static final List EXTRA_OPTIONS = new ArrayList<>(); - - @Override - public CompilerOptionsQueryImplementation.Result getOptions(FileObject file) { - return new CompilerOptionsQueryImplementation.Result() { - @Override - public List getArguments() { - return EXTRA_OPTIONS; - } - - @Override - public void addChangeListener(ChangeListener listener) { - } - - @Override - public void removeChangeListener(ChangeListener listener) { - } - }; - } - } -} diff --git a/java/java.debug/nbproject/project.properties b/java/java.debug/nbproject/project.properties index e486f51ade0c..54549dc50357 100644 --- a/java/java.debug/nbproject/project.properties +++ b/java/java.debug/nbproject/project.properties @@ -15,6 +15,6 @@ # specific language governing permissions and limitations # under the License. javac.source=1.8 -spec.version.base=1.63.0 +spec.version.base=1.64.0 requires.nb.javac=true diff --git a/java/java.disco/manifest.mf b/java/java.disco/manifest.mf index 6db9eee028ac..cb7c96e66d02 100644 --- a/java/java.disco/manifest.mf +++ b/java/java.disco/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module: org.netbeans.modules.java.disco OpenIDE-Module-Layer: org/netbeans/modules/java/disco/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/disco/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.java.platform.ui -OpenIDE-Module-Specification-Version: 2.9 +OpenIDE-Module-Specification-Version: 2.10 diff --git a/java/java.editor.base/nbproject/project.properties b/java/java.editor.base/nbproject/project.properties index 88879957a05a..1f620a92a638 100644 --- a/java/java.editor.base/nbproject/project.properties +++ b/java/java.editor.base/nbproject/project.properties @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -spec.version.base=2.90.0 +spec.version.base=2.91.0 is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial diff --git a/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java b/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java index e129842e4538..f5bb63be8782 100644 --- a/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java +++ b/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java @@ -653,7 +653,7 @@ private void handleDeclaration(TreePath path) { @Override public Void visitLiteral(LiteralTree node, Void p) { if (node.getKind() == Kind.STRING_LITERAL) { - allStringLiterals.add((String) ((LiteralTree) node).getValue()); + allStringLiterals.add((String)node.getValue()); } return super.visitLiteral(node, p); } diff --git a/java/java.editor.lib/nbproject/project.properties b/java/java.editor.lib/nbproject/project.properties index e321faa6c37a..4c083d44f716 100644 --- a/java/java.editor.lib/nbproject/project.properties +++ b/java/java.editor.lib/nbproject/project.properties @@ -21,6 +21,6 @@ javadoc.apichanges=${basedir}/apichanges.xml javac.source=1.8 -spec.version.base=1.55.0 +spec.version.base=1.56.0 is.autoload=true diff --git a/java/java.editor/nbproject/project.properties b/java/java.editor/nbproject/project.properties index 74745dc5e064..914e09646b80 100644 --- a/java/java.editor/nbproject/project.properties +++ b/java/java.editor/nbproject/project.properties @@ -17,7 +17,7 @@ javadoc.title=Java Editor -spec.version.base=2.93.0 +spec.version.base=2.94.0 test.qa-functional.cp.extra=${editor.dir}/modules/org-netbeans-modules-editor-fold.jar javac.source=1.8 #test.unit.cp.extra= diff --git a/java/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java b/java/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java index 733ba9ad3226..d8a91390a419 100644 --- a/java/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java +++ b/java/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java @@ -1522,7 +1522,7 @@ public CharSequence getAssignToVarText() { public String toString() { return (typeName != null ? typeName + " " : "") + varName; //NOI18N } - } + } static class FieldItem extends WhiteListJavaCompletionItem { @@ -1545,6 +1545,7 @@ static class FieldItem extends WhiteListJavaCompletionItem { private String typeName; private String leftText; private String rightText; + private CharSequence sortText; private boolean autoImportEnclosingType; private CharSequence enclSortText; private int castEndOffset; @@ -1597,7 +1598,10 @@ public int getSortPriority() { @Override public CharSequence getSortText() { - return simpleName + "#" + enclSortText; //NOI18N + if (sortText == null) { + sortText = LazySortText.link(simpleName, enclSortText); + } + return sortText; } @Override @@ -1827,7 +1831,7 @@ static class MethodItem extends WhiteListJavaCompletionItem { protected List params; private String typeName; private boolean addSemicolon; - private String sortText; + private CharSequence sortText; private String leftText; private String rightText; private boolean autoImportEnclosingType; @@ -1910,7 +1914,7 @@ public CharSequence getSortText() { cnt++; } sortParams.append(')'); - sortText = simpleName + "#" + enclSortText + "#" + ((cnt < 10 ? "0" : "") + cnt) + "#" + sortParams.toString(); //NOI18N + sortText = LazySortText.link(simpleName, enclSortText, ((cnt < 10 ? "0" : "") + cnt) + "#" + sortParams.toString()); //NOI18N } return sortText; } diff --git a/java/java.editor/src/org/netbeans/modules/editor/java/LazySortText.java b/java/java.editor/src/org/netbeans/modules/editor/java/LazySortText.java index 47ed375f9a77..2ef4682971d7 100644 --- a/java/java.editor/src/org/netbeans/modules/editor/java/LazySortText.java +++ b/java/java.editor/src/org/netbeans/modules/editor/java/LazySortText.java @@ -24,15 +24,18 @@ import org.netbeans.api.java.source.support.ReferencesCount; /** + * Characters are lazily computed in charAt(), avoid toString(). + * + * Use link() to combine lazy sequences. * * @author Dusan Balek */ -class LazySortText implements CharSequence { +final class LazySortText implements CharSequence { - private String simpleName; - private String enclName; - private ElementHandle handle; - private ReferencesCount referencesCount; + private final String simpleName; + private final String enclName; + private final ElementHandle handle; + private final ReferencesCount referencesCount; private String importanceLevel = null; LazySortText(String simpleName, String enclName, ElementHandle handle, ReferencesCount referencesCount) { @@ -48,6 +51,7 @@ public int length() { } @Override + @SuppressWarnings("AssignmentToMethodParameter") public char charAt(int index) { if ((index < 0) || (index >= length())) { throw new StringIndexOutOfBoundsException(index); @@ -74,10 +78,61 @@ public CharSequence subSequence(int start, int end) { throw new UnsupportedOperationException("Not supported yet."); //NOI18N } + @Override + public String toString() { + return new StringBuilder(this).toString(); + } + private String getImportanceLevel() { if (importanceLevel == null) { importanceLevel = String.format("%8d", Utilities.getImportanceLevel(referencesCount, handle)); //NOI18N } return importanceLevel; } + + public static CharSequence link(CharSequence first, CharSequence second) { + return new LinkedLazyCharSequence(first, second); + } + + public static CharSequence link(CharSequence first, CharSequence second, CharSequence third) { + return new LinkedLazyCharSequence(first, new LinkedLazyCharSequence(second, third)); + } + + private static final class LinkedLazyCharSequence implements CharSequence { + + private final CharSequence first; + private final CharSequence second; + private final int length; + + private LinkedLazyCharSequence(CharSequence first, CharSequence second) { + this.first = first; + this.second = second; + this.length = first.length() + second.length() + 1; + } + + @Override + @SuppressWarnings("AssignmentToMethodParameter") + public char charAt(int index) { + if (index < first.length()) { + return first.charAt(index); + } + index -= first.length(); + if (index-- == 0) { + return '#'; + } + return second.charAt(index); + } + + @Override + public int length() { + return length; + } + + @Override + public CharSequence subSequence(int start, int end) { + throw new UnsupportedOperationException("Not supported yet."); //NOI18N + } + + } + } diff --git a/java/java.examples/manifest.mf b/java/java.examples/manifest.mf index 387144009ee5..d248fc45a506 100644 --- a/java/java.examples/manifest.mf +++ b/java/java.examples/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.examples/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/examples/Bundle.properties -OpenIDE-Module-Specification-Version: 1.61 +OpenIDE-Module-Specification-Version: 1.62 OpenIDE-Module-Layer: org/netbeans/modules/java/examples/resources/mf-layer.xml AutoUpdate-Show-In-Client: false diff --git a/java/java.file.launcher/manifest.mf b/java/java.file.launcher/manifest.mf index d611fd0f4077..d08ae5a80fd8 100644 --- a/java/java.file.launcher/manifest.mf +++ b/java/java.file.launcher/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.file.launcher OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/file/launcher/Bundle.properties -OpenIDE-Module-Specification-Version: 1.2 +OpenIDE-Module-Specification-Version: 1.3 diff --git a/java/java.file.launcher/nbproject/project.properties b/java/java.file.launcher/nbproject/project.properties index 2699b073bc7c..5738f2b3880a 100644 --- a/java/java.file.launcher/nbproject/project.properties +++ b/java/java.file.launcher/nbproject/project.properties @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -javac.source=1.8 +javac.release=17 cp.extra=${tools.jar} requires.nb.javac=true javac.compilerargs=-Xlint -Xlint:-serial diff --git a/java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/SingleSourceFileUtil.java b/java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/SingleSourceFileUtil.java index 8ca36068a060..0152f195164d 100644 --- a/java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/SingleSourceFileUtil.java +++ b/java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/SingleSourceFileUtil.java @@ -30,7 +30,7 @@ import java.util.logging.Logger; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import org.netbeans.api.java.platform.JavaPlatformManager; +import org.netbeans.api.java.platform.JavaPlatform; import org.netbeans.api.project.FileOwnerQuery; import org.netbeans.modules.java.file.launcher.queries.MultiSourceRootProvider; import org.netbeans.modules.java.file.launcher.spi.SingleFileOptionsQueryImplementation; @@ -49,6 +49,7 @@ public final class SingleSourceFileUtil { public static final Logger LOG = Logger.getLogger(SingleSourceFileUtil.class.getPackage().getName()); + // TODO this checks the runtime JDK of NB! public static int findJavaVersion() throws NumberFormatException { // JEP-330 is supported only on JDK-11 and above. String javaVersion = System.getProperty("java.specification.version"); //NOI18N @@ -59,7 +60,9 @@ public static int findJavaVersion() throws NumberFormatException { return version; } + // synced with JavaNode public static final String FILE_ARGUMENTS = "single_file_run_arguments"; //NOI18N + public static final String FILE_JDK = "single_file_run_jdk"; //NOI18N public static final String FILE_VM_OPTIONS = "single_file_vm_options"; //NOI18N public static FileObject getJavaFileWithoutProjectFromLookup(Lookup lookup) { @@ -101,8 +104,8 @@ public static boolean isSupportedFile(FileObject file) { return false; } } - public static Process compileJavaSource(FileObject fileObject) { - FileObject javac = JavaPlatformManager.getDefault().getDefaultPlatform().findTool("javac"); //NOI18N + public static Process compileJavaSource(FileObject fileObject, JavaPlatform jdk) { + FileObject javac = jdk.findTool("javac"); //NOI18N File javacFile = FileUtil.toFile(javac); String javacPath = javacFile.getAbsolutePath(); List compileCommandList = new ArrayList<>(); diff --git a/java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/actions/LaunchProcess.java b/java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/actions/LaunchProcess.java index 51e6b9182f5a..befa4cf8c89f 100644 --- a/java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/actions/LaunchProcess.java +++ b/java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/actions/LaunchProcess.java @@ -26,7 +26,9 @@ import java.util.List; import java.util.concurrent.Callable; import java.util.logging.Level; +import java.util.logging.Logger; import org.netbeans.api.extexecution.base.ExplicitProcessParameters; +import org.netbeans.api.java.platform.JavaPlatform; import org.netbeans.api.java.platform.JavaPlatformManager; import org.netbeans.modules.java.file.launcher.SingleSourceFileUtil; import org.openide.filesystems.FileObject; @@ -59,8 +61,10 @@ private Process setupProcess(String port) throws InterruptedException { try { boolean compile = SingleSourceFileUtil.findJavaVersion() < 11 || SingleSourceFileUtil.hasClassSibling(fileObject); + JavaPlatform jdk = readRunJdkFromAttribute(fileObject); + if (compile) { - Process p = SingleSourceFileUtil.compileJavaSource(fileObject); + Process p = SingleSourceFileUtil.compileJavaSource(fileObject, jdk); if (p.waitFor() != 0) { return p; } @@ -68,7 +72,7 @@ private Process setupProcess(String port) throws InterruptedException { List commandsList = new ArrayList<>(); - FileObject java = JavaPlatformManager.getDefault().getDefaultPlatform().findTool("java"); //NOI18N + FileObject java = jdk.findTool("java"); //NOI18N File javaFile = FileUtil.toFile(java); String javaPath = javaFile.getAbsolutePath(); URI cwd = SingleSourceFileUtil.getOptionsFor(fileObject).getWorkDirectory(); @@ -123,6 +127,19 @@ private Process setupProcess(String port) throws InterruptedException { return null; } + private static JavaPlatform readRunJdkFromAttribute(FileObject fo) { + String runJDKAttribute = fo.getAttribute(SingleSourceFileUtil.FILE_JDK) instanceof String str ? str : null; + if (runJDKAttribute != null && !runJDKAttribute.isBlank()) { + for (JavaPlatform jdk : JavaPlatformManager.getDefault().getInstalledPlatforms()) { + if (runJDKAttribute.equals(jdk.getDisplayName())) { + return jdk; + } + } + Logger.getLogger(LaunchProcess.class.getName()).log(Level.WARNING, "Unknown JDK: [{0}]", runJDKAttribute); + } + return JavaPlatformManager.getDefault().getDefaultPlatform(); + } + private static List readArgumentsFromAttribute(FileObject fileObject, String attributeName) { Object argumentsObject = fileObject.getAttribute(attributeName); if (!(argumentsObject instanceof String)) { diff --git a/java/java.freeform/manifest.mf b/java/java.freeform/manifest.mf index 31b2967bf8aa..95752850879b 100644 --- a/java/java.freeform/manifest.mf +++ b/java/java.freeform/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.freeform/1 -OpenIDE-Module-Specification-Version: 1.68 +OpenIDE-Module-Specification-Version: 1.69 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/freeform/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/java/freeform/resources/layer.xml AutoUpdate-Show-In-Client: false diff --git a/java/java.graph/manifest.mf b/java/java.graph/manifest.mf index 23860531fa71..33035323b756 100644 --- a/java/java.graph/manifest.mf +++ b/java/java.graph/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.graph/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/graph/Bundle.properties -OpenIDE-Module-Specification-Version: 1.26 +OpenIDE-Module-Specification-Version: 1.27 diff --git a/java/java.guards/manifest.mf b/java/java.guards/manifest.mf index fc5fb20b8223..66d94a238cbb 100644 --- a/java/java.guards/manifest.mf +++ b/java/java.guards/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.java.guards/0 OpenIDE-Module-Layer: org/netbeans/modules/java/guards/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/guards/Bundle.properties OpenIDE-Module-Provides: org.netbeans.api.editor.guards.Java -OpenIDE-Module-Specification-Version: 0.56 +OpenIDE-Module-Specification-Version: 0.57 diff --git a/java/java.hints.declarative.test/nbproject/project.properties b/java/java.hints.declarative.test/nbproject/project.properties index ba10e2fe2a0d..a0e6f3c9dbfc 100644 --- a/java/java.hints.declarative.test/nbproject/project.properties +++ b/java/java.hints.declarative.test/nbproject/project.properties @@ -17,5 +17,5 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.41.0 +spec.version.base=1.42.0 javadoc.arch=${basedir}/arch.xml diff --git a/java/java.hints.declarative/nbproject/project.properties b/java/java.hints.declarative/nbproject/project.properties index 487de2858d12..fec5840c4942 100644 --- a/java/java.hints.declarative/nbproject/project.properties +++ b/java/java.hints.declarative/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.45.0 +spec.version.base=1.46.0 requires.nb.javac=true test.config.stableBTD.includes=**/*Test.class diff --git a/java/java.hints.declarative/test/unit/src/org/netbeans/modules/java/hints/declarative/DeclarativeHintRegistryTest.java b/java/java.hints.declarative/test/unit/src/org/netbeans/modules/java/hints/declarative/DeclarativeHintRegistryTest.java index fa0c4477ff36..82a9e5e6d418 100644 --- a/java/java.hints.declarative/test/unit/src/org/netbeans/modules/java/hints/declarative/DeclarativeHintRegistryTest.java +++ b/java/java.hints.declarative/test/unit/src/org/netbeans/modules/java/hints/declarative/DeclarativeHintRegistryTest.java @@ -48,7 +48,7 @@ public void testAdditionalConstraints() { HintDescription hd = allHints.iterator().next().iterator().next(); - assertEquals(new HashSet<>(Arrays.asList("java.lang.String")), hd.getAdditionalConstraints().requiredErasedTypes); + assertEquals(new HashSet<>(Arrays.asList("java.lang.String")), hd.getAdditionalConstraints().requiredErasedTypes()); } public void testSuppressWarnings() { diff --git a/java/java.hints.legacy.spi/nbproject/project.properties b/java/java.hints.legacy.spi/nbproject/project.properties index bb64be3ef926..a8e49096cb12 100644 --- a/java/java.hints.legacy.spi/nbproject/project.properties +++ b/java/java.hints.legacy.spi/nbproject/project.properties @@ -17,6 +17,6 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.42.0 +spec.version.base=1.43.0 javadoc.arch=${basedir}/arch.xml requires.nb.javac=true diff --git a/java/java.hints.test/nbproject/project.properties b/java/java.hints.test/nbproject/project.properties index a8d21f08a380..8fadda58178d 100644 --- a/java/java.hints.test/nbproject/project.properties +++ b/java/java.hints.test/nbproject/project.properties @@ -17,7 +17,7 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.44.0 +spec.version.base=1.45.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml requires.nb.javac=true diff --git a/java/java.hints.ui/nbproject/project.properties b/java/java.hints.ui/nbproject/project.properties index 5d1ae1df4938..49c80172ea34 100644 --- a/java/java.hints.ui/nbproject/project.properties +++ b/java/java.hints.ui/nbproject/project.properties @@ -16,5 +16,5 @@ # under the License. javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.43.0 +spec.version.base=1.44.0 requires.nb.javac=true diff --git a/java/java.hints/nbproject/project.properties b/java/java.hints/nbproject/project.properties index 5d2a4f82802e..a99989f7aa3a 100644 --- a/java/java.hints/nbproject/project.properties +++ b/java/java.hints/nbproject/project.properties @@ -15,9 +15,9 @@ # specific language governing permissions and limitations # under the License. -spec.version.base=1.108.0 +spec.version.base=1.109.0 -javac.source=1.8 +javac.release=17 nbroot=../.. jbrowse.external=${nbroot}/retouche diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/Imports.java b/java/java.hints/src/org/netbeans/modules/java/hints/Imports.java index 8946acf5292b..f0723c11ca7b 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/Imports.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/Imports.java @@ -161,14 +161,8 @@ private static List getAllImportsOfKind(CompilationInfo ci, Impo if (it.getQualifiedIdentifier() instanceof MemberSelectTree) { MemberSelectTree ms = (MemberSelectTree) it.getQualifiedIdentifier(); if (kind == ImportHintKind.DEFAULT_PACKAGE) { - if (it.isStatic()) { - if (ms.getExpression().toString().equals("java.lang.StringTemplate") && ms.getIdentifier().toString().equals("STR")) { - result.add(TreePathHandle.create(new TreePath(topLevel, it), ci)); - } - } else { - if ((ms.getExpression().toString().equals(DEFAULT_PACKAGE))) { - result.add(TreePathHandle.create(new TreePath(topLevel, it), ci)); - } + if (!it.isStatic() && ms.getExpression().toString().equals(DEFAULT_PACKAGE)) { + result.add(TreePathHandle.create(new TreePath(topLevel, it), ci)); } } if (it.isStatic()) { diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/bugs/Unused.java b/java/java.hints/src/org/netbeans/modules/java/hints/bugs/Unused.java index e681ed7b97ea..182d05231fb2 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/bugs/Unused.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/bugs/Unused.java @@ -19,7 +19,6 @@ package org.netbeans.modules.java.hints.bugs; import com.sun.source.tree.Tree.Kind; -import java.util.ArrayList; import java.util.List; import javax.lang.model.element.ElementKind; import org.netbeans.modules.java.editor.base.semantic.UnusedDetector; @@ -34,6 +33,8 @@ import org.netbeans.spi.java.hints.TriggerTreeKind; import org.openide.util.NbBundle.Messages; +import static org.netbeans.api.java.source.CompilationInfo.CacheClearPolicy.ON_TASK_END; + /** * * @author lahvac @@ -52,24 +53,46 @@ public class Unused { @BooleanOption(displayName="#LBL_UnusedPackagePrivate", tooltip="#TP_UnusedPackagePrivate", defaultValue=DETECT_UNUSED_PACKAGE_PRIVATE_DEFAULT) public static final String DETECT_UNUSED_PACKAGE_PRIVATE = "detect.unused.package.private"; - @TriggerTreeKind(Kind.COMPILATION_UNIT) + @TriggerTreeKind({ + //class-like kinds: + Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE, Kind.RECORD, + Kind.VARIABLE, + Kind.METHOD + }) public static List unused(HintContext ctx) { List unused = UnusedDetector.findUnused(ctx.getInfo(), () -> ctx.isCanceled()); - List result = new ArrayList<>(unused.size()); - boolean detectUnusedPackagePrivate = ctx.getPreferences().getBoolean(DETECT_UNUSED_PACKAGE_PRIVATE, DETECT_UNUSED_PACKAGE_PRIVATE_DEFAULT); + if (unused.isEmpty()) { + return null; + } + boolean detectUnusedPackagePrivate = getTaskCachedBoolean(ctx, DETECT_UNUSED_PACKAGE_PRIVATE, DETECT_UNUSED_PACKAGE_PRIVATE_DEFAULT); for (UnusedDescription ud : unused) { if (ctx.isCanceled()) { break; } + if (ud.unusedElementPath.getLeaf() != ctx.getPath().getLeaf()) { + continue; + } if (!detectUnusedPackagePrivate && ud.packagePrivate) { continue; } ErrorDescription err = convertUnused(ctx, ud); if (err != null) { - result.add(err); + return List.of(err); } + break; + } + return null; + } + + // reading from AuxiliaryConfigBasedPreferences in inner loops is not cheap since it needs a mutex + private static boolean getTaskCachedBoolean(HintContext ctx, String key, boolean defaultVal) { + Object cached = ctx.getInfo().getCachedValue(key); + if (cached instanceof Boolean val) { + return val; } - return result; + boolean fromPrefs = ctx.getPreferences().getBoolean(key, defaultVal); + ctx.getInfo().putCachedValue(key, fromPrefs, ON_TASK_END); + return fromPrefs; } @Messages({ diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java b/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java index dbccee227fb5..303fad62c1eb 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java @@ -21,6 +21,7 @@ import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.LineMap; import com.sun.source.util.TreePath; +import java.awt.GraphicsEnvironment; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -79,22 +80,21 @@ import org.openide.filesystems.FileObject; import org.openide.text.PositionBounds; import org.openide.util.Exceptions; +import org.openide.util.Pair; import org.openide.util.Union2; -/** +/** Provides errors and hints for VSCode. This class is abstract to + * be subclasses and registered by VSCode extension XML layer. * * @author lahvac */ -@MimeRegistration(mimeType="text/x-java", service=ErrorProvider.class) public class JavaErrorProvider implements ErrorProvider { - public static final String HINTS_TOOL_ID = "hints"; public static Consumer computeDiagsCallback; //for tests @Override public List computeErrors(Context context) { List result = new ArrayList<>(); - try { ParserManager.parse(Collections.singletonList(Source.create(context.file())), new UserTask() { @Override @@ -117,7 +117,7 @@ public void run(ResultIterator it) throws Exception { AtomicBoolean cancel = new AtomicBoolean(); context.registerCancelCallback(() -> cancel.set(true)); HintsSettings settings; - + if (context.getHintsConfigFile() != null) { Preferences hintSettings = ToolPreferences.from(context.getHintsConfigFile().toURI()).getPreferences(HINTS_TOOL_ID, "text/x-java"); settings = HintsSettings.createPreferencesBasedHintsSettings(hintSettings, true, null); @@ -125,7 +125,7 @@ public void run(ResultIterator it) throws Exception { settings = HintsSettings.getGlobalSettings(); } result.addAll(convert2Diagnostic(context.errorKind(), new HintsInvoker(settings, context.getOffset(), cancel).computeHints(cc), ed -> !disabled.contains(ed.getSeverity()))); - + } break; } @@ -201,24 +201,42 @@ private static List convertFixes(ErrorDescription err, Consumer fixes = sortFixes(lfl.getFixes()); - List result = new ArrayList<>(); + + List> fixesAndSubfixes = new ArrayList<>(); // true if main fix for (Fix f : fixes) { + fixesAndSubfixes.add(Pair.of(f, true)); + for (Fix subFix : f.getSubfixes()) { + fixesAndSubfixes.add(Pair.of(subFix, false)); + } + } + + List result = new ArrayList<>(); + boolean printSubFixes = false; + + for (Pair textAndFix : fixesAndSubfixes) { + if (!printSubFixes && !textAndFix.second()) { + continue; + } + + Fix f = textAndFix.first(); + int startResultSize = result.size(); + String text = textAndFix.second() ? f.getText() : " -> " + f.getText(); + if (f instanceof IncompleteClassPath.ResolveFix) { // We know that this is a project problem and that the problems reported by ProjectProblemsProvider should be resolved - CodeAction action = new CodeAction(f.getText(), new Command(f.getText(), "nbls.project.resolveProjectProblems")); + CodeAction action = new CodeAction(text, new Command(text, "nbls.project.resolveProjectProblems")); result.add(action); } if (f instanceof org.netbeans.modules.java.hints.errors.EnablePreview.ResolveFix) { org.netbeans.modules.java.hints.errors.EnablePreview.ResolveFix rf = (org.netbeans.modules.java.hints.errors.EnablePreview.ResolveFix) f; List params = rf.getNewSourceLevel() != null ? Arrays.asList(rf.getNewSourceLevel()) - : Collections.emptyList(); - CodeAction action = new CodeAction(f.getText(), new Command(f.getText(), "nbls.java.project.enable.preview", params)); + : Collections.emptyList(); + CodeAction action = new CodeAction(text, new Command(text, "nbls.java.project.enable.preview", params)); result.add(action); } if (f instanceof ImportClass.FixImport) { //TODO: FixImport is not a JavaFix, create one. Is there a better solution? - String text = f.getText(); CharSequence sortText = ((ImportClass.FixImport) f).getSortText(); ElementHandle toImport = ((ImportClass.FixImport) f).getToImport(); f = new JavaFix(topLevelHandle[0], sortText != null ? sortText.toString() : null) { @@ -234,8 +252,8 @@ protected void performRewrite(JavaFix.TransformationContext ctx) throws Exceptio } WorkingCopy copy = ctx.getWorkingCopy(); CompilationUnitTree cut = GeneratorUtilities.get(copy).addImports( - copy.getCompilationUnit(), - Collections.singleton(resolved) + copy.getCompilationUnit(), + Collections.singleton(resolved) ); copy.rewrite(copy.getCompilationUnit(), cut); } @@ -243,7 +261,7 @@ protected void performRewrite(JavaFix.TransformationContext ctx) throws Exceptio } if (f instanceof JavaFixImpl) { JavaFix jf = ((JavaFixImpl) f).jf; - CodeAction action = new LazyCodeAction(f.getText(), () -> { + CodeAction action = new LazyCodeAction(text, () -> { try { List edits = modify2TextEdits(js, wc -> { wc.toPhase(JavaSource.Phase.RESOLVED); @@ -262,7 +280,7 @@ protected void performRewrite(JavaFix.TransformationContext ctx) throws Exceptio } if (f instanceof ModificationResultBasedFix) { ModificationResultBasedFix cf = (ModificationResultBasedFix) f; - CodeAction codeAction = new LazyCodeAction(f.getText(), () -> { + CodeAction codeAction = new LazyCodeAction(text, () -> { try { List> documentChanges = new ArrayList<>(); for (ModificationResult changes : cf.getModificationResults()) { @@ -290,8 +308,8 @@ protected void performRewrite(JavaFix.TransformationContext ctx) throws Exceptio continue outer; } else { edits.add(new TextEdit(diff.getStartPosition().getOffset(), - diff.getEndPosition().getOffset(), - newText != null ? newText : "")); + diff.getEndPosition().getOffset(), + newText != null ? newText : "")); } } documentChanges.add(Union2.createFirst(new TextDocumentEdit(fileObject.toURI().toString(), edits))); //XXX: toURI @@ -306,6 +324,9 @@ protected void performRewrite(JavaFix.TransformationContext ctx) throws Exceptio }); result.add(codeAction); } + if (textAndFix.second()) { + printSubFixes = startResultSize != result.size(); + } } return result; @@ -370,8 +391,8 @@ private static List fileModifications(ModificationResult changes, File for (ModificationResult.Difference diff : diffs) { String newText = diff.getNewText(); edits.add(new TextEdit(diff.getStartPosition().getOffset(), - diff.getEndPosition().getOffset(), - newText != null ? newText : "")); + diff.getEndPosition().getOffset(), + newText != null ? newText : "")); } return edits; } diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceExpressionBasedMethodFix.java b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceExpressionBasedMethodFix.java index 5d95c2596bc6..8fabf3426802 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceExpressionBasedMethodFix.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceExpressionBasedMethodFix.java @@ -179,7 +179,8 @@ public String toString() { public ChangeInfo implement() throws Exception { JButton btnOk = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Ok")); JButton btnCancel = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Cancel")); - IntroduceMethodPanel panel = new IntroduceMethodPanel("", duplicatesCount, targets, targetIsInterface); //NOI18N + btnCancel.setDefaultCapable(false); + IntroduceMethodPanel panel = new IntroduceMethodPanel("method", duplicatesCount, targets, targetIsInterface); //NOI18N String caption = NbBundle.getMessage(IntroduceHint.class, "CAP_IntroduceMethod"); DialogDescriptor dd = new DialogDescriptor(panel, caption, true, new Object[]{btnOk, btnCancel}, btnOk, DialogDescriptor.DEFAULT_ALIGN, null, null); NotificationLineSupport notifier = dd.createNotificationLineSupport(); diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceFieldFix.java b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceFieldFix.java index d0b00b360eb4..16abc0748441 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceFieldFix.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceFieldFix.java @@ -149,6 +149,7 @@ public ChangeInfo implement() throws IOException, BadLocationException, ParseExc JButton btnOk = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Ok")); btnOk.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(IntroduceHint.class, "AD_IntrHint_OK")); JButton btnCancel = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Cancel")); + btnCancel.setDefaultCapable(false); btnCancel.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(IntroduceHint.class, "AD_IntrHint_Cancel")); IntroduceFieldPanel panel = createPanel(btnOk); FieldValidator fv = new FieldValidator(source, null, this.handle); diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceFieldPanel.java b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceFieldPanel.java index 47d98111a37d..8d092045738b 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceFieldPanel.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceFieldPanel.java @@ -18,27 +18,19 @@ */ package org.netbeans.modules.java.hints.introduce; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; import java.util.Collections; import java.util.EnumSet; import java.util.Set; import java.util.prefs.Preferences; -import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.Modifier; -import javax.lang.model.element.TypeElement; import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JTextField; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import org.netbeans.api.java.source.ElementHandle; import org.netbeans.api.java.source.TreePathHandle; import org.openide.NotificationLineSupport; import org.openide.util.NbBundle; import org.openide.util.NbPreferences; -import org.openide.util.Utilities; /** * Panel that contains options for creating a field or a local variable. @@ -203,9 +195,9 @@ protected boolean updateUI(MemberSearchResult result) { ok = true; } else if (result.getConflictingKind() != null) { if (result.getConflictingKind() != ElementKind.FIELD) { - notifier.setErrorMessage(Bundle.ERR_LocalVarOrParameterHidden()); + notifyNameError(Bundle.ERR_LocalVarOrParameterHidden()); } else { - notifier.setErrorMessage(Bundle.ERR_ConflictingField()); + notifyNameError(Bundle.ERR_ConflictingField()); } ok = false; } else if (result.getOverriden() != null) { @@ -574,24 +566,24 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }// //GEN-END:initComponents private void declareFinalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_declareFinalActionPerformed - // TODO add your handling code here: -}//GEN-LAST:event_declareFinalActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_declareFinalActionPerformed -private void initConstructorsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_initConstructorsActionPerformed - adjustFinal(); -}//GEN-LAST:event_initConstructorsActionPerformed + private void initConstructorsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_initConstructorsActionPerformed + adjustFinal(); + }//GEN-LAST:event_initConstructorsActionPerformed -private void initFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_initFieldActionPerformed - adjustFinal(); -}//GEN-LAST:event_initFieldActionPerformed + private void initFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_initFieldActionPerformed + adjustFinal(); + }//GEN-LAST:event_initFieldActionPerformed -private void initMethodActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_initMethodActionPerformed - adjustFinal(); -}//GEN-LAST:event_initMethodActionPerformed + private void initMethodActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_initMethodActionPerformed + adjustFinal(); + }//GEN-LAST:event_initMethodActionPerformed -private void replaceAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_replaceAllActionPerformed + private void replaceAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_replaceAllActionPerformed adjustInitializeIn(); -}//GEN-LAST:event_replaceAllActionPerformed + }//GEN-LAST:event_replaceAllActionPerformed private void checkRefactorExistingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkRefactorExistingActionPerformed if (checkRefactorExisting.isEnabled()) { diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceMethodFix.java b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceMethodFix.java index e92d0eee4126..90fd6910ef18 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceMethodFix.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceMethodFix.java @@ -419,7 +419,8 @@ public String toDebugString(CompilationInfo info) { public ChangeInfo implement() throws Exception { JButton btnOk = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Ok")); JButton btnCancel = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Cancel")); - IntroduceMethodPanel panel = new IntroduceMethodPanel("", duplicatesCount, targets, targetIsInterface); //NOI18N + btnCancel.setDefaultCapable(false); + IntroduceMethodPanel panel = new IntroduceMethodPanel("method", duplicatesCount, targets, targetIsInterface); //NOI18N String caption = NbBundle.getMessage(IntroduceHint.class, "CAP_IntroduceMethod"); DialogDescriptor dd = new DialogDescriptor(panel, caption, true, new Object[]{btnOk, btnCancel}, btnOk, DialogDescriptor.DEFAULT_ALIGN, null, null); NotificationLineSupport notifier = dd.createNotificationLineSupport(); diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceMethodPanel.java b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceMethodPanel.java index a6be89af0026..4d2eb4bfbd85 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceMethodPanel.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceMethodPanel.java @@ -23,7 +23,6 @@ import java.util.Collection; import java.util.Collections; import java.util.EnumSet; -import java.util.Map; import java.util.Set; import java.util.prefs.Preferences; import javax.lang.model.element.Modifier; @@ -73,15 +72,17 @@ public IntroduceMethodPanel(String name, int duplicatesCount, Collection 0 ) { this.name.setCaretPosition(name.length()); this.name.setSelectionStart(0); this.name.setSelectionEnd(name.length()); } - this.changeSupport = new MethodNameSupport(this.name); - this.changeSupport.setChangeListener(this); - + Preferences pref = getPreferences(); if (!targetInterface) { @@ -127,8 +128,9 @@ public void setNotifier(NotificationLineSupport notifier) { } private class MethodNameSupport extends NameChangeSupport { - public MethodNameSupport(JTextField control) { - super(control); + + public MethodNameSupport(JTextField control, boolean initAsValid) { + super(control, initAsValid); } @Override diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceVariableFix.java b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceVariableFix.java index bb65ec8741ee..01245cef5475 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceVariableFix.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceVariableFix.java @@ -128,6 +128,7 @@ public String getText() { public ChangeInfo implement() throws IOException, BadLocationException, ParseException { JButton btnOk = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Ok")); JButton btnCancel = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Cancel")); + btnCancel.setDefaultCapable(false); IntroduceFieldPanel panel = new IntroduceFieldPanel(guessedName, null, duplicatesCount, true, handle.getKind() == Tree.Kind.VARIABLE, IntroduceFieldPanel.VARIABLE, diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/NameChangeSupport.java b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/NameChangeSupport.java index b02f92e4fa3b..7e80b88394b4 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/NameChangeSupport.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/NameChangeSupport.java @@ -20,20 +20,16 @@ import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; -import java.lang.reflect.InvocationTargetException; -import javax.lang.model.element.Element; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; import javax.lang.model.element.Modifier; -import javax.lang.model.element.TypeElement; import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import org.netbeans.api.java.source.ElementHandle; import org.netbeans.api.java.source.TreePathHandle; -import org.openide.NotificationLineSupport; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; import org.openide.util.Utilities; @@ -56,13 +52,32 @@ class NameChangeSupport extends FocusAdapter implements DocumentListener, Runnab private Modifier minAccess; private boolean valid; private String validateName; - + public NameChangeSupport(JTextField control) { + this(control, false); + } + + public NameChangeSupport(JTextField control, boolean initAsValid) { this.control = control; + this.valid = initAsValid; control.getDocument().addDocumentListener(this); control.addFocusListener(this); + // ensure validation finishes before ENTER closes the window while current state is valid + control.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + if (valid && e.getKeyCode() == KeyEvent.VK_ENTER) { + try { + validateTask.waitFinished(1000); + } catch (InterruptedException ignore) {} + if (!valid) { + e.consume(); + } + } + } + }); } - + public synchronized void setChangeListener(ChangeListener l) { assert listener == null; this.listener = l; @@ -117,8 +132,10 @@ public boolean isValid() { public void run() { TreePathHandle t; MemberValidator v; + String name; synchronized (this) { - if (validateName == null) { + name = this.validateName; + if (name == null) { return; } if (validator == null) { @@ -131,10 +148,10 @@ public void run() { Modifier mod = null; final ChangeListener l; - if (validateName.isEmpty()) { + if (name.isEmpty()) { notifyNameError(Bundle.ERR_NameIsEmpty()); nv = false; - } else if (!Utilities.isJavaIdentifier(validateName)) { + } else if (!Utilities.isJavaIdentifier(name)) { notifyNameError(Bundle.ERR_NameIsNotValid()); nv = false; } else { diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java b/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java index e71e0885e273..c5954477fadb 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java @@ -23,7 +23,6 @@ import com.sun.source.tree.InstanceOfTree; import com.sun.source.tree.ParenthesizedTree; import com.sun.source.tree.StatementTree; -import com.sun.source.tree.Tree; import com.sun.source.tree.Tree.Kind; import com.sun.source.tree.TypeCastTree; import com.sun.source.tree.VariableTree; @@ -59,10 +58,10 @@ * @author sdedic */ @NbBundle.Messages({ - "DN_ConvertToPatternInstanceOf=Convert to instanceof ", - "DESC_ConvertToPatternInstanceOf=Convert to instanceof ", - "ERR_ConvertToPatternInstanceOf=instanceof can be used here", - "FIX_ConvertToPatternInstanceOf=Use instanceof " + "DN_ConvertToPatternInstanceOf=Convert to instanceof pattern", + "DESC_ConvertToPatternInstanceOf=Convert to instanceof pattern", + "ERR_ConvertToPatternInstanceOf=instanceof pattern can be used here", + "FIX_ConvertToPatternInstanceOf=Use instanceof pattern" }) @Hint(displayName="#DN_ConvertToPatternInstanceOf", description="#DESC_ConvertToPatternInstanceOf", category="rules15", minSourceVersion = "14") diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/ExpectedTypeResolver.java b/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/ExpectedTypeResolver.java index a6ab78059b6d..b266c3944ae8 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/ExpectedTypeResolver.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/ExpectedTypeResolver.java @@ -73,7 +73,6 @@ import com.sun.source.tree.RequiresTree; import com.sun.source.tree.ReturnTree; import com.sun.source.tree.Scope; -import com.sun.source.tree.StringTemplateTree; import com.sun.source.tree.SwitchExpressionTree; import com.sun.source.tree.SwitchTree; import com.sun.source.tree.SynchronizedTree; @@ -1432,12 +1431,6 @@ public List visitDeconstructionPattern(DeconstructionPatte return null; } - @Override - public List visitStringTemplate(StringTemplateTree stt, Object p) { - //TODO: - return null; - } - @Override public List visitAnyPattern(AnyPatternTree apt, Object p) { return null; diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/ImportsTest.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/ImportsTest.java index 1cd70f8478eb..aded17510c7c 100644 --- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/ImportsTest.java +++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/ImportsTest.java @@ -18,12 +18,9 @@ */ package org.netbeans.modules.java.hints; -import javax.lang.model.SourceVersion; import org.netbeans.junit.NbTestCase; import org.netbeans.modules.java.hints.test.api.HintTest; -import static org.junit.Assume.assumeTrue; - /** * * @author lahvac @@ -61,33 +58,26 @@ public void testUnusedSimpleRemove() throws Exception { } public void testRedundantLangImportRemove() throws Exception { - assumeTrue(Runtime.version().feature() >= 21); // API dependency HintTest.create() - .sourceLevel(SourceVersion.latest().ordinal()) - .options("--enable-preview") .input( "package test;\n" + + "import java.lang.Exception;\n" + "import java.lang.System;\n" + - "import static java.lang.StringTemplate.STR;\n" + - "import static java.lang.StringTemplate.RAW;\n" + "public class Test {\n" + - " public static void main(String[] args) {\n" + - " System.out.println(STR.\"hello world\");\n" + - " System.out.println(RAW.\"hello world\");" + + " public static void main(String[] args) throws Exception {\n" + + " System.out.println(\"hello world\");\n" + " }\n" + "}") .run(Imports.class) - .assertWarnings("1:0-1:24:verifier:DN_Imports_DEFAULT_PACKAGE", "2:0-2:43:verifier:DN_Imports_DEFAULT_PACKAGE") - .findWarning("1:0-1:24:verifier:DN_Imports_DEFAULT_PACKAGE") + .assertWarnings("1:0-1:27:verifier:DN_Imports_DEFAULT_PACKAGE", "2:0-2:24:verifier:DN_Imports_DEFAULT_PACKAGE") + .findWarning("2:0-2:24:verifier:DN_Imports_DEFAULT_PACKAGE") .applyFix("LBL_Imports_Fix_All_DEFAULT_PACKAGE") .assertCompilable() .assertOutput( "package test;\n" + - "import static java.lang.StringTemplate.RAW;\n" + "public class Test {\n" + - " public static void main(String[] args) {\n" + - " System.out.println(STR.\"hello world\");\n" + - " System.out.println(RAW.\"hello world\");" + + " public static void main(String[] args) throws Exception {\n" + + " System.out.println(\"hello world\");\n" + " }\n" + "}"); } diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOfTest.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOfTest.java index 6e78bba9ce31..f69558b2dacb 100644 --- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOfTest.java +++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOfTest.java @@ -20,7 +20,6 @@ import org.netbeans.junit.NbTestCase; import org.netbeans.modules.java.hints.test.api.HintTest; -import javax.lang.model.SourceVersion; /** * diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/threading/TinyTest.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/threading/TinyTest.java index 7999ae704bc5..d7e2596c0379 100644 --- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/threading/TinyTest.java +++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/threading/TinyTest.java @@ -18,6 +18,7 @@ */ package org.netbeans.modules.java.hints.threading; +import org.junit.Assume; import org.netbeans.junit.NbTestCase; import org.netbeans.modules.java.hints.test.api.HintTest; @@ -216,6 +217,7 @@ public void testThreadYield() throws Exception { } public void testThreadSuspend() throws Exception { + Assume.assumeTrue(Runtime.version().feature() <= 22); HintTest .create() .input("package test;\n" + diff --git a/java/java.j2sedeploy/manifest.mf b/java/java.j2sedeploy/manifest.mf index 7f83ce66f591..77d02f8541b7 100644 --- a/java/java.j2sedeploy/manifest.mf +++ b/java/java.j2sedeploy/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.j2sedeploy OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2sedeploy/Bundle.properties -OpenIDE-Module-Specification-Version: 1.37 +OpenIDE-Module-Specification-Version: 1.38 AutoUpdate-Show-In-Client: false diff --git a/java/java.j2seembedded/manifest.mf b/java/java.j2seembedded/manifest.mf index cecd4a5b5400..e44662b04df0 100644 --- a/java/java.j2seembedded/manifest.mf +++ b/java/java.j2seembedded/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.j2seembedded OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seembedded/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/java/j2seembedded/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.34 +OpenIDE-Module-Specification-Version: 1.35 diff --git a/java/java.j2semodule/manifest.mf b/java/java.j2semodule/manifest.mf index 86ce65367505..9a5d580bf124 100644 --- a/java/java.j2semodule/manifest.mf +++ b/java/java.j2semodule/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.java.j2semodule OpenIDE-Module-Layer: org/netbeans/modules/java/j2semodule/ui/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2semodule/Bundle.properties -OpenIDE-Module-Specification-Version: 1.27 +OpenIDE-Module-Specification-Version: 1.28 diff --git a/java/java.j2seplatform/manifest.mf b/java/java.j2seplatform/manifest.mf index 05858d64abdc..e8a06577fdb0 100644 --- a/java/java.j2seplatform/manifest.mf +++ b/java/java.j2seplatform/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seplatform/Bundle. OpenIDE-Module-Layer: org/netbeans/modules/java/j2seplatform/resources/layer.xml OpenIDE-Module-Install: org/netbeans/modules/java/j2seplatform/J2SEPlatformModule.class AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.68 +OpenIDE-Module-Specification-Version: 1.69 OpenIDE-Module-Provides: j2seplatform diff --git a/java/java.j2seprofiles/manifest.mf b/java/java.j2seprofiles/manifest.mf index f715f9968f02..84cfdf3498b7 100644 --- a/java/java.j2seprofiles/manifest.mf +++ b/java/java.j2seprofiles/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.j2seprofiles OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seprofiles/Bundle.properties -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.34 diff --git a/java/java.j2seproject/nbproject/project.properties b/java/java.j2seproject/nbproject/project.properties index 48a7e73c5c94..725f3aa0df1d 100644 --- a/java/java.j2seproject/nbproject/project.properties +++ b/java/java.j2seproject/nbproject/project.properties @@ -17,7 +17,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -spec.version.base=1.112.0 +spec.version.base=1.113.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml diff --git a/java/java.kit/manifest.mf b/java/java.kit/manifest.mf index 07a9fbba8244..4d569e5ac5d2 100644 --- a/java/java.kit/manifest.mf +++ b/java/java.kit/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.61 OpenIDE-Module-Recommends: org.netbeans.modules.profiler, org.netbeans.modules.debugger.jpda.kit,org.netbeans.modules.selenium2.java OpenIDE-Module-Layer: org/netbeans/modules/java/kit/layer.xml diff --git a/java/java.lexer/manifest.mf b/java/java.lexer/manifest.mf index 9babf90d4c1e..38579d3fff99 100644 --- a/java/java.lexer/manifest.mf +++ b/java/java.lexer/manifest.mf @@ -1,5 +1,5 @@ OpenIDE-Module: org.netbeans.modules.java.lexer/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/java/lexer/Bundle.properties -OpenIDE-Module-Specification-Version: 1.61 +OpenIDE-Module-Specification-Version: 1.62 OpenIDE-Module-Layer: org/netbeans/lib/java/lexer/layer.xml diff --git a/java/java.lsp.server/nbcode/integration/nbproject/project.xml b/java/java.lsp.server/nbcode/integration/nbproject/project.xml index 3cee4feb1698..70102d62f3a3 100644 --- a/java/java.lsp.server/nbcode/integration/nbproject/project.xml +++ b/java/java.lsp.server/nbcode/integration/nbproject/project.xml @@ -118,6 +118,15 @@ + + org.netbeans.modules.java.platform + + + + 1 + 1.66 + + org.netbeans.modules.parsing.api diff --git a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspAssetsDecorationProvider.java b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspAssetsDecorationProvider.java new file mode 100644 index 000000000000..9e2160d79da8 --- /dev/null +++ b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspAssetsDecorationProvider.java @@ -0,0 +1,120 @@ +/* + * 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.nbcode.integration; + +import java.util.Optional; +import java.util.logging.Logger; +import org.netbeans.modules.cloud.oracle.assets.CloudAssets; +import org.netbeans.modules.cloud.oracle.bucket.BucketItem; +import org.netbeans.modules.cloud.oracle.compute.ComputeInstanceItem; +import org.netbeans.modules.cloud.oracle.database.DatabaseItem; +import org.netbeans.modules.cloud.oracle.developer.ContainerRepositoryItem; +import org.netbeans.modules.cloud.oracle.developer.ContainerTagItem; +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.netbeans.modules.java.lsp.server.explorer.NodeLookupContextValues; +import org.netbeans.modules.java.lsp.server.explorer.api.TreeDataListener; +import org.netbeans.modules.java.lsp.server.explorer.api.TreeDataProvider; +import org.netbeans.modules.java.lsp.server.explorer.api.TreeItemData; +import org.openide.nodes.Node; +import org.openide.util.lookup.ServiceProvider; + + +/** + * + * @author Jan Horvath + */ +@ServiceProvider(service = TreeDataProvider.Factory.class, path = "Explorers/cloud.assets") +public class LspAssetsDecorationProvider implements TreeDataProvider.Factory { + private static final Logger LOG = Logger.getLogger(LspAssetsDecorationProvider.class.getName()); + + public static final String CTXVALUE_CAP_REFERENCE_NAME = "cap:refName"; // NOI18N + public static final String CTXVALUE_PREFIX_REFERENCE_NAME = "cloudAssetsReferenceName:"; // NOI18N + public static final String CTXVALUE_PREFIX_PUBLIC_IP = "publicIp:"; // NOI18N + public static final String CTXVALUE_PREFIX_IMAGE_URL = "imageUrl:"; // NOI18N + public static final String CTXVALUE_PREFIX_IMAGE_COUNT = "imageCount:"; // NOI18N + public static final String CTXVALUE_PREFIX_REPOSITORY_PUBLIC = "repositoryPublic:"; // NOI18N + + @Override + public synchronized TreeDataProvider createProvider(String treeId) { + return new ProviderImpl(null); + } + + static class ProviderImpl implements TreeDataProvider { + public ProviderImpl(NodeLookupContextValues lookupValues) { + } + + @Override + public TreeItemData createDecorations(Node n, boolean expanded) { + TreeItemData d = new TreeItemData(); + String refName; + boolean set = false; + + OCIItem item = n.getLookup().lookup(OCIItem.class); + if (item == null) { + return null; + } + refName = CloudAssets.getDefault().getReferenceName(item); + if (refName != null) { + d.addContextValues(CTXVALUE_PREFIX_REFERENCE_NAME + refName); + set = true; + } + if (item instanceof ComputeInstanceItem) { + String publicIp = ((ComputeInstanceItem) item).getPublicIp(); + if (publicIp != null) { + d.addContextValues(CTXVALUE_PREFIX_PUBLIC_IP + publicIp); + set = true; + } + } + if (item instanceof ContainerRepositoryItem) { + ContainerRepositoryItem repo = (ContainerRepositoryItem) item; + d.addContextValues(CTXVALUE_PREFIX_IMAGE_COUNT + repo.getImageCount()); + d.addContextValues(CTXVALUE_PREFIX_REPOSITORY_PUBLIC + repo.getIsPublic()); + set = true; + } + if (item instanceof ContainerTagItem) { + String imageUrl = ((ContainerTagItem) item).getUrl(); + Optional instance = CloudAssets.getDefault().getAssignedItems().stream().filter(i -> i.getClass().equals(ComputeInstanceItem.class)).findFirst(); + if (instance.isPresent()) { + d.addContextValues(CTXVALUE_PREFIX_PUBLIC_IP + ((ComputeInstanceItem) instance.get()).getPublicIp()); + } + d.addContextValues(CTXVALUE_PREFIX_IMAGE_URL + imageUrl); + set = true; + } + if (item instanceof BucketItem + || item instanceof DatabaseItem) { + d.addContextValues(CTXVALUE_CAP_REFERENCE_NAME); + set = true; + } + return set ? d : null; + } + + @Override + public void addTreeItemDataListener(TreeDataListener l) { + } + + @Override + public void removeTreeItemDataListener(TreeDataListener l) { + } + + @Override + public void nodeReleased(Node n) { + } + + } +} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/DownloadConfig.java b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspJavaPlatformProviderOverride.java similarity index 65% rename from nbi/engine/src/org/netbeans/installer/downloader/DownloadConfig.java rename to java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspJavaPlatformProviderOverride.java index 1a823e2ec69f..31066657e35d 100644 --- a/nbi/engine/src/org/netbeans/installer/downloader/DownloadConfig.java +++ b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspJavaPlatformProviderOverride.java @@ -16,19 +16,16 @@ * specific language governing permissions and limitations * under the License. */ +package org.netbeans.modules.nbcode.integration; -package org.netbeans.installer.downloader; +import org.netbeans.modules.java.lsp.server.ui.AbstractJavaPlatformProviderOverride; +import org.netbeans.modules.java.platform.implspi.JavaPlatformProvider; +import org.openide.util.lookup.ServiceProvider; /** * - * @author Danila_Dugurov + * @author sdedic */ -public class DownloadConfig { - ///////////////////////////////////////////////////////////////////////////////// - // Constants - public static final int DISPATCHER_QUANTUM = 100; - public static final int DISPATCHER_POOL = 10; - - public static final int ATTEMPT_COUNT = 3; - public static final int REATTEMPT_DELAY = 1000; +@ServiceProvider(service = JavaPlatformProvider.class, position = 10_000) +public class LspJavaPlatformProviderOverride extends AbstractJavaPlatformProviderOverride { } diff --git a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspOcidDecorationProvider.java b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspOcidDecorationProvider.java new file mode 100644 index 000000000000..fe144e036eb7 --- /dev/null +++ b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspOcidDecorationProvider.java @@ -0,0 +1,72 @@ +/* + * 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.nbcode.integration; + +import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.netbeans.modules.java.lsp.server.explorer.NodeLookupContextValues; +import org.netbeans.modules.java.lsp.server.explorer.api.TreeDataListener; +import org.netbeans.modules.java.lsp.server.explorer.api.TreeDataProvider; +import org.netbeans.modules.java.lsp.server.explorer.api.TreeItemData; +import org.openide.nodes.Node; +import org.openide.util.lookup.ServiceProvider; + +/** + * + * @author Jan Horvath + */ +@ServiceProvider(service = TreeDataProvider.Factory.class, path = "Explorers/_all") +public class LspOcidDecorationProvider implements TreeDataProvider.Factory { + public static final String CTXVALUE_PREFIX_OCID = "ocid:"; // NOI18N + + @Override + public synchronized TreeDataProvider createProvider(String treeId) { + return new ProviderImpl(null); + } + + static class ProviderImpl implements TreeDataProvider { + public ProviderImpl(NodeLookupContextValues lookupValues) { + } + + @Override + public TreeItemData createDecorations(Node n, boolean expanded) { + TreeItemData d = new TreeItemData(); + + OCIItem item = n.getLookup().lookup(OCIItem.class); + if (item == null) { + return null; + } + + d.addContextValues(CTXVALUE_PREFIX_OCID + item.getKey().getValue()); + return d; + } + + @Override + public void addTreeItemDataListener(TreeDataListener l) { + } + + @Override + public void removeTreeItemDataListener(TreeDataListener l) { + } + + @Override + public void nodeReleased(Node n) { + } + + } +} diff --git a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/cloud-cookies.contextValues b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/cloud-cookies.contextValues index 4e9ec0636ecf..2f6a716a843a 100644 --- a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/cloud-cookies.contextValues +++ b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/cloud-cookies.contextValues @@ -23,4 +23,7 @@ org.netbeans.modules.cloud.oracle.devops.BuildPipelineItem org.netbeans.modules.cloud.oracle.devops.DevopsProjectItem org.netbeans.modules.cloud.oracle.assets.SuggestedItem org.netbeans.modules.cloud.oracle.compute.ClusterItem -org.netbeans.modules.cloud.oracle.compute.ComputeInstance \ No newline at end of file +org.netbeans.modules.cloud.oracle.compute.ComputeInstanceItem +org.netbeans.modules.cloud.oracle.bucket.BucketItem +org.netbeans.modules.cloud.oracle.vault.VaultItem +org.netbeans.modules.cloud.oracle.developer.ContainerRepositoryItem \ No newline at end of file diff --git a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/commands/OCIDCommand.java b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/commands/OCIDCommand.java deleted file mode 100644 index 7cf88de51994..000000000000 --- a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/commands/OCIDCommand.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.nbcode.integration.commands; - -import com.google.gson.JsonPrimitive; -import java.util.Collections; -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.netbeans.modules.cloud.oracle.items.OCIItem; -import org.netbeans.modules.java.lsp.server.explorer.TreeNodeRegistry; -import org.netbeans.modules.java.lsp.server.explorer.TreeViewProvider; -import org.netbeans.spi.lsp.CommandProvider; -import org.openide.nodes.Node; -import org.openide.util.Lookup; -import org.openide.util.lookup.ServiceProvider; - -/** - * - * @author Tomas Hurka - */ -@ServiceProvider(service = CommandProvider.class) -public class OCIDCommand implements CommandProvider { - - private static final Logger LOG = Logger.getLogger(OCIDCommand.class.getName()); - - private static final String COMMAND_CLOUD_OCID_GET = "nbls.cloud.ocid.get"; // NOI18N - - public OCIDCommand() { - } - - @Override - public Set getCommands() { - return Collections.singleton(COMMAND_CLOUD_OCID_GET); - } - - @Override - public CompletableFuture runCommand(String command, List arguments) { - if (arguments.size() < 1) { - throw new IllegalArgumentException("Expected nodeid"); // NOI18N - } - TreeNodeRegistry r = Lookup.getDefault().lookup(TreeNodeRegistry.class); - if (r == null) { - return CompletableFuture.completedFuture(null); - } - int nodeId = ((JsonPrimitive) arguments.get(0)).getAsInt(); - LOG.log(Level.FINE, "Running OCID command with context: {0}", nodeId); // NOI18N - - TreeViewProvider nodeProvider = r.providerOf(nodeId); - Node node = null; - if (nodeProvider != null) { - node = nodeProvider.findNode(nodeId); - } - if (node == null) { - return CompletableFuture.completedFuture(null); - } - OCIItem item = node.getLookup().lookup(OCIItem.class); - if (item != null) { - return CompletableFuture.completedFuture(item.getKey().getValue()); - } - return CompletableFuture.completedFuture(null); - } -} diff --git a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml index a3415479a698..8141315be67c 100644 --- a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml +++ b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/layer.xml @@ -61,6 +61,7 @@ + @@ -174,4 +175,17 @@ + + + + + + + + + + + + + diff --git a/java/java.lsp.server/nbproject/project.properties b/java/java.lsp.server/nbproject/project.properties index 1942cf8d0b74..2f3af3cf4b7c 100644 --- a/java/java.lsp.server/nbproject/project.properties +++ b/java/java.lsp.server/nbproject/project.properties @@ -17,7 +17,7 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=2.8.0 +spec.version.base=2.9.0 javadoc.arch=${basedir}/arch.xml requires.nb.javac=true lsp.build.dir=vscode/nbcode diff --git a/java/java.lsp.server/nbproject/project.xml b/java/java.lsp.server/nbproject/project.xml index 2b5122a231bb..cea7ea966aae 100644 --- a/java/java.lsp.server/nbproject/project.xml +++ b/java/java.lsp.server/nbproject/project.xml @@ -400,6 +400,15 @@ 0.3 + + org.netbeans.modules.java.platform + + + + 1 + 1.66 + + org.netbeans.modules.java.project @@ -697,12 +706,6 @@ 9.24 - - com.google.guava - - 27.16 - - diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/cloud/OCIAssets.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/cloud/OCIAssets.java index d1cc2eb19856..914860033b6c 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/cloud/OCIAssets.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/cloud/OCIAssets.java @@ -36,7 +36,6 @@ public class OCIAssets implements ExplorerManagerFactory { public static final String ID = "cloud.assets"; // NOI18N public static final String CLOUD_PATH = "CloudAssets"; // NOI18N - private static String CLOUD_NODE_NAME = "cloudAssets"; @Override public CompletionStage createManager(String id, Lookup context) { @@ -46,7 +45,6 @@ public CompletionStage createManager(String id, Lookup context) ExplorerManager em = new ExplorerManager(); Lookup.Result nodes = Lookups.forPath("Cloud/Oracle/Assets").lookupResult(Node.class); nodes.allInstances().stream() -// .filter(n -> CLOUD_NODE_NAME.equals(n.getName())) .findFirst() .ifPresent(n -> em.setRootContext(n)); return CompletableFuture.completedFuture(em); diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/DefaultDecorationsImpl.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/DefaultDecorationsImpl.java index 498eefd055d4..c99b758a035e 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/DefaultDecorationsImpl.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/DefaultDecorationsImpl.java @@ -216,7 +216,7 @@ public TreeItemData createDecorations(Node n, boolean expanded) { d.addContextValues(CTXVALUE_CAP_RENAME); set = true; } - + return set ? d : null; } diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ConstructorGenerator.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ConstructorGenerator.java index 583f90585472..c4602b78e2d6 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ConstructorGenerator.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ConstructorGenerator.java @@ -188,7 +188,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat data.put(OFFSET, startOffset); data.put(CONSTRUCTORS, constructors); data.put(FIELDS, fields); - return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateConstructor(), isSource ? CODE_GENERATOR_KIND : CodeActionKind.QuickFix, null, "nbls.generate.code", GENERATE_CONSTRUCTOR, data)); + return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateConstructor(), isSource ? CODE_GENERATOR_KIND : CodeActionKind.QuickFix, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_CONSTRUCTOR, client.getNbCodeCapabilities()), data)); } @Override diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/DelegateMethodGenerator.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/DelegateMethodGenerator.java index 74c4523b85be..b7eae2e038e4 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/DelegateMethodGenerator.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/DelegateMethodGenerator.java @@ -137,7 +137,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat data.put(OFFSET, offset); data.put(TYPE, typeItem); data.put(FIELDS, fields); - return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateDelegateMethod(), CODE_GENERATOR_KIND, null, "nbls.generate.code", GENERATE_DELEGATE_METHOD, data)); + return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateDelegateMethod(), CODE_GENERATOR_KIND, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_DELEGATE_METHOD, client.getNbCodeCapabilities()), data)); } @Override diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/EqualsHashCodeGenerator.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/EqualsHashCodeGenerator.java index 4e9b4f747a59..7f2a8084d80f 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/EqualsHashCodeGenerator.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/EqualsHashCodeGenerator.java @@ -115,11 +115,11 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat String uri = Utils.toUri(info.getFileObject()); if (equalsHashCode[0] == null) { if (equalsHashCode[1] == null) { - return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateEqualsHashCode(), CODE_GENERATOR_KIND, null, "nbls.generate.code", GENERATE_EQUALS_HASHCODE, data(0, uri, offset, fields))); + return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateEqualsHashCode(), CODE_GENERATOR_KIND, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_EQUALS_HASHCODE, client.getNbCodeCapabilities()), data(0, uri, offset, fields))); } - return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateEquals(), CODE_GENERATOR_KIND, null, "nbls.generate.code", GENERATE_EQUALS_HASHCODE, data(EQUALS_ONLY, uri, offset, fields))); + return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateEquals(), CODE_GENERATOR_KIND, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_EQUALS_HASHCODE, client.getNbCodeCapabilities()), data(EQUALS_ONLY, uri, offset, fields))); } - return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateHashCode(), CODE_GENERATOR_KIND, null, "nbls.generate.code", GENERATE_EQUALS_HASHCODE, data(HASH_CODE_ONLY, uri, offset, fields))); + return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateHashCode(), CODE_GENERATOR_KIND, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_EQUALS_HASHCODE, client.getNbCodeCapabilities()), data(HASH_CODE_ONLY, uri, offset, fields))); } @Override diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/GetterSetterGenerator.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/GetterSetterGenerator.java index fb85050e92be..0a96c15dcea8 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/GetterSetterGenerator.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/GetterSetterGenerator.java @@ -103,7 +103,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat List result = new ArrayList<>(); if (missingGetters) { String name = pair.first().size() == 1 ? Bundle.DN_GenerateGetterFor(pair.first().iterator().next().getSimpleName().toString()) : Bundle.DN_GenerateGetters(); - result.add(createCodeAction(client, name, all ? CODE_GENERATOR_KIND : CodeActionKind.QuickFix, null, "nbls.generate.code", GENERATE_GETTER_SETTER, data(GeneratorUtils.GETTERS_ONLY, uri, offset, all, pair.first().stream().map(variableElement -> { + result.add(createCodeAction(client, name, all ? CODE_GENERATOR_KIND : CodeActionKind.QuickFix, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_GETTER_SETTER, client.getNbCodeCapabilities()), data(GeneratorUtils.GETTERS_ONLY, uri, offset, all, pair.first().stream().map(variableElement -> { QuickPickItem item = new QuickPickItem(createLabel(info, variableElement)); item.setUserData(new ElementData(variableElement)); return item; @@ -111,7 +111,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat } if (missingSetters) { String name = pair.second().size() == 1 ? Bundle.DN_GenerateSetterFor(pair.second().iterator().next().getSimpleName().toString()) : Bundle.DN_GenerateSetters(); - result.add(createCodeAction(client, name, all ? CODE_GENERATOR_KIND : CodeActionKind.QuickFix, null, "nbls.generate.code", GENERATE_GETTER_SETTER, data(GeneratorUtils.SETTERS_ONLY, uri, offset, all, pair.second().stream().map(variableElement -> { + result.add(createCodeAction(client, name, all ? CODE_GENERATOR_KIND : CodeActionKind.QuickFix, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_GETTER_SETTER, client.getNbCodeCapabilities()), data(GeneratorUtils.SETTERS_ONLY, uri, offset, all, pair.second().stream().map(variableElement -> { QuickPickItem item = new QuickPickItem(createLabel(info, variableElement)); item.setUserData(new ElementData(variableElement)); return item; @@ -120,7 +120,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat if (missingGetters && missingSetters) { pair.first().retainAll(pair.second()); String name = pair.first().size() == 1 ? Bundle.DN_GenerateGetterSetterFor(pair.first().iterator().next().getSimpleName().toString()) : Bundle.DN_GenerateGettersSetters(); - result.add(createCodeAction(client, name, all ? CODE_GENERATOR_KIND : CodeActionKind.QuickFix, null, "nbls.generate.code", GENERATE_GETTER_SETTER, data(0, uri, offset, all, pair.first().stream().map(variableElement -> { + result.add(createCodeAction(client, name, all ? CODE_GENERATOR_KIND : CodeActionKind.QuickFix, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_GETTER_SETTER, client.getNbCodeCapabilities()), data(0, uri, offset, all, pair.first().stream().map(variableElement -> { QuickPickItem item = new QuickPickItem(createLabel(info, variableElement)); item.setUserData(new ElementData(variableElement)); return item; diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ImplementOverrideMethodGenerator.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ImplementOverrideMethodGenerator.java index c839e8e60dde..4aca8de3ca64 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ImplementOverrideMethodGenerator.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ImplementOverrideMethodGenerator.java @@ -109,7 +109,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat implementMethods.add(new QuickPickItem(createLabel(info, method), enclosingTypeName, null, mustImplement, new ElementData(method))); } if (!implementMethods.isEmpty()) { - result.add(createCodeAction(client, Bundle.DN_GenerateImplementMethod(), CODE_GENERATOR_KIND, null, "nbls.generate.code", GENERATE_IMPLEMENT_OVERRIDE, data(uri, offset, true, implementMethods))); + result.add(createCodeAction(client, Bundle.DN_GenerateImplementMethod(), CODE_GENERATOR_KIND, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_IMPLEMENT_OVERRIDE, client.getNbCodeCapabilities()), data(uri, offset, true, implementMethods))); } } if (typeElement.getKind().isClass() || typeElement.getKind().isInterface()) { @@ -125,7 +125,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat overrideMethods.add(item); } if (!overrideMethods.isEmpty()) { - result.add(createCodeAction(client, Bundle.DN_GenerateOverrideMethod(), CODE_GENERATOR_KIND, null, "nbls.generate.code", GENERATE_IMPLEMENT_OVERRIDE, data(uri, offset, false, overrideMethods))); + result.add(createCodeAction(client, Bundle.DN_GenerateOverrideMethod(), CODE_GENERATOR_KIND, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_IMPLEMENT_OVERRIDE, client.getNbCodeCapabilities()), data(uri, offset, false, overrideMethods))); } } return result; diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/LoggerGenerator.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/LoggerGenerator.java index 4c92f0975fd2..46afb67b3541 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/LoggerGenerator.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/LoggerGenerator.java @@ -108,7 +108,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat Map data = new HashMap<>(); data.put(URI, uri); data.put(OFFSET, offset); - return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateLogger(), CODE_GENERATOR_KIND, null, "nbls.generate.code", GENERATE_LOGGER, data)); + return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateLogger(), CODE_GENERATOR_KIND, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_LOGGER, client.getNbCodeCapabilities()), data)); } @Override diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/LspServerTelemetryManager.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/LspServerTelemetryManager.java new file mode 100644 index 000000000000..d82646afb16c --- /dev/null +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/LspServerTelemetryManager.java @@ -0,0 +1,201 @@ +/* + * 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.java.lsp.server.protocol; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.concurrent.Future; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; +import org.eclipse.lsp4j.ConfigurationItem; +import org.eclipse.lsp4j.ConfigurationParams; +import org.eclipse.lsp4j.MessageType; +import org.eclipse.lsp4j.services.LanguageClient; +import org.netbeans.api.java.queries.CompilerOptionsQuery; +import org.netbeans.api.java.queries.CompilerOptionsQuery.Result; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectManager; +import org.netbeans.api.project.ui.ProjectProblems; +import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; +import org.openide.util.Lookup; + +/** + * + * @author atalati + */ +public class LspServerTelemetryManager { + + public final String SCAN_START_EVT = "SCAN_START_EVT"; + public final String SCAN_END_EVT = "SCAN_END_EVT"; + public final String WORKSPACE_INFO_EVT = "WORKSPACE_INFO_EVT"; + + private final String ENABLE_PREVIEW = "--enable-preview"; + private final String STANDALONE_PRJ = "Standalone"; + private final WeakHashMap> clients = new WeakHashMap<>(); + private long lspServerIntiailizationTime; + + public synchronized void connect(LanguageClient client, Future future) { + clients.put(client, future); + lspServerIntiailizationTime = System.currentTimeMillis(); + } + + public synchronized void sendTelemetry(TelemetryEvent event) { + Set toRemove = new HashSet<>(); + List toSendTelemetry = new ArrayList<>(); + + synchronized (clients) { + for (Map.Entry> entry : clients.entrySet()) { + if (entry.getValue().isDone()) { + toRemove.add(entry.getKey()); + } else { + toSendTelemetry.add(entry.getKey()); + } + } + clients.keySet().removeAll(toRemove); + } + + for (LanguageClient client : toSendTelemetry) { + client.telemetryEvent(event); + } + } + + public void sendTelemetry(LanguageClient client, TelemetryEvent event) { + boolean shouldSendTelemetry = false; + + synchronized (clients) { + if(clients.containsKey(client)){ + if (clients.get(client).isDone()) { + clients.remove(client); + } else { + shouldSendTelemetry = true; + } + } + } + + if (shouldSendTelemetry) { + client.telemetryEvent(event); + } + } + + public void sendWorkspaceInfo(LanguageClient client, List workspaceClientFolders, Collection prjs, long timeToOpenPrjs) { + JsonObject properties = new JsonObject(); + JsonArray prjProps = new JsonArray(); + + Map mp = prjs.stream() + .collect(Collectors.toMap(project -> project.getProjectDirectory().getPath(), project -> project)); + + for (FileObject workspaceFolder : workspaceClientFolders) { + try { + JsonObject obj = new JsonObject(); + String prjPath = workspaceFolder.getPath(); + String prjId = this.getPrjId(prjPath); + obj.addProperty("id", prjId); + + // In future if different JDK is used for different project then this can be updated + obj.addProperty("javaVersion", System.getProperty("java.version")); + + if (mp.containsKey(prjPath)) { + Project prj = mp.get(prjPath); + + ProjectManager.Result r = ProjectManager.getDefault().isProject2(prj.getProjectDirectory()); + String projectType = r.getProjectType(); + obj.addProperty("buildTool", (projectType.contains("maven") ? "MavenProject" : "GradleProject")); + + obj.addProperty("openedWithProblems", ProjectProblems.isBroken(prj)); + + boolean isPreviewFlagEnabled = this.isEnablePreivew(prj.getProjectDirectory(), projectType); + obj.addProperty("enablePreview", isPreviewFlagEnabled); + } else { + obj.addProperty("buildTool", this.STANDALONE_PRJ); + obj.addProperty("javaVersion", System.getProperty("java.version")); + obj.addProperty("openedWithProblems", false); + + boolean isPreviewFlagEnabled = this.isEnablePreivew(workspaceFolder, this.STANDALONE_PRJ); + obj.addProperty("enablePreview", isPreviewFlagEnabled); + } + + prjProps.add(obj); + + } catch (NoSuchAlgorithmException ex) { + Exceptions.printStackTrace(ex); + } + } + + properties.add("prjsInfo", prjProps); + + properties.addProperty("timeToOpenPrjs", timeToOpenPrjs); + properties.addProperty("numOfPrjsOpened", workspaceClientFolders.size()); + properties.addProperty("lspServerInitializationTime", System.currentTimeMillis() - this.lspServerIntiailizationTime); + + this.sendTelemetry(client, new TelemetryEvent(MessageType.Info.toString(), this.WORKSPACE_INFO_EVT, properties)); + } + + private boolean isEnablePreivew(FileObject source, String prjType) { + if (prjType.equals(this.STANDALONE_PRJ)) { + NbCodeLanguageClient client = Lookup.getDefault().lookup(NbCodeLanguageClient.class); + if (client == null) { + return false; + } + AtomicBoolean isEnablePreviewSet = new AtomicBoolean(false); + ConfigurationItem conf = new ConfigurationItem(); + conf.setSection(client.getNbCodeCapabilities().getAltConfigurationPrefix() + "runConfig.vmOptions"); + client.configuration(new ConfigurationParams(Collections.singletonList(conf))).thenAccept(c -> { + String config = ((JsonPrimitive) ((List) c).get(0)).getAsString(); + isEnablePreviewSet.set(config.contains(this.ENABLE_PREVIEW)); + }); + + return isEnablePreviewSet.get(); + } + + Result result = CompilerOptionsQuery.getOptions(source); + return result.getArguments().contains(this.ENABLE_PREVIEW); + } + + private String getPrjId(String prjPath) throws NoSuchAlgorithmException { + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + byte[] hash = digest.digest(prjPath.getBytes(StandardCharsets.UTF_8)); + + BigInteger number = new BigInteger(1, hash); + + // Convert message digest into hex value + StringBuilder hexString = new StringBuilder(number.toString(16)); + + // Pad with leading zeros + while (hexString.length() < 64) { + hexString.insert(0, '0'); + } + + return hexString.toString(); + } + +} diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java index f42d7ee24809..203cb9e7bc75 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/Server.java @@ -45,6 +45,7 @@ import java.util.logging.Logger; import com.google.gson.InstanceCreator; import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; import java.util.prefs.Preferences; import java.util.LinkedHashSet; import java.util.Objects; @@ -159,7 +160,8 @@ */ public final class Server { private static final Logger LOG = Logger.getLogger(Server.class.getName()); - + private static final LspServerTelemetryManager LSP_SERVER_TELEMETRY = new LspServerTelemetryManager(); + private Server() { } @@ -181,7 +183,7 @@ public static NbLspServer launchServer(Pair io, LspSe ((LanguageClientAware) server).connect(remote); msgProcessor.attachClient(server.client); Future runningServer = serverLauncher.startListening(); - LSPServerTelemetryFactory.getDefault().connect(server.client, runningServer); + LSP_SERVER_TELEMETRY.connect(server.client, runningServer); return new NbLspServer(server, runningServer); } @@ -382,6 +384,7 @@ public static class LanguageServerImpl implements LanguageServer, LanguageClient private static final String NETBEANS_FORMAT = "format"; private static final String NETBEANS_JAVA_IMPORTS = "java.imports"; + private static final String NETBEANS_PROJECT_JDKHOME = "project.jdkhome"; private static final String NETBEANS_JAVA_HINTS = "hints"; // change to a greater throughput if the initialization waits on more processes than just (serialized) project open. @@ -769,6 +772,8 @@ private void asyncOpenSelectedProjects1(CompletableFuture f, Project[ } } f.complete(candidateMapping); + List workspaceClientFolders = workspaceService.getClientWorkspaceFolders(); + LSP_SERVER_TELEMETRY.sendWorkspaceInfo(client, workspaceClientFolders, openedProjects, System.currentTimeMillis() - t); LOG.log(Level.INFO, "{0} projects opened in {1}ms", new Object[] { prjsRequested.length, (System.currentTimeMillis() - t) }); } else { LOG.log(Level.FINER, "{0}: Collecting projects to prime from: {1}", new Object[]{id, Arrays.asList(additionalProjects)}); @@ -1020,6 +1025,7 @@ private void collectProjectCandidates(FileObject fo, List candidates private void initializeOptions() { getWorkspaceProjects().thenAccept(projects -> { ConfigurationItem item = new ConfigurationItem(); + // PENDING: what about doing just one roundtrip to the client- we may request multiple ConfiguratonItems in one message ? item.setSection(client.getNbCodeCapabilities().getConfigurationPrefix() + NETBEANS_JAVA_HINTS); client.configuration(new ConfigurationParams(Collections.singletonList(item))).thenAccept(c -> { if (c != null && !c.isEmpty() && c.get(0) instanceof JsonObject) { @@ -1030,6 +1036,16 @@ private void initializeOptions() { textDocumentService.reRunDiagnostics(); } }); + item.setSection(client.getNbCodeCapabilities().getConfigurationPrefix() + NETBEANS_PROJECT_JDKHOME); + client.configuration(new ConfigurationParams(Collections.singletonList(item))).thenAccept(c -> { + JsonPrimitive newProjectJDKHomePath = null; + + if (c != null && !c.isEmpty() && c.get(0) instanceof JsonPrimitive) { + newProjectJDKHomePath = (JsonPrimitive) c.get(0); + } else { + } + textDocumentService.updateProjectJDKHome(newProjectJDKHomePath); + }); if (projects != null && projects.length > 0) { FileObject fo = projects[0].getProjectDirectory(); item.setScopeUri(Utils.toUri(fo)); @@ -1366,11 +1382,10 @@ private static void hackNoReuseOfOutputsForAntProjects() { } } - public static class LSPServerTelemetryFactory extends CustomIndexerFactory { + public static class CustomIndexerTelemetryFactory extends CustomIndexerFactory { - private static LSPServerTelemetryFactory INSTANCE; + private static CustomIndexerTelemetryFactory INSTANCE; - private final WeakHashMap> clients = new WeakHashMap<>(); private final CustomIndexer noOp = new CustomIndexer() { @Override protected void index(Iterable files, Context context) { @@ -1378,49 +1393,25 @@ protected void index(Iterable files, Context context) { }; @MimeRegistration(mimeType="", service=CustomIndexerFactory.class) - public static LSPServerTelemetryFactory getDefault() { + public static CustomIndexerTelemetryFactory getDefault() { if (INSTANCE == null) { - INSTANCE = new LSPServerTelemetryFactory(); + INSTANCE = new CustomIndexerTelemetryFactory(); } return INSTANCE; } - private LSPServerTelemetryFactory() { - } - - public synchronized void connect(LanguageClient client, Future future) { - clients.put(client, future); + private CustomIndexerTelemetryFactory() { } @Override public synchronized boolean scanStarted(Context context) { - Set toRemove = new HashSet<>(); - for (Map.Entry> entry : clients.entrySet()) { - if (entry.getValue().isDone()) { - toRemove.add(entry.getKey()); - } else { - entry.getKey().telemetryEvent("nbls.scanStarted"); - } - } - for (LanguageClient lc : toRemove) { - clients.remove(lc); - } - return true; + LSP_SERVER_TELEMETRY.sendTelemetry(new TelemetryEvent(MessageType.Info.toString(), LSP_SERVER_TELEMETRY.SCAN_START_EVT, "nbls.scanStarted")); + return true; } @Override public synchronized void scanFinished(Context context) { - Set toRemove = new HashSet<>(); - for (Map.Entry> entry : clients.entrySet()) { - if (entry.getValue().isDone()) { - toRemove.add(entry.getKey()); - } else { - entry.getKey().telemetryEvent("nbls.scanFinished"); - } - } - for (LanguageClient lc : toRemove) { - clients.remove(lc); - } + LSP_SERVER_TELEMETRY.sendTelemetry(new TelemetryEvent(MessageType.Info.toString(),LSP_SERVER_TELEMETRY.SCAN_END_EVT,"nbls.scanFinished")); } @Override @@ -1433,7 +1424,7 @@ public void filesDirty(Iterable dirty, Context context) { @Override public String getIndexerName() { - return "LSPServerTelemetry"; + return "CustomIndexerTelemetryFactory"; } @Override diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TelemetryEvent.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TelemetryEvent.java new file mode 100644 index 000000000000..8b70648241f7 --- /dev/null +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TelemetryEvent.java @@ -0,0 +1,55 @@ +/* + * 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.java.lsp.server.protocol; + +/** + * + * @author atalati + */ +public class TelemetryEvent { + + private final String name; + private final String type; + private final Object properties; + + public TelemetryEvent(String type, String name) { + this.name = name; + this.type = type; + this.properties = null; + } + + public TelemetryEvent(String type, String name, Object properties) { + this.name = name; + this.type = type; + this.properties = properties; + } + + public String getName() { + return name; + } + + public String getType() { + return type; + } + + public Object getProperties() { + return properties; + } +} + diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java index ad0d82fa448e..d51967268a8b 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java @@ -240,6 +240,7 @@ import org.netbeans.api.lsp.StructureElement; import org.netbeans.modules.editor.indent.api.Reformat; import org.netbeans.modules.java.lsp.server.URITranslator; +import org.netbeans.modules.java.lsp.server.ui.AbstractJavaPlatformProviderOverride; import org.netbeans.modules.parsing.impl.SourceAccessor; import org.netbeans.spi.editor.hints.ErrorDescription; import org.netbeans.spi.editor.hints.Fix; @@ -1032,7 +1033,10 @@ public CompletableFuture>> codeAction(CodeActio continue; } } - Optional diag = diagnostics.stream().filter(d -> entry.getKey().equals(d.getCode().getLeft())).findFirst(); + Optional diag = diagnostics.stream().filter(d -> { + String code = d.getCode() != null ? d.getCode().getLeft() : null; + return entry.getKey().equals(code); + }).findFirst(); org.netbeans.api.lsp.Diagnostic.LazyCodeActions actions = err.getActions(); if (actions != null) { for (org.netbeans.api.lsp.CodeAction inputAction : actions.computeCodeActions(ex -> client.logMessage(new MessageParams(MessageType.Error, ex.getMessage())))) { @@ -2086,6 +2090,15 @@ void updateJavaHintPreferences(JsonObject configuration) { reRunDiagnostics(); } + void updateProjectJDKHome(JsonPrimitive configuration) { + if (configuration == null) { + client.logMessage(new MessageParams(MessageType.Log,"Project runtime JDK unset, defaults to NBLS JDK")); + } else { + client.logMessage(new MessageParams(MessageType.Log, "Project runtime JDK set to " + configuration.getAsString())); + } + AbstractJavaPlatformProviderOverride.setDefaultPlatformOverride(configuration != null ? configuration.getAsString() : null); + } + private String key(ErrorProvider.Kind errorKind) { return errorKind.name().toLowerCase(Locale.ROOT); } diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ToStringGenerator.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ToStringGenerator.java index b88b31213572..9391da00bffa 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ToStringGenerator.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/ToStringGenerator.java @@ -116,7 +116,7 @@ public List getCodeActions(NbCodeLanguageClient client, ResultIterat data.put(URI, uri); data.put(OFFSET, offset); data.put(FIELDS, fields); - return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateToString(), CODE_GENERATOR_KIND, null, "nbls.generate.code", GENERATE_TO_STRING, data)); + return Collections.singletonList(createCodeAction(client, Bundle.DN_GenerateToString(), CODE_GENERATOR_KIND, null, "nbls.generate.code", Utils.encodeCommand(GENERATE_TO_STRING, client.getNbCodeCapabilities()), data)); } @Override diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java index d3027a2eb620..6e0755bfb6e6 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java @@ -1347,7 +1347,9 @@ public void didChangeConfiguration(DidChangeConfigurationParams params) { String fullConfigPrefix = client.getNbCodeCapabilities().getConfigurationPrefix(); String configPrefix = fullConfigPrefix.substring(0, fullConfigPrefix.length() - 1); server.openedProjects().thenAccept(projects -> { + // PENDING: invent a pluggable mechanism for this, this does not scale and the typecast to serviceImpl is ugly ((TextDocumentServiceImpl)server.getTextDocumentService()).updateJavaHintPreferences(((JsonObject) params.getSettings()).getAsJsonObject(configPrefix).getAsJsonObject(NETBEANS_JAVA_HINTS)); + ((TextDocumentServiceImpl)server.getTextDocumentService()).updateProjectJDKHome(((JsonObject) params.getSettings()).getAsJsonObject(configPrefix).getAsJsonObject("project").getAsJsonPrimitive("jdkhome")); if (projects != null && projects.length > 0) { updateJavaFormatPreferences(projects[0].getProjectDirectory(), ((JsonObject) params.getSettings()).getAsJsonObject(configPrefix).getAsJsonObject("format")); updateJavaImportPreferences(projects[0].getProjectDirectory(), ((JsonObject) params.getSettings()).getAsJsonObject(configPrefix).getAsJsonObject("java").getAsJsonObject("imports")); diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractJavaPlatformProviderOverride.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractJavaPlatformProviderOverride.java new file mode 100644 index 000000000000..df668954dd94 --- /dev/null +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ui/AbstractJavaPlatformProviderOverride.java @@ -0,0 +1,122 @@ +/* + * 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.java.lsp.server.ui; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.io.File; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; +import org.netbeans.api.java.platform.JavaPlatform; +import org.netbeans.api.java.platform.JavaPlatformManager; +import org.netbeans.modules.java.platform.implspi.JavaPlatformProvider; +import org.netbeans.spi.java.platform.JavaPlatformFactory; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.util.Exceptions; +import org.openide.util.Lookup; + +public abstract class AbstractJavaPlatformProviderOverride implements JavaPlatformProvider { + + private static final JavaPlatform[] NO_PLATFORMS = new JavaPlatform[0]; + private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); + private FileObject defaultPlatformOverride; + + @Override + @SuppressWarnings("ReturnOfCollectionOrArrayField") + public JavaPlatform[] getInstalledPlatforms() { + return NO_PLATFORMS; + } + + @Override + public JavaPlatform getDefaultPlatform() { + FileObject override; + + synchronized (this) { + override = defaultPlatformOverride; + } + + if (override == null) { + return null; + } + + Set existingNames = new HashSet<>(); + JavaPlatform found = null; + + for (JavaPlatform platform : JavaPlatformManager.getDefault().getInstalledPlatforms()) { + if (platform.getInstallFolders().stream().anyMatch(folder -> folder.equals(override))) { + found = platform; + break; + } + existingNames.add(platform.getDisplayName()); + } + + if (found == null ){ + String newName = defaultPlatformOverride.getPath(); + + while (existingNames.contains(newName)) { + newName += "1"; + } + + for (JavaPlatformFactory.Provider provider : Lookup.getDefault().lookupAll(JavaPlatformFactory.Provider.class)) { + JavaPlatformFactory factory = provider.forType("j2se"); + if (factory != null) { + try { + found = factory.create(override, newName, true); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + } + } + + return found; + } + + @Override + public void addPropertyChangeListener(PropertyChangeListener listener) { + pcs.addPropertyChangeListener(listener); + } + + @Override + public void removePropertyChangeListener(PropertyChangeListener listener) { + pcs.removePropertyChangeListener(listener); + } + + private void dosetDefaultPlatformOverride(String defaultPlatformOverride) { + FileObject override = defaultPlatformOverride != null ? FileUtil.toFileObject(new File(defaultPlatformOverride)) + : null; + + synchronized (this) { + this.defaultPlatformOverride = override; + } + + pcs.firePropertyChange(null, null, null); + } + + public static void setDefaultPlatformOverride(String defaultPlatformOverride) { + for (JavaPlatformProvider p : Lookup.getDefault().lookupAll(JavaPlatformProvider.class)) { + if (p instanceof AbstractJavaPlatformProviderOverride) { + ((AbstractJavaPlatformProviderOverride) p).dosetDefaultPlatformOverride(defaultPlatformOverride); + } + } + } + +} diff --git a/java/java.lsp.server/test/unit/src/META-INF/generated-layer.xml b/java/java.lsp.server/test/unit/src/META-INF/generated-layer.xml index 2f64f85e2fd5..84a2d34124f8 100644 --- a/java/java.lsp.server/test/unit/src/META-INF/generated-layer.xml +++ b/java/java.lsp.server/test/unit/src/META-INF/generated-layer.xml @@ -14,4 +14,14 @@ + + + + + + + + + + diff --git a/java/java.lsp.server/vscode/CHANGELOG.md b/java/java.lsp.server/vscode/CHANGELOG.md index ac733c3f7da5..f305e83d8a96 100644 --- a/java/java.lsp.server/vscode/CHANGELOG.md +++ b/java/java.lsp.server/vscode/CHANGELOG.md @@ -20,6 +20,21 @@ under the License. --> +## Version 22.9.9 +* OCI Cloud Assets panel added which allows setting Micronaut OCI runtime properties & generate OCI policies +* JDK Configuration wizard added to unify setting Java for various VSCode parts +* API/SPI to apply WorkspaceEdit +* Micronaut: + * Endpoint method generator for non-db based controllers added + * Command creating request body for given endpoint added + * Provide Endpoint and Bean symbols originating from libraries + * Method parameters should be resolvable in expression language + * New from Template invocation should accept template as an optional parameter +* ... and other bug fixes + +## Version 22.0.0 +* LSP: Generate Tests converted to Source Action +* Micronaut: code completion for update methods fixed ## Version 21.9.9 * This is Early Access of 22.0.0 version (this version used due to VSCode versioning) diff --git a/java/java.lsp.server/vscode/README.md b/java/java.lsp.server/vscode/README.md index 3cffaacf5474..30bb6155f24c 100644 --- a/java/java.lsp.server/vscode/README.md +++ b/java/java.lsp.server/vscode/README.md @@ -25,13 +25,18 @@ [![Build Status](https://ci-builds.apache.org/job/Netbeans/view/vscode/job/netbeans-vscode/badge/icon)](https://ci-builds.apache.org/job/Netbeans/view/vscode/job/netbeans-vscode/) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/apache/netbeans/blob/master/LICENSE) -**Version 21.9.9 is 22.0 Early Access version.** +**Version 22.9.9 is 23.0 Early Access version.** This is [Apache NetBeans](http://netbeans.org) Language Server extension for VS Code. Use it to get all the _goodies of NetBeans_ via the VS Code user interface! Runs on __JDK11__ and all newer versions. Apache NetBeans Language Server brings full featured Java development (edit-compile-debug & test cycle) for Maven and Gradle projects to VSCode. As well as other features. ## Getting Started -1. Set JDK in `VSCode | Preferences | Settings ...` __Netbeans: Jdkhome__ setting to point to JDK which Language Server will run on and projects will be compiled with. More below in section [Selecting the JDK](#selecting-the-jdk) +1. Use command __Java: JDK Configuration__ to set same JDK in Apache NetBeans Language Server and all other Java settings in VSCode like Integrated terminal `JAVA_HOME` and `PATH`, Maven Runtime and JDK for MS Java as well if installed: +![JDK Configuration](images/java_jdk_configuration.png) + + 2. Select installed JDK to use for these settings in step 2/3 + 3. In step 3/3 select if settings will be applied at User level for all Workspaces (Folders open) or for current Workspace (Folder) only. + 4. NetBeans Language Server JDK Home setting `netbeans.jdkhome` is __also__ available in `VSCode | Preferences | Settings ...` `Netbeans: Jdkhome` . More below in section [Selecting the JDK](#selecting-the-jdk) 2. Use __Java: New Project...__ " command to start creating new project, or 3. Open the folder with existing __pom.xml__ for Maven or ___Gradle___ project files (_build.gradle, gradle.properties_). @@ -184,6 +189,14 @@ Oracle Cloud Infrastructure Explorer supports viewing compartments and resources ![Cloud Explorer](images/cloud-explorer.png) It is possible to add JDBC connection to Oracle Autonomous DB running in OCI using __Add DB Connection__ menu. It downloads DB Wallet automatically. + +## Cloud Assets Panel +Cloud Assets panel shows Micronaut OCI Properties to be set. These are read from project artefacts currently provided in project pom.xml or build.gradle. When user OCI configuration file `.oci/config` is present it allows to set various OCI assets (resources) needed for project runtime using user OCI tenancy. + +![Cloud Assets](images/cloud_assets.png) + +It is also possible to generate suggested OCI Policies needed by project to run in OCI and copy & paste these policies into OCI Cloud Console. + ## Supported Options * __netbeans.jdkhome__ - path to the JDK, see dedicated section below @@ -204,6 +217,15 @@ following locations: As soon as one of the settings is changed, the Language Server is restarted. +## Checking JDK compatibility + +The extension will check if source level Java (defined in the project) is compatible +with the one used by extension. It checks if the source level Java version is lower or equal +to the Java version used by extension, and if this condition is not fulfilled, it will show +warning message. + +It will not perform the check if the RedHat extension is installed. + ## Running Language Server per VSCode workspace or for user It is possible to run Apache NetBeans Language Server per workspace (VSCode window). This allows separation of Language Server for given project as Language Server JVM is not shared for more VSCode open workspaces (projects). It is possible to change this in `Preferences | Settings | Netbeans: Userdir`. Set to `local` to use dedicated Language Server per workspace or set to `global` (this is default) to have one Language Server for all VSCode workspaces. diff --git a/java/java.lsp.server/vscode/images/cloud_assets.png b/java/java.lsp.server/vscode/images/cloud_assets.png new file mode 100644 index 000000000000..1f80bf1dc372 Binary files /dev/null and b/java/java.lsp.server/vscode/images/cloud_assets.png differ diff --git a/java/java.lsp.server/vscode/images/java_jdk_configuration.png b/java/java.lsp.server/vscode/images/java_jdk_configuration.png new file mode 100644 index 000000000000..94e13e94dc99 Binary files /dev/null and b/java/java.lsp.server/vscode/images/java_jdk_configuration.png differ diff --git a/java/java.lsp.server/vscode/package-lock.json b/java/java.lsp.server/vscode/package-lock.json index ef30fce4948e..9385b1c6cb25 100644 --- a/java/java.lsp.server/vscode/package-lock.json +++ b/java/java.lsp.server/vscode/package-lock.json @@ -1,19 +1,21 @@ { "name": "apache-netbeans-java", - "version": "0.1.0", + "version": "99.99.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "apache-netbeans-java", - "version": "0.1.0", + "version": "99.99.9", "license": "Apache 2.0", "dependencies": { "@vscode/debugadapter": "1.55.1", "@vscode/webview-ui-toolkit": "^1.2.2", + "handlebars": "^4.7.8", "jdk-utils": "^0.4.4", "jsonc-parser": "3.0.0", - "vscode-languageclient": "8.0.1" + "vscode-languageclient": "8.0.1", + "xml2js": "^0.6.2" }, "devDependencies": { "@types/glob": "^7.1.1", @@ -22,6 +24,7 @@ "@types/ps-node": "^0.1.0", "@types/vscode": "^1.76.0", "@types/vscode-webview": "^1.57.1", + "@types/xml2js": "^0.4.14", "@vscode/codicons": "0.0.29", "esbuild": "^0.16.17", "glob": "^7.1.6", @@ -463,6 +466,15 @@ "integrity": "sha512-ghW5SfuDmsGDS2A4xkvGsLwDRNc3Vj5rS6rPOyPm/IryZuf3wceZKxgYaUoW+k9f0f/CB7y2c1rRsdOWZWn0PQ==", "dev": true }, + "node_modules/@types/xml2js": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.14.tgz", + "integrity": "sha512-4YnrRemBShWRO2QjvUin8ESA41rH+9nQGLUGZV/1IDhi3SL9OhdpNC/MrulTWuptXKwhx/aDxE7toV0f/ypIXQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@ungap/promise-all-settled": { "version": "1.1.2", "dev": true, @@ -908,6 +920,27 @@ "node": ">=4.x" } }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, "node_modules/has-flag": { "version": "4.0.0", "dev": true, @@ -1147,6 +1180,15 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -1224,6 +1266,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "license": "MIT" + }, "node_modules/normalize-path": { "version": "3.0.0", "dev": true, @@ -1372,6 +1420,11 @@ ], "license": "MIT" }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", @@ -1394,6 +1447,15 @@ "randombytes": "^2.1.0" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/string-width": { "version": "4.2.3", "dev": true, @@ -1486,6 +1548,19 @@ "node": ">=4.2.0" } }, + "node_modules/uglify-js": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.0.tgz", + "integrity": "sha512-wNKHUY2hYYkf6oSFfhwwiHo4WCHzHmzcXsqXYTN9ja3iApYIFbb2U6ics9hBcYLHcYGQoAlwnZlTrf3oF+BL/Q==", + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/vscode-jsonrpc": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.1.tgz", @@ -1548,6 +1623,12 @@ "node": ">= 8" } }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "license": "MIT" + }, "node_modules/workerpool": { "version": "6.2.0", "dev": true, @@ -1574,6 +1655,26 @@ "dev": true, "license": "ISC" }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "engines": { + "node": ">=4.0" + } + }, "node_modules/y18n": { "version": "5.0.8", "dev": true, @@ -1861,6 +1962,15 @@ "integrity": "sha512-ghW5SfuDmsGDS2A4xkvGsLwDRNc3Vj5rS6rPOyPm/IryZuf3wceZKxgYaUoW+k9f0f/CB7y2c1rRsdOWZWn0PQ==", "dev": true }, + "@types/xml2js": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.14.tgz", + "integrity": "sha512-4YnrRemBShWRO2QjvUin8ESA41rH+9nQGLUGZV/1IDhi3SL9OhdpNC/MrulTWuptXKwhx/aDxE7toV0f/ypIXQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@ungap/promise-all-settled": { "version": "1.1.2", "dev": true @@ -2147,6 +2257,18 @@ "version": "1.10.5", "dev": true }, + "handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, "has-flag": { "version": "4.0.0", "dev": true @@ -2306,6 +2428,11 @@ "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, "mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -2363,6 +2490,11 @@ "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, "normalize-path": { "version": "3.0.0", "dev": true @@ -2445,6 +2577,11 @@ "version": "5.2.1", "dev": true }, + "sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + }, "semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", @@ -2460,6 +2597,11 @@ "randombytes": "^2.1.0" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, "string-width": { "version": "4.2.3", "dev": true, @@ -2519,6 +2661,12 @@ "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", "dev": true }, + "uglify-js": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.0.tgz", + "integrity": "sha512-wNKHUY2hYYkf6oSFfhwwiHo4WCHzHmzcXsqXYTN9ja3iApYIFbb2U6ics9hBcYLHcYGQoAlwnZlTrf3oF+BL/Q==", + "optional": true + }, "vscode-jsonrpc": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.1.tgz", @@ -2564,6 +2712,11 @@ "isexe": "^2.0.0" } }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" + }, "workerpool": { "version": "6.2.0", "dev": true @@ -2581,6 +2734,20 @@ "version": "1.0.2", "dev": true }, + "xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" + }, "y18n": { "version": "5.0.8", "dev": true diff --git a/java/java.lsp.server/vscode/package.json b/java/java.lsp.server/vscode/package.json index 0afa8561e436..b30768a2bf1f 100644 --- a/java/java.lsp.server/vscode/package.json +++ b/java/java.lsp.server/vscode/package.json @@ -4,7 +4,7 @@ "description": "Apache NetBeans Language Server Extension for Visual Studio Code", "author": "Apache NetBeans", "license": "Apache 2.0", - "version": "0.1.0", + "version": "99.99.9", "preview": false, "repository": { "type": "git", @@ -78,7 +78,7 @@ }, { "id": "cloud.assets", - "name": "Cloud Assets", + "name": "Oracle Cloud Assets", "when": "nbJavaLSReady" }, { @@ -115,8 +115,17 @@ "null" ], "default": null, - "description": "Specifies JDK for the Apache NetBeans Language Server", - "scope": "machine" + "description": "Specifies the JDK on which the Apache NetBeans Language Server is run", + "scope": "machine-overridable" + }, + "netbeans.project.jdkhome": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "Specifies the JDK on which user's project will be run. Defaults to the value of netbeans.jdkhome", + "scope": "machine-overridable" }, "netbeans.verbose": { "type": "boolean", @@ -221,6 +230,23 @@ "default": 999, "minimum": 1 }, + "netbeans.guides.notified": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ocid": { + "format": "string" + }, + "actionType": { + "format": "string" + } + } + }, + "default": null, + "description": "Specifies the OCIDs of resources for which guides are already shown", + "scope": "machine-overridable" + }, "java+.runConfig.arguments": { "type": "string", "default": "", @@ -473,6 +499,24 @@ "command": "nbls.cloud.ocid.copy", "title": "Copy OCID" }, + { + "command": "nbls.cloud.publicIp.copy", + "title": "Copy the public IP address" + }, + { + "command": "nbls.cloud.imageUrl.copy", + "title": "Copy pull command" + }, + { + "command": "nbls.cloud.computeInstance.ssh", + "title": "Start SSH session", + "icon": "$(terminal)" + }, + { + "command": "nbls.cloud.container.docker", + "title": "Run in Compute Instance", + "icon": "$(play)" + }, { "command": "nbls.workspace.compile", "title": "Compile Workspace", @@ -548,22 +592,27 @@ }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.AddToProject", - "title": "Add To Project", + "title": "Add to Oracle Cloud Assets", "icon": "$(add)" }, + { + "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.SetReferenceName", + "title": "Set a Reference Name", + "icon": "$(edit)" + }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.RemoveFromProject", - "title": "Remove From Project", + "title": "Remove from Oracle Cloud Assets", "icon": "$(remove)" }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.AddSuggestedItemAction", - "title": "Add To Project", + "title": "Add Suggested to Oracle Cloud Assets", "icon": "$(add)" }, { "command": "nbls.cloud.assets.refresh", - "title": "Refresh Cloud Assets", + "title": "Refresh Oracle Cloud Assets", "icon": "$(refresh)" }, { @@ -581,6 +630,11 @@ "title": "Add New Cloud Resource", "icon": "$(add)" }, + { + "command": "nbls.cloud.assets.configmap.upload", + "title": "Add Cloud Assets to ConfigMap", + "icon": "$(add)" + }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.CloudRefresh", "title": "Refresh", @@ -763,6 +817,22 @@ "command": "nbls.cloud.ocid.copy", "when": "false" }, + { + "command": "nbls.cloud.publicIp.copy", + "when": "false" + }, + { + "command": "nbls.cloud.imageUrl.copy", + "when": "false" + }, + { + "command": "nbls.cloud.computeInstance.ssh", + "when": "false" + }, + { + "command": "nbls.cloud.container.docker", + "when": "false" + }, { "command": "nbls:Database:netbeans.db.explorer.action.Connect", "when": "false" @@ -787,6 +857,10 @@ "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.AddToProject", "when": "false" }, + { + "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.SetReferenceName", + "when": "false" + }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.RemoveFromProject", "when": "false" @@ -975,9 +1049,29 @@ }, { "command": "nbls.cloud.ocid.copy", - "when": "viewItem =~ /class:oracle.items.OCIItem/", + "when": "viewItem =~ /ocid:.*/", "group": "oci@1000" }, + { + "command": "nbls.cloud.publicIp.copy", + "when": "viewItem =~ /publicIp:.*/ && viewItem =~ /^(?!.*imageUrl:).*/", + "group": "oci@1000" + }, + { + "command": "nbls.cloud.imageUrl.copy", + "when": "viewItem =~ /imageUrl:.*/", + "group": "oci@1000" + }, + { + "command": "nbls.cloud.computeInstance.ssh", + "when": "viewItem =~ /publicIp:.*/ && viewItem =~ /^(?!.*imageUrl:).*/", + "group": "inline@10" + }, + { + "command": "nbls.cloud.container.docker", + "when": "viewItem =~ /publicIp:.*/ && viewItem =~ /imageUrl:.*/", + "group": "inline@10" + }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.AddRepository", "when": "viewItem =~ /class:oracle.devops.DevopsProjectItem/", @@ -990,7 +1084,12 @@ }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.AddToProject", - "when": "viewItem =~ /class:oracle/ && view != cloud.assets", + "when": "viewItem =~ /(ComputeInstanceItem|ClusterItem|BucketItem|DatabaseItem|VaultItem|ContainerRepositoryItem)/ && view != cloud.assets", + "group": "inline@14" + }, + { + "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.SetReferenceName", + "when": "viewItem =~ /cap:refName/ && view == cloud.assets", "group": "inline@14" }, { @@ -1005,7 +1104,7 @@ }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.CloudRefresh", - "when": "viewItem =~ /class:oracle/ && view != cloud.assets", + "when": "viewItem =~ /class:oracle/", "group": "inline@13" }, { @@ -1102,6 +1201,14 @@ "uriExpression": "nbres:/org/netbeans/modules/cloud/oracle/resources/computeinstance.svg", "codeicon": "server-environment" }, + { + "uriExpression": "nbres:/org/netbeans/modules/cloud/oracle/resources/containerrepository.svg", + "codeicon": "briefcase" + }, + { + "uriExpression": "nbres:/org/netbeans/modules/cloud/oracle/resources/containertag.svg", + "codeicon": "tag" + }, { "uriExpression": "nbres:/org/netbeans/modules/cloud/oracle/resources/cluster.svg", "codeicon": "compass" @@ -1237,6 +1344,7 @@ "@types/ps-node": "^0.1.0", "@types/vscode": "^1.76.0", "@types/vscode-webview": "^1.57.1", + "@types/xml2js": "^0.4.14", "@vscode/codicons": "0.0.29", "esbuild": "^0.16.17", "glob": "^7.1.6", @@ -1248,9 +1356,11 @@ "dependencies": { "@vscode/debugadapter": "1.55.1", "@vscode/webview-ui-toolkit": "^1.2.2", + "handlebars": "^4.7.8", "jdk-utils": "^0.4.4", "jsonc-parser": "3.0.0", - "vscode-languageclient": "8.0.1" + "vscode-languageclient": "8.0.1", + "xml2js": "^0.6.2" }, "__metadata": { "id": "66c7d7dc-934c-499b-94af-5375e8234fdd", diff --git a/java/java.lsp.server/vscode/src/extension.ts b/java/java.lsp.server/vscode/src/extension.ts index 0434ecc07400..0cc35df8c2a6 100644 --- a/java/java.lsp.server/vscode/src/extension.ts +++ b/java/java.lsp.server/vscode/src/extension.ts @@ -62,12 +62,16 @@ import { InputStep, MultiStepInput } from './utils'; import { PropertiesView } from './propertiesView/propertiesView'; import * as configuration from './jdk/configuration'; import * as jdk from './jdk/jdk'; +import { validateJDKCompatibility } from './jdk/validation/validation'; +import * as sshGuide from './panels/SshGuidePanel'; +import * as runImageGuide from './panels/RunImageGuidePanel'; +import { shouldHideGuideFor } from './panels/guidesUtil'; const API_VERSION : string = "1.0"; export const COMMAND_PREFIX : string = "nbls"; const DATABASE: string = 'Database'; const listeners = new Map(); -let client: Promise; +export let client: Promise; let testAdapter: NbTestAdapter | undefined; let nbProcess : ChildProcess | null = null; let debugPort: number = -1; @@ -184,6 +188,8 @@ function findJDK(onChange: (path : string | null) => void): void { } let currentJdk = find(); + let projectJdk : string | undefined = getProjectJDKHome(); + validateJDKCompatibility(currentJdk, projectJdk); let timeout: NodeJS.Timeout | undefined = undefined; workspace.onDidChangeConfiguration(params => { if (timeout) { @@ -206,10 +212,12 @@ function findJDK(onChange: (path : string | null) => void): void { let newJdk = find(); let newD = isDarkColorTheme(); let newJavaEnabled = isJavaSupportEnabled(); - if (newJdk !== currentJdk || newD != nowDark || newJavaEnabled != nowJavaEnabled) { + let newProjectJDK : string | undefined = getProjectJDKHome(); + if (newJdk !== currentJdk || newD != nowDark || newJavaEnabled != nowJavaEnabled || newProjectJDK != projectJdk) { nowDark = newD; nowJavaEnabled = newJavaEnabled; currentJdk = newJdk; + projectJdk = newProjectJDK; onChange(currentJdk); } }, 0); @@ -347,7 +355,20 @@ function shouldEnableConflictingJavaSupport() : boolean | undefined { return r; } -export function activate(context: ExtensionContext): VSNetBeansAPI { +function getValueAfterPrefix(input: string | undefined, prefix: string): string { + if (input === undefined) { + return ""; + } + const parts = input.split(' '); + for (let i = 0; i < parts.length; i++) { + if (parts[i].startsWith(prefix)) { + return parts[i].substring(prefix.length); + } + } + return ''; +} + +export function activate(context: ExtensionContext): VSNetBeansAPI { const provider = new StringContentProvider(); const scheme = 'in-memory'; const providerRegistration = vscode.workspace.registerTextDocumentContentProvider(scheme, provider); @@ -361,6 +382,13 @@ export function activate(context: ExtensionContext): VSNetBeansAPI { }) ); context.subscriptions.push(vscode.commands.registerCommand('cloud.assets.config.create', async function (viewItem) { + const CONFIG_LOCAL = 'Open a preview of the config in the editor'; + const CONFIG_TO_CM = 'Upload the config to a ConfigMap artifact in an OCI DevOps Project'; + const selected: any = await window.showQuickPick([CONFIG_LOCAL, CONFIG_TO_CM], { placeHolder: 'Select a target for the config' }); + if (selected == CONFIG_TO_CM) { + await commands.executeCommand('nbls.cloud.assets.configmap.upload'); + return; + } const content = await vscode.commands.executeCommand('nbls.cloud.assets.config.create.local') as string; const document = vscode.Uri.parse(`${scheme}:application.properties?${encodeURIComponent(content)}`); vscode.workspace.openTextDocument(document).then(doc => { @@ -796,11 +824,58 @@ export function activate(context: ExtensionContext): VSNetBeansAPI { context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.cloud.ocid.copy', async (node) => { - const ocid : string = await commands.executeCommand(COMMAND_PREFIX + '.cloud.ocid.get', node.id); + const ocid = getValueAfterPrefix(node.contextValue, 'ocid:'); vscode.env.clipboard.writeText(ocid); } )); + context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.cloud.publicIp.copy', + async (node) => { + const publicIp = getValueAfterPrefix(node.contextValue, 'publicIp:'); + vscode.env.clipboard.writeText(publicIp); + } + )); + + context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.cloud.imageUrl.copy', + async (node) => { + const imageUrl = getValueAfterPrefix(node.contextValue, 'imageUrl:'); + vscode.env.clipboard.writeText("docker pull " + imageUrl); + } + )); + + context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.cloud.computeInstance.ssh', + async (node) => { + const publicIp = getValueAfterPrefix(node.contextValue, 'publicIp:'); + const ocid = getValueAfterPrefix(node.contextValue, 'ocid:'); + + if (!shouldHideGuideFor(sshGuide.viewType, ocid)) { + sshGuide.SshGuidePanel.createOrShow(context, { + publicIp, + ocid + }); + } + + openSSHSession("opc", publicIp, node.label); + } + )); + + context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.cloud.container.docker', + async (node) => { + const publicIp = getValueAfterPrefix(node.contextValue, 'publicIp:'); + const imageUrl = getValueAfterPrefix(node.contextValue, 'imageUrl:'); + const ocid = getValueAfterPrefix(node.contextValue, 'ocid:'); + + if (!shouldHideGuideFor(runImageGuide.viewType, ocid)){ + runImageGuide.RunImageGuidePanel.createOrShow(context, { + publicIp, + ocid + }); + } + + runDockerSSH("opc", publicIp, imageUrl); + } + )); + const archiveFileProvider = { provideTextDocumentContent: async (uri: vscode.Uri, token: vscode.CancellationToken): Promise => { return await commands.executeCommand('nbls.get.archive.file.content', uri.toString()); @@ -876,6 +951,26 @@ function activateWithJDK(specifiedJDK: string | null, context: ExtensionContext, } } +function openSSHSession(username: string, host: string, name?: string) { + let sessionName; + if (name === undefined) { + sessionName =`${username}@${host}`; + } else { + sessionName = name; + } + + const terminal = vscode.window.createTerminal(`SSH: ${username}@${host}`); + terminal.sendText(`ssh ${username}@${host}`); + terminal.show(); +} + +function runDockerSSH(username: string, host: string, dockerImage: string) { + const sshCommand = `ssh ${username}@${host} "docker pull ${dockerImage} && docker run -p 8080:8080 -it ${dockerImage}"`; + + const terminal = vscode.window.createTerminal('Remote Docker'); + terminal.sendText(sshCommand); + terminal.show(); +} function killNbProcess(notifyKill : boolean, log : vscode.OutputChannel, specProcess?: ChildProcess) : Promise { const p = nbProcess; @@ -939,6 +1034,10 @@ function isJavaSupportEnabled() : boolean { return workspace.getConfiguration('netbeans')?.get('javaSupport.enabled') as boolean; } +function getProjectJDKHome() : string { + return workspace.getConfiguration('netbeans')?.get('project.jdkhome') as string; +} + function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContext, log : vscode.OutputChannel, notifyKill: boolean, setClient : [(c : NbLanguageClient) => void, (err : any) => void] ): void { @@ -1099,6 +1198,7 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex 'netbeans.hints', 'netbeans.format', 'netbeans.java.imports', + 'netbeans.project.jdkhome', 'java+.runConfig.vmOptions', 'java+.runConfig.cwd' ], @@ -1282,9 +1382,38 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex if (enableJava) { c.findTreeViewService().createView('cloud.resources', undefined, { canSelectMany : false }); } - c.findTreeViewService().createView('cloud.assets', undefined, { canSelectMany : false, showCollapseAll: false }); + c.findTreeViewService().createView('cloud.assets', undefined, { canSelectMany : false, showCollapseAll: false , providerInitializer : (customizable) => + customizable.addItemDecorator(new CloudAssetsDecorator())}); }).catch(setClient[1]); + class CloudAssetsDecorator implements TreeItemDecorator { + decorateChildren(element: Visualizer, children: Visualizer[]): Visualizer[] { + return children; + } + + async decorateTreeItem(vis : Visualizer, item : vscode.TreeItem) : Promise { + const refName = getValueAfterPrefix(item.contextValue, "cloudAssetsReferenceName:"); + if (refName !== undefined && refName !== null && refName.length > 0) { + item.description = refName; + return item; + } + const imageCount = getValueAfterPrefix(item.contextValue, "imageCount:"); + const repositoryPublic: Boolean = "true" === getValueAfterPrefix(item.contextValue, "repositoryPublic:"); + if (imageCount !== undefined && imageCount !== null && imageCount.length > 0) { + if (repositoryPublic) { + item.description = imageCount + " (public)"; + } else { + item.description = imageCount + " (private)"; + } + return item; + } + return item; + } + + dispose() { + } + } + class Decorator implements TreeItemDecorator { private provider : CustomizableTreeDataProvider; private setCommand : vscode.Disposable; diff --git a/java/java.lsp.server/vscode/src/jdk/settings.ts b/java/java.lsp.server/vscode/src/jdk/settings.ts index 31abd6157765..9a6cb8512f32 100644 --- a/java/java.lsp.server/vscode/src/jdk/settings.ts +++ b/java/java.lsp.server/vscode/src/jdk/settings.ts @@ -306,7 +306,7 @@ class ProjectJavaSettings extends Setting { name: version, path: jdk.javaHome }); - } + } } try { await vscode.workspace.getConfiguration().update(this.property, definitions, scope); @@ -324,9 +324,16 @@ const NBLS_EXTENSION_ID = 'asf.apache-netbeans-java'; const NBLS_SETTINGS_NAME = 'Language Server by Apache NetBeans'; const NBLS_SETTINGS_PROPERTY = 'netbeans.jdkhome'; function nblsSetting(): Setting { - return new JavaSetting(NBLS_SETTINGS_NAME, NBLS_SETTINGS_PROPERTY, false); + return new JavaSetting(NBLS_SETTINGS_NAME, NBLS_SETTINGS_PROPERTY, true); } +const NBLS_SETTINGS_PROJECT_NAME = 'Language Server by Apache NetBeans - Java Runtime for Projects'; +const NBLS_SETTINGS_PROJECT_PROPERTY = 'netbeans.project.jdkhome'; +function nblsProjectSetting(): Setting { + return new JavaSetting(NBLS_SETTINGS_PROJECT_NAME, NBLS_SETTINGS_PROJECT_PROPERTY, true); +} + + const JDTLS_EXTENSION_ID = 'redhat.java'; const JDTLS_SETTINGS_NAME = 'Language Server by RedHat'; const JDTLS_SETTINGS_PROPERTY = 'java.jdt.ls.java.home'; @@ -334,7 +341,7 @@ function jdtlsSetting(): Setting { return new JavaSetting(JDTLS_SETTINGS_NAME, JDTLS_SETTINGS_PROPERTY); } -const PROJECTS_SETTINGS_NAME = 'Java Runtime for Projects'; +const PROJECTS_SETTINGS_NAME = 'Language Server by RedHat - Java Runtime for Projects'; const PROJECTS_SETTINGS_PROPERTY = 'java.configuration.runtimes'; export function projectsSettings(): Setting { return new ProjectJavaSettings(PROJECTS_SETTINGS_NAME, PROJECTS_SETTINGS_PROPERTY); @@ -364,6 +371,7 @@ export function getAvailable(): Setting[] { if (vscode.extensions.getExtension(NBLS_EXTENSION_ID)) { settings.push(nblsSetting()); + settings.push(nblsProjectSetting()); } if (vscode.extensions.getExtension(JDTLS_EXTENSION_ID)) { diff --git a/java/java.lsp.server/vscode/src/jdk/validation/extensionUtils.ts b/java/java.lsp.server/vscode/src/jdk/validation/extensionUtils.ts new file mode 100644 index 000000000000..39d0f56ade0c --- /dev/null +++ b/java/java.lsp.server/vscode/src/jdk/validation/extensionUtils.ts @@ -0,0 +1,32 @@ +/* + * 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 * as vscode from 'vscode'; +import { client as nblsClient } from '../../extension'; + +const RH_EXTENSION_ID = 'redhat.java'; + +export function isRHExtensionActive(): boolean { + const rh = vscode.extensions.getExtension(RH_EXTENSION_ID); + return rh ? true : false; +} + +export async function waitForNblsCommandToBeAvailable() { + await nblsClient; +} diff --git a/java/java.lsp.server/vscode/src/jdk/validation/javaUtil.ts b/java/java.lsp.server/vscode/src/jdk/validation/javaUtil.ts new file mode 100644 index 000000000000..af34a5270720 --- /dev/null +++ b/java/java.lsp.server/vscode/src/jdk/validation/javaUtil.ts @@ -0,0 +1,78 @@ +/* + * 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 * as fs from 'fs'; +import * as path from 'path'; +import * as cp from 'child_process'; + +const JAVA_VERSION_REGEX = /version\s+"(\S+)"/; + +function findExecutable(program: string, home: string): string | undefined { + if (home) { + let executablePath = path.join(home, 'bin', program); + if (process.platform === 'win32') { + if (fs.existsSync(executablePath + '.cmd')) { + return executablePath + '.cmd'; + } + if (fs.existsSync(executablePath + '.exe')) { + return executablePath + '.exe'; + } + } else if (fs.existsSync(executablePath)) { + return executablePath; + } + } + return undefined; +} + +export function normalizeJavaVersion(version: string): string { + return version.startsWith("1.") ? version.substring(2) : version; +} + +export async function getJavaVersion(homeFolder: string): Promise { + return new Promise(resolve => { + if (homeFolder && fs.existsSync(homeFolder)) { + const executable: string | undefined = findExecutable('java', homeFolder); + if (executable) { + cp.execFile(executable, ['-version'], { encoding: 'utf8' }, (_error, _stdout, stderr) => { + if (stderr) { + let javaVersion: string | undefined; + stderr.split('\n').forEach((line: string) => { + const javaInfo: string[] | null = line.match(JAVA_VERSION_REGEX); + if (javaInfo && javaInfo.length > 1) { + javaVersion = javaInfo[1]; + } + }); + if (javaVersion) { + let majorVersion = normalizeJavaVersion(javaVersion); + let i = majorVersion.indexOf('.'); + if (i > -1) { + majorVersion = majorVersion.slice(0, i); + } + resolve(majorVersion); + return; + } + } + resolve(undefined); + }); + } + } else { + resolve(undefined); + } + }); +} \ No newline at end of file diff --git a/java/java.lsp.server/vscode/src/jdk/validation/project.ts b/java/java.lsp.server/vscode/src/jdk/validation/project.ts new file mode 100644 index 000000000000..57419e2e5eb5 --- /dev/null +++ b/java/java.lsp.server/vscode/src/jdk/validation/project.ts @@ -0,0 +1,193 @@ +/* + * 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 * as xml2js from 'xml2js'; +import * as fs from 'fs'; +import * as path from 'path'; +import * as vscode from 'vscode'; +import * as os from 'os'; +import { normalizeJavaVersion } from './javaUtil'; + +const GET_PROJECT_INFO = 'nbls.project.info'; +const GRADLE_TARGET_COMPATIBILITY_REGEX = /targetCompatibility\s*=\s*(?:JavaVersion\s*\.\s*toVersion\s*\(\s*['"](\d+(\.\d+)?)['"]\s*\)|['"](\d+(\.\d+)?)['"])/ +const GRADLE_SOURCE_COMPATIBILITY_REGEX = /sourceCompatibility\s*=\s*(?:JavaVersion\s*\.\s*toVersion\s*\(\s*['"](\d+(\.\d+)?)['"]\s*\)|['"](\d+(\.\d+)?)['"])/ + +export enum BuildSystemType { + MAVEN = 'Maven', + GRADLE = 'Gradle', + UNKNOWN = 'Unknown' +} + +export async function getProjectFrom(projectUri: vscode.Uri): Promise { + const projectInfos: any[] = await vscode.commands.executeCommand(GET_PROJECT_INFO, projectUri.toString(), { recursive: true, projectStructure: true }); + if (projectInfos?.length && projectInfos[0]) { + const projectDirectory = projectInfos[0].projectDirectory.toString(); + const buildSystem: BuildSystemType = resolveBuildSystemType(projectUri, projectInfos[0].projectType); + + switch (buildSystem) { + case BuildSystemType.MAVEN: + const mavenSubprojects: Project[] = projectInfos[0].subprojects + .map((subproject: string) => new MavenProject(subproject, [])) + return new MavenProject(projectDirectory, mavenSubprojects); + case BuildSystemType.GRADLE: + const gradleSubprojects: Project[] = projectInfos[0].subprojects + .map((subproject: string) => new GradleProject(subproject, [])) + return new GradleProject(projectDirectory, gradleSubprojects); + default: + break; + } + } + return Promise.resolve(undefined); +} + +function resolveBuildSystemType(uri: vscode.Uri, projectType?: string): BuildSystemType { + if (projectType?.includes('gradle')) { + return BuildSystemType.GRADLE; + } + if (projectType?.includes('maven')) { + return BuildSystemType.MAVEN; + } + if (fs.existsSync(path.join(uri.fsPath, 'build.gradle'))) { + return BuildSystemType.GRADLE; + } + if (fs.existsSync(path.join(uri.fsPath, 'pom.xml'))) { + return BuildSystemType.MAVEN; + } + return BuildSystemType.UNKNOWN; +} + +export abstract class Project { + + readonly directory: string; + readonly subprojects: Project[]; + + constructor(directory: string, subprojects: any[]) { + this.directory = vscode.Uri.parse(directory).fsPath; + this.subprojects = subprojects; + } + + // Whether the project contains subprojects + containsSubprojects(): boolean { + return this.subprojects.length > 0; + } + + async getJavaVersion(): Promise { + if (!this.containsSubprojects()) { + return this.extractJavaVersion(); + } + + let maxJavaVersion: number | undefined; + + for (const subproject of this.subprojects) { + const projectDirectory: string = vscode.Uri.file(subproject.directory).toString(); + const subInfos: any[] = await vscode.commands.executeCommand(GET_PROJECT_INFO, projectDirectory); + if (subInfos?.length && subInfos[0]) { + const javaVersion = subproject.extractJavaVersion(); + + if (!maxJavaVersion || (javaVersion && javaVersion > maxJavaVersion)) { + maxJavaVersion = javaVersion; + } + } + } + return maxJavaVersion; + } + + // Extracts project java version + // Note: update when this feature becomes available: https://github.com/apache/netbeans/issues/7557 + protected abstract extractJavaVersion(): number | undefined +} + +export class MavenProject extends Project { + + constructor(directory: string, subprojects: any[]) { + super(directory, subprojects); + } + + extractJavaVersion(): number | undefined { + const buildscript = path.resolve(this.directory, 'pom.xml'); + let version: string | undefined; + if (fs.existsSync(buildscript)) { + const parser: xml2js.Parser = new xml2js.Parser({ async: false }); + parser.parseString(fs.readFileSync(buildscript)?.toString() || '', (err, result) => { + if (!err && result) { + const properties = result['project']?.['properties']; + if (properties?.[0]) { + const mavenCompilerTarget = properties[0]['maven.compiler.target']; + if (mavenCompilerTarget?.[0]) { + version = mavenCompilerTarget[0]; + return; + } + + const mavenCompilerSource = properties[0]['maven.compiler.source']; + if (mavenCompilerSource?.[0]) { + version = mavenCompilerSource[0]; + return; + } + + const jdkVersion = properties[0]['jdk.version']; + if (jdkVersion?.[0]) { + version = jdkVersion[0]; + return; + } + } + } + }) + } + return version ? Number(normalizeJavaVersion(version)) : undefined; + } +} + +export class GradleProject extends Project { + + constructor(directory: string, subprojects: any[]) { + super(directory, subprojects); + } + + getJavaCompatibilityFrom(buildscript: string, from: 'target' | 'source'): string | undefined { + const res = from === 'target' ? GRADLE_TARGET_COMPATIBILITY_REGEX.exec(buildscript) : GRADLE_SOURCE_COMPATIBILITY_REGEX.exec(buildscript) + if (res?.[3]) { + return res[3]; // Get the version number directly + } else if (res?.[1]) { + return res[1]; // Get the version number from JavaVersion.toVersion + } + return undefined; + } + + extractJavaVersion(): number | undefined { + let version: number | undefined; + const buildscript = path.resolve(this.directory, 'build.gradle'); + if (fs.existsSync(buildscript)) { + fs.readFileSync(buildscript)?.toString().split(os.EOL).find(l => { + let tempVersion: string | undefined = this.getJavaCompatibilityFrom(l, 'target'); + + if (!tempVersion) { + tempVersion = this.getJavaCompatibilityFrom(l, 'source'); + } + + if (tempVersion) { + version = Number(normalizeJavaVersion(tempVersion)); + return true; + } + + return false; + }); + } + return version; + } +} \ No newline at end of file diff --git a/java/java.lsp.server/vscode/src/jdk/validation/validation.ts b/java/java.lsp.server/vscode/src/jdk/validation/validation.ts new file mode 100644 index 000000000000..32048d4e2433 --- /dev/null +++ b/java/java.lsp.server/vscode/src/jdk/validation/validation.ts @@ -0,0 +1,79 @@ +/* + * 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 * as vscode from 'vscode'; +import * as jdkUtils from 'jdk-utils'; + +import { isRHExtensionActive, waitForNblsCommandToBeAvailable } from './extensionUtils'; +import { getJavaVersion } from './javaUtil'; +import { getProjectFrom } from './project'; + +const CONFIGURE_JDK_COMMAND = 'nbls.jdk.configuration' +const CONFIGURE_JDK = 'Configure JDK'; + +export async function validateJDKCompatibility(javaPath: string | null, projectPath: string | null) { + // In this case RH will try it's best to validate Java versions + if (isRHExtensionActive()) return; + + const projectJavaVersion = await getProjectJavaVersion(); + const ideJavaVersion = await parseJavaVersion(javaPath); + const ideProjectJavaVersion = await parseJavaVersion(projectPath); + + let conflictingVersion : number = 0; + + if (projectJavaVersion) { + // project settings is preferred, if defined. + if (ideProjectJavaVersion) { + if (ideProjectJavaVersion < projectJavaVersion) { + conflictingVersion = ideProjectJavaVersion; + } + } else if (ideJavaVersion && ideJavaVersion < projectJavaVersion) { + conflictingVersion = ideJavaVersion; + } + } + if (conflictingVersion) { + const value = await vscode.window.showWarningMessage(`Source level (JDK ${projectJavaVersion}) not compatible with current JDK installation (JDK ${conflictingVersion})`, CONFIGURE_JDK); + if (value === CONFIGURE_JDK) { + vscode.commands.executeCommand(CONFIGURE_JDK_COMMAND); + } + } +} + +async function parseJavaVersion(javaPath: string | null): Promise { + if (!javaPath) return undefined; + + const javaRuntime = await jdkUtils.getRuntime(javaPath, { checkJavac: true }); + if (!javaRuntime?.hasJavac) { + return undefined; + } + const version = await getJavaVersion(javaRuntime.homedir); + return version ? Number(version) : undefined; +} + +async function getProjectJavaVersion(): Promise { + const folder = vscode.workspace.workspaceFolders?.[0]; + if (!folder) return undefined; + + await waitForNblsCommandToBeAvailable(); + + const project = await getProjectFrom(folder.uri); + const javaVersion = await project?.getJavaVersion(); + + return javaVersion; +} diff --git a/java/java.lsp.server/vscode/src/panels/GuidePanel.ts b/java/java.lsp.server/vscode/src/panels/GuidePanel.ts new file mode 100644 index 000000000000..5e230572efba --- /dev/null +++ b/java/java.lsp.server/vscode/src/panels/GuidePanel.ts @@ -0,0 +1,111 @@ +/* + * 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 * as vscode from "vscode"; +import * as path from "path"; +import * as fs from "fs"; +import * as Handlebars from "handlebars"; +import { promisify } from "util"; + +const readFile = promisify(fs.readFile); + +export abstract class GuidePanel { + + readonly webviewsFolder: string = "webviews"; + readonly stylesFolder: string = "styles"; + readonly scriptsFolder: string = "scripts"; + + protected properties: any; + readonly templatePath: string; + readonly panel: vscode.WebviewPanel; + disposables: vscode.Disposable[] = []; + + abstract messageHandler(message: any): void; + + constructor(context: vscode.ExtensionContext, viewType: string, templatePath: string, properties: any) { + this.properties = properties; + this.templatePath = templatePath; + this.panel = vscode.window.createWebviewPanel( + viewType, + "Oracle Cloud Assets", + { viewColumn: vscode.ViewColumn.One, preserveFocus: true }, + { + enableCommandUris: true, + enableScripts: true, + localResourceRoots: [vscode.Uri.file(path.join(context.extensionPath, this.webviewsFolder))], + } + ); + const iconPath: vscode.Uri = vscode.Uri.file(path.join(context.extensionPath, "images", "Apache_NetBeans_Logo.png")); + this.panel.iconPath = { + light: iconPath, + dark: iconPath, + }; + + this.disposables.push( + this.panel.onDidDispose( + () => this.dispose())); + + this.panel.onDidChangeViewState( + () => { + if (this.panel.visible) { + this.setHtml(context); + } + }, + null, + this.disposables + ); + + this.panel.webview.onDidReceiveMessage( + (e) => this.messageHandler(e), + undefined, + this.disposables + ); + + this.setHtml(context); + } + + protected getSources(context: vscode.ExtensionContext): any { + return { + cssUri: this.panel.webview.asWebviewUri(vscode.Uri.file(path.join(context.extensionPath, this.webviewsFolder, this.stylesFolder, "guide.css"))), + javascriptUri: this.panel.webview.asWebviewUri( + vscode.Uri.file(path.join(context.extensionPath, this.webviewsFolder, this.scriptsFolder, "guide.js")) + ), + } + } + + private async setHtml(context: vscode.ExtensionContext) { + let templateFilePath = path.join(context.extensionPath, this.webviewsFolder, this.templatePath); + const template = await this.getTemplateFromPath(templateFilePath); + this.panel.webview.html = template({ + cspSource: this.panel.webview.cspSource, + ...this.getSources(context), + ...this.properties + }); + } + + private async getTemplateFromPath(path: string): Promise> { + const templateFile = await readFile(path, "utf-8"); + return Handlebars.compile(templateFile); + } + + public dispose() { + this.panel.dispose(); + this.disposables.forEach(x => x?.dispose()); + } +} diff --git a/java/java.lsp.server/vscode/src/panels/RunImageGuidePanel.ts b/java/java.lsp.server/vscode/src/panels/RunImageGuidePanel.ts new file mode 100644 index 000000000000..d39d62662718 --- /dev/null +++ b/java/java.lsp.server/vscode/src/panels/RunImageGuidePanel.ts @@ -0,0 +1,77 @@ +/* + * 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 * as vscode from "vscode"; +import { GuidePanel } from "./GuidePanel"; +import { dummyKeyPathLocation, shouldHideGuideFor, sshConfigLocation, toggleGuideFor } from "./guidesUtil"; + +export type RunImageGuidePanelProps = { + publicIp: string; + ocid: string; +} + +export const viewType: string = "runImageGuide"; +const templatePath: string = "run-image-guide.handlebars"; + +export class RunImageGuidePanel extends GuidePanel { + public static currentPanel: RunImageGuidePanel | undefined; + + public static createOrShow(context: vscode.ExtensionContext, props: RunImageGuidePanelProps) { + if (RunImageGuidePanel.currentPanel) { + if (!this.propertiesUpdated(props)) { + RunImageGuidePanel.currentPanel.panel.reveal(); + return; + } + RunImageGuidePanel.currentPanel.panel.dispose(); + } + + RunImageGuidePanel.currentPanel = new RunImageGuidePanel(context, props); + } + + private static propertiesUpdated(props: RunImageGuidePanelProps): boolean { + const { ocid, publicIp } = props; + return RunImageGuidePanel.currentPanel?.properties.ocid !== ocid || RunImageGuidePanel.currentPanel.properties.publicIp !== publicIp; + } + + constructor(context: vscode.ExtensionContext, props: RunImageGuidePanelProps) { + const { ocid, publicIp } = props; + super(context, viewType, templatePath, { + ocid, + publicIp, + dummyKeyPathLocation, + sshConfigLocation, + showGuide: "", + }); + } + + async messageHandler(message: any): Promise { + if (message.command === "showGuide") { + await toggleGuideFor(viewType, this.properties.ocid); + this.properties.showGuide = this.properties.showGuide === "checked" ? "" : "checked" + } else if (message.command === "openSSHConfig") { + vscode.workspace.openTextDocument(sshConfigLocation).then(document => vscode.window.showTextDocument(document)); + } + } + + public dispose() { + RunImageGuidePanel.currentPanel = undefined; + super.dispose(); + } + +} diff --git a/java/java.lsp.server/vscode/src/panels/SshGuidePanel.ts b/java/java.lsp.server/vscode/src/panels/SshGuidePanel.ts new file mode 100644 index 000000000000..e689dcb96659 --- /dev/null +++ b/java/java.lsp.server/vscode/src/panels/SshGuidePanel.ts @@ -0,0 +1,77 @@ +/* + * 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 * as vscode from "vscode"; +import { GuidePanel } from "./GuidePanel"; +import { dummyKeyPathLocation, sshConfigLocation, toggleGuideFor } from "./guidesUtil"; + +export type SshGuidePanelProps = { + publicIp: string; + ocid: string; +} + +export const viewType: string = "sshGuide"; +const templatePath: string = "ssh-guide.handlebars"; + +export class SshGuidePanel extends GuidePanel { + + public static currentPanel: SshGuidePanel | undefined; + + public static createOrShow(context: vscode.ExtensionContext, props: SshGuidePanelProps) { + if (SshGuidePanel.currentPanel) { + if (!this.propertiesUpdated(props)) { + SshGuidePanel.currentPanel.panel.reveal(); + return; + } + SshGuidePanel.currentPanel.panel.dispose(); + } + + SshGuidePanel.currentPanel = new SshGuidePanel(context, props); + } + + private static propertiesUpdated(props: SshGuidePanelProps): boolean { + const { ocid, publicIp } = props; + return SshGuidePanel.currentPanel?.properties.ocid !== ocid || SshGuidePanel.currentPanel.properties.publicIp !== publicIp; + } + + constructor(context: vscode.ExtensionContext, props: SshGuidePanelProps) { + const { ocid, publicIp } = props; + super(context, viewType, templatePath, { + ocid, + publicIp, + dummyKeyPathLocation, + sshConfigLocation, + showGuide: "", + }); + } + + async messageHandler(message: any): Promise { + if (message.command === "showGuide") { + await toggleGuideFor(viewType, this.properties.ocid); + this.properties.showGuide = this.properties.showGuide === "checked" ? "" : "checked" + } else if (message.command === "openSSHConfig") { + vscode.workspace.openTextDocument(sshConfigLocation).then(document => vscode.window.showTextDocument(document)); + } + } + + public dispose() { + SshGuidePanel.currentPanel = undefined; + super.dispose(); + } +} diff --git a/java/java.lsp.server/vscode/src/panels/guidesUtil.ts b/java/java.lsp.server/vscode/src/panels/guidesUtil.ts new file mode 100644 index 000000000000..b3b40df24fde --- /dev/null +++ b/java/java.lsp.server/vscode/src/panels/guidesUtil.ts @@ -0,0 +1,61 @@ +/* + * 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 * as vscode from 'vscode'; +import * as path from 'path'; +import * as os from 'os'; + +export const GUIDE_NOTIFICATION_CONFIGURATION_KEY = 'guides.notified'; + +type GuideNotification = { + ocid: string; + viewType: string; +} + +export const sshConfigLocation = path.join(os.homedir(), '.ssh', 'config'); +export const dummyKeyPathLocation = path.join(os.homedir(), '', 'ssh-key-yyyy-mm-dd.key'); + +export function shouldHideGuideFor(viewType: string, ocid?: string): boolean { + const notifiedGuides: Array | undefined = vscode.workspace.getConfiguration('netbeans').get>(GUIDE_NOTIFICATION_CONFIGURATION_KEY); + return notifiedGuides && notifiedGuides.find((notified) => notified.ocid === ocid && notified.viewType === viewType) ? true : false; +} + +export async function toggleGuideFor(viewType: string, ocid: string) { + const notifiedGuides: Array = vscode.workspace.getConfiguration('netbeans').get>(GUIDE_NOTIFICATION_CONFIGURATION_KEY) || []; + const notifiedForOcid = notifiedGuides.find((notified) => notified.ocid === ocid && notified.viewType === viewType) + + if (notifiedForOcid) { + try { + const updatedNotifiedGuides = notifiedGuides.filter((notified) => notified.ocid !== ocid) + await vscode.workspace.getConfiguration('netbeans') + .update(GUIDE_NOTIFICATION_CONFIGURATION_KEY, + updatedNotifiedGuides.length > 0 ? updatedNotifiedGuides : undefined, + true) + } catch (err) { + vscode.window.showErrorMessage(`Failed to update property: netbeans.${GUIDE_NOTIFICATION_CONFIGURATION_KEY}, ${err}`); + } + } else { + notifiedGuides.push({ ocid, viewType }); + try { + await vscode.workspace.getConfiguration('netbeans').update(GUIDE_NOTIFICATION_CONFIGURATION_KEY, [...notifiedGuides], true) + } catch (err) { + vscode.window.showErrorMessage(`Failed to update property: netbeans.${GUIDE_NOTIFICATION_CONFIGURATION_KEY}, ${err}`); + } + } +} diff --git a/java/java.lsp.server/vscode/webviews/run-image-guide.handlebars b/java/java.lsp.server/vscode/webviews/run-image-guide.handlebars new file mode 100644 index 000000000000..3312fb35f472 --- /dev/null +++ b/java/java.lsp.server/vscode/webviews/run-image-guide.handlebars @@ -0,0 +1,120 @@ + + + + + + + + + Run Container Image in Compute Instance + + + +
+
+ +
+

Run Container Image on a Compute Instance

+
+ +
+
+

Before you begin:

+
+ +
+
    +
  • + Locate the path to the private ssh key file for this compute instance. The private ssh key file will have either: +
      +
    • Been generated when you launched the instance and you will have been prompted to download it
    • +
    • Or, you uploaded a public ssh key, from a public/private key paid, and you will now need the private key that matches + that public key
    • +
    +
  • +
+
+ +
+

Connecting to Your Linux Instance Using SSH

+
+ +

Add the path to the instance of the private ssh key to your ssh config file: + {{sshConfigLocation}}:

+ +

Paste the following entry into your ssh config, with the paths to the private ssh key included:

+
+
Host {{publicIp}} instance
  IdentityFile {{dummyKeyPathLocation}}
+
+ +
+

Setting up Virtual Firewall

+
+

+ This is done so that container can be reached from the internet. +

+ +
+

Add a Security List Ingress Rule to Your Compute Instance

+
+ +
+
    +
  • Open + Compute instances.
  • +
  • Open the details for your compute instance by clicking on name of the instance.
  • +
  • Within the Compute instance detail, under the + Primary VNIC + section click on + Subnet name.
  • +
  • Click on Security Lists section.
  • +
  • Click on the security list.
  • +
  • Click, + Add Ingress Rule. +
      +
    • Add an ingress rule with the following properties: +
        +
      • Source Type: CIDR
      • +
      • Source CIDR: 0.0.0.0/0
      • +
      • IP Protocol: TCP
      • +
      • Destination Port Range: 8080
      • +
      +
    • +
    • Click on Add Ingress Rule
    • +
    +
  • +
+
+
+ + + +
+
+ + \ No newline at end of file diff --git a/java/java.lsp.server/vscode/webviews/scripts/guide.js b/java/java.lsp.server/vscode/webviews/scripts/guide.js new file mode 100644 index 000000000000..393c6ab4f359 --- /dev/null +++ b/java/java.lsp.server/vscode/webviews/scripts/guide.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +const vscode = acquireVsCodeApi(); +document.addEventListener("DOMContentLoaded", function () { + const showGuide = document.getElementById("showGuide"); + showGuide.addEventListener("click", () => { + vscode.postMessage({ command: "showGuide", value: showGuide.checked }); + }); + + const openSSHConfig = document.getElementById("openSSHConfig"); + openSSHConfig.addEventListener("click", () => { + vscode.postMessage({ command: "openSSHConfig", value: openSSHConfig.checked }); + }); +}); diff --git a/java/java.lsp.server/vscode/webviews/ssh-guide.handlebars b/java/java.lsp.server/vscode/webviews/ssh-guide.handlebars new file mode 100644 index 000000000000..aa4abe5d716f --- /dev/null +++ b/java/java.lsp.server/vscode/webviews/ssh-guide.handlebars @@ -0,0 +1,81 @@ + + + + + + + + + + SSH connection guide + + + +
+
+ +
+

SSH connection guide

+
+ +
+
+

Before you begin

+
+ +
+
    +
  • Locate the path to the private ssh key file for this compute instance. The private ssh key file will have either: +
      +
    • Been generated when you launched the instance and you will have been prompted to download it
    • +
    • Or, you uploaded a public ssh key, from a public/private key paid, and you will now need the private key that matches that public key
    • +
    +
  • +
+
+ +
+

Connecting to Your Linux Instance Using SSH

+
+ +

Add the path to the instance of the private ssh key to your ssh config file: + {{sshConfigLocation}}:

+ +

Paste the following entry into your ssh config, with the paths to the private ssh key included:

+
+
Host {{publicIp}} instance
  IdentityFile {{dummyKeyPathLocation}}
+
+
+ + + + +
+
+ + \ No newline at end of file diff --git a/java/java.lsp.server/vscode/webviews/styles/guide.css b/java/java.lsp.server/vscode/webviews/styles/guide.css new file mode 100644 index 000000000000..0855162a5395 --- /dev/null +++ b/java/java.lsp.server/vscode/webviews/styles/guide.css @@ -0,0 +1,162 @@ +/* + * 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. + */ + +body, +html { + height: 100%; +} + +.guidePageContainer { + align-items: start; + display: flex; + justify-content: center; + min-width: 100%; + min-height: 100%; +} + +.guidePage { + width: 90%; + max-width: 1200px; + font-size: 10px; +} + +.guidePage .content { + margin-top: 20px; +} + +.guidePage p { + font-size: 1.3em; +} + +.guidePage .path { + background-color: #2d2d2d; + color: #f8f8f2; + padding: 2px; + border-radius: 4px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + font-family: "Courier New", Courier, monospace; +} + +.guidePage .codeContainer { + position: relative; + background-color: #2d2d2d; + padding: 10px; + border-radius: 4px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + +.guidePage .codeContainer pre { + margin: 0; + font-size: 1.2em; + color: #f8f8f2; + overflow-x: auto; + font-family: "Courier New", Courier, monospace; +} + +.guidePage .codeContainer .unknownPath { + color: #cc0000; +} + +.guidePage .title { + margin-top: 1em; +} + +.guidePage .subtitle { + margin-bottom: 0.8em; +} + +.guidePage .title h1 { + padding: 0; + margin: 0; + border: none; + font-weight: normal; + font-size: 3.6em; + white-space: nowrap; +} + +.guidePage .subtitle h2 { + font-weight: lighter; + padding: 0; + margin: 0; + border: none; + font-size: 2.6em; + line-height: initial; + white-space: nowrap; +} + +.guidePage .subtitle h3 { + padding: 0; + margin: 0; + border: none; + font-size: 1.7em; + line-height: initial; + white-space: nowrap; +} + +.guidePage .list-steps > ul { + font-size: 1.3em; +} + +.guidePage .list-steps li { + min-width: 0; + font-weight: 300; + white-space: nowrap; +} + +.guidePage .list-steps .inner-list > li { + list-style-type: disc; + font-size: 1em; +} + +.guidePage .footer .showOnStartup { + min-width: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.guidePage .footer { + padding-top: 1em; +} + +.guidePage .footer .guideControl { + font-size: 1.3em; +} + +.guidePage .footer .guideControl > .checkbox { + transform: scale(1.2); + vertical-align: bottom !important; +} + +.guidePage .footer .guideControl > .checkboxLabel { + vertical-align: top !important; +} + +.guidePage .footer .guideControl > .checkbox:focus { + outline: 1px solid; + outline-color: var(--vscode-focusBorder); +} + +.guidePage .propertyValue { + background-color: #2d2d2d; + color: #f8f8f2; + padding: 2px; + border-radius: 4px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} diff --git a/java/java.metrics/manifest.mf b/java/java.metrics/manifest.mf index 4c0e562312f0..fc7393bb92e5 100644 --- a/java/java.metrics/manifest.mf +++ b/java/java.metrics/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.metrics OpenIDE-Module-Layer: org/netbeans/modules/java/metrics/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/metrics/Bundle.properties -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.34 AutoUpdate-Show-In-Client: false diff --git a/java/java.module.graph/manifest.mf b/java/java.module.graph/manifest.mf index 2dc77b32272f..af1077067ff8 100644 --- a/java/java.module.graph/manifest.mf +++ b/java/java.module.graph/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.module.graph OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/module/graph/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/java/java.mx.project/manifest.mf b/java/java.mx.project/manifest.mf index ed1cf698f058..c15d47edb2ad 100644 --- a/java/java.mx.project/manifest.mf +++ b/java/java.mx.project/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.java.mx.project OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/mx/project/Bundle.properties -OpenIDE-Module-Specification-Version: 1.14 +OpenIDE-Module-Specification-Version: 1.15 diff --git a/java/java.nativeimage.debugger/manifest.mf b/java/java.nativeimage.debugger/manifest.mf index 7263f7192886..b239efbee9eb 100644 --- a/java/java.nativeimage.debugger/manifest.mf +++ b/java/java.nativeimage.debugger/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.nativeimage.debugger/0 OpenIDE-Module-Layer: org/netbeans/modules/java/nativeimage/debugger/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/nativeimage/debugger/Bundle.properties -OpenIDE-Module-Specification-Version: 0.15 +OpenIDE-Module-Specification-Version: 0.16 diff --git a/java/java.navigation/manifest.mf b/java/java.navigation/manifest.mf index baf574cbd082..52249326d49a 100644 --- a/java/java.navigation/manifest.mf +++ b/java/java.navigation/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.java.navigation/1 OpenIDE-Module-Layer: org/netbeans/modules/java/navigation/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/navigation/Bundle.properties OpenIDE-Module-Requires: org.openide.windows.WindowManager -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 AutoUpdate-Show-In-Client: false diff --git a/java/java.openjdk.project/manifest.mf b/java/java.openjdk.project/manifest.mf index ee1b8bcbc9f8..8ee35bf8353a 100644 --- a/java/java.openjdk.project/manifest.mf +++ b/java/java.openjdk.project/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.openjdk.project/1 OpenIDE-Module-Layer: org/netbeans/modules/java/openjdk/project/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/openjdk/project/Bundle.properties -OpenIDE-Module-Specification-Version: 1.22 +OpenIDE-Module-Specification-Version: 1.23 diff --git a/java/java.platform.ui/manifest.mf b/java/java.platform.ui/manifest.mf index b8a15518c2aa..ea508bad260c 100644 --- a/java/java.platform.ui/manifest.mf +++ b/java/java.platform.ui/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.platform.ui/1 -OpenIDE-Module-Specification-Version: 1.67 +OpenIDE-Module-Specification-Version: 1.68 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/platform/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/java/platform/resources/layer.xml AutoUpdate-Show-In-Client: false diff --git a/java/java.platform/manifest.mf b/java/java.platform/manifest.mf index ed5c26b79e5b..47ad1e763d47 100644 --- a/java/java.platform/manifest.mf +++ b/java/java.platform/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.platform/1 -OpenIDE-Module-Specification-Version: 1.67 +OpenIDE-Module-Specification-Version: 1.68 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/platform/Bundle.properties AutoUpdate-Show-In-Client: false OpenIDE-Module-Recommends: org.netbeans.modules.java.platform.ui diff --git a/java/java.preprocessorbridge/nbproject/project.properties b/java/java.preprocessorbridge/nbproject/project.properties index d108d89ddcde..5790f0c7874b 100644 --- a/java/java.preprocessorbridge/nbproject/project.properties +++ b/java/java.preprocessorbridge/nbproject/project.properties @@ -17,7 +17,7 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked javac.source=1.8 -spec.version.base=1.74.0 +spec.version.base=1.75.0 javadoc.apichanges=${basedir}/apichanges.xml requires.nb.javac=true diff --git a/java/java.project.ui/manifest.mf b/java/java.project.ui/manifest.mf index fd95d796f809..c7422dd5631c 100644 --- a/java/java.project.ui/manifest.mf +++ b/java/java.project.ui/manifest.mf @@ -3,7 +3,7 @@ OpenIDE-Module: org.netbeans.modules.java.project.ui/1 OpenIDE-Module-Layer: org/netbeans/modules/java/project/ui/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/project/ui/Bundle.properties OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.100 +OpenIDE-Module-Specification-Version: 1.101 OpenIDE-Module-Recommends: org.netbeans.spi.java.project.runner.JavaRunnerImplementation AutoUpdate-Show-In-Client: false diff --git a/java/java.project/manifest.mf b/java/java.project/manifest.mf index c18053bee472..7dfbdf804ad9 100644 --- a/java/java.project/manifest.mf +++ b/java/java.project/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.project/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/project/Bundle.properties OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.97 +OpenIDE-Module-Specification-Version: 1.98 AutoUpdate-Show-In-Client: false diff --git a/java/java.source.ant/nbproject/project.properties b/java/java.source.ant/nbproject/project.properties index b8a93baf4980..93003028a6d4 100644 --- a/java/java.source.ant/nbproject/project.properties +++ b/java/java.source.ant/nbproject/project.properties @@ -17,7 +17,7 @@ ant.jar=${ant.core.lib} javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.56.0 +spec.version.base=1.57.0 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/java/java.source.base/nbproject/org-netbeans-modules-java-source-base.sig b/java/java.source.base/nbproject/org-netbeans-modules-java-source-base.sig index 1fd2a7b2cdfe..125e97a224a5 100644 --- a/java/java.source.base/nbproject/org-netbeans-modules-java-source-base.sig +++ b/java/java.source.base/nbproject/org-netbeans-modules-java-source-base.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.66.0 +#Version 2.68.0 CLSS public abstract interface com.sun.source.tree.TreeVisitor<%0 extends java.lang.Object, %1 extends java.lang.Object> meth public abstract {com.sun.source.tree.TreeVisitor%0} visitAnnotatedType(com.sun.source.tree.AnnotatedTypeTree,{com.sun.source.tree.TreeVisitor%1}) @@ -56,7 +56,6 @@ meth public abstract {com.sun.source.tree.TreeVisitor%0} visitPrimitiveType(com. meth public abstract {com.sun.source.tree.TreeVisitor%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.tree.TreeVisitor%1}) -meth public abstract {com.sun.source.tree.TreeVisitor%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.tree.TreeVisitor%1}) @@ -140,7 +139,6 @@ meth public {com.sun.source.util.TreeScanner%0} visitPrimitiveType(com.sun.sourc meth public {com.sun.source.util.TreeScanner%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.util.TreeScanner%1}) -meth public {com.sun.source.util.TreeScanner%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.util.TreeScanner%1}) @@ -1506,7 +1504,6 @@ meth public com.sun.source.tree.PrimitiveTypeTree PrimitiveType(javax.lang.model meth public com.sun.source.tree.ProvidesTree Provides(com.sun.source.tree.ExpressionTree,java.util.List) meth public com.sun.source.tree.RequiresTree Requires(boolean,boolean,com.sun.source.tree.ExpressionTree) meth public com.sun.source.tree.ReturnTree Return(com.sun.source.tree.ExpressionTree) -meth public com.sun.source.tree.StringTemplateTree StringTemplate(com.sun.source.tree.ExpressionTree,java.util.List,java.util.List) meth public com.sun.source.tree.SwitchTree Switch(com.sun.source.tree.ExpressionTree,java.util.List) meth public com.sun.source.tree.SwitchTree addSwitchCase(com.sun.source.tree.SwitchTree,com.sun.source.tree.CaseTree) meth public com.sun.source.tree.SwitchTree insertSwitchCase(com.sun.source.tree.SwitchTree,int,com.sun.source.tree.CaseTree) diff --git a/java/java.source.base/nbproject/project.properties b/java/java.source.base/nbproject/project.properties index 170637154fce..8a521a038b49 100644 --- a/java/java.source.base/nbproject/project.properties +++ b/java/java.source.base/nbproject/project.properties @@ -23,7 +23,7 @@ javadoc.name=Java Source Base javadoc.title=Java Source Base javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=2.68.0 +spec.version.base=2.69.0 test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/nb-javac-api.jar test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\ ${o.n.core.dir}/lib/boot.jar:\ diff --git a/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java b/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java index 8eeca5480203..6b8b05e16e79 100644 --- a/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java +++ b/java/java.source.base/src/org/netbeans/api/java/source/TreeMaker.java @@ -3917,16 +3917,4 @@ public LambdaExpressionTree setLambdaBody(LambdaExpressionTree method, Tree newB return delegate.setLambdaBody(method, newBody); } - /**Creates a new string template expression from the given parameters. - * - * @param processor the processor of the string template - * @param fragments the template fragments - * @param expressions the template expressions - * @return the string template instance - * @since 2.65 - */ - public StringTemplateTree StringTemplate(ExpressionTree processor, List fragments, List expressions) { - return delegate.StringTemplate(processor, fragments, expressions); - } - } diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java b/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java index dded462b5ee8..836872d20f01 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java @@ -34,7 +34,7 @@ */ public class NoJavacHelper { - public static final int REQUIRED_JAVAC_VERSION = 22; // <- TODO: increment on every release + public static final int REQUIRED_JAVAC_VERSION = 23; // <- TODO: increment on every release private static final boolean HAS_WORKING_JAVAC; static { diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/builder/TreeFactory.java b/java/java.source.base/src/org/netbeans/modules/java/source/builder/TreeFactory.java index e31b4697659d..aed7625d6e78 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/builder/TreeFactory.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/builder/TreeFactory.java @@ -222,12 +222,6 @@ public PatternCaseLabelTree PatternCaseLabel(PatternTree pat) { return make.at(NOPOS).PatternCaseLabel((JCPattern) pat); } - public StringTemplateTree StringTemplate(ExpressionTree processor, List fragments, List expressions) { - return make.at(NOPOS).StringTemplate((JCExpression) processor, - fragments.stream().collect(com.sun.tools.javac.util.List.collector()), - expressions.stream().map(expr -> (JCExpression) expr).collect(com.sun.tools.javac.util.List.collector())); - } - public AnyPatternTree AnyPattern() { return make.at(NOPOS).AnyPattern(); } diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java b/java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java index 0075fbc04b07..2faea15be640 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java @@ -116,7 +116,6 @@ import org.netbeans.modules.java.source.parsing.FileObjects; import org.netbeans.modules.java.source.parsing.JavacParser; import org.netbeans.modules.java.source.save.CasualDiff; -import org.netbeans.modules.java.source.save.CasualDiff.StringTemplateFragmentTree; import org.netbeans.modules.java.source.save.DiffContext; import org.netbeans.modules.java.source.save.PositionEstimator; import org.netbeans.modules.java.source.save.Reformatter; @@ -1895,27 +1894,14 @@ public void visitLiteral(JCLiteral tree) { case CHAR: print("\'" + quote( - String.valueOf((char) ((Number) tree.value).intValue()), '"') + + String.valueOf((char) ((Number) tree.value).intValue()), '"', true) + "\'"); break; case CLASS: if (tree.value instanceof String) { - String leading; - String trailing; - if (tree instanceof StringTemplateFragmentTree) { - StringTemplateFragmentTree stf = (StringTemplateFragmentTree) tree; - switch (stf.fragmentKind) { - case START: leading = "\""; trailing = "\\{"; break; - case MIDDLE: leading = "}"; trailing = "\\{"; break; - case END: leading = "}"; trailing = "\""; break; - default: throw new IllegalStateException(stf.fragmentKind.name()); - } - } else { - leading = trailing = "\""; - } - print(leading); - print(quote((String) tree.value, '\'')); - print(trailing); + print("\""); + print(quote((String) tree.value, '\'', false)); + print("\""); } else if (tree.value instanceof String[]) { int indent = out.col; print("\"\"\""); @@ -1929,7 +1915,7 @@ public void visitLiteral(JCLiteral tree) { print('\\'); print('"'); } else if (line.charAt(c) != '\'' && line.charAt(c) != '"') { - print(Convert.quote(line.charAt(c))); + print(Convert.quote(line.charAt(c), false)); } else { print(line.charAt(c)); } @@ -1954,12 +1940,12 @@ public void visitLiteral(JCLiteral tree) { } } - private static String quote(String val, char keep) { + private static String quote(String val, char keep, boolean charContext) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < val.length(); i++) { char c = val.charAt(i); if (c != keep) { - sb.append(Convert.quote(c)); + sb.append(Convert.quote(c, charContext)); } else { sb.append(c); } @@ -2092,31 +2078,6 @@ public void visitConstantCaseLabel(JCConstantCaseLabel tree) { printExpr(tree.expr); } - @Override - public void visitStringTemplate(JCStringTemplate tree) { - printExpr(tree.processor, TreeInfo.postfixPrec); - print('.'); - - Iterator fragmentIt = tree.fragments.iterator(); - Iterator expressionIt = tree.expressions.iterator(); - boolean start = true; - - while (expressionIt.hasNext()) { - if (start) { - print("\""); - } else { - print("}"); - } - print(quote(fragmentIt.next(), '\'')); - print("\\{"); - print(expressionIt.next()); - start = false; - } - print("}"); - print(quote(fragmentIt.next(), '\'')); - print("\""); - } - @Override public void visitLetExpr(LetExpr tree) { print("(let " + tree.defs + " in " + tree.expr + ")"); diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java b/java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java index 93ca03a57e8d..08527547a62a 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java @@ -109,7 +109,6 @@ import com.sun.tools.javac.tree.JCTree.JCRequires; import com.sun.tools.javac.tree.JCTree.JCReturn; import com.sun.tools.javac.tree.JCTree.JCStatement; -import com.sun.tools.javac.tree.JCTree.JCStringTemplate; import com.sun.tools.javac.tree.JCTree.JCSwitch; import com.sun.tools.javac.tree.JCTree.JCSwitchExpression; import com.sun.tools.javac.tree.JCTree.JCSynchronized; @@ -175,7 +174,6 @@ import org.openide.util.NbBundle; import org.openide.util.NbCollections; import javax.lang.model.type.TypeKind; -import org.netbeans.modules.java.source.save.CasualDiff.StringTemplateFragmentTree.FragmentKind; import org.netbeans.modules.java.source.transform.TreeHelpers; public class CasualDiff { @@ -1992,61 +1990,6 @@ protected int diffRecordPattern(JCRecordPattern oldT, JCRecordPattern newT, int[ return bounds[1]; } - protected int diffStringTemplate(JCStringTemplate oldT, JCStringTemplate newT, int[] bounds) { - int localPointer = bounds[0]; - - // processor - int[] processorBounds = getBounds(oldT.processor); - copyTo(localPointer, processorBounds[0]); - localPointer = diffTree(oldT.processor, newT.processor, processorBounds); - - tokenSequence.move(processorBounds[1]); - do { } while (tokenSequence.moveNext() && JavaTokenId.DOT != tokenSequence.token().id()); - tokenSequence.moveNext(); - copyTo(localPointer, localPointer = tokenSequence.offset()); - - // expressions - List oldFragmentsAndExpressions = zipFragmentsAndExpressions(oldT, localPointer); - List newFragmentsAndExpressions = zipFragmentsAndExpressions(newT, NOPOS); - PositionEstimator est = EstimatorFactory.stringTemplate(oldFragmentsAndExpressions, newFragmentsAndExpressions, diffContext); - localPointer = diffList(oldFragmentsAndExpressions, newFragmentsAndExpressions, localPointer, est, Measure.REAL_MEMBER, printer); - copyTo(localPointer, bounds[1]); - return bounds[1]; - } - - private List zipFragmentsAndExpressions(JCStringTemplate template, int pos) { - ListBuffer result = new ListBuffer<>(); - Iterator fragmentIt = template.fragments.iterator(); - Iterator expressionIt = template.expressions.iterator(); - - while (fragmentIt.hasNext()) { - JCExpression expression = expressionIt.hasNext() ? expressionIt.next() : null; - FragmentKind fragmentKind = result.isEmpty() ? FragmentKind.START - : expression != null ? FragmentKind.MIDDLE - : FragmentKind.END; - JCLiteral literal = new StringTemplateFragmentTree(TypeTag.CLASS, fragmentIt.next(), fragmentKind); - - if (pos != NOPOS) { - tokenSequence.move(pos); - - if (tokenSequence.moveNext() && tokenSequence.token().id() == JavaTokenId.STRING_LITERAL) { - literal.pos = tokenSequence.offset(); - diffContext.syntheticEndPositions.put(literal, literal.pos + tokenSequence.token().length()); - } - - pos = expression != null ? endPos(expression) : NOPOS; - } - - result.append(literal); - - if (expression != null) { - result.append(expression); - } - } - - return result.toList(); - } - protected int diffConstantCaseLabel(JCConstantCaseLabel oldT, JCConstantCaseLabel newT, int[] bounds) { return diffTree((JCTree) oldT.expr, (JCTree) newT.expr, bounds); } @@ -5813,9 +5756,6 @@ private int diffTreeImpl0(JCTree oldT, JCTree newT, JCTree parent /*used only fo case RECORDPATTERN: retVal = diffRecordPattern((JCRecordPattern) oldT, (JCRecordPattern) newT, elementBounds); break; - case STRING_TEMPLATE: - retVal = diffStringTemplate((JCStringTemplate) oldT, (JCStringTemplate) newT, elementBounds); - break; default: // handle special cases like field groups and enum constants if (oldT.getKind() == Kind.OTHER) { @@ -6444,19 +6384,4 @@ private int findVar(int start, int end) { return -1; } - public static final class StringTemplateFragmentTree extends JCLiteral { - - public final FragmentKind fragmentKind; - - public StringTemplateFragmentTree(TypeTag typetag, Object value, FragmentKind kind) { - super(typetag, value); - this.fragmentKind = kind; - } - - public enum FragmentKind { - START, - MIDDLE, - END; - } - } } diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java b/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java index 86cb9171cf25..f1239136427f 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java @@ -3556,18 +3556,6 @@ public Boolean visitErroneous(ErroneousTree node, Void p) { return true; } - @Override - public Boolean visitStringTemplate(StringTemplateTree node, Void p) { - scan(node.getProcessor(), p); - accept(DOT); - for (ExpressionTree expression : node.getExpressions()) { - accept(STRING_LITERAL); - scan(expression, p); - } - accept(STRING_LITERAL); - return true; - } - @Override public Boolean visitOther(Tree node, Void p) { do { diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java b/java/java.source.base/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java index 7182ff73ea09..4efeb9b2af6c 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java @@ -615,10 +615,6 @@ public Tree visitYield(YieldTree tree, Object p) { return rewriteChildren(tree); } @Override - public Tree visitStringTemplate(StringTemplateTree tree, Object p) { - return rewriteChildren(tree); - } - @Override public Tree visitAnyPattern(AnyPatternTree tree, Object p) { return rewriteChildren(tree); } @@ -1545,19 +1541,6 @@ private DeconstructionPatternTree rewriteChildren(DeconstructionPatternTree tree return tree; } - private StringTemplateTree rewriteChildren(StringTemplateTree tree) { - ExpressionTree newProcessor = (ExpressionTree) translate(tree.getProcessor()); - List newExpressions = translate(tree.getExpressions()); - if (newProcessor != tree.getProcessor()|| !Objects.equals(newExpressions, tree.getExpressions())) { - StringTemplateTree n = make.StringTemplate(newProcessor, tree.getFragments(), newExpressions); - model.setType(n, model.getType(tree)); - copyCommentTo(tree,n); - copyPosTo(tree,n); - tree = n; - } - return tree; - } - private AnyPatternTree rewriteChildren(AnyPatternTree tree) { return tree; } diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/transform/TreeDuplicator.java b/java/java.source.base/src/org/netbeans/modules/java/source/transform/TreeDuplicator.java index 0a66c94932a1..c09091ec46d1 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/transform/TreeDuplicator.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/transform/TreeDuplicator.java @@ -72,7 +72,6 @@ import com.sun.source.tree.ProvidesTree; import com.sun.source.tree.RequiresTree; import com.sun.source.tree.ReturnTree; -import com.sun.source.tree.StringTemplateTree; import com.sun.source.tree.SwitchExpressionTree; import com.sun.source.tree.SwitchTree; import com.sun.source.tree.SynchronizedTree; @@ -714,15 +713,6 @@ public Tree visitAnyPattern(AnyPatternTree tree, Void p) { return make.AnyPattern(); } - @Override - public Tree visitStringTemplate(StringTemplateTree tree, Void p) { - StringTemplateTree n = make.StringTemplate(tree.getProcessor(), tree.getFragments(), tree.getExpressions()); - model.setType(n, model.getType(tree)); - comments.copyComments(tree, n); - model.setPos(n, model.getPos(tree)); - return n; - } - @Override public Tree visitSwitchExpression(SwitchExpressionTree tree, Void p) { SwitchExpressionTree n = make.SwitchExpression(tree.getExpression(), tree.getCases()); diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/StringTemplateTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/StringTemplateTest.java deleted file mode 100644 index df7b4cfca365..000000000000 --- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/StringTemplateTest.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * 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.api.java.source.gen; - -import com.sun.source.tree.BlockTree; -import com.sun.source.tree.CaseTree; -import com.sun.source.tree.ClassTree; -import com.sun.source.tree.CompilationUnitTree; -import com.sun.source.tree.ExpressionTree; -import com.sun.source.tree.IdentifierTree; -import com.sun.source.tree.MethodTree; -import com.sun.source.tree.NewClassTree; -import com.sun.source.tree.StatementTree; -import com.sun.source.tree.StringTemplateTree; -import com.sun.source.tree.SwitchExpressionTree; -import com.sun.source.tree.SwitchTree; -import com.sun.source.tree.Tree; -import com.sun.source.tree.Tree.Kind; -import com.sun.source.tree.VariableTree; -import com.sun.source.util.TreeScanner; -import com.sun.tools.javac.tree.JCTree; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.Modifier; -import javax.swing.event.ChangeListener; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertNotNull; -import org.netbeans.api.java.source.JavaSource; -import org.netbeans.api.java.source.Task; -import org.netbeans.api.java.source.TestUtilities; -import org.netbeans.api.java.source.TreeMaker; -import org.netbeans.api.java.source.WorkingCopy; -import org.netbeans.junit.NbTestSuite; -import org.netbeans.modules.java.source.parsing.JavacParser; -import org.netbeans.spi.java.queries.CompilerOptionsQueryImplementation; -import org.openide.filesystems.FileObject; -import org.openide.util.lookup.ServiceProvider; - -public class StringTemplateTest extends TreeRewriteTestBase { - - private static final List EXTRA_OPTIONS = new ArrayList<>(); - - public StringTemplateTest(String testName) { - super(testName); - } - - public static NbTestSuite suite() { - NbTestSuite suite = new NbTestSuite(); - suite.addTestSuite(StringTemplateTest.class); - return suite; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - sourceLevel = "1.21"; - JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = true; - EXTRA_OPTIONS.add("--enable-preview"); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = false; - - } - - @ServiceProvider(service = CompilerOptionsQueryImplementation.class, position = 100) - public static class TestCompilerOptionsQueryImplementation implements CompilerOptionsQueryImplementation { - - @Override - public CompilerOptionsQueryImplementation.Result getOptions(FileObject file) { - return new CompilerOptionsQueryImplementation.Result() { - @Override - public List getArguments() { - return EXTRA_OPTIONS; - } - - @Override - public void addChangeListener(ChangeListener listener) { - } - - @Override - public void removeChangeListener(ChangeListener listener) { - } - }; - } - - } - - public void testRenameInStringTemplate() throws Exception { - String code = "package test; \n" - + "public class Test {\n" - + " private String test(int a, int b) {\n" - + " return STR.\"\\{a}\";\n" - + " }\n" - + "}\n"; - String golden = "package test; \n" - + "public class Test {\n" - + " private String test(int a, int b) {\n" - + " return FMT.\"\\{b}\";\n" - + " }\n" - + "}\n"; - - prepareTest("Test", code); - - JavaSource js = getJavaSource(); - assertNotNull(js); - - Task task = new Task() { - public void run(WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(JavaSource.Phase.RESOLVED); - TreeMaker make = workingCopy.getTreeMaker(); - CompilationUnitTree cut = workingCopy.getCompilationUnit(); - new TreeScanner() { - @Override - public Void visitIdentifier(IdentifierTree node, Void p) { - if (node.getName().contentEquals("a")) { - workingCopy.rewrite(node, make.Identifier("b")); - return null; - } - if (node.getName().contentEquals("STR")) { - workingCopy.rewrite(node, make.Identifier("FMT")); - return null; - } - return super.visitIdentifier(node, p); - } - }.scan(cut, null); - } - - }; - - js.runModificationTask(task).commit(); - - String res = TestUtilities.copyFileToString(getTestFile()); - //System.err.println(res); - assertEquals(golden, res); - - } - - public void testRemoveStringTemplateFragment() throws Exception { - String code = "package test; \n" - + "public class Test {\n" - + " private String test(int a, int b, int c) {\n" - + " String s1 = STR.\"a\\{a}b\\{b}c\\{c}e\";\n" - + " String s2 = STR.\"a\\{a}b\\{b}c\\{c}e\";\n" - + " String s3 = STR.\"a\\{a}b\\{b}c\\{c}e\";\n" - + " }\n" - + "}\n"; - String golden = "package test; \n" - + "public class Test {\n" - + " private String test(int a, int b, int c) {\n" - + " String s1 = STR.\"b\\{b}c\\{c}e\";\n" - + " String s2 = STR.\"a\\{a}c\\{c}e\";\n" - + " String s3 = STR.\"a\\{a}b\\{b}e\";\n" - + " }\n" - + "}\n"; - - prepareTest("Test", code); - - JavaSource js = getJavaSource(); - assertNotNull(js); - - Task task = new Task() { - public void run(WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(JavaSource.Phase.RESOLVED); - TreeMaker make = workingCopy.getTreeMaker(); - CompilationUnitTree cut = workingCopy.getCompilationUnit(); - new TreeScanner() { - @Override - public Void visitVariable(VariableTree node, Void p) { - CONT: if (node.getInitializer() != null) { - int toDelete; - switch (node.getName().toString()) { - case "s1": toDelete = 0; break; - case "s2": toDelete = 1; break; - case "s3": toDelete = 2; break; - default: break CONT; - } - - StringTemplateTree template = (StringTemplateTree) node.getInitializer(); - List fragments = new ArrayList<>(template.getFragments()); - List expressions = new ArrayList<>(template.getExpressions()); - - fragments.remove(toDelete); - expressions.remove(toDelete); - - workingCopy.rewrite(template, make.StringTemplate(template.getProcessor(), fragments, expressions)); - } - return super.visitVariable(node, p); - } - }.scan(cut, null); - } - - }; - - js.runModificationTask(task).commit(); - - String res = TestUtilities.copyFileToString(getTestFile()); - //System.err.println(res); - assertEquals(golden, res); - - } - - public void testAddStringTemplateFragment() throws Exception { - String code = "package test; \n" - + "public class Test {\n" - + " private String test(int a, int b, int c) {\n" - + " String s1 = STR.\"0\\{0}1\\{1}e\";\n" - + " String s2 = STR.\"0\\{0}1\\{1}e\";\n" - + " String s3 = STR.\"0\\{0}1\\{1}e\";\n" - + " }\n" - + "}\n"; - String golden = "package test; \n" - + "public class Test {\n" - + " private String test(int a, int b, int c) {\n" - + " String s1 = STR.\"a\\{a}0\\{0}1\\{1}e\";\n" - + " String s2 = STR.\"0\\{0}a\\{a}1\\{1}e\";\n" - + " String s3 = STR.\"0\\{0}1\\{1}a\\{a}e\";\n" - + " }\n" - + "}\n"; - - prepareTest("Test", code); - - JavaSource js = getJavaSource(); - assertNotNull(js); - - Task task = new Task() { - public void run(WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(JavaSource.Phase.RESOLVED); - TreeMaker make = workingCopy.getTreeMaker(); - CompilationUnitTree cut = workingCopy.getCompilationUnit(); - new TreeScanner() { - @Override - public Void visitVariable(VariableTree node, Void p) { - CONT: if (node.getInitializer() != null) { - int insertPos; - switch (node.getName().toString()) { - case "s1": insertPos = 0; break; - case "s2": insertPos = 1; break; - case "s3": insertPos = 2; break; - default: break CONT; - } - - StringTemplateTree template = (StringTemplateTree) node.getInitializer(); - List fragments = new ArrayList<>(template.getFragments()); - List expressions = new ArrayList<>(template.getExpressions()); - - fragments.add(insertPos, "a"); - expressions.add(insertPos, make.Identifier("a")); - - workingCopy.rewrite(template, make.StringTemplate(template.getProcessor(), fragments, expressions)); - } - return super.visitVariable(node, p); - } - }.scan(cut, null); - } - - }; - - js.runModificationTask(task).commit(); - - String res = TestUtilities.copyFileToString(getTestFile()); - //System.err.println(res); - assertEquals(golden, res); - - } - - public void testNewStringTemplate() throws Exception { - String code = "package test; \n" - + "public class Test {\n" - + " private String test(int a, int b, int c) {\n" - + " String s;\n" - + " }\n" - + "}\n"; - String golden = "package test; \n" - + "public class Test {\n" - + " private String test(int a, int b, int c) {\n" - + " String s = STR.\"a\\{a}b\\{b}c\\{c}e\";\n" - + " }\n" - + "}\n"; - - prepareTest("Test", code); - - JavaSource js = getJavaSource(); - assertNotNull(js); - - Task task = new Task() { - public void run(WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(JavaSource.Phase.RESOLVED); - TreeMaker make = workingCopy.getTreeMaker(); - CompilationUnitTree cut = workingCopy.getCompilationUnit(); - new TreeScanner() { - @Override - public Void visitVariable(VariableTree node, Void p) { - if (node.getName().contentEquals("s")) { - List fragments = new ArrayList<>(); - List expressions = new ArrayList<>(); - - fragments.add("a"); - expressions.add(make.Identifier("a")); - fragments.add("b"); - expressions.add(make.Identifier("b")); - fragments.add("c"); - expressions.add(make.Identifier("c")); - fragments.add("e"); - - workingCopy.rewrite(node, make.setInitialValue(node, make.StringTemplate(make.Identifier("STR"), fragments, expressions))); - } - return super.visitVariable(node, p); - } - }.scan(cut, null); - } - - }; - - js.runModificationTask(task).commit(); - - String res = TestUtilities.copyFileToString(getTestFile()); - //System.err.println(res); - assertEquals(golden, res); - - } - -} diff --git a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java index fc0911df9abf..c11be84ffc76 100644 --- a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java +++ b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java @@ -6753,32 +6753,6 @@ public void testSealed3() throws Exception { reformat(doc, content, golden); } - public void testStringTemplate() throws Exception { - testFile = new File(getWorkDir(), "Test.java"); - TestUtilities.copyStringToFile(testFile, ""); - FileObject testSourceFO = FileUtil.toFileObject(testFile); - DataObject testSourceDO = DataObject.find(testSourceFO); - EditorCookie ec = (EditorCookie) testSourceDO.getCookie(EditorCookie.class); - final Document doc = ec.openDocument(); - doc.putProperty(Language.class, JavaTokenId.language()); - String content - = "\n" - + "class Test {\n\n" - + " private String t() {\n" - + " return STR.\"a\\{1 + 2}b\";\n" - + " }\n" - + "}\n"; - - String golden - = "\n" - + "class Test {\n\n" - + " private String t() {\n" - + " return STR.\"a\\{1 + 2}b\";\n" - + " }\n" - + "}\n"; - reformat(doc, content, golden); - } - private void reformat(Document doc, String content, String golden) throws Exception { reformat(doc, content, golden, 0, content.length()); } diff --git a/java/java.source.compat8/manifest.mf b/java/java.source.compat8/manifest.mf index e62b70144ced..c0ac3f3ec298 100644 --- a/java/java.source.compat8/manifest.mf +++ b/java/java.source.compat8/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.source.compat8 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/source/compat8/Bundle.properties -OpenIDE-Module-Specification-Version: 9.28 +OpenIDE-Module-Specification-Version: 9.29 OpenIDE-Module-Fragment-Host: org.netbeans.modules.java.source.base diff --git a/java/java.source.queries/manifest.mf b/java/java.source.queries/manifest.mf index b91a707fb318..21f865349078 100644 --- a/java/java.source.queries/manifest.mf +++ b/java/java.source.queries/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.source.queries OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/source/queries/Bundle.properties -OpenIDE-Module-Specification-Version: 1.43 +OpenIDE-Module-Specification-Version: 1.44 OpenIDE-Module-Needs: org.netbeans.modules.java.source.queries.spi.QueriesController Netigso-Export-Package: org.netbeans.modules.java.source.queries.api,org.netbeans.modules.java.source.queries.spi diff --git a/java/java.source.queriesimpl/manifest.mf b/java/java.source.queriesimpl/manifest.mf index f832b3f0f3b8..55a54b1e2ec4 100644 --- a/java/java.source.queriesimpl/manifest.mf +++ b/java/java.source.queriesimpl/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.source.queriesimpl OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/source/queriesimpl/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 OpenIDE-Module-Provides: org.netbeans.modules.java.source.queries.spi.QueriesController diff --git a/java/java.source/nbproject/org-netbeans-modules-java-source.sig b/java/java.source/nbproject/org-netbeans-modules-java-source.sig index a3b5dcc5461c..5b74ba762b92 100644 --- a/java/java.source/nbproject/org-netbeans-modules-java-source.sig +++ b/java/java.source/nbproject/org-netbeans-modules-java-source.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 0.189.0 +#Version 0.190.0 CLSS public abstract interface com.sun.source.tree.TreeVisitor<%0 extends java.lang.Object, %1 extends java.lang.Object> meth public abstract {com.sun.source.tree.TreeVisitor%0} visitAnnotatedType(com.sun.source.tree.AnnotatedTypeTree,{com.sun.source.tree.TreeVisitor%1}) @@ -56,7 +56,6 @@ meth public abstract {com.sun.source.tree.TreeVisitor%0} visitPrimitiveType(com. meth public abstract {com.sun.source.tree.TreeVisitor%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.tree.TreeVisitor%1}) -meth public abstract {com.sun.source.tree.TreeVisitor%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.tree.TreeVisitor%1}) @@ -140,7 +139,6 @@ meth public {com.sun.source.util.TreeScanner%0} visitPrimitiveType(com.sun.sourc meth public {com.sun.source.util.TreeScanner%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.util.TreeScanner%1}) -meth public {com.sun.source.util.TreeScanner%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.util.TreeScanner%1}) @@ -1511,7 +1509,6 @@ meth public com.sun.source.tree.PrimitiveTypeTree PrimitiveType(javax.lang.model meth public com.sun.source.tree.ProvidesTree Provides(com.sun.source.tree.ExpressionTree,java.util.List) meth public com.sun.source.tree.RequiresTree Requires(boolean,boolean,com.sun.source.tree.ExpressionTree) meth public com.sun.source.tree.ReturnTree Return(com.sun.source.tree.ExpressionTree) -meth public com.sun.source.tree.StringTemplateTree StringTemplate(com.sun.source.tree.ExpressionTree,java.util.List,java.util.List) meth public com.sun.source.tree.SwitchTree Switch(com.sun.source.tree.ExpressionTree,java.util.List) meth public com.sun.source.tree.SwitchTree addSwitchCase(com.sun.source.tree.SwitchTree,com.sun.source.tree.CaseTree) meth public com.sun.source.tree.SwitchTree insertSwitchCase(com.sun.source.tree.SwitchTree,int,com.sun.source.tree.CaseTree) diff --git a/java/java.source/nbproject/project.properties b/java/java.source/nbproject/project.properties index 6574754845eb..15a65925624b 100644 --- a/java/java.source/nbproject/project.properties +++ b/java/java.source/nbproject/project.properties @@ -22,7 +22,7 @@ javadoc.name=Java Source javadoc.title=Java Source javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=0.190.0 +spec.version.base=0.191.0 test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/nb-javac-api.jar test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\ ${o.n.core.dir}/lib/boot.jar:\ diff --git a/java/java.source/src/org/netbeans/modules/java/Bundle.properties b/java/java.source/src/org/netbeans/modules/java/Bundle.properties index ab7092de7c0a..74949b6a2eb2 100644 --- a/java/java.source/src/org/netbeans/modules/java/Bundle.properties +++ b/java/java.source/src/org/netbeans/modules/java/Bundle.properties @@ -31,6 +31,12 @@ LBL_JavaNode_sheet_classpaths=Classpaths HINT_JavaNode_sheet_classpaths=Effective classpaths used by the IDE for this source file, for example as reported by a project. Sources displayed where applicable. LBL_JavaNode_sheet_classfile=Class File HINT_JavaNode_sheet_classfile=Java Class File Attributes +PROP_JavaNode_singlefile_jdk=JDK +HINT_JavaNode_singlefile_jdk=JDK used to run the file. +PROP_JavaNode_singlefile_arguments=Program Arguments +HINT_JavaNode_singlefile_arguments=Arguments passed to the main method while running the file. +PROP_JavaNode_singlefile_options=VM Options +HINT_JavaNode_singlefile_options=VM Options to be considered while running the file. PROP_JavaNode_classfile_version=Classfile Version HINT_JavaNode_classfile_version=The Java API and Language Level of this class file PROP_JavaNode_compile_classpath=Compile Classpath diff --git a/java/java.source/src/org/netbeans/modules/java/JavaNode.java b/java/java.source/src/org/netbeans/modules/java/JavaNode.java index 470a80a2119f..6dec93234e29 100644 --- a/java/java.source/src/org/netbeans/modules/java/JavaNode.java +++ b/java/java.source/src/org/netbeans/modules/java/JavaNode.java @@ -21,8 +21,12 @@ import com.sun.source.tree.ClassTree; import com.sun.source.tree.CompilationUnitTree; +import java.awt.Component; import org.netbeans.api.java.source.support.ErrorAwareTreeScanner; import java.awt.Image; +import java.beans.PropertyChangeListener; +import java.beans.PropertyEditor; +import java.beans.PropertyEditorSupport; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -37,24 +41,27 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Comparator; import java.util.HexFormat; -import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.stream.Stream; import javax.lang.model.element.Modifier; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JComboBox; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NonNull; import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.api.java.classpath.ClassPath; +import org.netbeans.api.java.platform.JavaPlatformManager; import org.netbeans.api.java.source.CompilationController; import org.netbeans.api.java.source.JavaSource; -import org.netbeans.api.java.source.ModificationResult; import org.netbeans.api.project.FileOwnerQuery; import org.netbeans.api.project.Project; import org.netbeans.api.queries.FileBuiltQuery; @@ -63,14 +70,11 @@ import org.netbeans.modules.classfile.ClassFile; import org.netbeans.modules.classfile.InvalidClassFormatException; import org.netbeans.modules.java.source.usages.ExecutableFilesIndex; -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.java.loaders.RenameHandler; import org.openide.filesystems.*; import org.openide.loaders.DataNode; import org.openide.loaders.DataObject; +import org.openide.modules.SpecificationVersion; import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; @@ -103,7 +107,9 @@ public final class JavaNode extends DataNode implements ChangeListener { private static final String ANNOTATION_ICON_BASE = "org/netbeans/modules/java/resources/annotation_file.png"; //NOI18N private static final String EXECUTABLE_BADGE_URL = "org/netbeans/modules/java/resources/executable-badge.png"; //NOI18N private static final String NEEDS_COMPILE_BADGE_URL = "org/netbeans/modules/java/resources/needs-compile.png"; //NOI18N + // synced with org.netbeans.modules.java.file.launcher.SingleSourceFileUtil private static final String FILE_ARGUMENTS = "single_file_run_arguments"; //NOI18N + private static final String FILE_JDK = "single_file_run_jdk"; //NOI18N private static final String FILE_VM_OPTIONS = "single_file_vm_options"; //NOI18N private static final Map IMAGE_CACHE = new ConcurrentHashMap<>(); @@ -232,72 +238,16 @@ protected final Sheet createSheet () { DataObject dObj = super.getDataObject(); // If any of the parent folders is a project, user won't have the option to specify these attributes to the java files. if (parentProject == null) { - Node.Property arguments = new PropertySupport.ReadWrite ( - "runFileArguments", // NOI18N - String.class, - "Arguments", - "Arguments passed to the main method while running the file." - ) { - @Override - public String getValue () { - Object arguments = dObj.getPrimaryFile().getAttribute(FILE_ARGUMENTS); - return arguments != null ? (String) arguments : ""; - } - - @Override - public void setValue (String o) { - try { - dObj.getPrimaryFile().setAttribute(FILE_ARGUMENTS, o); - } catch (IOException ex) { - LOG.log( - Level.WARNING, - "Java File does not exist : {0}", //NOI18N - dObj.getPrimaryFile().getName()); - } - } - }; - Node.Property vmOptions = new PropertySupport.ReadWrite ( - "runFileVMOptions", // NOI18N - String.class, - "VM Options", - "VM Options to be considered while running the file." - ) { - @Override - public String getValue () { - Object vmOptions = dObj.getPrimaryFile().getAttribute(FILE_VM_OPTIONS); - return vmOptions != null ? (String) vmOptions : ""; - } - - @Override - public void setValue(String o) { - try { - dObj.getPrimaryFile().setAttribute(FILE_VM_OPTIONS, o); - Source s = Source.create(dObj.getPrimaryFile()); - ModificationResult result = ModificationResult.runModificationTask(List.of(s), new UserTask() { - - @Override - public void run(ResultIterator resultIterator) { - } - }); - result.commit(); - } catch (IOException | ParseException ex) { - LOG.log( - Level.WARNING, - "Java File does not exist : {0}", //NOI18N - dObj.getPrimaryFile().getName()); - } - } - }; Sheet.Set ss = new Sheet.Set(); ss.setName("runFileArguments"); // NOI18N - ss.setDisplayName(getMessage(JavaNode.class, "LBL_JavaNode_without_project_run")); + ss.setDisplayName(getMessage(JavaNode.class, "LBL_JavaNode_without_project_run")); // NOI18N ss.setShortDescription("Run the file's source code."); - ss.put (arguments); - ss.put (vmOptions); + ss.put(new RunFileJDKProperty(dObj)); + ss.put(new JavaFileAttributeProperty(dObj, FILE_ARGUMENTS, "runFileArguments", "singlefile_arguments")); // NOI18N + ss.put(new JavaFileAttributeProperty(dObj, FILE_VM_OPTIONS, "runFileVMOptions", "singlefile_options")); // NOI18N sheet.put(ss); } - - + @SuppressWarnings("LocalVariableHidesMemberVariable") PropertySet[] propertySets = sheet.toArray(); @@ -429,6 +379,120 @@ public String getValue() { } } + private static final class RunFileJDKProperty extends PropertySupport.ReadWrite { + + private final PropertyEditorSupport jdkPicker = new JDKPicker(); + private final DataObject dObj; + + public RunFileJDKProperty(DataObject dObj) { + super("runFileJDK", String.class, // NOI18N + getMessage(JavaNode.class, "PROP_JavaNode_singlefile_jdk"), // NOI18N + getMessage(JavaNode.class, "HINT_JavaNode_singlefile_jdk")); // NOI18N + this.dObj = dObj; + } + + @Override + public String getValue() { + return dObj.getPrimaryFile().getAttribute(FILE_JDK) instanceof String jdk ? jdk : ""; + } + + @Override + public void setValue(String text) { + try { + dObj.getPrimaryFile().setAttribute(FILE_JDK, text); + } catch (IOException ex) { + LOG.log(Level.WARNING, "Java File does not exist : {0}", dObj.getPrimaryFile().getName()); //NOI18N + } + } + + @Override + public PropertyEditor getPropertyEditor() { + return jdkPicker; + } + + // inline combobox for jdk property + private static final class JDKPicker extends PropertyEditorSupport { + + private final JComboBox jdkCombo = new JComboBox(); + private final PropertyChangeListener modelUpdater = e -> initModel(); + private String[] jdks; + + public JDKPicker() { + initModel(); + jdkCombo.addActionListener(e -> super.setValue(jdkCombo.getSelectedItem())); + JavaPlatformManager jdkman = JavaPlatformManager.getDefault(); + jdkman.addPropertyChangeListener(WeakListeners.propertyChange(modelUpdater, jdkman)); + } + + private void initModel() { + jdks = Stream.of(JavaPlatformManager.getDefault().getInstalledPlatforms()) + .filter(jdk -> isCompatible(jdk.getSpecification().getVersion())) + .map(jdk -> jdk.getDisplayName()) + .sorted(Comparator.reverseOrder()) + .toArray(String[]::new); + jdkCombo.setModel(new DefaultComboBoxModel(jdks)); + } + + private static boolean isCompatible(SpecificationVersion jdkVerison) { + try { + return Integer.parseInt(jdkVerison.toString()) >= 11; + } catch (NumberFormatException ignore) {} + return false; + } + + @Override + public void setAsText(String text) throws IllegalArgumentException { + jdkCombo.setSelectedItem(text); + } + + @Override + public void setValue(Object value) { + jdkCombo.setSelectedItem(value); + super.setValue(value); + } + + @Override + @SuppressWarnings("ReturnOfCollectionOrArrayField") + public String[] getTags() { + return jdks; + } + + @Override + public Component getCustomEditor() { + return jdkCombo; + } + + } + + } + + // editable file attribute + private static final class JavaFileAttributeProperty extends PropertySupport.ReadWrite { + + private final String attribute; + private final DataObject dObj; + + public JavaFileAttributeProperty(DataObject dObj, String attribute, String name, String msgKeyPart) { + super(name, String.class, getMessage(JavaNode.class, "PROP_JavaNode_" + msgKeyPart), getMessage(JavaNode.class, "HINT_JavaNode_" + msgKeyPart)); // NOI18N + this.dObj = dObj; + this.attribute = attribute; + } + + @Override + public String getValue() { + return dObj.getPrimaryFile().getAttribute(attribute) instanceof String val ? val : ""; + } + + @Override + public void setValue(String o) { + try { + dObj.getPrimaryFile().setAttribute(attribute, o); + } catch (IOException ex) { + LOG.log(Level.WARNING, "Java File does not exist : {0}", dObj.getPrimaryFile().getName()); //NOI18N + } + } + } + @Override public void stateChanged(ChangeEvent e) { WORKER.post(new BuildStatusTask(this)); diff --git a/java/java.source/src/org/netbeans/modules/java/classfile/CodeGenerator.java b/java/java.source/src/org/netbeans/modules/java/classfile/CodeGenerator.java index 5c72770889b5..db4d16d9d7fb 100644 --- a/java/java.source/src/org/netbeans/modules/java/classfile/CodeGenerator.java +++ b/java/java.source/src/org/netbeans/modules/java/classfile/CodeGenerator.java @@ -393,6 +393,9 @@ public Tree visitType(TypeElement e, Void p) { List members = new LinkedList(); for (Element m : e.getEnclosedElements()) { + if (m.getKind() == ElementKind.RECORD_COMPONENT) { + continue; // TODO update to 'extend AbstractElementVisitor14'; visiting record components causes UnknownElementException + } Tree member = visit(m); if (member != null) @@ -408,6 +411,10 @@ public Tree visitType(TypeElement e, Void p) { return addDeprecated(e, make.Interface(mods, e.getSimpleName(), constructTypeParams(e.getTypeParameters()), computeSuper(e.getInterfaces()), members)); case ENUM: return addDeprecated(e, make.Enum(mods, e.getSimpleName(), computeSuper(e.getInterfaces()), members)); + case RECORD: + // TODO generates final class atm + return addDeprecated(e, make.Class(mods, e.getSimpleName(), constructTypeParams(e.getTypeParameters()), null, computeSuper(e.getInterfaces()), members)); +// return addDeprecated(e, make.Record(mods, e.getSimpleName(), computeSuper(e.getInterfaces()), members)); case ANNOTATION_TYPE: return addDeprecated(e, make.AnnotationType(mods, e.getSimpleName(), members)); default: @@ -782,6 +789,8 @@ public void writeInstr(Instruction instr) { IMPLICIT_MODIFIERS = new HashMap, Set>(); IMPLICIT_MODIFIERS.put(Arrays.asList(ElementKind.ENUM), EnumSet.of(Modifier.STATIC, Modifier.ABSTRACT, Modifier.FINAL)); + // TODO implement record support +// IMPLICIT_MODIFIERS.put(Arrays.asList(ElementKind.RECORD), EnumSet.of(Modifier.STATIC, Modifier.ABSTRACT, Modifier.FINAL)); IMPLICIT_MODIFIERS.put(Arrays.asList(ElementKind.ANNOTATION_TYPE), EnumSet.of(Modifier.STATIC, Modifier.ABSTRACT)); IMPLICIT_MODIFIERS.put(Arrays.asList(ElementKind.METHOD, ElementKind.ANNOTATION_TYPE), EnumSet.of(Modifier.ABSTRACT)); IMPLICIT_MODIFIERS.put(Arrays.asList(ElementKind.METHOD, ElementKind.INTERFACE), EnumSet.of(Modifier.ABSTRACT)); diff --git a/java/java.sourceui/nbproject/project.properties b/java/java.sourceui/nbproject/project.properties index 3efde0712632..4fca4dbd252a 100644 --- a/java/java.sourceui/nbproject/project.properties +++ b/java/java.sourceui/nbproject/project.properties @@ -18,7 +18,7 @@ javadoc.apichanges=${basedir}/apichanges.xml javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.73.0 +spec.version.base=1.74.0 # failing or missing test files test.config.default.excludes=\ diff --git a/java/java.testrunner.ant/manifest.mf b/java/java.testrunner.ant/manifest.mf index 7058d0f992d3..01ad9e89b9c5 100644 --- a/java/java.testrunner.ant/manifest.mf +++ b/java/java.testrunner.ant/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.testrunner.ant OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/testrunner/ant/Bundle.properties -OpenIDE-Module-Specification-Version: 1.27 +OpenIDE-Module-Specification-Version: 1.28 diff --git a/java/java.testrunner.ui/manifest.mf b/java/java.testrunner.ui/manifest.mf index 6d6e10a6254c..1c592e966a16 100644 --- a/java/java.testrunner.ui/manifest.mf +++ b/java/java.testrunner.ui/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.testrunner.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/testrunner/ui/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.java.testrunner.ui.api.JavaManager -OpenIDE-Module-Specification-Version: 1.29 +OpenIDE-Module-Specification-Version: 1.30 diff --git a/java/java.testrunner/manifest.mf b/java/java.testrunner/manifest.mf index f07d6b7bf129..54293b60933e 100644 --- a/java/java.testrunner/manifest.mf +++ b/java/java.testrunner/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.java.testrunner OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/testrunner/Bundle.properties -OpenIDE-Module-Specification-Version: 1.45 +OpenIDE-Module-Specification-Version: 1.46 diff --git a/java/javadoc/nbproject/project.properties b/java/javadoc/nbproject/project.properties index 529df21808a1..a925b2aff07f 100644 --- a/java/javadoc/nbproject/project.properties +++ b/java/javadoc/nbproject/project.properties @@ -21,7 +21,7 @@ javac.source=1.8 # requires nb.javac for compiling of tests on Mac requires.nb.javac=true -spec.version.base=1.80.0 +spec.version.base=1.81.0 test.config.stableBTD.includes=\ **/hints/AnalyzerTest.class,\ **/search/*Test.class diff --git a/java/javaee.injection/manifest.mf b/java/javaee.injection/manifest.mf index 6b86715edc68..744778c1cff8 100644 --- a/java/javaee.injection/manifest.mf +++ b/java/javaee.injection/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javaee.injection OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javaee/injection/Bundle.properties -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 AutoUpdate-Show-In-Client: false diff --git a/java/javawebstart/manifest.mf b/java/javawebstart/manifest.mf index 9fcfcc54c98a..e9687421f323 100644 --- a/java/javawebstart/manifest.mf +++ b/java/javawebstart/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javawebstart OpenIDE-Module-Layer: org/netbeans/modules/javawebstart/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javawebstart/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 AutoUpdate-Show-In-Client: false diff --git a/java/jellytools.java/manifest.mf b/java/jellytools.java/manifest.mf index 6ba5aed2d451..9f31b86c6584 100644 --- a/java/jellytools.java/manifest.mf +++ b/java/jellytools.java/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.jellytools.java/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jellytools/java/Bundle.properties -OpenIDE-Module-Specification-Version: 3.55 +OpenIDE-Module-Specification-Version: 3.56 diff --git a/java/jshell.support/nbproject/project.properties b/java/jshell.support/nbproject/project.properties index 65d79f7b3e91..75e8e9c30770 100644 --- a/java/jshell.support/nbproject/project.properties +++ b/java/jshell.support/nbproject/project.properties @@ -17,5 +17,5 @@ javac.release=11 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.25.0 +spec.version.base=1.26.0 is.eager=true diff --git a/java/junit.ant.ui/manifest.mf b/java/junit.ant.ui/manifest.mf index 1e4766bd4aaa..e5e5c3909ae0 100644 --- a/java/junit.ant.ui/manifest.mf +++ b/java/junit.ant.ui/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.junit.ant.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/junit/ant/ui/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.junit.ant.ui.AntJUnitManagerProvider -OpenIDE-Module-Specification-Version: 1.30 +OpenIDE-Module-Specification-Version: 1.31 diff --git a/java/junit.ant/manifest.mf b/java/junit.ant/manifest.mf index de47ba784d9f..3360fbdc3972 100644 --- a/java/junit.ant/manifest.mf +++ b/java/junit.ant/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.junit.ant OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/junit/ant/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.junit.ant.JUnitAntLogger -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/java/junit.ui/manifest.mf b/java/junit.ui/manifest.mf index 39a319f8d4ff..63da00b9fdac 100644 --- a/java/junit.ui/manifest.mf +++ b/java/junit.ui/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.junit.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/junit/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.32 +OpenIDE-Module-Specification-Version: 1.33 diff --git a/java/junit/manifest.mf b/java/junit/manifest.mf index 182c5b62d240..c6bf970f8fda 100644 --- a/java/junit/manifest.mf +++ b/java/junit/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.junit/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/junit/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/junit/resources/layer.xml -OpenIDE-Module-Specification-Version: 2.99 +OpenIDE-Module-Specification-Version: 2.100 OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker AutoUpdate-Show-In-Client: false diff --git a/java/ko4j.debugging/manifest.mf b/java/ko4j.debugging/manifest.mf index f52c0a1d3c62..6654c85cbe1d 100644 --- a/java/ko4j.debugging/manifest.mf +++ b/java/ko4j.debugging/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ko4j.debugging OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ko4j/debugging/Bundle.properties -OpenIDE-Module-Specification-Version: 1.27 +OpenIDE-Module-Specification-Version: 1.28 OpenIDE-Module-Needs: org.netbeans.modules.web.browser.api.PageInspector OpenIDE-Module-Provides: org.netbeans.modules.ko4j.debugging diff --git a/java/kotlin.editor/manifest.mf b/java/kotlin.editor/manifest.mf index 5dc6e23ef52c..628982cf095c 100644 --- a/java/kotlin.editor/manifest.mf +++ b/java/kotlin.editor/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.kotlin.editor OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/kotlin/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.20 +OpenIDE-Module-Specification-Version: 1.21 diff --git a/java/languages.antlr/manifest.mf b/java/languages.antlr/manifest.mf index 1062a326c924..9e5342c7875b 100644 --- a/java/languages.antlr/manifest.mf +++ b/java/languages.antlr/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.languages.antlr OpenIDE-Module-Layer: org/netbeans/modules/languages/antlr/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/antlr/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 AutoUpdate-Show-In-Client: true diff --git a/java/lib.jshell.agent/manifest.mf b/java/lib.jshell.agent/manifest.mf index 6bf8fa940b78..0d9eecaada0d 100644 --- a/java/lib.jshell.agent/manifest.mf +++ b/java/lib.jshell.agent/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.lib.jshell.agent OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/jshell/agent/Bundle.properties -OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Specification-Version: 1.25 Premain-class: org.netbeans.lib.jshell.agent.NbJShellAgent Can-Redefine-Classes: true Can-Retransform-Classes: true diff --git a/java/lib.nbjavac/nbproject/project.properties b/java/lib.nbjavac/nbproject/project.properties index 2b7f39215c71..79e24d3bbd0c 100644 --- a/java/lib.nbjavac/nbproject/project.properties +++ b/java/lib.nbjavac/nbproject/project.properties @@ -17,5 +17,5 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.41.0 +spec.version.base=1.42.0 requires.nb.javac=true diff --git a/java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBAttr.java b/java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBAttr.java index 0935891ddf5c..beb38b2aaa33 100644 --- a/java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBAttr.java +++ b/java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBAttr.java @@ -29,7 +29,6 @@ import com.sun.tools.javac.tree.JCTree.JCClassDecl; import com.sun.tools.javac.tree.JCTree.JCExpression; import com.sun.tools.javac.tree.JCTree.JCMethodDecl; -import com.sun.tools.javac.tree.JCTree.JCStringTemplate; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; import com.sun.tools.javac.tree.TreeMaker; import com.sun.tools.javac.util.Context; @@ -111,24 +110,6 @@ public void visitCatch(JCCatch that) { super.visitBlock(tm.Block(0, List.of(that.param, that.body))); } - @Override - public void visitStringTemplate(JCStringTemplate tree) { - //workaround for: - //a) crash when tree.processor is null - //b) crash when the StringTemplate.process method does not exist - //should be removed when javac is improved to be more resilient w.r.t. these errors: - boolean prevInStringTemplate = rs.inStringTemplate; - try { - if (tree.processor == null) { - tree.processor = tm.Erroneous(); - } - rs.inStringTemplate = true; - super.visitStringTemplate(tree); - } finally { - rs.inStringTemplate = prevInStringTemplate; - } - } - private boolean fullyAttribute; private Env fullyAttributeResult; diff --git a/java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBParserFactory.java b/java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBParserFactory.java index 4af392a707cc..73a578d9062b 100644 --- a/java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBParserFactory.java +++ b/java/lib.nbjavac/src/org/netbeans/lib/nbjavac/services/NBParserFactory.java @@ -157,7 +157,7 @@ public JCStatement parseSimpleStatement() { if (result instanceof JCEnhancedForLoop) { JCEnhancedForLoop tree = (JCEnhancedForLoop) result; if (getEndPos(tree.var) == Position.NOPOS) { - endPosTable.storeEnd(tree.var, getEndPos(((JCVariableDecl) tree.var).vartype)); + endPosTable.storeEnd(tree.var, getEndPos(tree.var.vartype)); } } return result; diff --git a/java/lib.nbjshell/manifest.mf b/java/lib.nbjshell/manifest.mf index a5b07ac2e157..cde50fbfba2e 100644 --- a/java/lib.nbjshell/manifest.mf +++ b/java/lib.nbjshell/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.lib.nbjshell OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/nbjshell/Bundle.properties -OpenIDE-Module-Specification-Version: 1.27 +OpenIDE-Module-Specification-Version: 1.28 OpenIDE-Module-Needs: jshell.implementation OpenIDE-Module-Needs-Message: NetBeans do not ship implementation of Java Shell. You may run NetBeans with JDK9, which provides one. diff --git a/java/lib.nbjshell9/manifest.mf b/java/lib.nbjshell9/manifest.mf index ff35121f0631..71e532d00e47 100644 --- a/java/lib.nbjshell9/manifest.mf +++ b/java/lib.nbjshell9/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.lib.nbjshell9 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/nbjshell9/Bundle.properties -OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Specification-Version: 1.25 OpenIDE-Module-Provides: jshell.implementation OpenIDE-Module-Package-Dependencies: [jdk.jshell.JShell] OpenIDE-Module-Java-Dependencies: Java > 9 diff --git a/java/libs.cglib/manifest.mf b/java/libs.cglib/manifest.mf index 66408a1a36af..8c450f37184d 100644 --- a/java/libs.cglib/manifest.mf +++ b/java/libs.cglib/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.libs.cglib/1 -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/cglib/Bundle.properties diff --git a/java/libs.corba.omgapi/manifest.mf b/java/libs.corba.omgapi/manifest.mf index 025e8295caef..f8f877138f3e 100644 --- a/java/libs.corba.omgapi/manifest.mf +++ b/java/libs.corba.omgapi/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.libs.corba.omgapi OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/corba/omgapi/Bundle.properties -OpenIDE-Module-Specification-Version: 1.20 +OpenIDE-Module-Specification-Version: 1.21 diff --git a/java/libs.javacapi/external/binaries-list b/java/libs.javacapi/external/binaries-list index bf8129d49f78..7e227e986c7d 100644 --- a/java/libs.javacapi/external/binaries-list +++ b/java/libs.javacapi/external/binaries-list @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -07266A99C001F11616B36F5128EB78D2242F3096 com.dukescript.nbjavac:nb-javac:jdk-22.0.1+8:api -D8B9FE09D677A6D589BA3C1E5AD636AF7F47AEE2 com.dukescript.nbjavac:nb-javac:jdk-22.0.1+8 +22634F5884CE6835660FB01C2B2D2D27AFB96A50 http://lahoda.info/nb-javac/23%2B35-extra/nb-javac-jdk-23+35-api.jar nb-javac-jdk-23+35-api.jar +D6E98991F58ABADC2272EFE6FBB7772705832AB0 http://lahoda.info/nb-javac/23%2B35-extra/nb-javac-jdk-23+35-impl.jar nb-javac-jdk-23+35.jar diff --git a/java/libs.nbjavacapi/external/nb-javac-jdk-22.0.1+8-license.txt b/java/libs.javacapi/external/nb-javac-jdk-23+35-license.txt similarity index 99% rename from java/libs.nbjavacapi/external/nb-javac-jdk-22.0.1+8-license.txt rename to java/libs.javacapi/external/nb-javac-jdk-23+35-license.txt index 2fe171364534..e1852eaac70c 100644 --- a/java/libs.nbjavacapi/external/nb-javac-jdk-22.0.1+8-license.txt +++ b/java/libs.javacapi/external/nb-javac-jdk-23+35-license.txt @@ -1,10 +1,10 @@ Name: Javac Compiler Implementation Description: Javac Compiler Implementation -Version: jdk-22.0.1+8 -Files: nb-javac-jdk-22.0.1+8-api.jar nb-javac-jdk-22.0.1+8.jar +Version: 23+35 +Files: nb-javac-jdk-23+35-api.jar nb-javac-jdk-23+35.jar License: GPL-2-CP -Origin: OpenJDK (https://github.com/openjdk/jdk22u) -Source: https://github.com/openjdk/jdk22u +Origin: OpenJDK (https://github.com/openjdk/jdk) +Source: https://github.com/openjdk/jdk Type: optional,reviewed Comment: The binary has been reviewed to be under the Classpath Exception as a whole. Optional at runtime, but used by default. diff --git a/java/libs.javacapi/nbproject/org-netbeans-libs-javacapi.sig b/java/libs.javacapi/nbproject/org-netbeans-libs-javacapi.sig index 5ee0a1c62147..f3dda70e51fd 100644 --- a/java/libs.javacapi/nbproject/org-netbeans-libs-javacapi.sig +++ b/java/libs.javacapi/nbproject/org-netbeans-libs-javacapi.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 8.48.0 +#Version 8.49.0 CLSS public abstract interface com.sun.source.doctree.AttributeTree innr public final static !enum ValueKind @@ -74,6 +74,7 @@ fld public final static com.sun.source.doctree.DocTree$Kind INHERIT_DOC fld public final static com.sun.source.doctree.DocTree$Kind LINK fld public final static com.sun.source.doctree.DocTree$Kind LINK_PLAIN fld public final static com.sun.source.doctree.DocTree$Kind LITERAL +fld public final static com.sun.source.doctree.DocTree$Kind MARKDOWN fld public final static com.sun.source.doctree.DocTree$Kind OTHER fld public final static com.sun.source.doctree.DocTree$Kind PARAM fld public final static com.sun.source.doctree.DocTree$Kind PROVIDES @@ -135,6 +136,7 @@ meth public {com.sun.source.doctree.DocTreeVisitor%0} visitEscape(com.sun.source meth public {com.sun.source.doctree.DocTreeVisitor%0} visitHidden(com.sun.source.doctree.HiddenTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitIndex(com.sun.source.doctree.IndexTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitProvides(com.sun.source.doctree.ProvidesTree,{com.sun.source.doctree.DocTreeVisitor%1}) +meth public {com.sun.source.doctree.DocTreeVisitor%0} visitRawText(com.sun.source.doctree.RawTextTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitSnippet(com.sun.source.doctree.SnippetTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitSpec(com.sun.source.doctree.SpecTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitSummary(com.sun.source.doctree.SummaryTree,{com.sun.source.doctree.DocTreeVisitor%1}) @@ -202,6 +204,10 @@ intf com.sun.source.doctree.BlockTagTree meth public abstract com.sun.source.doctree.ReferenceTree getServiceType() meth public abstract java.util.List getDescription() +CLSS public abstract interface com.sun.source.doctree.RawTextTree +intf com.sun.source.doctree.DocTree +meth public abstract java.lang.String getContent() + CLSS public abstract interface com.sun.source.doctree.ReferenceTree intf com.sun.source.doctree.DocTree meth public abstract java.lang.String getSignature() @@ -467,6 +473,7 @@ meth public abstract com.sun.source.tree.StatementTree getThenStatement() CLSS public abstract interface com.sun.source.tree.ImportTree intf com.sun.source.tree.Tree +meth public abstract boolean isModule() meth public abstract boolean isStatic() meth public abstract com.sun.source.tree.Tree getQualifiedIdentifier() @@ -640,12 +647,6 @@ meth public abstract javax.lang.model.element.TypeElement getEnclosingClass() CLSS public abstract interface com.sun.source.tree.StatementTree intf com.sun.source.tree.Tree -CLSS public abstract interface com.sun.source.tree.StringTemplateTree -intf com.sun.source.tree.ExpressionTree -meth public abstract com.sun.source.tree.ExpressionTree getProcessor() -meth public abstract java.util.List getExpressions() -meth public abstract java.util.List getFragments() - CLSS public abstract interface com.sun.source.tree.SwitchExpressionTree intf com.sun.source.tree.ExpressionTree meth public abstract com.sun.source.tree.ExpressionTree getExpression() @@ -772,7 +773,6 @@ fld public final static com.sun.source.tree.Tree$Kind SUPER_WILDCARD fld public final static com.sun.source.tree.Tree$Kind SWITCH fld public final static com.sun.source.tree.Tree$Kind SWITCH_EXPRESSION fld public final static com.sun.source.tree.Tree$Kind SYNCHRONIZED -fld public final static com.sun.source.tree.Tree$Kind TEMPLATE fld public final static com.sun.source.tree.Tree$Kind THROW fld public final static com.sun.source.tree.Tree$Kind TRY fld public final static com.sun.source.tree.Tree$Kind TYPE_ANNOTATION @@ -851,7 +851,6 @@ meth public abstract {com.sun.source.tree.TreeVisitor%0} visitPrimitiveType(com. meth public abstract {com.sun.source.tree.TreeVisitor%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.tree.TreeVisitor%1}) -meth public abstract {com.sun.source.tree.TreeVisitor%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.tree.TreeVisitor%1}) @@ -946,6 +945,7 @@ meth public abstract com.sun.source.doctree.LiteralTree newCodeTree(com.sun.sour meth public abstract com.sun.source.doctree.LiteralTree newLiteralTree(com.sun.source.doctree.TextTree) meth public abstract com.sun.source.doctree.ParamTree newParamTree(boolean,com.sun.source.doctree.IdentifierTree,java.util.List) meth public abstract com.sun.source.doctree.ProvidesTree newProvidesTree(com.sun.source.doctree.ReferenceTree,java.util.List) +meth public abstract com.sun.source.doctree.RawTextTree newRawTextTree(com.sun.source.doctree.DocTree$Kind,java.lang.String) meth public abstract com.sun.source.doctree.ReferenceTree newReferenceTree(java.lang.String) meth public abstract com.sun.source.doctree.ReturnTree newReturnTree(java.util.List) meth public abstract com.sun.source.doctree.SeeTree newSeeTree(java.util.List) @@ -1020,6 +1020,7 @@ meth public {com.sun.source.util.DocTreeScanner%0} visitLiteral(com.sun.source.d meth public {com.sun.source.util.DocTreeScanner%0} visitOther(com.sun.source.doctree.DocTree,{com.sun.source.util.DocTreeScanner%1}) meth public {com.sun.source.util.DocTreeScanner%0} visitParam(com.sun.source.doctree.ParamTree,{com.sun.source.util.DocTreeScanner%1}) meth public {com.sun.source.util.DocTreeScanner%0} visitProvides(com.sun.source.doctree.ProvidesTree,{com.sun.source.util.DocTreeScanner%1}) +meth public {com.sun.source.util.DocTreeScanner%0} visitRawText(com.sun.source.doctree.RawTextTree,{com.sun.source.util.DocTreeScanner%1}) meth public {com.sun.source.util.DocTreeScanner%0} visitReference(com.sun.source.doctree.ReferenceTree,{com.sun.source.util.DocTreeScanner%1}) meth public {com.sun.source.util.DocTreeScanner%0} visitReturn(com.sun.source.doctree.ReturnTree,{com.sun.source.util.DocTreeScanner%1}) meth public {com.sun.source.util.DocTreeScanner%0} visitSee(com.sun.source.doctree.SeeTree,{com.sun.source.util.DocTreeScanner%1}) @@ -1055,6 +1056,7 @@ meth public abstract java.text.BreakIterator getBreakIterator() meth public abstract java.util.List getFirstSentence(java.util.List) meth public abstract javax.lang.model.element.Element getElement(com.sun.source.util.DocTreePath) meth public abstract javax.lang.model.type.TypeMirror getType(com.sun.source.util.DocTreePath) +meth public abstract javax.lang.model.util.Elements$DocCommentKind getDocCommentKind(com.sun.source.util.TreePath) meth public abstract void printMessage(javax.tools.Diagnostic$Kind,java.lang.CharSequence,com.sun.source.doctree.DocTree,com.sun.source.doctree.DocCommentTree,com.sun.source.tree.CompilationUnitTree) meth public abstract void setBreakIterator(java.text.BreakIterator) meth public static com.sun.source.util.DocTrees instance(javax.annotation.processing.ProcessingEnvironment) @@ -1113,6 +1115,7 @@ meth public {com.sun.source.util.SimpleDocTreeVisitor%0} visitLiteral(com.sun.so meth public {com.sun.source.util.SimpleDocTreeVisitor%0} visitOther(com.sun.source.doctree.DocTree,{com.sun.source.util.SimpleDocTreeVisitor%1}) meth public {com.sun.source.util.SimpleDocTreeVisitor%0} visitParam(com.sun.source.doctree.ParamTree,{com.sun.source.util.SimpleDocTreeVisitor%1}) meth public {com.sun.source.util.SimpleDocTreeVisitor%0} visitProvides(com.sun.source.doctree.ProvidesTree,{com.sun.source.util.SimpleDocTreeVisitor%1}) +meth public {com.sun.source.util.SimpleDocTreeVisitor%0} visitRawText(com.sun.source.doctree.RawTextTree,{com.sun.source.util.SimpleDocTreeVisitor%1}) meth public {com.sun.source.util.SimpleDocTreeVisitor%0} visitReference(com.sun.source.doctree.ReferenceTree,{com.sun.source.util.SimpleDocTreeVisitor%1}) meth public {com.sun.source.util.SimpleDocTreeVisitor%0} visitReturn(com.sun.source.doctree.ReturnTree,{com.sun.source.util.SimpleDocTreeVisitor%1}) meth public {com.sun.source.util.SimpleDocTreeVisitor%0} visitSee(com.sun.source.doctree.SeeTree,{com.sun.source.util.SimpleDocTreeVisitor%1}) @@ -1196,7 +1199,6 @@ meth public {com.sun.source.util.SimpleTreeVisitor%0} visitPrimitiveType(com.sun meth public {com.sun.source.util.SimpleTreeVisitor%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.util.SimpleTreeVisitor%1}) meth public {com.sun.source.util.SimpleTreeVisitor%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.util.SimpleTreeVisitor%1}) meth public {com.sun.source.util.SimpleTreeVisitor%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.util.SimpleTreeVisitor%1}) -meth public {com.sun.source.util.SimpleTreeVisitor%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.util.SimpleTreeVisitor%1}) meth public {com.sun.source.util.SimpleTreeVisitor%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.util.SimpleTreeVisitor%1}) meth public {com.sun.source.util.SimpleTreeVisitor%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.util.SimpleTreeVisitor%1}) meth public {com.sun.source.util.SimpleTreeVisitor%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.util.SimpleTreeVisitor%1}) @@ -1329,7 +1331,6 @@ meth public {com.sun.source.util.TreeScanner%0} visitPrimitiveType(com.sun.sourc meth public {com.sun.source.util.TreeScanner%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.util.TreeScanner%1}) -meth public {com.sun.source.util.TreeScanner%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.util.TreeScanner%1}) @@ -1636,6 +1637,7 @@ fld public final static javax.lang.model.SourceVersion RELEASE_2 fld public final static javax.lang.model.SourceVersion RELEASE_20 fld public final static javax.lang.model.SourceVersion RELEASE_21 fld public final static javax.lang.model.SourceVersion RELEASE_22 +fld public final static javax.lang.model.SourceVersion RELEASE_23 fld public final static javax.lang.model.SourceVersion RELEASE_3 fld public final static javax.lang.model.SourceVersion RELEASE_4 fld public final static javax.lang.model.SourceVersion RELEASE_5 @@ -2081,7 +2083,7 @@ meth public abstract javax.lang.model.type.TypeMirror getExtendsBound() meth public abstract javax.lang.model.type.TypeMirror getSuperBound() CLSS public abstract javax.lang.model.util.AbstractAnnotationValueVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() supr javax.lang.model.util.AbstractAnnotationValueVisitor9<{javax.lang.model.util.AbstractAnnotationValueVisitor14%0},{javax.lang.model.util.AbstractAnnotationValueVisitor14%1}> @@ -2111,8 +2113,13 @@ CLSS public abstract javax.lang.model.util.AbstractAnnotationValueVisitor9<%0 ex cons protected init() supr javax.lang.model.util.AbstractAnnotationValueVisitor8<{javax.lang.model.util.AbstractAnnotationValueVisitor9%0},{javax.lang.model.util.AbstractAnnotationValueVisitor9%1}> +CLSS public abstract javax.lang.model.util.AbstractAnnotationValueVisitorPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +supr javax.lang.model.util.AbstractAnnotationValueVisitor14<{javax.lang.model.util.AbstractAnnotationValueVisitorPreview%0},{javax.lang.model.util.AbstractAnnotationValueVisitorPreview%1}> + CLSS public abstract javax.lang.model.util.AbstractElementVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() meth public abstract {javax.lang.model.util.AbstractElementVisitor14%0} visitRecordComponent(javax.lang.model.element.RecordComponentElement,{javax.lang.model.util.AbstractElementVisitor14%1}) supr javax.lang.model.util.AbstractElementVisitor9<{javax.lang.model.util.AbstractElementVisitor14%0},{javax.lang.model.util.AbstractElementVisitor14%1}> @@ -2146,8 +2153,13 @@ cons protected init() meth public abstract {javax.lang.model.util.AbstractElementVisitor9%0} visitModule(javax.lang.model.element.ModuleElement,{javax.lang.model.util.AbstractElementVisitor9%1}) supr javax.lang.model.util.AbstractElementVisitor8<{javax.lang.model.util.AbstractElementVisitor9%0},{javax.lang.model.util.AbstractElementVisitor9%1}> +CLSS public abstract javax.lang.model.util.AbstractElementVisitorPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +supr javax.lang.model.util.AbstractElementVisitor14<{javax.lang.model.util.AbstractElementVisitorPreview%0},{javax.lang.model.util.AbstractElementVisitorPreview%1}> + CLSS public abstract javax.lang.model.util.AbstractTypeVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() supr javax.lang.model.util.AbstractTypeVisitor9<{javax.lang.model.util.AbstractTypeVisitor14%0},{javax.lang.model.util.AbstractTypeVisitor14%1}> @@ -2181,6 +2193,11 @@ CLSS public abstract javax.lang.model.util.AbstractTypeVisitor9<%0 extends java. cons protected init() supr javax.lang.model.util.AbstractTypeVisitor8<{javax.lang.model.util.AbstractTypeVisitor9%0},{javax.lang.model.util.AbstractTypeVisitor9%1}> +CLSS public abstract javax.lang.model.util.AbstractTypeVisitorPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +supr javax.lang.model.util.AbstractTypeVisitor14<{javax.lang.model.util.AbstractTypeVisitorPreview%0},{javax.lang.model.util.AbstractTypeVisitorPreview%1}> + CLSS public javax.lang.model.util.ElementFilter meth public static java.util.List constructorsIn(java.lang.Iterable) meth public static java.util.List methodsIn(java.lang.Iterable) @@ -2205,7 +2222,7 @@ supr java.lang.Object hfds CONSTRUCTOR_KIND,FIELD_KINDS,METHOD_KIND,MODULE_KIND,PACKAGE_KIND,RECORD_COMPONENT_KIND,TYPE_KINDS CLSS public javax.lang.model.util.ElementKindVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() cons protected init({javax.lang.model.util.ElementKindVisitor14%0}) meth public {javax.lang.model.util.ElementKindVisitor14%0} visitRecordComponent(javax.lang.model.element.RecordComponentElement,{javax.lang.model.util.ElementKindVisitor14%1}) @@ -2264,8 +2281,14 @@ cons protected init({javax.lang.model.util.ElementKindVisitor9%0}) meth public {javax.lang.model.util.ElementKindVisitor9%0} visitModule(javax.lang.model.element.ModuleElement,{javax.lang.model.util.ElementKindVisitor9%1}) supr javax.lang.model.util.ElementKindVisitor8<{javax.lang.model.util.ElementKindVisitor9%0},{javax.lang.model.util.ElementKindVisitor9%1}> +CLSS public javax.lang.model.util.ElementKindVisitorPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +cons protected init({javax.lang.model.util.ElementKindVisitorPreview%0}) +supr javax.lang.model.util.ElementKindVisitor14<{javax.lang.model.util.ElementKindVisitorPreview%0},{javax.lang.model.util.ElementKindVisitorPreview%1}> + CLSS public javax.lang.model.util.ElementScanner14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() cons protected init({javax.lang.model.util.ElementScanner14%0}) meth public {javax.lang.model.util.ElementScanner14%0} visitExecutable(javax.lang.model.element.ExecutableElement,{javax.lang.model.util.ElementScanner14%1}) @@ -2313,7 +2336,14 @@ cons protected init({javax.lang.model.util.ElementScanner9%0}) meth public {javax.lang.model.util.ElementScanner9%0} visitModule(javax.lang.model.element.ModuleElement,{javax.lang.model.util.ElementScanner9%1}) supr javax.lang.model.util.ElementScanner8<{javax.lang.model.util.ElementScanner9%0},{javax.lang.model.util.ElementScanner9%1}> +CLSS public javax.lang.model.util.ElementScannerPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +cons protected init({javax.lang.model.util.ElementScannerPreview%0}) +supr javax.lang.model.util.ElementScanner14<{javax.lang.model.util.ElementScannerPreview%0},{javax.lang.model.util.ElementScannerPreview%1}> + CLSS public abstract interface javax.lang.model.util.Elements +innr public final static !enum DocCommentKind innr public final static !enum Origin meth public abstract !varargs void printElements(java.io.Writer,javax.lang.model.element.Element[]) meth public abstract boolean hides(javax.lang.model.element.Element,javax.lang.model.element.Element) @@ -2344,11 +2374,20 @@ meth public javax.lang.model.element.RecordComponentElement recordComponentFor(j meth public javax.lang.model.element.TypeElement getEnumConstantBody(javax.lang.model.element.VariableElement) meth public javax.lang.model.element.TypeElement getOutermostTypeElement(javax.lang.model.element.Element) meth public javax.lang.model.element.TypeElement getTypeElement(javax.lang.model.element.ModuleElement,java.lang.CharSequence) +meth public javax.lang.model.util.Elements$DocCommentKind getDocCommentKind(javax.lang.model.element.Element) meth public javax.lang.model.util.Elements$Origin getOrigin(javax.lang.model.AnnotatedConstruct,javax.lang.model.element.AnnotationMirror) meth public javax.lang.model.util.Elements$Origin getOrigin(javax.lang.model.element.Element) meth public javax.lang.model.util.Elements$Origin getOrigin(javax.lang.model.element.ModuleElement,javax.lang.model.element.ModuleElement$Directive) meth public javax.tools.JavaFileObject getFileObjectOf(javax.lang.model.element.Element) +CLSS public final static !enum javax.lang.model.util.Elements$DocCommentKind + outer javax.lang.model.util.Elements +fld public final static javax.lang.model.util.Elements$DocCommentKind END_OF_LINE +fld public final static javax.lang.model.util.Elements$DocCommentKind TRADITIONAL +meth public static javax.lang.model.util.Elements$DocCommentKind valueOf(java.lang.String) +meth public static javax.lang.model.util.Elements$DocCommentKind[] values() +supr java.lang.Enum + CLSS public final static !enum javax.lang.model.util.Elements$Origin outer javax.lang.model.util.Elements fld public final static javax.lang.model.util.Elements$Origin EXPLICIT @@ -2360,7 +2399,7 @@ meth public static javax.lang.model.util.Elements$Origin[] values() supr java.lang.Enum CLSS public javax.lang.model.util.SimpleAnnotationValueVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() cons protected init({javax.lang.model.util.SimpleAnnotationValueVisitor14%0}) supr javax.lang.model.util.SimpleAnnotationValueVisitor9<{javax.lang.model.util.SimpleAnnotationValueVisitor14%0},{javax.lang.model.util.SimpleAnnotationValueVisitor14%1}> @@ -2408,8 +2447,14 @@ cons protected init() cons protected init({javax.lang.model.util.SimpleAnnotationValueVisitor9%0}) supr javax.lang.model.util.SimpleAnnotationValueVisitor8<{javax.lang.model.util.SimpleAnnotationValueVisitor9%0},{javax.lang.model.util.SimpleAnnotationValueVisitor9%1}> +CLSS public javax.lang.model.util.SimpleAnnotationValueVisitorPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +cons protected init({javax.lang.model.util.SimpleAnnotationValueVisitorPreview%0}) +supr javax.lang.model.util.SimpleAnnotationValueVisitor14<{javax.lang.model.util.SimpleAnnotationValueVisitorPreview%0},{javax.lang.model.util.SimpleAnnotationValueVisitorPreview%1}> + CLSS public javax.lang.model.util.SimpleElementVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() cons protected init({javax.lang.model.util.SimpleElementVisitor14%0}) meth public {javax.lang.model.util.SimpleElementVisitor14%0} visitRecordComponent(javax.lang.model.element.RecordComponentElement,{javax.lang.model.util.SimpleElementVisitor14%1}) @@ -2452,8 +2497,14 @@ cons protected init({javax.lang.model.util.SimpleElementVisitor9%0}) meth public {javax.lang.model.util.SimpleElementVisitor9%0} visitModule(javax.lang.model.element.ModuleElement,{javax.lang.model.util.SimpleElementVisitor9%1}) supr javax.lang.model.util.SimpleElementVisitor8<{javax.lang.model.util.SimpleElementVisitor9%0},{javax.lang.model.util.SimpleElementVisitor9%1}> +CLSS public javax.lang.model.util.SimpleElementVisitorPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +cons protected init({javax.lang.model.util.SimpleElementVisitorPreview%0}) +supr javax.lang.model.util.SimpleElementVisitor14<{javax.lang.model.util.SimpleElementVisitorPreview%0},{javax.lang.model.util.SimpleElementVisitorPreview%1}> + CLSS public javax.lang.model.util.SimpleTypeVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() cons protected init({javax.lang.model.util.SimpleTypeVisitor14%0}) supr javax.lang.model.util.SimpleTypeVisitor9<{javax.lang.model.util.SimpleTypeVisitor14%0},{javax.lang.model.util.SimpleTypeVisitor14%1}> @@ -2499,8 +2550,14 @@ cons protected init() cons protected init({javax.lang.model.util.SimpleTypeVisitor9%0}) supr javax.lang.model.util.SimpleTypeVisitor8<{javax.lang.model.util.SimpleTypeVisitor9%0},{javax.lang.model.util.SimpleTypeVisitor9%1}> +CLSS public javax.lang.model.util.SimpleTypeVisitorPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +cons protected init({javax.lang.model.util.SimpleTypeVisitorPreview%0}) +supr javax.lang.model.util.SimpleTypeVisitor14<{javax.lang.model.util.SimpleTypeVisitorPreview%0},{javax.lang.model.util.SimpleTypeVisitorPreview%1}> + CLSS public javax.lang.model.util.TypeKindVisitor14<%0 extends java.lang.Object, %1 extends java.lang.Object> - anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_22) + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) cons protected init() cons protected init({javax.lang.model.util.TypeKindVisitor14%0}) supr javax.lang.model.util.TypeKindVisitor9<{javax.lang.model.util.TypeKindVisitor14%0},{javax.lang.model.util.TypeKindVisitor14%1}> @@ -2550,7 +2607,14 @@ cons protected init({javax.lang.model.util.TypeKindVisitor9%0}) meth public {javax.lang.model.util.TypeKindVisitor9%0} visitNoTypeAsModule(javax.lang.model.type.NoType,{javax.lang.model.util.TypeKindVisitor9%1}) supr javax.lang.model.util.TypeKindVisitor8<{javax.lang.model.util.TypeKindVisitor9%0},{javax.lang.model.util.TypeKindVisitor9%1}> +CLSS public javax.lang.model.util.TypeKindVisitorPreview<%0 extends java.lang.Object, %1 extends java.lang.Object> + anno 0 javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion value=RELEASE_23) +cons protected init() +cons protected init({javax.lang.model.util.TypeKindVisitorPreview%0}) +supr javax.lang.model.util.TypeKindVisitor14<{javax.lang.model.util.TypeKindVisitorPreview%0},{javax.lang.model.util.TypeKindVisitorPreview%1}> + CLSS public abstract interface javax.lang.model.util.Types +meth public <%0 extends javax.lang.model.type.TypeMirror> {%%0} stripAnnotations({%%0}) meth public abstract !varargs javax.lang.model.type.DeclaredType getDeclaredType(javax.lang.model.element.TypeElement,javax.lang.model.type.TypeMirror[]) meth public abstract !varargs javax.lang.model.type.DeclaredType getDeclaredType(javax.lang.model.type.DeclaredType,javax.lang.model.element.TypeElement,javax.lang.model.type.TypeMirror[]) meth public abstract boolean contains(javax.lang.model.type.TypeMirror,javax.lang.model.type.TypeMirror) @@ -2784,6 +2848,7 @@ meth public javax.lang.model.element.Modifier getAccessLevel() meth public javax.lang.model.element.NestingKind getNestingKind() meth public javax.tools.JavaFileObject$Kind getKind() meth public long getLastModified() +meth public static javax.tools.JavaFileObject forSource(java.net.URI,java.lang.String) supr java.lang.Object CLSS public abstract interface javax.tools.StandardJavaFileManager diff --git a/java/libs.javacapi/nbproject/project.properties b/java/libs.javacapi/nbproject/project.properties index 4d6a5759701e..7f4167c096dd 100644 --- a/java/libs.javacapi/nbproject/project.properties +++ b/java/libs.javacapi/nbproject/project.properties @@ -19,6 +19,6 @@ build.compiler.deprecation=false is.autoload=true javadoc.title=Javac API nbm.module.author=Petr Hrebejk -spec.version.base=8.49.0 +spec.version.base=8.50.0 javadoc.arch=${basedir}/arch.xml module.javadoc.packages=com.sun.source.tree,com.sun.source.util diff --git a/java/libs.javacapi/nbproject/project.xml b/java/libs.javacapi/nbproject/project.xml index 00cb13d7bae5..cc24468a24ea 100644 --- a/java/libs.javacapi/nbproject/project.xml +++ b/java/libs.javacapi/nbproject/project.xml @@ -40,11 +40,11 @@ - external/nb-javac-jdk-22.0.1+8-api.jar + external/nb-javac-jdk-23+35-api.jar - external/nb-javac-jdk-22.0.1+8.jar + external/nb-javac-jdk-23+35.jar diff --git a/java/libs.nbjavacapi/external/binaries-list b/java/libs.nbjavacapi/external/binaries-list index bf8129d49f78..7e227e986c7d 100644 --- a/java/libs.nbjavacapi/external/binaries-list +++ b/java/libs.nbjavacapi/external/binaries-list @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -07266A99C001F11616B36F5128EB78D2242F3096 com.dukescript.nbjavac:nb-javac:jdk-22.0.1+8:api -D8B9FE09D677A6D589BA3C1E5AD636AF7F47AEE2 com.dukescript.nbjavac:nb-javac:jdk-22.0.1+8 +22634F5884CE6835660FB01C2B2D2D27AFB96A50 http://lahoda.info/nb-javac/23%2B35-extra/nb-javac-jdk-23+35-api.jar nb-javac-jdk-23+35-api.jar +D6E98991F58ABADC2272EFE6FBB7772705832AB0 http://lahoda.info/nb-javac/23%2B35-extra/nb-javac-jdk-23+35-impl.jar nb-javac-jdk-23+35.jar diff --git a/java/libs.javacapi/external/nb-javac-jdk-22.0.1+8-license.txt b/java/libs.nbjavacapi/external/nb-javac-jdk-23+35-license.txt similarity index 99% rename from java/libs.javacapi/external/nb-javac-jdk-22.0.1+8-license.txt rename to java/libs.nbjavacapi/external/nb-javac-jdk-23+35-license.txt index 2fe171364534..e1852eaac70c 100644 --- a/java/libs.javacapi/external/nb-javac-jdk-22.0.1+8-license.txt +++ b/java/libs.nbjavacapi/external/nb-javac-jdk-23+35-license.txt @@ -1,10 +1,10 @@ Name: Javac Compiler Implementation Description: Javac Compiler Implementation -Version: jdk-22.0.1+8 -Files: nb-javac-jdk-22.0.1+8-api.jar nb-javac-jdk-22.0.1+8.jar +Version: 23+35 +Files: nb-javac-jdk-23+35-api.jar nb-javac-jdk-23+35.jar License: GPL-2-CP -Origin: OpenJDK (https://github.com/openjdk/jdk22u) -Source: https://github.com/openjdk/jdk22u +Origin: OpenJDK (https://github.com/openjdk/jdk) +Source: https://github.com/openjdk/jdk Type: optional,reviewed Comment: The binary has been reviewed to be under the Classpath Exception as a whole. Optional at runtime, but used by default. diff --git a/java/libs.nbjavacapi/manifest.mf b/java/libs.nbjavacapi/manifest.mf index 4ce3f08ce66b..8568a6a4fd9d 100644 --- a/java/libs.nbjavacapi/manifest.mf +++ b/java/libs.nbjavacapi/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.libs.nbjavacapi OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/nbjavac/api/Bundle.properties -OpenIDE-Module-Specification-Version: 21.3 +OpenIDE-Module-Specification-Version: 21.4 OpenIDE-Module-Hide-Classpath-Packages: com.sun.javadoc.**, com.sun.source.**, javax.annotation.processing.**, javax.lang.model.**, javax.tools.**, com.sun.tools.javac.** com.sun.tools.javac.**, com.sun.tools.javadoc.**, com.sun.tools.javap.**, com.sun.tools.classfile.**, com.sun.tools.doclint.** OpenIDE-Module-Fragment-Host: org.netbeans.libs.javacapi OpenIDE-Module-Provides: org.netbeans.libs.nbjavac diff --git a/java/libs.nbjavacapi/nbproject/project.properties b/java/libs.nbjavacapi/nbproject/project.properties index 984e04c2ae7d..0f160110e608 100644 --- a/java/libs.nbjavacapi/nbproject/project.properties +++ b/java/libs.nbjavacapi/nbproject/project.properties @@ -18,8 +18,8 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial license.file.override=${nb_all}/nbbuild/licenses/GPL-2-CP -release.external/nb-javac-jdk-22.0.1+8-api.jar=modules/ext/nb-javac-jdk-22u1-8-api.jar -release.external/nb-javac-jdk-22.0.1+8.jar=modules/ext/nb-javac-jdk-22u1-8.jar +release.external/nb-javac-jdk-23+35-api.jar=modules/ext/nb-javac-jdk-23-30-api.jar +release.external/nb-javac-jdk-23+35.jar=modules/ext/nb-javac-jdk-23-30.jar # for tests requires.nb.javac=true diff --git a/java/libs.nbjavacapi/nbproject/project.xml b/java/libs.nbjavacapi/nbproject/project.xml index cd2641f524d1..580a3eaf8e5a 100644 --- a/java/libs.nbjavacapi/nbproject/project.xml +++ b/java/libs.nbjavacapi/nbproject/project.xml @@ -45,12 +45,12 @@ - ext/nb-javac-jdk-22u1-8-api.jar - external/nb-javac-jdk-22.0.1+8-api.jar + ext/nb-javac-jdk-23-30-api.jar + external/nb-javac-jdk-23+35-api.jar - ext/nb-javac-jdk-22u1-8.jar - external/nb-javac-jdk-22.0.1+8.jar + ext/nb-javac-jdk-23-30.jar + external/nb-javac-jdk-23+35.jar diff --git a/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties b/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties index 25d08eb6130b..6ebee3d11081 100644 --- a/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties +++ b/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties @@ -18,6 +18,6 @@ OpenIDE-Module-Display-Category=Java OpenIDE-Module-Long-Description=\ This library provides a Java language parser for the IDE. \ - Supports JDK-22 features. + Supports JDK-23 features. OpenIDE-Module-Name=The nb-javac Java editing support library OpenIDE-Module-Short-Description=The nb-javac Java editing support library diff --git a/java/libs.springframework/manifest.mf b/java/libs.springframework/manifest.mf index 51b74f6272ad..721066227bf0 100644 --- a/java/libs.springframework/manifest.mf +++ b/java/libs.springframework/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module: org.netbeans.libs.springframework/1 OpenIDE-Module-Layer: org/netbeans/libs/springframework/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/springframework/Bundle.properties OpenIDE-Module-Provides: org.springframework.Library -OpenIDE-Module-Specification-Version: 1.62 +OpenIDE-Module-Specification-Version: 1.63 diff --git a/java/maven.checkstyle/manifest.mf b/java/maven.checkstyle/manifest.mf index 1c7501e493c3..0be2e52f942d 100644 --- a/java/maven.checkstyle/manifest.mf +++ b/java/maven.checkstyle/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.maven.checkstyle OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/checkstyle/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 diff --git a/java/maven.coverage/manifest.mf b/java/maven.coverage/manifest.mf index 9a73589707a4..d3f7d3019639 100644 --- a/java/maven.coverage/manifest.mf +++ b/java/maven.coverage/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.coverage OpenIDE-Module-Layer: org/netbeans/modules/maven/coverage/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/coverage/Bundle.properties -OpenIDE-Module-Specification-Version: 1.48 +OpenIDE-Module-Specification-Version: 1.49 AutoUpdate-Show-In-Client: false diff --git a/java/maven.embedder/manifest.mf b/java/maven.embedder/manifest.mf index 58a4fba39725..1502b07115e1 100644 --- a/java/maven.embedder/manifest.mf +++ b/java/maven.embedder/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.embedder/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/embedder/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 2.80 +OpenIDE-Module-Specification-Version: 2.81 diff --git a/java/maven.embedder/nbproject/project.properties b/java/maven.embedder/nbproject/project.properties index bb898d782a35..9ffd2ba29fcc 100644 --- a/java/maven.embedder/nbproject/project.properties +++ b/java/maven.embedder/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. is.autoload=true -javac.source=1.8 +javac.release=17 javac.compilerargs=-Xlint -Xlint:-serial release.external/jdom2-2.0.6.1.jar=modules/ext/maven/jdom2-2.0.6.1.jar release.external/maven-dependency-tree-2.2.jar=modules/ext/maven/maven-dependency-tree-2.2.jar diff --git a/java/maven.embedder/nbproject/project.xml b/java/maven.embedder/nbproject/project.xml index 86f9fd349e50..81b654d8ad71 100644 --- a/java/maven.embedder/nbproject/project.xml +++ b/java/maven.embedder/nbproject/project.xml @@ -141,7 +141,6 @@ - org.javeleon.netbeans org.nbheaven.sqe.core.maven org.nbheaven.sqe.core.maven3 diff --git a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/DependencyTreeFactory.java b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/DependencyTreeFactory.java index be01e6e54490..01251a25e088 100644 --- a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/DependencyTreeFactory.java +++ b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/DependencyTreeFactory.java @@ -19,7 +19,7 @@ package org.netbeans.modules.maven.embedder; import java.util.Collection; -import java.util.Collections; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.maven.MavenExecutionException; @@ -45,7 +45,7 @@ public class DependencyTreeFactory { @Deprecated public static DependencyNode createDependencyTree(MavenProject project, MavenEmbedder embedder, String scope) { try { - return createDependencyTree(project, embedder, Collections.singleton(scope)); + return createDependencyTree(project, embedder, List.of(scope)); } catch (MavenExecutionException ex) { LOG.log(Level.INFO, "Dependency tree scan failed", ex); return null; diff --git a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderConfiguration.java b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderConfiguration.java index 07208d8d068b..19f2f2d4da18 100644 --- a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderConfiguration.java +++ b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderConfiguration.java @@ -27,39 +27,26 @@ * * @author mkleint */ -class EmbedderConfiguration { - private final PlexusContainer cont; - private final Properties props; - private final boolean offline; - private final File settingsXml; - private final Properties userprops; - - EmbedderConfiguration(PlexusContainer cont, Properties props, Properties userprops, boolean offline, File settingsXml) { - this.cont = cont; - this.props = props; - this.offline = offline; - this.settingsXml = settingsXml; - this.userprops = userprops; - } +record EmbedderConfiguration(PlexusContainer container, Properties systemProps, Properties userProps, boolean offline, File settingsXml) { Properties getSystemProperties() { - return props; + return systemProps(); } - + Properties getUserProperties() { - return userprops; + return userProps(); } PlexusContainer getContainer() { - return cont; + return container(); } public boolean isOffline() { - return offline; + return offline(); } File getSettingsXml() { - return settingsXml; + return settingsXml(); } } diff --git a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderFactory.java b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderFactory.java index 88e1d2d10591..752f59fd4ae2 100644 --- a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderFactory.java +++ b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/EmbedderFactory.java @@ -60,35 +60,33 @@ public final class EmbedderFactory { //same prop constant in MavenSettings.java static final String PROP_DEFAULT_OPTIONS = "defaultOptions"; - private static final Set forbidden = new HashSet(); - static { - forbidden.add("netbeans.logger.console"); //NOI18N - forbidden.add("java.util.logging.config.class"); //NOI18N - forbidden.add("netbeans.autoupdate.language"); //NOI18N - forbidden.add("netbeans.dirs"); //NOI18N - forbidden.add("netbeans.home"); //NOI18N - forbidden.add("sun.awt.exception.handler"); //NOI18N - forbidden.add("org.openide.TopManager.GUI"); //NOI18N - forbidden.add("org.openide.major.version"); //NOI18N - forbidden.add("netbeans.autoupdate.variant"); //NOI18N - forbidden.add("netbeans.dynamic.classpath"); //NOI18N - forbidden.add("netbeans.autoupdate.country"); //NOI18N - forbidden.add("netbeans.hash.code"); //NOI18N - forbidden.add("org.openide.TopManager"); //NOI18N - forbidden.add("org.openide.version"); //NOI18N - forbidden.add("netbeans.buildnumber"); //NOI18N - forbidden.add("javax.xml.parsers.DocumentBuilderFactory"); //NOI18N - forbidden.add("javax.xml.parsers.SAXParserFactory"); //NOI18N - forbidden.add("rave.build"); //NOI18N - forbidden.add("netbeans.accept_license_class"); //NOI18N - forbidden.add("rave.version"); //NOI18N - forbidden.add("netbeans.autoupdate.version"); //NOI18N - forbidden.add("netbeans.importclass"); //NOI18N - forbidden.add("netbeans.user"); //NOI18N -// forbidden.add("java.class.path"); -// forbidden.add("https.nonProxyHosts"); - - } + private static final Set forbidden = Set.of( + "netbeans.logger.console", //NOI18N + "java.util.logging.config.class", //NOI18N + "netbeans.autoupdate.language", //NOI18N + "netbeans.dirs", //NOI18N + "netbeans.home", //NOI18N + "sun.awt.exception.handler", //NOI18N + "org.openide.TopManager.GUI", //NOI18N + "org.openide.major.version", //NOI18N + "netbeans.autoupdate.variant", //NOI18N + "netbeans.dynamic.classpath", //NOI18N + "netbeans.autoupdate.country", //NOI18N + "netbeans.hash.code", //NOI18N + "org.openide.TopManager", //NOI18N + "org.openide.version", //NOI18N + "netbeans.buildnumber", //NOI18N + "javax.xml.parsers.DocumentBuilderFactory", //NOI18N + "javax.xml.parsers.SAXParserFactory", //NOI18N + "rave.build", //NOI18N + "netbeans.accept_license_class", //NOI18N + "rave.version", //NOI18N + "netbeans.autoupdate.version", //NOI18N + "netbeans.importclass", //NOI18N + "netbeans.user" //NOI18N +// "java.class.path", +// "https.nonProxyHosts" + ); private static final Logger LOG = Logger.getLogger(EmbedderFactory.class.getName()); @@ -100,31 +98,24 @@ public final class EmbedderFactory { private static final RequestProcessor RP = new RequestProcessor("Maven Embedder warmup"); - private static final RequestProcessor.Task warmupTask = RP.create(new Runnable() { - @Override - public void run() { - //#211158 after being reset, recreate the instance for followup usage. - //makes the performance stats of the project embedder after resetting more predictable - getProjectEmbedder(); - } - }); + //#211158 after being reset, recreate the instance for followup usage. + //makes the performance stats of the project embedder after resetting more predictable + private static final RequestProcessor.Task warmupTask = RP.create(EmbedderFactory::getProjectEmbedder); static { - RP.post(new Runnable() { - @Override - public void run() { //#228379 - OpenProjects.getDefault().addProjectGroupChangeListener(new ProjectGroupChangeListener() { - @Override - public void projectGroupChanging(ProjectGroupChangeEvent event) { - resetCachedEmbedders(); - } - - @Override - public void projectGroupChanged(ProjectGroupChangeEvent event) { - } - }); - } + RP.post(() -> { //#228379 + OpenProjects.getDefault().addProjectGroupChangeListener(new ProjectGroupChangeListener() { + @Override + public void projectGroupChanging(ProjectGroupChangeEvent event) { + resetCachedEmbedders(); + } + @Override + public void projectGroupChanged(ProjectGroupChangeEvent event) {} + }); }); + // start initialization; guice can take a while the first time it runs + // if something calls getProjectEmbedder() in the mean time, this is becomes a no-op + warmupTask.schedule(100); } private EmbedderFactory() { @@ -236,7 +227,7 @@ public static void setGroupedMavenHome(ProjectGroup grp, File path) { static Map getCustomGlobalUserProperties() { //maybe set org.eclipse.aether.ConfigurationProperties.USER_AGENT with netbeans specific value. - Map toRet = new HashMap(); + Map toRet = new HashMap<>(); String options = getPreferences().get(PROP_DEFAULT_OPTIONS, ""); try { diff --git a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/MavenEmbedder.java b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/MavenEmbedder.java index 7f36705d0693..9cbd3924315c 100644 --- a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/MavenEmbedder.java +++ b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/MavenEmbedder.java @@ -142,8 +142,8 @@ public final class MavenEmbedder { settingsDecrypter = plexus.lookup(SettingsDecrypter.class); VersionResolver vr = plexus.lookup(VersionResolver.class); - if (vr instanceof NbVersionResolver2) { - versionResolver = (NbVersionResolver2)vr; + if (vr instanceof NbVersionResolver2 vr2) { + versionResolver = vr2; } else { versionResolver = null; } @@ -454,7 +454,7 @@ public MavenExecutionResult execute(MavenExecutionRequest req) { */ public List createModelLineage(File pom) throws ModelBuildingException { ModelBuildingResult res = executeModelBuilder(pom); - List toRet = new ArrayList(); + List toRet = new ArrayList<>(); for (String id : res.getModelIds()) { Model m = res.getRawModel(id); @@ -550,12 +550,12 @@ public List getLifecyclePhases() { LifecycleMapping lifecycleMapping = lookupComponent(LifecycleMapping.class); if (lifecycleMapping != null) { - Set phases = new TreeSet(); + Set phases = new TreeSet<>(); Map lifecycles = lifecycleMapping.getLifecycles(); for (Lifecycle lifecycle : lifecycles.values()) { phases.addAll(lifecycle.getPhases().keySet()); } - return new ArrayList(phases); + return new ArrayList<>(phases); } return Collections.emptyList(); diff --git a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/NBRepositoryModelResolver.java b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/NBRepositoryModelResolver.java index df9839131eca..84681bf36364 100644 --- a/java/maven.embedder/src/org/netbeans/modules/maven/embedder/NBRepositoryModelResolver.java +++ b/java/maven.embedder/src/org/netbeans/modules/maven/embedder/NBRepositoryModelResolver.java @@ -34,7 +34,6 @@ import org.apache.maven.model.resolution.ModelResolver; import org.apache.maven.model.resolution.UnresolvableModelException; import org.apache.maven.repository.RepositorySystem; -import org.openide.util.Exceptions; /** * @@ -44,7 +43,7 @@ class NBRepositoryModelResolver implements ModelResolver { private final MavenEmbedder embedder; - private List remoteRepositories = new ArrayList(); + private List remoteRepositories = new ArrayList<>(); NBRepositoryModelResolver(MavenEmbedder embedder) { @@ -53,7 +52,7 @@ class NBRepositoryModelResolver private NBRepositoryModelResolver(NBRepositoryModelResolver original) { this(original.embedder); - this.remoteRepositories = new ArrayList(original.remoteRepositories); + this.remoteRepositories = new ArrayList<>(original.remoteRepositories); } @Override @@ -72,10 +71,8 @@ public ModelSource resolveModel(String groupId, String artifactId, String versio Artifact artifactParent = embedder.lookupComponent(RepositorySystem.class).createProjectArtifact(groupId, artifactId, version); try { embedder.resolveArtifact(artifactParent, remoteRepositories, embedder.getLocalRepository()); - } catch (ArtifactResolutionException ex) { + } catch (ArtifactResolutionException | ArtifactNotFoundException ex) { throw new UnresolvableModelException(ex.getMessage(), groupId , artifactId , version ); - } catch (ArtifactNotFoundException ex) { - throw new UnresolvableModelException( ex.getMessage(), groupId , artifactId , version ); } return new FileModelSource(artifactParent.getFile()); diff --git a/java/maven.grammar/nbproject/project.properties b/java/maven.grammar/nbproject/project.properties index acdcfae07f41..0a580ae21550 100644 --- a/java/maven.grammar/nbproject/project.properties +++ b/java/maven.grammar/nbproject/project.properties @@ -17,4 +17,4 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.72.0 +spec.version.base=1.73.0 diff --git a/java/maven.graph/manifest.mf b/java/maven.graph/manifest.mf index 2154645919ac..e3c6e065cf98 100644 --- a/java/maven.graph/manifest.mf +++ b/java/maven.graph/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.maven.graph/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/graph/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 diff --git a/java/maven.hints/manifest.mf b/java/maven.hints/manifest.mf index 2ed6c42a0c3a..bc75cef75002 100644 --- a/java/maven.hints/manifest.mf +++ b/java/maven.hints/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.hints/1 -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/hints/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/maven/hints/layer.xml AutoUpdate-Show-In-Client: false diff --git a/java/maven.indexer.ui/manifest.mf b/java/maven.indexer.ui/manifest.mf index 331163241bc2..f986596ae3ab 100644 --- a/java/maven.indexer.ui/manifest.mf +++ b/java/maven.indexer.ui/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/indexer/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 2.59 +OpenIDE-Module-Specification-Version: 2.60 OpenIDE-Module: org.netbeans.modules.maven.indexer.ui/2 diff --git a/java/maven.indexer/external/binaries-list b/java/maven.indexer/external/binaries-list index bfde38daa870..3bf16d031787 100644 --- a/java/maven.indexer/external/binaries-list +++ b/java/maven.indexer/external/binaries-list @@ -14,13 +14,12 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -6B6780786C8FBF64FE4C809BBAC2CE4FD5D996C4 org.apache.maven.indexer:indexer-core:7.1.3 -7AB214FA5A675719E011F514939E52C010F049F6 org.apache.maven.indexer:search-api:7.1.3 -58A364CECD56F04A55D2F0C932DF879C7168C4C3 org.apache.maven.indexer:search-backend-smo:7.1.3 -2E487755A6814B2A1BC770C26569DCBA86873DCF org.apache.lucene:lucene-core:9.11.0 -DB385446BC3FD70E7C6A744276C0A157BD60EE0A org.apache.lucene:lucene-backward-codecs:9.11.0 -44ACCDC03C5482E602718F7BF91E5940BA4E4870 org.apache.lucene:lucene-highlighter:9.11.0 -E97FE1C0D102EDB8D6E1C01454992FD2B8D80AE0 org.apache.lucene:lucene-queryparser:9.11.0 -75A0A333CF1E043102743066C929E65FE51CBCDA org.apache.lucene:lucene-analysis-common:9.11.0 +7016F3B87E39E3C83B656C7C65E04C578127B266 org.apache.maven.indexer:indexer-core:7.1.4 +A4C838B4FF86F0327DA4715F9F8D2AA1D6C51633 org.apache.maven.indexer:search-api:7.1.4 +9D55FF1A2CCE7988615CF56ED69702C2C7FA5031 org.apache.maven.indexer:search-backend-smo:7.1.4 +8F52BA14B21774F41CE33CF5CA111CBDEFEED7F9 org.apache.lucene:lucene-core:9.11.1 +948FDA53CEEB0FA1B835AF5376ABEC771B2C3FB1 org.apache.lucene:lucene-backward-codecs:9.11.1 +E16CC9C531998A76EB5528147B5F07596F95FAD8 org.apache.lucene:lucene-highlighter:9.11.1 +AD6E5B135E1E284D4462D717086CE13A3CE01B4A org.apache.lucene:lucene-queryparser:9.11.1 +51286ACA019DB66311F71496191B4BD7ADAF3DCF org.apache.lucene:lucene-analysis-common:9.11.1 934C04D3CFEF185A8008E7BF34331B79730A9D43 javax.annotation:javax.annotation-api:1.3.2 -527175CA6D81050B53BDD4C457A6D6E017626B0E com.google.code.gson:gson:2.11.0 diff --git a/java/maven.indexer/external/indexer-core-7.1.3-license.txt b/java/maven.indexer/external/indexer-core-7.1.4-license.txt similarity index 99% rename from java/maven.indexer/external/indexer-core-7.1.3-license.txt rename to java/maven.indexer/external/indexer-core-7.1.4-license.txt index fe17e6a79b8f..c7f3b0812e67 100644 --- a/java/maven.indexer/external/indexer-core-7.1.3-license.txt +++ b/java/maven.indexer/external/indexer-core-7.1.4-license.txt @@ -1,11 +1,11 @@ Name: Maven Indexer Description: Maven remote repository indexing engine. -Version: 7.1.3 +Version: 7.1.4 Origin: Apache Software Foundation License: Apache-2.0 URL: https://repo.maven.apache.org/maven2/org/apache/maven/indexer/ Source: https://github.com/apache/maven-indexer -Files: indexer-core-7.1.3.jar search-api-7.1.3.jar search-backend-smo-7.1.3.jar +Files: indexer-core-7.1.4.jar search-api-7.1.4.jar search-backend-smo-7.1.4.jar Apache License Version 2.0, January 2004 diff --git a/java/maven.indexer/external/indexer-core-7.1.3-notice.txt b/java/maven.indexer/external/indexer-core-7.1.4-notice.txt similarity index 100% rename from java/maven.indexer/external/indexer-core-7.1.3-notice.txt rename to java/maven.indexer/external/indexer-core-7.1.4-notice.txt diff --git a/java/maven.indexer/external/lucene-9.11.0-license.txt b/java/maven.indexer/external/lucene-9.11.1-license.txt similarity index 99% rename from java/maven.indexer/external/lucene-9.11.0-license.txt rename to java/maven.indexer/external/lucene-9.11.1-license.txt index 6373bf4d691b..dc7a9bf3f2cf 100644 --- a/java/maven.indexer/external/lucene-9.11.0-license.txt +++ b/java/maven.indexer/external/lucene-9.11.1-license.txt @@ -1,11 +1,11 @@ Name: Apache Lucene Description: Java-based indexing and search technology -Version: 9.11.0 +Version: 9.11.1 Origin: Apache Software Foundation License: Apache-2.0-lucene2 URL: https://lucene.apache.org/ Source: https://github.com/apache/lucene -Files: lucene-analysis-common-9.11.0.jar lucene-backward-codecs-9.11.0.jar lucene-core-9.11.0.jar lucene-highlighter-9.11.0.jar lucene-queryparser-9.11.0.jar +Files: lucene-analysis-common-9.11.1.jar lucene-backward-codecs-9.11.1.jar lucene-core-9.11.1.jar lucene-highlighter-9.11.1.jar lucene-queryparser-9.11.1.jar Apache License Version 2.0, January 2004 diff --git a/java/maven.indexer/external/lucene-9.11.0-notice.txt b/java/maven.indexer/external/lucene-9.11.1-notice.txt similarity index 100% rename from java/maven.indexer/external/lucene-9.11.0-notice.txt rename to java/maven.indexer/external/lucene-9.11.1-notice.txt diff --git a/java/maven.indexer/manifest.mf b/java/maven.indexer/manifest.mf index bca3d34af33b..4fe8a7d5c11c 100644 --- a/java/maven.indexer/manifest.mf +++ b/java/maven.indexer/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/indexer/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 2.65 +OpenIDE-Module-Specification-Version: 2.66 OpenIDE-Module: org.netbeans.modules.maven.indexer/2 diff --git a/java/maven.indexer/nbproject/project.properties b/java/maven.indexer/nbproject/project.properties index d84d52c6e8a0..58ca4b59f6d6 100644 --- a/java/maven.indexer/nbproject/project.properties +++ b/java/maven.indexer/nbproject/project.properties @@ -17,17 +17,16 @@ test.config.stableBTD.includes=**/*Test.class is.autoload=true -javac.release=11 +javac.release=17 javac.compilerargs=-Xlint -Xlint:-serial -release.external/indexer-core-7.1.3.jar=modules/ext/maven/indexer-core-7.1.3.jar -release.external/search-api-7.1.3.jar=modules/ext/maven/search-api-7.1.3.jar -release.external/search-backend-smo-7.1.3.jar=modules/ext/maven/search-backend-smo-7.1.3.jar -release.external/gson-2.11.0.jar=modules/ext/maven/gson-2.11.0.jar -release.external/lucene-core-9.11.0.jar=modules/ext/maven/lucene-core-9.11.0.jar -release.external/lucene-backward-codecs-9.11.0.jar=modules/ext/maven/lucene-backward-codecs-9.11.0.jar -release.external/lucene-highlighter-9.11.0.jar=modules/ext/maven/lucene-highlighter-9.11.0.jar -release.external/lucene-queryparser-9.11.0.jar=modules/ext/maven/lucene-queryparser-9.11.0.jar -release.external/lucene-analysis-common-9.11.0.jar=modules/ext/maven/lucene-analysis-common-9.11.0.jar +release.external/indexer-core-7.1.4.jar=modules/ext/maven/indexer-core-7.1.4.jar +release.external/search-api-7.1.4.jar=modules/ext/maven/search-api-7.1.4.jar +release.external/search-backend-smo-7.1.4.jar=modules/ext/maven/search-backend-smo-7.1.4.jar +release.external/lucene-core-9.11.1.jar=modules/ext/maven/lucene-core-9.11.1.jar +release.external/lucene-backward-codecs-9.11.1.jar=modules/ext/maven/lucene-backward-codecs-9.11.1.jar +release.external/lucene-highlighter-9.11.1.jar=modules/ext/maven/lucene-highlighter-9.11.1.jar +release.external/lucene-queryparser-9.11.1.jar=modules/ext/maven/lucene-queryparser-9.11.1.jar +release.external/lucene-analysis-common-9.11.1.jar=modules/ext/maven/lucene-analysis-common-9.11.1.jar release.external/javax.annotation-api-1.3.2.jar=modules/ext/maven/javax.annotation-api-1.3.2.jar # XXX so long as Lucene is bundled here: sigtest.gen.fail.on.error=false diff --git a/java/maven.indexer/nbproject/project.xml b/java/maven.indexer/nbproject/project.xml index 29b8f32128b2..34b285a36fd0 100644 --- a/java/maven.indexer/nbproject/project.xml +++ b/java/maven.indexer/nbproject/project.xml @@ -25,6 +25,10 @@ org.netbeans.modules.maven.indexer + + com.google.gson + + org.netbeans.api.annotations.common @@ -176,45 +180,41 @@ org.netbeans.modules.maven.indexer.spi.impl - ext/maven/indexer-core-7.1.3.jar - external/indexer-core-7.1.3.jar + ext/maven/indexer-core-7.1.4.jar + external/indexer-core-7.1.4.jar - ext/maven/search-api-7.1.3.jar - external/search-api-7.1.3.jar + ext/maven/search-api-7.1.4.jar + external/search-api-7.1.4.jar - ext/maven/search-backend-smo-7.1.3.jar - external/search-backend-smo-7.1.3.jar + ext/maven/search-backend-smo-7.1.4.jar + external/search-backend-smo-7.1.4.jar - ext/maven/lucene-core-9.11.0.jar - external/lucene-core-9.11.0.jar + ext/maven/lucene-core-9.11.1.jar + external/lucene-core-9.11.1.jar - ext/maven/lucene-backward-codecs-9.11.0.jar - external/lucene-backward-codecs-9.11.0.jar + ext/maven/lucene-backward-codecs-9.11.1.jar + external/lucene-backward-codecs-9.11.1.jar - ext/maven/lucene-highlighter-9.11.0.jar - external/lucene-highlighter-9.11.0.jar + ext/maven/lucene-highlighter-9.11.1.jar + external/lucene-highlighter-9.11.1.jar - ext/maven/lucene-queryparser-9.11.0.jar - external/lucene-queryparser-9.11.0.jar + ext/maven/lucene-queryparser-9.11.1.jar + external/lucene-queryparser-9.11.1.jar - ext/maven/lucene-analysis-common-9.11.0.jar - external/lucene-analysis-common-9.11.0.jar + ext/maven/lucene-analysis-common-9.11.1.jar + external/lucene-analysis-common-9.11.1.jar ext/maven/javax.annotation-api-1.3.2.jar external/javax.annotation-api-1.3.2.jar - - ext/maven/gson-2.11.0.jar - external/gson-2.11.0.jar -
diff --git a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/CompositeResult.java b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/CompositeResult.java index 4d73b7f6f1a8..31fcb028ae3d 100644 --- a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/CompositeResult.java +++ b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/CompositeResult.java @@ -19,7 +19,6 @@ package org.netbeans.modules.maven.indexer; import java.util.List; -import java.util.stream.Collectors; import org.netbeans.modules.maven.indexer.spi.ResultImplementation; /** @@ -27,13 +26,7 @@ * * @author mbien */ -final class CompositeResult implements ResultImplementation { - - private final List> results; - - public CompositeResult(List> results) { - this.results = results; - } +record CompositeResult(List> results) implements ResultImplementation { public CompositeResult(ResultImplementation first, ResultImplementation second) { this(List.of(first, second)); @@ -62,7 +55,7 @@ public List getResults() { .flatMap(r -> r.getResults().stream()) .sorted() .distinct() - .collect(Collectors.toList()); + .toList(); } @Override diff --git a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java index 4bf573797f47..93580fda9da1 100644 --- a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java +++ b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java @@ -75,6 +75,7 @@ import org.apache.maven.search.api.SearchRequest; import org.apache.maven.search.api.request.FieldQuery; import org.apache.maven.search.api.request.Paging; +import org.apache.maven.search.api.transport.Java11HttpClientTransport; import org.apache.maven.search.backend.smo.SmoSearchBackend; import org.apache.maven.search.backend.smo.SmoSearchBackendFactory; import org.apache.maven.settings.Proxy; @@ -102,7 +103,6 @@ import org.codehaus.plexus.component.repository.ComponentDescriptor; import org.codehaus.plexus.component.repository.ComponentRequirement; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; -import org.codehaus.plexus.util.FileUtils; import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.modules.maven.embedder.EmbedderFactory; @@ -182,8 +182,8 @@ public class NexusRepositoryIndexerImpl implements RepositoryIndexerImplementati * For remote repo download and indexing tasks. */ private static final RequestProcessor RP_REMOTE = new RequestProcessor("maven-remote-indexing"); - - private final SmoSearchBackend smo = SmoSearchBackendFactory.createDefault(); + + private SmoSearchBackend smo = null; @Override public boolean handlesRepository(RepositoryInfo repo) { @@ -361,7 +361,7 @@ private boolean loadIndexingContext(final RepositoryInfo info) throws IOExceptio ); } else { creators = List.of( - info.getId().equals(smo.getRepositoryId()) + info.getId().equals(getSMO().getRepositoryId()) ? new MinimalArtifactInfoRemoteIndexCreator() : new MinimalArtifactInfoIndexCreator(), new NotifyingIndexCreator() @@ -418,14 +418,14 @@ private boolean loadIndexingContext(final RepositoryInfo info) throws IOExceptio int MAX_MAX_CLAUSE = 1<<11; // conservative maximum for too general queries, like "c:*class*" - if (q instanceof BooleanQuery) { - List list = ((BooleanQuery)q).clauses(); + if (q instanceof BooleanQuery booleanQuery) { + List list = booleanQuery.clauses(); if (list.size() == 1) { Query q1 = list.get(0).getQuery(); - if (q1 instanceof PrefixQuery && "u".equals(((PrefixQuery)q1).getPrefix().field())) { + if (q1 instanceof PrefixQuery pq && "u".equals(pq.getPrefix().field())) { // increase for queries like "+u:org.netbeans.modules|*" to succeed MAX_MAX_CLAUSE = 1<<16; - } else if (q1 instanceof TermQuery && "p".equals(((TermQuery) q1).getTerm().field())) { + } else if (q1 instanceof TermQuery tq && "p".equals(tq.getTerm().field())) { // +p:nbm also produces several thousand hits MAX_MAX_CLAUSE = 1<<16; } @@ -525,9 +525,7 @@ private void indexLoadedRepo(final RepositoryInfo repo, boolean updateLocal) thr } // MINDEXER-42: cannot use WagonHelper.getWagonResourceFetcher Wagon wagon = embedder.lookup(Wagon.class, protocol); - if (wagon instanceof HttpWagon) { //#216401 - HttpWagon httpwagon = (HttpWagon) wagon; - //#215343 + if (wagon instanceof HttpWagon httpwagon) { //#215343 Properties p = new Properties(); p.setProperty("User-Agent", "netBeans/" + System.getProperty("netbeans.buildnumber")); httpwagon.setHttpHeaders(p); @@ -613,7 +611,7 @@ private void indexLoadedRepo(final RepositoryInfo repo, boolean updateLocal) thr try { // Ensure no stale cache files are left removeGroupCache(repo); - scan(indexingContext, null, repoListener, updateLocal); + scanLocalRepo(indexingContext, null, repoListener, updateLocal); storeGroupCache(repo, indexingContext); } finally { repoListener.close(); @@ -796,34 +794,34 @@ public void shutdownAll() { * @see DefaultScannerListener * @see #artifactDiscovered(ArtifactContext, IndexingContext) */ - private void scan(IndexingContext context, String fromPath, ArtifactScanningListener listener, boolean update) throws IOException { + private void scanLocalRepo(IndexingContext context, String fromPath, ArtifactScanningListener listener, boolean update) throws IOException { File repositoryDirectory = context.getRepository(); if (repositoryDirectory == null) { return; // nothing to scan } - + if (!repositoryDirectory.exists()) { throw new IOException( "Repository directory " + repositoryDirectory + " does not exist" ); } - + // always use cache directory when reindexing - File tmpDir = new File(Places.getCacheDirectory(), "tmp-" + context.getRepositoryId()); - if (!tmpDir.mkdirs()) { - throw new IOException( "Cannot create temporary directory: " + tmpDir ); + Path tmpDir = Places.getCacheDirectory().toPath().resolve("tmp-" + context.getRepositoryId()); + if (Files.exists(tmpDir)) { + removeDir(tmpDir); } - File tmpFile = new File(tmpDir, context.getId() + "-tmp"); // TODO: purpose of file? - + Files.createDirectory(tmpDir); + IndexingContext tmpContext = null; try { - FSDirectory directory = FSDirectory.open(tmpDir.toPath()); + FSDirectory directory = FSDirectory.open(tmpDir); if (update) { IndexUtils.copyDirectory(context.getIndexDirectory(), directory); } tmpContext = new DefaultIndexingContext( context.getId() + "-tmp", context.getRepositoryId(), context.getRepository(), - tmpDir, + tmpDir.toFile(), context.getRepositoryUrl(), context.getIndexUpdateUrl(), context.getIndexCreators(), @@ -840,10 +838,7 @@ private void scan(IndexingContext context, String fromPath, ArtifactScanningList if (tmpContext != null) { tmpContext.close( true ); } - if (tmpFile.exists()) { - tmpFile.delete(); - } - FileUtils.deleteDirectory(tmpDir); + removeDir(tmpDir); } } @@ -1214,7 +1209,7 @@ private ResultImplementation getVersions(final String groupId, fi public ResultImplementation findVersionsByClass(final String className, List repos) { Optional central = repos.stream() - .filter(repo -> repo.getId().equals(smo.getRepositoryId())) + .filter(repo -> repo.getId().equals(getSMO().getRepositoryId())) .findFirst(); // remote index contains no class data -> use web service @@ -1227,7 +1222,7 @@ public ResultImplementation findVersionsByClass(final String clas org.apache.maven.search.api.MAVEN.FQ_CLASS_NAME : org.apache.maven.search.api.MAVEN.CLASS_NAME, className)); - return new CompositeResult<>(findVersionsByClass(className, otherRepos), new SMORequestResult(smo, request)); + return new CompositeResult<>(findVersionsByClass(className, otherRepos), new SMORequestResult(getSMO(), request)); } else { ResultImpl result = new ResultImpl<>((ResultImpl result1) -> { findVersionsByClass(className, result1, result1.getSkipped(), false); @@ -1383,7 +1378,7 @@ private static void convertToNBGroupInfo(Collection artifactInfos public ResultImplementation findBySHA1(final String sha1, List repos) { Optional central = repos.stream() - .filter(repo -> repo.getId().equals(smo.getRepositoryId())) + .filter(repo -> repo.getId().equals(getSMO().getRepositoryId())) .findFirst(); // remote index contains no sh1 data -> use web service @@ -1394,7 +1389,7 @@ public ResultImplementation findBySHA1(final String sha1, List(findBySHA1(sha1, otherRepos), new SMORequestResult(smo, request)); + return new CompositeResult<>(findBySHA1(sha1, otherRepos), new SMORequestResult(getSMO(), request)); } else { ResultImpl result = new ResultImpl<>((ResultImpl result1) -> { findBySHA1(sha1, result1, result1.getSkipped(), false); @@ -1748,30 +1743,22 @@ static NBVersionInfo convertToNBVersionInfo(ArtifactInfo ai) { } private static Query setBooleanRewrite (final Query q) { - if (q instanceof MultiTermQuery) { - ((MultiTermQuery)q).setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_REWRITE); - } else if (q instanceof BooleanQuery) { - for (BooleanClause c : ((BooleanQuery)q).clauses()) { + if (q instanceof MultiTermQuery multiTermQuery) { + multiTermQuery.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_REWRITE); + } else if (q instanceof BooleanQuery booleanQuery) { + for (BooleanClause c : booleanQuery.clauses()) { setBooleanRewrite(c.getQuery()); } } return q; } - private static class SkippedAction implements RepoAction { - - private final ResultImpl result; - - private SkippedAction(ResultImpl result) { - this.result = result; - } - + private record SkippedAction(ResultImpl result) implements RepoAction { @Override public void run(RepositoryInfo repo, IndexingContext context) throws IOException { //indexing context is always null here.. result.addSkipped(repo); } - } private static class NoJavadocSourceFilter implements ArtifactInfoFilter { @@ -1846,21 +1833,24 @@ private static void rebuildGroupCache(RepositoryInfo repo, IndexingContext conte }); } - // somewhat based on maven-indexer impl (in WagonHelper) prior to removal in maven-indexer 7.0.0 - private static class WagonFetcher implements ResourceFetcher { + private synchronized SmoSearchBackend getSMO() { + if (smo == null) { + smo = SmoSearchBackendFactory.create( + SmoSearchBackendFactory.DEFAULT_BACKEND_ID, + SmoSearchBackendFactory.DEFAULT_REPOSITORY_ID, + SmoSearchBackendFactory.DEFAULT_SMO_URI, + new Java11HttpClientTransport(SMORequestResult.REQUEST_TIMEOUT) + ); + } + return smo; + } - private final TransferListener listener; - private final AuthenticationInfo authenticationInfo; - private final ProxyInfo proxyInfo; - private final Wagon wagon; + // somewhat based on maven-indexer impl (in WagonHelper) prior to removal in maven-indexer 7.0.0 + private record WagonFetcher(Wagon wagon, TransferListener listener, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) implements ResourceFetcher { - public WagonFetcher(Wagon wagon, TransferListener listener, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) { + public WagonFetcher { Objects.requireNonNull(wagon); Objects.requireNonNull(listener); - this.wagon = wagon; - this.listener = listener; - this.authenticationInfo = authenticationInfo; - this.proxyInfo = proxyInfo; } @Override diff --git a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/OnStop.java b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/OnStop.java index fdf2bfa183ed..3004e3cc79fe 100644 --- a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/OnStop.java +++ b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/OnStop.java @@ -46,8 +46,8 @@ public void run() { } } for (RepositoryIndexerImplementation rii : Lookup.getDefault().lookupAll(RepositoryIndexerImplementation.class)) { - if (rii instanceof NexusRepositoryIndexerImpl) { - ((NexusRepositoryIndexerImpl)rii).shutdownAll(); + if (rii instanceof NexusRepositoryIndexerImpl impl) { + impl.shutdownAll(); } } } diff --git a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/SMORequestResult.java b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/SMORequestResult.java index b84c7f5c82f5..deb4f95d0bdc 100644 --- a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/SMORequestResult.java +++ b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/SMORequestResult.java @@ -19,12 +19,13 @@ package org.netbeans.modules.maven.indexer; import java.io.IOException; +import java.time.Duration; +import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.stream.Collectors; import org.apache.maven.search.api.MAVEN; import org.apache.maven.search.api.SearchRequest; import org.apache.maven.search.backend.smo.SmoSearchBackend; @@ -43,7 +44,10 @@ final class SMORequestResult implements ResultImplementation { // if we paginate too much we will get throttled private static final int MAX_PAGES = 10; - private static final long TIMEOUT = 20_000; + + // response time is fairly unpredictable + static final Duration REQUEST_TIMEOUT = Duration.ofSeconds(15); + private static final Duration SEARCH_TIMEOUT = Duration.ofSeconds(20); private final SmoSearchBackend smo; private SmoSearchResponse response; @@ -58,7 +62,7 @@ public SMORequestResult(SmoSearchBackend smo, SearchRequest request) { } catch (IOException ex) { LOG.log(Level.INFO, "SMO "+request+" failed", ex); this.response = null; - this.list = Collections.emptyList(); + this.list = List.of(); } } @@ -76,7 +80,7 @@ public List getResults() { null, null, rec.getValue(MAVEN.CLASSIFIER))) - .collect(Collectors.toList()); + .toList(); } return list; } @@ -87,9 +91,9 @@ public void waitForSkipped() { return; } List fullList = new ArrayList<>(getResults()); - long start = System.currentTimeMillis(); + Instant timeout = Instant.now().plus(SEARCH_TIMEOUT); int page = 0; - while (isPartial() && page++ < MAX_PAGES && (System.currentTimeMillis()-start) < TIMEOUT) { + while (isPartial() && page++ < MAX_PAGES && Instant.now().isBefore(timeout)) { list = null; try { response = search(response.getSearchRequest().nextPage()); diff --git a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/api/PluginIndexManager.java b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/api/PluginIndexManager.java index 2ef834d67b8c..643636547740 100644 --- a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/api/PluginIndexManager.java +++ b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/api/PluginIndexManager.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -265,7 +264,7 @@ public static Set getPluginsForGoalPrefix(String prefix) throws Exceptio qf.setValue(prefix); qf.setOccur(QueryField.OCCUR_MUST); qf.setMatch(QueryField.MATCH_EXACT); - for (NBVersionInfo v : RepositoryQueries.findResult(Collections.singletonList(qf), null).getResults()) { + for (NBVersionInfo v : RepositoryQueries.findResult(List.of(qf), null).getResults()) { result.add(v.getGroupId() + '|' + v.getArtifactId() + '|' + v.getVersion()); } // This is more complete but much too slow: diff --git a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/api/RepositoryQueries.java b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/api/RepositoryQueries.java index 6a8e8fd26a94..4bc380b5233d 100644 --- a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/api/RepositoryQueries.java +++ b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/api/RepositoryQueries.java @@ -225,12 +225,8 @@ private static Map> getQueryP for (RepositoryInfo repo : repos) { for (RepositoryIndexQueryProvider idx : idxs) { if(idx.handlesRepository(repo)) { - List mappedRepos = qp2Repo.get(idx); - if(mappedRepos == null) { - mappedRepos = new LinkedList<>(); - qp2Repo.put(idx, mappedRepos); - } - mappedRepos.add(repo); + qp2Repo.computeIfAbsent(idx, k -> new LinkedList<>()) + .add(repo); break; } } diff --git a/java/maven.junit.ui/manifest.mf b/java/maven.junit.ui/manifest.mf index a3038f66163f..5755bf29f80c 100644 --- a/java/maven.junit.ui/manifest.mf +++ b/java/maven.junit.ui/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.junit.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/junit/ui/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.maven.junit.ui.MavenJUnitManagerProvider -OpenIDE-Module-Specification-Version: 1.30 +OpenIDE-Module-Specification-Version: 1.31 diff --git a/java/maven.junit/manifest.mf b/java/maven.junit/manifest.mf index 692eb21b2df7..8f8a08fc9e15 100644 --- a/java/maven.junit/manifest.mf +++ b/java/maven.junit/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.junit/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/junit/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.59 +OpenIDE-Module-Specification-Version: 1.60 diff --git a/java/maven.kit/manifest.mf b/java/maven.kit/manifest.mf index e2cee69eed07..7e93fd470cff 100644 --- a/java/maven.kit/manifest.mf +++ b/java/maven.kit/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.kit/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/feature/Bundle.properties OpenIDE-Module-Recommends: org.netbeans.modules.testng.maven.MavenTestNGSupport,org.netbeans.modules.maven.junit.ui.MavenJUnitManagerProvider,org.netbeans.modules.selenium2.maven.Selenium2MavenSupportImpl -OpenIDE-Module-Specification-Version: 4.56 +OpenIDE-Module-Specification-Version: 4.57 diff --git a/java/maven.model/manifest.mf b/java/maven.model/manifest.mf index e10a0031c2f4..91a33f295348 100644 --- a/java/maven.model/manifest.mf +++ b/java/maven.model/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.model/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/model/Bundle.properties -OpenIDE-Module-Specification-Version: 1.69 +OpenIDE-Module-Specification-Version: 1.70 diff --git a/java/maven.model/nbproject/project.xml b/java/maven.model/nbproject/project.xml index c118d385cefe..a540053f228b 100644 --- a/java/maven.model/nbproject/project.xml +++ b/java/maven.model/nbproject/project.xml @@ -209,7 +209,6 @@ - org.javeleon.netbeans org.netbeans.modules.groovy.support org.netbeans.modules.hudson.maven org.netbeans.modules.licensechanger diff --git a/java/maven.osgi/manifest.mf b/java/maven.osgi/manifest.mf index 4abd72031d0c..3535006b8045 100644 --- a/java/maven.osgi/manifest.mf +++ b/java/maven.osgi/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.maven.osgi/1 OpenIDE-Module-Layer: org/netbeans/modules/maven/osgi/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/osgi/Bundle.properties -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.61 diff --git a/java/maven.persistence/manifest.mf b/java/maven.persistence/manifest.mf index ee5c08d2c23c..684a789eb5f9 100644 --- a/java/maven.persistence/manifest.mf +++ b/java/maven.persistence/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.persistence/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/persistence/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 diff --git a/java/maven.refactoring/nbproject/project.properties b/java/maven.refactoring/nbproject/project.properties index 6b0f64a806c4..38fe04b6fb04 100644 --- a/java/maven.refactoring/nbproject/project.properties +++ b/java/maven.refactoring/nbproject/project.properties @@ -17,4 +17,4 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial requires.nb.javac=true -spec.version.base=1.46.0 +spec.version.base=1.47.0 diff --git a/java/maven.repository/manifest.mf b/java/maven.repository/manifest.mf index 6f35e0ae35f2..38f2ea8ac3b8 100644 --- a/java/maven.repository/manifest.mf +++ b/java/maven.repository/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.repository/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/repository/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.67 +OpenIDE-Module-Specification-Version: 1.68 diff --git a/java/maven.search/manifest.mf b/java/maven.search/manifest.mf index e43c071f1d4f..134e424b5e5f 100644 --- a/java/maven.search/manifest.mf +++ b/java/maven.search/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.maven.search OpenIDE-Module-Layer: org/netbeans/modules/maven/search/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/search/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 diff --git a/java/maven.spring/manifest.mf b/java/maven.spring/manifest.mf index ce03f46ece49..e059d4f5beca 100644 --- a/java/maven.spring/manifest.mf +++ b/java/maven.spring/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.maven.spring/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/spring/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 diff --git a/java/maven/nbproject/project.properties b/java/maven/nbproject/project.properties index c365a502454f..71afaef0e985 100644 --- a/java/maven/nbproject/project.properties +++ b/java/maven/nbproject/project.properties @@ -21,7 +21,7 @@ javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml javahelp.hs=maven.hs extra.module.files=maven-nblib/ -spec.version.base=2.164.0 +spec.version.base=2.165.0 # The CPExtender test fails in library processing (not randomly) since NetBeans 8.2; disabling. test.excludes=**/CPExtenderTest.class diff --git a/java/maven/nbproject/project.xml b/java/maven/nbproject/project.xml index e65ec33f4930..ea75fb0bd078 100644 --- a/java/maven/nbproject/project.xml +++ b/java/maven/nbproject/project.xml @@ -611,7 +611,6 @@ - org.javeleon.netbeans org.nbheaven.sqe.core.maven org.nbheaven.sqe.core.maven3 diff --git a/java/maven/src/org/netbeans/modules/maven/ActionProviderImpl.java b/java/maven/src/org/netbeans/modules/maven/ActionProviderImpl.java index f30e0a491aca..617801f26ecb 100644 --- a/java/maven/src/org/netbeans/modules/maven/ActionProviderImpl.java +++ b/java/maven/src/org/netbeans/modules/maven/ActionProviderImpl.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -35,6 +34,7 @@ import javax.swing.Action; import javax.swing.JMenu; import javax.swing.JMenuItem; +import javax.swing.JSeparator; import javax.swing.SwingUtilities; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.versioning.ComparableVersion; @@ -45,9 +45,7 @@ import org.netbeans.api.project.ProjectInformation; import org.netbeans.api.project.ProjectUtils; import org.netbeans.api.project.ui.OpenProjects; -import static org.netbeans.modules.maven.Bundle.*; import org.netbeans.modules.maven.api.Constants; -import org.netbeans.modules.maven.api.MavenConfiguration; import org.netbeans.modules.maven.api.ModelUtils; import org.netbeans.modules.maven.api.ModuleInfoUtils; import org.netbeans.modules.maven.api.NbMavenProject; @@ -72,6 +70,7 @@ import org.netbeans.modules.maven.model.pom.POMModel; import org.netbeans.modules.maven.operations.Operations; import org.netbeans.modules.maven.options.MavenSettings; +import org.netbeans.modules.maven.options.SettingsPanel; import org.netbeans.modules.maven.spi.actions.AbstractMavenActionsProvider; import org.netbeans.modules.maven.spi.actions.ActionConvertor; import org.netbeans.modules.maven.spi.actions.MavenActionsProvider; @@ -79,9 +78,9 @@ 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.netbeans.spi.project.ProjectServiceProvider; import org.netbeans.spi.project.SingleMethod; +import org.netbeans.spi.project.ui.CustomizerProvider2; import org.netbeans.spi.project.ui.support.DefaultProjectOperations; import org.netbeans.spi.project.ui.support.ProjectSensitiveActions; import org.openide.DialogDescriptor; @@ -106,6 +105,8 @@ import org.openide.util.lookup.Lookups; import org.openide.util.lookup.ProxyLookup; +import static org.netbeans.modules.maven.Bundle.*; + /** * * @author Milos Kleint @@ -185,7 +186,7 @@ protected M2Configuration usedConfiguration(boolean useActive, Lookup ctx) { @Override public String[] getSupportedActions() { - Set supp = new HashSet(); + Set supp = new HashSet<>(); supp.addAll( Arrays.asList(supported)); M2ConfigProvider configs = proj.getLookup().lookup(M2ConfigProvider.class); @@ -196,7 +197,7 @@ public String[] getSupportedActions() { supp.addAll( added); } } - return supp.toArray(new String[0]); + return supp.toArray(String[]::new); } private boolean usingSurefire28() { @@ -275,11 +276,8 @@ private void invokeAction(final String action, final Lookup lookup, boolean chec } if (SwingUtilities.isEventDispatchThread()) { - RP.post(new Runnable() { - @Override - public void run() { - invokeAction(action, lookup, false); - } + RP.post(() -> { + invokeAction(action, lookup, false); }); return; } @@ -364,9 +362,7 @@ public void run() { Utilities.performPOMModelOperations( proj.getProjectDirectory().getFileObject("pom.xml"), - Collections.singletonList(new UpdateSurefireOperation( - surefireVersion, junitVersion - )) + List.of(new UpdateSurefireOperation(surefireVersion, junitVersion)) ); //this appears to run too fast, before the resolved model is updated. // SwingUtilities.invokeLater(new Runnable() { @@ -412,7 +408,7 @@ private boolean checkCompilerPlugin(final String action) { RequestProcessor.getDefault().post(() -> { Utilities.performPOMModelOperations( proj.getProjectDirectory().getFileObject("pom.xml"), - Collections.singletonList(new UpdateCompilerOperation())); + List.of(new UpdateCompilerOperation())); }); return false; // false means do not continue } @@ -423,7 +419,7 @@ private boolean checkCompilerPlugin(final String action) { } public static Map replacements(Project proj, String action, Lookup lookup) { - Map replacements = new HashMap(); + Map replacements = new HashMap<>(); for (ReplaceTokenProvider prov : proj.getLookup().lookupAll(ReplaceTokenProvider.class)) { replacements.putAll(prov.createReplacements(action, lookup)); } @@ -549,13 +545,10 @@ public void actionPerformed(java.awt.event.ActionEvent e) { if (!showUI) { final M2ConfigProvider conf = proj.getLookup().lookup(M2ConfigProvider.class); - RP.post(new Runnable() { - @Override - public void run() { - ModelRunConfig rc = createCustomRunConfig(conf); - setupTaskName("custom", rc, context); - RunUtils.run(rc); - } + RP.post(() -> { + ModelRunConfig rc = createCustomRunConfig(conf); + setupTaskName("custom", rc, context); + RunUtils.run(rc); }); return; } @@ -574,39 +567,33 @@ public void run() { } maps.getActions().add(mapping); final String remembered = pnl.isRememberedAs(); - final Boolean offline = Boolean.valueOf(pnl.isOffline()); + final Boolean offline = pnl.isOffline(); final boolean debug = pnl.isShowDebug(); final boolean recursive = pnl.isRecursive(); final boolean updateSnapshots = pnl.isUpdateSnapshots(); - RP.post(new Runnable() { - @Override - public void run() { - M2ConfigProvider conf = proj.getLookup().lookup(M2ConfigProvider.class); - ActionToGoalUtils.writeMappingsToFileAttributes(proj.getProjectDirectory(), maps); - if (remembered != null) { - try { - - String tit = "CUSTOM-" + remembered; //NOI18N - mapping.setActionName(tit); - mapping.setDisplayName(remembered); - //TODO shall we write to configuration based files or not? - ModelHandle2.putMapping(mapping, proj, conf.getDefaultConfig()); - } catch (IOException ex) { - LOG.log(Level.INFO, "Cannot write custom action mapping", ex); - } + RP.post(() -> { + M2ConfigProvider conf = proj.getLookup().lookup(M2ConfigProvider.class); + ActionToGoalUtils.writeMappingsToFileAttributes(proj.getProjectDirectory(), maps); + if (remembered != null) { + try { + String tit = "CUSTOM-" + remembered; //NOI18N + mapping.setActionName(tit); + mapping.setDisplayName(remembered); + //TODO shall we write to configuration based files or not? + ModelHandle2.putMapping(mapping, proj, conf.getDefaultConfig()); + } catch (IOException ex) { + LOG.log(Level.INFO, "Cannot write custom action mapping", ex); } - ModelRunConfig rc = createCustomRunConfig(conf); - rc.setOffline(offline); - rc.setShowDebug(debug); - rc.setRecursive(recursive); - rc.setUpdateSnapshots(updateSnapshots); - - setupTaskName("custom", rc, Lookup.EMPTY); //NOI18N - RunUtils.run(rc); } + ModelRunConfig rc = createCustomRunConfig(conf); + rc.setOffline(offline); + rc.setShowDebug(debug); + rc.setRecursive(recursive); + rc.setUpdateSnapshots(updateSnapshots); + setupTaskName("custom", rc, Lookup.EMPTY); //NOI18N + RunUtils.run(rc); }); - } } @@ -615,11 +602,11 @@ private ModelRunConfig createCustomRunConfig(M2ConfigProvider conf) { ModelRunConfig rc = new ModelRunConfig(proj, mapping, mapping.getActionName(), null, Lookup.EMPTY, false); //#171086 also inject profiles from currently selected configuratiin - List acts = new ArrayList(); + List acts = new ArrayList<>(); acts.addAll(rc.getActivatedProfiles()); acts.addAll(conf.getActiveConfiguration().getActivatedProfiles()); rc.setActivatedProfiles(acts); - Map props = new HashMap(rc.getProperties()); + Map props = new HashMap<>(rc.getProperties()); props.putAll(conf.getActiveConfiguration().getProperties()); rc.addProperties(props); rc.setTaskDisplayName(TXT_Build(proj.getLookup().lookup(NbMavenProject.class).getMavenProject().getArtifactId())); @@ -627,6 +614,36 @@ private ModelRunConfig createCustomRunConfig(M2ConfigProvider conf) { } } + @Messages("LBL_Edit_project_goals=Edit Project Goals...") + private final static class EditProjectGoalsAction extends AbstractAction { + + private final Project project; + + private EditProjectGoalsAction(Project project) { + putValue(Action.NAME, LBL_Edit_project_goals()); + this.project = project; + } + + @Override + public void actionPerformed(ActionEvent ae) { + CustomizerProvider2 provider = project.getLookup().lookup(CustomizerProvider2.class); + provider.showCustomizer(ModelHandle2.PANEL_MAPPING, null); + } + } + + @Messages("LBL_Edit_global_goals=Edit Global Goals...") + private final static class EditGlobalGoalsAction extends AbstractAction { + + private EditGlobalGoalsAction() { + putValue(Action.NAME, LBL_Edit_global_goals()); + } + + @Override + public void actionPerformed(ActionEvent ae) { + SettingsPanel.showGlobalMavenGoalCustomizer(); + } + } + // XXX should this be an API somewhere? private abstract static class ConditionallyShownAction extends AbstractAction implements ContextAwareAction { protected boolean triggeredOnFile = false; @@ -744,47 +761,50 @@ public void actionPerformed(java.awt.event.ActionEvent e) { @Messages({ "LBL_Loading=Loading...", - "LBL_Custom_run_goals=Goals..." + "LBL_Custom_run_goals=Other Goals..." }) @Override public JMenuItem getPopupPresenter() { - final JMenu menu = new JMenu(onFile ? LBL_Custom_Run_File() : LBL_Custom_Run()); - final JMenuItem loading = new JMenuItem(LBL_Loading()); + JMenu menu = new JMenu(onFile ? LBL_Custom_Run_File() : LBL_Custom_Run()); + JMenuItem loading = new JMenuItem(LBL_Loading()); menu.add(loading); /*using lazy construction strategy*/ - RP.post(new Runnable() { - - @Override - public void run() { - NetbeansActionMapping[] maps; - if (onFile && !onPom) { - maps = ActionToGoalUtils.getActiveCustomMappingsForFile(proj.getLookup().lookup(NbMavenProjectImpl.class)); - } else { - maps = ActionToGoalUtils.getActiveCustomMappings(proj.getLookup().lookup(NbMavenProjectImpl.class)); + RP.post(() -> { + NetbeansActionMapping[] maps; + if (onFile && !onPom) { + maps = ActionToGoalUtils.getActiveCustomMappingsForFile(proj.getLookup().lookup(NbMavenProjectImpl.class)); + } else { + maps = ActionToGoalUtils.getActiveCustomMappings(proj.getLookup().lookup(NbMavenProjectImpl.class)); + } + List acts = new ArrayList<>(); + for (NetbeansActionMapping mapp : maps) { + Action act = createCustomMavenAction(mapp.getActionName(), mapp, false, lookup, proj); + act.putValue(NAME, mapp.getDisplayName() == null ? mapp.getActionName() : mapp.getDisplayName()); + acts.add(act); + } + acts.add(createCustomMavenAction(LBL_Custom_run_goals(), new NetbeansActionMapping(), true, lookup, proj)); + acts.add(new EditProjectGoalsAction(proj)); + acts.add(new EditGlobalGoalsAction()); + SwingUtilities.invokeLater(() -> { + boolean selected = menu.isSelected(); + menu.remove(loading); + for (Action a : acts) { + menu.add(new JMenuItem(a)); } - final List acts = new ArrayList(); - for (NetbeansActionMapping mapp : maps) { - Action act = createCustomMavenAction(mapp.getActionName(), mapp, false, lookup, proj); - act.putValue(NAME, mapp.getDisplayName() == null ? mapp.getActionName() : mapp.getDisplayName()); - acts.add(act); + // before edit actions + if (menu.getItemCount() > 3) { + menu.add(new JSeparator(), menu.getItemCount() - 3); } - acts.add(createCustomMavenAction(LBL_Custom_run_goals(), new NetbeansActionMapping(), true, lookup, proj)); - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - boolean selected = menu.isSelected(); - menu.remove(loading); - for (Action a : acts) { - menu.add(new JMenuItem(a)); - } - menu.getPopupMenu().pack(); - menu.repaint(); - menu.updateUI(); - menu.setSelected(selected); - } - }); - } + // between run and edit actions + if (menu.getItemCount() > 2) { + menu.add(new JSeparator(), menu.getItemCount() - 2); + } + menu.getPopupMenu().pack(); + menu.repaint(); + menu.updateUI(); + menu.setSelected(selected); + }); }, 100); return menu; } @@ -813,15 +833,11 @@ public CloseSubprojectsAction(NbMavenProjectImpl project) { putValue(Action.NAME, ACT_CloseRequired()); } public @Override void actionPerformed(ActionEvent e) { - RP.post(new Runnable() { - @Override - public void run() { - Set res = ProjectUtils.getContainedProjects(project, true); - Project[] arr = res.toArray(new Project[0]); - OpenProjects.getDefault().close(arr); - } + RP.post(() -> { + Set res = ProjectUtils.getContainedProjects(project, true); + Project[] arr = res.toArray(Project[]::new); + OpenProjects.getDefault().close(arr); }); - } } @@ -842,8 +858,6 @@ public UpdateSurefireOperation(@NullAllowed String newSurefirePluginVersion, @Nu this.newJUnit = newJUnit; } - - @Override public void performOperation(POMModel model) { org.netbeans.modules.maven.model.pom.Project prj = model.getProject(); diff --git a/java/maven/src/org/netbeans/modules/maven/ModuleInfoSupport.java b/java/maven/src/org/netbeans/modules/maven/ModuleInfoSupport.java index 0917e6ea525a..53f101878a10 100644 --- a/java/maven/src/org/netbeans/modules/maven/ModuleInfoSupport.java +++ b/java/maven/src/org/netbeans/modules/maven/ModuleInfoSupport.java @@ -235,7 +235,7 @@ static void addRequires(FileObject moduleInfo, List newModules) { src.runModificationTask((WorkingCopy copy) -> { copy.toPhase(JavaSource.Phase.RESOLVED); TreeMaker tm = copy.getTreeMaker(); - ModuleTree modle = (ModuleTree) copy.getCompilationUnit().getModule(); + ModuleTree modle = copy.getCompilationUnit().getModule(); ModuleTree newModle = modle; for (String mName : mNames) { newModle = tm.addModuleDirective(newModle, tm.Requires(false, false, tm.QualIdent(mName))); diff --git a/java/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.form b/java/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.form index 03bde265f64a..0513c5bdc32e 100644 --- a/java/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.form +++ b/java/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.form @@ -60,7 +60,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -240,7 +240,7 @@ - + @@ -329,7 +329,7 @@ - + diff --git a/java/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.java b/java/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.java index cd8198b7ef99..2857a09fc613 100644 --- a/java/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.java +++ b/java/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.java @@ -108,7 +108,7 @@ public class ActionMappings extends javax.swing.JPanel implements HelpCtx.Provid private static final RequestProcessor RP = new RequestProcessor(ActionMappings.class); private NbMavenProjectImpl project; private ModelHandle2 handle; - private final HashMap titles = new HashMap(); + private final HashMap titles = new HashMap<>(); private final GoalsListener goalsListener; private final TextValueCompleter goalcompleter; @@ -222,12 +222,10 @@ public Component getListCellRendererComponent(JList list, Object value, int inde loadMappings(); clearFields(); - comboListener = new ActionListener() { - @Override public void actionPerformed(ActionEvent e) { - clearFields(); - loadMappings(); - addListeners(); - } + comboListener = (ActionEvent e) -> { + clearFields(); + loadMappings(); + addListeners(); }; } @@ -269,7 +267,7 @@ public void addNotify() { addListeners(); RP.post(new Runnable() { @Override public void run() { - final Set strs = new HashSet(); + final Set strs = new HashSet<>(); final GoalsProvider provider = Lookup.getDefault().lookup(GoalsProvider.class); if (provider != null) { strs.addAll(provider.getAvailableGoals()); @@ -288,12 +286,10 @@ public void addNotify() { } final List profiles = allProfiles; - SwingUtilities.invokeLater(new Runnable() { - @Override public void run() { - goalcompleter.setValueList(strs, false); //do not bother about partial results, too many intermediate apis.. - if (profiles != null) { - profilecompleter.setValueList(profiles, false); - } + SwingUtilities.invokeLater(() -> { + goalcompleter.setValueList(strs, false); //do not bother about partial results, too many intermediate apis.. + if (profiles != null) { + profilecompleter.setValueList(profiles, false); } }); } @@ -348,6 +344,7 @@ private void initComponents() { gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 4; gridBagConstraints.gridheight = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.ipadx = 427; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(0, 18, 0, 12); @@ -426,6 +423,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { gridBagConstraints.gridy = 7; gridBagConstraints.gridwidth = 4; gridBagConstraints.gridheight = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.ipadx = 455; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(18, 18, 0, 12); @@ -446,6 +444,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { gridBagConstraints.gridy = 9; gridBagConstraints.gridwidth = 4; gridBagConstraints.gridheight = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.ipadx = 455; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(6, 18, 0, 12); @@ -494,8 +493,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { gridBagConstraints.ipadx = 436; gridBagConstraints.ipady = 120; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 18, 0, 12); add(jScrollPane2, gridBagConstraints); @@ -557,6 +554,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { gridBagConstraints.gridy = 11; gridBagConstraints.gridwidth = 4; gridBagConstraints.gridheight = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.ipadx = 455; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(6, 18, 0, 12); @@ -735,11 +733,11 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS } } - DefaultComboBoxModel cbModel = new DefaultComboBoxModel(allIcons.toArray(new String[0])); + DefaultComboBoxModel cbModel = new DefaultComboBoxModel<>(allIcons.toArray(String[]::new)); boolean hasAvailable; if (cbModel.getSize() != 0) { hasAvailable = true; - JComboBox cb = new JComboBox(); + JComboBox cb = new JComboBox<>(); cb.setModel(cbModel); pnl.add(cb); cb.setRenderer(new DefaultListCellRenderer() { @@ -983,7 +981,7 @@ private void writeProperties(final NetbeansActionMapping mapp) { public static Map convertStringToActionProperties(String text) { PropertySplitter split = new PropertySplitter(text); String tok = split.nextPair(); - Map props = new LinkedHashMap(); + Map props = new LinkedHashMap<>(); while (tok != null) { String[] prp = StringUtils.split(tok, "=", 2); //NOI18N if (prp.length >= 1 ) { @@ -998,7 +996,7 @@ public static Map convertStringToActionProperties(String text) { if (key.endsWith("=")) { key = key.substring(0, key.length() - 1); } - if (key.trim().length() > 0 && Verifier.checkElementName(key.trim()) == null) { + if (!key.isBlank() && Verifier.checkElementName(key.trim()) == null) { props.put(key.trim(), prp.length > 1 ? prp[1] : ""); } } @@ -1203,7 +1201,7 @@ protected MappingWrapper doUpdate() { String text = txtGoals.getText(); StringTokenizer tok = new StringTokenizer(text, " "); //NOI18N NetbeansActionMapping mapp = wr.getMapping(); - List goals = new ArrayList(); + List goals = new ArrayList<>(); while (tok.hasMoreTokens()) { String token = tok.nextToken(); goals.add(token); @@ -1228,7 +1226,7 @@ protected MappingWrapper doUpdate() { String text = txtProfiles.getText(); StringTokenizer tok = new StringTokenizer(text, " ,"); //NOI18N NetbeansActionMapping mapp = wr.getMapping(); - List profs = new ArrayList(); + List profs = new ArrayList<>(); while (tok.hasMoreTokens()) { String token = tok.nextToken(); profs.add(token); @@ -1250,7 +1248,7 @@ protected MappingWrapper doUpdate() { String text = txtPackagings.getText().trim(); StringTokenizer tok = new StringTokenizer(text, " ,"); //NOI18N NetbeansActionMapping mapp = wr.getMapping(); - List packs = new ArrayList(); + List packs = new ArrayList<>(); while (tok.hasMoreTokens()) { String token = tok.nextToken(); packs.add(token.trim()); @@ -1415,7 +1413,7 @@ public void actionPerformed(ActionEvent e) { if (expr != null) { String props = area.getText(); String sep = "\n";//NOI18N - if (props.endsWith("\n") || props.trim().length() == 0) {//NOI18N + if (props.endsWith("\n") || props.isBlank()) {//NOI18N sep = "";//NOI18N } props = props + sep + expr + "="; //NOI18N @@ -1441,7 +1439,7 @@ static class EnvVarAction extends AbstractAction { @Override public void actionPerformed(ActionEvent e) { String props = area.getText(); String sep = "\n";//NOI18N - if (props.endsWith("\n") || props.trim().length() == 0) {//NOI18N + if (props.endsWith("\n") || props.isBlank()) {//NOI18N sep = "";//NOI18N } props = props + sep + "Env.FOO=bar"; //NOI18N @@ -1498,7 +1496,7 @@ static class JdkAction extends AbstractAction { @Override public void actionPerformed(ActionEvent e) { String props = area.getText(); String sep = "\n";//NOI18N - if (props.endsWith("\n") || props.trim().length() == 0) {//NOI18N + if (props.endsWith("\n") || props.isBlank()) {//NOI18N sep = "";//NOI18N } String val = "Env.JAVA_HOME=" + value; @@ -1584,7 +1582,7 @@ private static void replacePattern(String pattern, JTextComponent area, String r } } else { String sep = "\n";//NOI18N - if (props.endsWith("\n") || props.trim().length() == 0) {//NOI18N + if (props.endsWith("\n") || props.isBlank()) {//NOI18N sep = "";//NOI18N } props = props + sep + replace; //NOI18N @@ -1620,7 +1618,7 @@ private static class NonEmptyInputLine extends NotifyDescriptor.InputLine implem } private void checkValid () { - setValid(textField.getText() != null && textField.getText().trim().length() > 0); + setValid(textField.getText() != null && !textField.getText().isBlank()); } } diff --git a/java/maven/src/org/netbeans/modules/maven/execute/ActionToGoalUtils.java b/java/maven/src/org/netbeans/modules/maven/execute/ActionToGoalUtils.java index e277393c1369..f7663eb7c200 100644 --- a/java/maven/src/org/netbeans/modules/maven/execute/ActionToGoalUtils.java +++ b/java/maven/src/org/netbeans/modules/maven/execute/ActionToGoalUtils.java @@ -26,9 +26,11 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; import org.apache.maven.model.Build; import org.netbeans.modules.maven.spi.actions.MavenActionsProvider; import org.netbeans.modules.maven.NbMavenProjectImpl; @@ -41,7 +43,6 @@ import org.netbeans.modules.maven.api.FileUtilities; import org.netbeans.modules.maven.api.NbMavenProject; import org.netbeans.modules.maven.api.execute.ExecutionContext; -import org.netbeans.modules.maven.api.execute.RunUtils; import org.netbeans.modules.maven.execute.model.ActionToGoalMapping; import org.netbeans.modules.maven.execute.model.NetbeansActionMapping; import org.netbeans.modules.maven.execute.model.io.xpp3.NetbeansBuildActionXpp3Reader; @@ -95,7 +96,7 @@ private ActionToGoalUtils() { * @since 2.50 */ public static @NonNull List actionProviders(@NonNull Project project) { - List providers = new ArrayList(); + List providers = new ArrayList<>(); providers.addAll(project.getLookup().lookupAll(MavenActionsProvider.class)); providers.addAll(Lookup.getDefault().lookupAll(MavenActionsProvider.class)); return providers; @@ -157,11 +158,11 @@ public static RunConfig createRunConfig(String action, NbMavenProjectImpl projec if (rc instanceof ModelRunConfig && ((ModelRunConfig)rc).isFallback()) { return rc; } - List acts = new ArrayList(); + List acts = new ArrayList<>(); acts.addAll(rc.getActivatedProfiles()); acts.addAll(requested.getActivatedProfiles()); rc.setActivatedProfiles(acts); - Map props = new HashMap(rc.getProperties()); + Map props = new HashMap<>(rc.getProperties()); props.putAll(requested.getProperties()); rc.addProperties(props); } @@ -280,8 +281,8 @@ public static NetbeansActionMapping[] getActiveCustomMappingsForFile(NbMavenProj private static NetbeansActionMapping[] getActiveCustomMappingsImpl(NbMavenProjectImpl project, boolean forFiles) { M2ConfigProvider configs = project.getLookup().lookup(M2ConfigProvider.class); - List toRet = new ArrayList(); - List names = new ArrayList(); + List toRet = new ArrayList<>(); + Set names = new HashSet<>(); // first add all project specific custom actions. for (NetbeansActionMapping map : configs.getActiveConfiguration().getCustomMappings()) { toRet.add(map); @@ -320,7 +321,7 @@ private static NetbeansActionMapping[] getActiveCustomMappingsImpl(NbMavenProjec } } - return toRet.toArray(new NetbeansActionMapping[0]); + return toRet.toArray(NetbeansActionMapping[]::new); } @@ -347,9 +348,7 @@ public static ActionToGoalMapping readMappingsFromFileAttributes(FileObject fo) NetbeansBuildActionXpp3Reader reader = new NetbeansBuildActionXpp3Reader(); try { mapp = reader.read(new StringReader(string)); - } catch (IOException ex) { - ex.printStackTrace(); - } catch (XmlPullParserException ex) { + } catch (IOException | XmlPullParserException ex) { ex.printStackTrace(); } } diff --git a/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java b/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java index 2419314862b6..df4de54c5044 100644 --- a/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java +++ b/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java @@ -25,6 +25,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.Charset; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; @@ -663,7 +664,8 @@ ProcessBuilder constructBuilder(final RunConfig clonedConfig, InputOutput ioput) File mavenHome = null; File wrapper = null; if (MavenSettings.getDefault().isPreferMavenWrapper()) { - wrapper = searchMavenWrapper(config); + // wrapper will be an absolute or relative path, do not "absolutize" after searchMavenWrapper + wrapper = searchMavenWrapper(clonedConfig); } if (wrapper != null) { constructeur = new WrapperShellConstructor(wrapper); @@ -754,11 +756,11 @@ ProcessBuilder constructBuilder(final RunConfig clonedConfig, InputOutput ioput) return builder; } - - private static void printGray(InputOutput io, String text) { + + private static void printColor(InputOutput io, String text, IOColors.OutputType style) { if (IOColorLines.isSupported(io)) { try { - IOColorLines.println(io, text, IOColors.getColor(io, IOColors.OutputType.LOG_DEBUG)); + IOColorLines.println(io, text, IOColors.getColor(io, style)); } catch (IOException ex) { Exceptions.printStackTrace(ex); } @@ -767,6 +769,10 @@ private static void printGray(InputOutput io, String text) { } } + private static void printGray(InputOutput io, String text) { + printColor(io, text, IOColors.OutputType.LOG_DEBUG); + } + private void processIssue153101(IOException x, InputOutput ioput) { //#153101 if (x.getMessage() != null && x.getMessage().contains("CreateProcess error=5")) { @@ -893,6 +899,43 @@ static boolean isMultiThreadedMaven(List params) { } return false; } + + /** + * Tries to relativize wrapper path. The execution starts in a {@link RunConfig#getExecutionDirectory() }, + * assuming one of the project or parent project directories. If wrapper is present, it should be inside + * project, so relative paths between project modules should work. This is how "normal humans" run and use + * mvnw wrapper. In addition, it avoids issues with the wrapper script when the project has a space + * in its path - there's most probably no spaces in module names - but it is NOT forbidden !! + * + * @param wrapper wrapper file + * @param config execution config + * @return relativized path, if possible. + */ + @NbBundle.Messages({ + "WARN_SpaceInPath=Warning: A space in project path or module name may prevent mvnw wrapper to function properly." + }) + private File resolveWrapperPath(File wrapper, RunConfig config) { + File absWrapper = wrapper.getAbsoluteFile(); + File executionDir = config.getExecutionDirectory(); + Path absWrapperDir = absWrapper.toPath().getParent(); + Path absDir = executionDir.getAbsoluteFile().toPath(); + + if (absWrapperDir.startsWith(absDir) || absDir.startsWith(absWrapperDir)) { + Path relative = absDir.relativize(wrapper.getAbsoluteFile().toPath()); + if (!relative.toString().contains(" ")) { // NOI18N + if (relative.getNameCount() == 1) { + // prevent searching on PATH + return Paths.get(".").resolve(relative).toFile(); // NOI18N + } else { + return relative.toFile(); + } + } + } + if (absWrapper.toString().contains(" ")) { + printColor(io, Bundle.WARN_SpaceInPath(), IOColors.OutputType.LOG_WARNING); + } + return absWrapper; + } private File searchMavenWrapper(RunConfig config) { String fileName = Utilities.isWindows() ? "mvnw.cmd" : "mvnw"; //NOI18N @@ -902,7 +945,7 @@ private File searchMavenWrapper(RunConfig config) { if (baseDir != null) { File mvnw = new File(baseDir, fileName); if (mvnw.exists()) { - return mvnw; + return resolveWrapperPath(mvnw, config); } } project = project.getParent(); @@ -914,7 +957,7 @@ private File searchMavenWrapper(RunConfig config) { private static class WrapperShellConstructor implements Constructor { private final @NonNull File wrapper; - + WrapperShellConstructor(@NonNull File wrapper) { this.wrapper = wrapper; } @@ -925,7 +968,7 @@ public List construct() { //if maven.bat file is in space containing path, we need to quote with simple quotes. String quote = "\""; List toRet = new ArrayList<>(); - toRet.add(quoteSpaces(wrapper.getAbsolutePath(), quote)); + toRet.add(quoteSpaces(wrapper.getPath(), quote)); if (Utilities.isWindows()) { //#153101, since #228901 always on windows use cmd /c toRet.add(0, "/c"); //NOI18N diff --git a/java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.form b/java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.form index 6f466a3e2ae9..d0042312af01 100644 --- a/java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.form +++ b/java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.form @@ -28,7 +28,7 @@ - + @@ -52,12 +52,19 @@ - - - - + + + + + + + + + + + + - @@ -82,36 +89,36 @@ - + - + - - + + - + - + - + - + - + @@ -120,7 +127,7 @@ - + diff --git a/java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.java b/java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.java index dac6876d176c..1680f7a2f46e 100644 --- a/java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.java +++ b/java/maven/src/org/netbeans/modules/maven/execute/ui/RunGoalsPanel.java @@ -19,7 +19,6 @@ package org.netbeans.modules.maven.execute.ui; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; @@ -50,46 +49,41 @@ public class RunGoalsPanel extends javax.swing.JPanel { private static final RequestProcessor RP = new RequestProcessor(RunGoalsPanel.class); - private List historyMappings; + private final List historyMappings; private int historyIndex = 0; private TextValueCompleter goalcompleter; - private TextValueCompleter profilecompleter; + private final TextValueCompleter profilecompleter; private NbMavenProjectImpl project; /** Creates new form RunGoalsPanel */ public RunGoalsPanel() { initComponents(); cbRememberActionPerformed(null); - historyMappings = new ArrayList(); + historyMappings = new ArrayList<>(); btnPrev.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/maven/execute/back.png", false)); //NOI18N btnNext.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/maven/execute/forward.png", false)); //NOI18N - goalcompleter = new TextValueCompleter(new ArrayList(0), txtGoals, " "); //NOI18N + goalcompleter = new TextValueCompleter(new ArrayList<>(0), txtGoals, " "); //NOI18N goalcompleter.setLoading(true); // doing lazy.. - RP.post(new Runnable() { - @Override public void run() { - GoalsProvider provider = Lookup.getDefault().lookup(GoalsProvider.class); - if (provider != null) { - final Set strs = provider.getAvailableGoals(); - try { - List phases = EmbedderFactory.getProjectEmbedder().getLifecyclePhases(); - strs.addAll(phases); - } catch (Exception e) { - // oh wel just ignore.. - e.printStackTrace(); - } - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - goalcompleter.setValueList(strs, false);//do not bother about partial results, too many intermediate apis.. - } - }); + RP.post(() -> { + GoalsProvider provider = Lookup.getDefault().lookup(GoalsProvider.class); + if (provider != null) { + Set strs = provider.getAvailableGoals(); + try { + List phases = EmbedderFactory.getProjectEmbedder().getLifecyclePhases(); + strs.addAll(phases); + } catch (Exception e) { + // oh wel just ignore.. + e.printStackTrace(); } + SwingUtilities.invokeLater(() -> { + goalcompleter.setValueList(strs, false);//do not bother about partial results, too many intermediate apis.. + }); } }); - profilecompleter = new TextValueCompleter(new ArrayList(0), txtProfiles, " "); + profilecompleter = new TextValueCompleter(new ArrayList<>(0), txtProfiles, " "); } @Override @@ -101,18 +95,12 @@ public void addNotify() { private void readProfiles(final Project mavenProject) { profilecompleter.setLoading(true); - RP.post(new Runnable() { - @Override public void run() { - ProjectProfileHandler profileHandler = mavenProject.getLookup().lookup(ProjectProfileHandler.class); - final List ret = profileHandler.getAllProfiles(); - - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - profilecompleter.setValueList(ret, false); - } - }); - } + RP.post(() -> { + ProjectProfileHandler profileHandler = mavenProject.getLookup().lookup(ProjectProfileHandler.class); + List ret = profileHandler.getAllProfiles(); + SwingUtilities.invokeLater(() -> { + profilecompleter.setValueList(ret, false); + }); }); } @@ -158,7 +146,7 @@ public void readConfig(final RunConfig config) { txtProfiles.setText(createSpaceSeparatedList(config.getActivatedProfiles())); setUpdateSnapshots(config.isUpdateSnapshots()); - setOffline(config.isOffline() != null ? config.isOffline().booleanValue() : false); + setOffline(config.isOffline() != null ? config.isOffline() : false); setRecursive(config.isRecursive()); setShowDebug(config.isShowDebug()); if(config.getProject()!=null){ @@ -182,16 +170,16 @@ private void readMapping(NetbeansActionMapping mapp) { public void applyValues(NetbeansActionMapping mapp) { StringTokenizer tok = new StringTokenizer(txtGoals.getText().trim()); - List lst = new ArrayList(); + List lst = new ArrayList<>(); while (tok.hasMoreTokens()) { lst.add(tok.nextToken()); } - mapp.setGoals(lst.size() > 0 ? lst : null); + mapp.setGoals(!lst.isEmpty() ? lst : null); mapp.setProperties(ActionMappings.convertStringToActionProperties(epProperties.getText())); tok = new StringTokenizer(txtProfiles.getText().trim(), " ,"); - lst = new ArrayList(); + lst = new ArrayList<>(); while (tok.hasMoreTokens()) { lst.add(tok.nextToken()); } @@ -202,13 +190,13 @@ public void applyValues(NetbeansActionMapping mapp) { public void applyValues(BeanRunConfig rc) { StringTokenizer tok = new StringTokenizer(txtGoals.getText().trim()); - List lst = new ArrayList(); + List lst = new ArrayList<>(); while (tok.hasMoreTokens()) { lst.add(tok.nextToken()); } - rc.setGoals(lst.size() > 0 ? lst : Collections.singletonList("install")); //NOI18N + rc.setGoals(!lst.isEmpty() ? lst : List.of("install")); //NOI18N tok = new StringTokenizer(txtProfiles.getText().trim()); - lst = new ArrayList(); + lst = new ArrayList<>(); while (tok.hasMoreTokens()) { lst.add(tok.nextToken()); } @@ -226,7 +214,7 @@ public void applyValues(BeanRunConfig rc) { rc.setRecursive(isRecursive()); rc.setShowDebug(isShowDebug()); rc.setUpdateSnapshots(isUpdateSnapshots()); - rc.setOffline(Boolean.valueOf(isOffline())); + rc.setOffline(isOffline()); } /** This method is called from within the constructor to @@ -281,35 +269,19 @@ private void initComponents() { btnNext.setToolTipText(org.openide.util.NbBundle.getMessage(RunGoalsPanel.class, "TIP_Next")); // NOI18N btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); - btnNext.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnNextActionPerformed(evt); - } - }); + btnNext.addActionListener(this::btnNextActionPerformed); btnPrev.setToolTipText(org.openide.util.NbBundle.getMessage(RunGoalsPanel.class, "TIP_Prev")); // NOI18N btnPrev.setMargin(new java.awt.Insets(2, 2, 2, 2)); - btnPrev.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnPrevActionPerformed(evt); - } - }); + btnPrev.addActionListener(this::btnPrevActionPerformed); org.openide.awt.Mnemonics.setLocalizedText(cbRemember, org.openide.util.NbBundle.getMessage(RunGoalsPanel.class, "LBL_Remember")); // NOI18N cbRemember.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); cbRemember.setMargin(new java.awt.Insets(0, 0, 0, 0)); - cbRemember.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - cbRememberActionPerformed(evt); - } - }); + cbRemember.addActionListener(this::cbRememberActionPerformed); org.openide.awt.Mnemonics.setLocalizedText(btnAddProps, "&Add >"); - btnAddProps.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnAddPropsActionPerformed(evt); - } - }); + btnAddProps.addActionListener(this::btnAddPropsActionPerformed); epProperties.setContentType("text/x-properties"); // NOI18N jScrollPane2.setViewportView(epProperties); @@ -331,11 +303,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(cbUpdateSnapshots))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblGoals) - .addComponent(lblProfiles) - .addComponent(jLabel2) - .addComponent(btnAddProps)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblGoals) + .addComponent(lblProfiles) + .addComponent(jLabel2)) + .addGap(13, 13, 13)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(btnAddProps) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtGoals) .addComponent(txtProfiles) @@ -363,12 +339,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(lblProfiles) .addComponent(txtProfiles, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) - .addGap(39, 39, 39) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnAddProps)) - .addComponent(jScrollPane2)) + .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cbRecursive) @@ -377,7 +353,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cbOffline) .addComponent(cbDebug)) - .addGap(34, 34, 34) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) @@ -385,7 +361,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(btnNext) .addComponent(cbRemember) .addComponent(txtRemember, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) ); }// //GEN-END:initComponents @@ -447,7 +423,7 @@ public boolean isUpdateSnapshots() { public String isRememberedAs() { if (cbRemember.isSelected()) { String txt = txtRemember.getText().trim(); - if (txt.length() > 0) { + if (!txt.isEmpty()) { return txt; } } diff --git a/java/maven/src/org/netbeans/modules/maven/nbactions.xml b/java/maven/src/org/netbeans/modules/maven/nbactions.xml index 4800e5ea15d4..17fcc0b8066c 100644 --- a/java/maven/src/org/netbeans/modules/maven/nbactions.xml +++ b/java/maven/src/org/netbeans/modules/maven/nbactions.xml @@ -20,4 +20,42 @@ --> + + CUSTOM-Add/Update Wrapper (mvnw) + Add/Update Wrapper (mvnw) + + wrapper:wrapper + + + only-script + + + + CUSTOM-Dependency Tree + Dependency Tree + + eu.maveniverse.maven.plugins:toolbox:tree + + + + CUSTOM-Dependency Tree (plugins) + Dependency Tree (plugins) + + eu.maveniverse.maven.plugins:toolbox:plugin-tree + + + + CUSTOM-Compute Libyear + Compute Libyear + + eu.maveniverse.maven.plugins:toolbox:libyear + + + + CUSTOM-Compute Libyear (plugins) + Compute Libyear (plugins) + + eu.maveniverse.maven.plugins:toolbox:plugin-libyear + + diff --git a/java/maven/src/org/netbeans/modules/maven/newproject/idenative/SimpleJavaTemplateHandler.java b/java/maven/src/org/netbeans/modules/maven/newproject/idenative/SimpleJavaTemplateHandler.java index c0cb41d37c81..684c389ba062 100644 --- a/java/maven/src/org/netbeans/modules/maven/newproject/idenative/SimpleJavaTemplateHandler.java +++ b/java/maven/src/org/netbeans/modules/maven/newproject/idenative/SimpleJavaTemplateHandler.java @@ -19,22 +19,22 @@ package org.netbeans.modules.maven.newproject.idenative; import java.io.File; -import java.util.Collections; import java.util.List; import org.apache.maven.project.MavenProject; import org.netbeans.api.java.platform.JavaPlatform; import org.netbeans.api.java.platform.JavaPlatformManager; -import org.netbeans.modules.maven.api.Constants; import org.netbeans.modules.maven.api.PluginPropertyUtils; import org.netbeans.modules.maven.api.archetype.ProjectInfo; import org.netbeans.modules.maven.classpath.AbstractBootPathImpl; -import org.netbeans.modules.maven.model.ModelOperation; import org.netbeans.modules.maven.model.pom.POMModel; import org.netbeans.modules.maven.model.pom.Project; import org.netbeans.modules.maven.model.pom.Properties; import org.netbeans.modules.maven.options.MavenSettings; import org.netbeans.modules.maven.spi.newproject.CreateProjectBuilder; +import static org.netbeans.modules.maven.api.Constants.GROUP_APACHE_PLUGINS; +import static org.netbeans.modules.maven.api.Constants.PLUGIN_COMPILER; + /** * * @author sdedic @@ -43,59 +43,52 @@ public class SimpleJavaTemplateHandler extends IDENativeTemplateHandler { @Override protected CreateProjectBuilder customizeBuilder(CreateProjectBuilder builder, ProjectInfo pi) { - return super.customizeBuilder(builder, pi).setAdditionalNonPomWork(new CreateProjectBuilder.AdditionalChangeHandle() { - @Override - public Runnable createAdditionalChange(final CreateProjectBuilder.Context context) { - return new Runnable() { - - @Override - public void run() { - File src = new File(context.getProjectDirectory(), "src" + File.separator + "main" + File.separator + "java"); - src.mkdirs(); - if (context.getPackageName() != null) { - String path = context.getPackageName().replace(".", File.separator); - new File(src, path).mkdirs(); + return super.customizeBuilder(builder, pi) + .setAdditionalNonPomWork( + (CreateProjectBuilder.Context context) -> () -> { + File src = new File(context.getProjectDirectory(), "src" + File.separator + "main" + File.separator + "java"); + src.mkdirs(); + String packageName = context.getPackageName(); + if (packageName != null) { + String path = packageName.replace(".", File.separator); + new File(src, path).mkdirs(); + } + } + ) + .setAdditionalOperations( + (CreateProjectBuilder.Context context) -> List.of((POMModel model) -> { + MavenProject mp = context.getParent(); + boolean setLevel = true; + if (mp != null) { + if ( PluginPropertyUtils.getPluginProperty(mp, GROUP_APACHE_PLUGINS, PLUGIN_COMPILER, "release", "compile", "maven.compiler.release") != null + || PluginPropertyUtils.getPluginProperty(mp, GROUP_APACHE_PLUGINS, PLUGIN_COMPILER, "source", "compile", "maven.compiler.source") != null + || PluginPropertyUtils.getPluginProperty(mp, GROUP_APACHE_PLUGINS, PLUGIN_COMPILER, "target", "compile", "maven.compiler.target") != null) { + setLevel = false; } } - }; - } - }).setAdditionalOperations(new CreateProjectBuilder.PomOperationsHandle() { - //#230984 use source 1.7 by default, unless parent paroject defines something, in that case, just inherit - @Override - public List> createPomOperations(final CreateProjectBuilder.Context context) { - return Collections.>singletonList(new ModelOperation() { - - @Override - public void performOperation(POMModel model) { - MavenProject mp = context.getParent(); - boolean setLevel = true; - if (mp != null) { - String source = PluginPropertyUtils.getPluginProperty(mp, Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER, "source", "compile", "maven.compiler.source"); - String target = PluginPropertyUtils.getPluginProperty(mp, Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER, "target", "compile", "maven.compiler.target"); - if (target != null || source != null) { - setLevel = false; + if (setLevel) { + Project root = model.getProject(); + if (root != null) { + Properties props = root.getProperties(); + if (props == null) { + props = model.getFactory().createProperties(); + root.setProperties(props); } - } - if (setLevel) { - Project root = model.getProject(); - if (root != null) { - Properties props = root.getProperties(); - if (props == null) { - props = model.getFactory().createProperties(); - root.setProperties(props); - } - JavaPlatform active = AbstractBootPathImpl.getActivePlatform(MavenSettings.getDefault().getDefaultJdk()); - if (active == null) { - active = JavaPlatformManager.getDefault().getDefaultPlatform(); - } - String version = active.getSpecification().getVersion().toString(); + JavaPlatform active = AbstractBootPathImpl.getActivePlatform(MavenSettings.getDefault().getDefaultJdk()); + if (active == null) { + active = JavaPlatformManager.getDefault().getDefaultPlatform(); + } + String version = active.getSpecification().getVersion().toString(); + if (version != null && version.startsWith("1.")) { props.setProperty("maven.compiler.source", version); props.setProperty("maven.compiler.target", version); + } else { + // MCOMPILER-582: compiler plugin 3.13.0+ supports the release flag on all JDK versions + props.setProperty("maven.compiler.release", version); } } } - }); - } - }); + }) + ); } } diff --git a/java/maven/src/org/netbeans/modules/maven/options/MavenVersionSettings.java b/java/maven/src/org/netbeans/modules/maven/options/MavenVersionSettings.java index 3bed06351ce5..5f1e41c1752c 100644 --- a/java/maven/src/org/netbeans/modules/maven/options/MavenVersionSettings.java +++ b/java/maven/src/org/netbeans/modules/maven/options/MavenVersionSettings.java @@ -44,21 +44,22 @@ public final class MavenVersionSettings { static { // TODO update periodically - modifications might require unit test adjustments - String nb_version = "RELEASE220"; - String nb_utilities_version = "14.1"; + String nb_version = "RELEASE230"; + String nb_utilities_version = "14.2"; fallback = Map.ofEntries( entry(key("org.netbeans.api", "org-netbeans-modules-editor"), nb_version), // represents all other nb artifacts entry(key(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER), "3.13.0"), + entry(key(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_JAR), "3.4.2"), entry(key(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_RESOURCES), "3.3.1"), - entry(key(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_FAILSAFE), "3.2.5"), - entry(key(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_SUREFIRE), "3.2.5"), + entry(key(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_FAILSAFE), "3.3.1"), + entry(key(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_SUREFIRE), "3.3.1"), entry(key("org.apache.netbeans.utilities", "utilities-parent"), nb_utilities_version), entry(key("org.apache.netbeans.utilities", "nbm-maven-harness"), nb_utilities_version), entry(key("org.apache.netbeans.utilities", "nbm-shared"), nb_utilities_version), entry(key("org.apache.netbeans.utilities", "nbm-repository-plugin"), nb_utilities_version), entry(key("org.apache.netbeans.utilities", "nbm-maven-plugin"), nb_utilities_version), - entry(key("org.apache.netbeans.archetypes", "nbm-archetype"), "1.18"), - entry(key("org.apache.netbeans.archetypes", "netbeans-platform-app-archetype"), "1.23") + entry(key("org.apache.netbeans.archetypes", "nbm-archetype"), "1.19"), + entry(key("org.apache.netbeans.archetypes", "netbeans-platform-app-archetype"), "1.24") ); } @@ -87,10 +88,13 @@ public String getVersion(String groupId, String artifactId) { // non blocking query, might not succeed if index not available private static String queryLatestKnownArtifactVersion(String gid, String aid, String min) { RepositoryQueries.Result query = RepositoryQueries.getVersionsResult(gid, aid, null); + // TODO don't upgrade to maven 4 plugins for now - we should take the active mvn version into account for a proper fix + boolean onlyMaven3 = Constants.GROUP_APACHE_PLUGINS.equals(gid); // Versions are sorted in descending order return query.getResults().stream() .map(NBVersionInfo::getVersion) .filter(v -> !v.endsWith("-SNAPSHOT")) + .filter(v -> !onlyMaven3 || (onlyMaven3 && v.startsWith("3."))) .findFirst() .filter(v -> min == null || new ComparableVersion(v).compareTo(new ComparableVersion(min)) > 0) // don't downgrade .orElse(min); diff --git a/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java b/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java index 4a4359995b69..d86e9dbfc6c4 100644 --- a/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java +++ b/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java @@ -159,27 +159,22 @@ public Component getListCellRendererComponent(JList list, Object value, int inde comMavenHome.setRenderer(new ComboBoxRenderer()); this.controller = controller; - listItemChangedListener = new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - if (SEPARATOR.equals(comMavenHome.getSelectedItem())) { - comMavenHome.setSelectedIndex(lastSelected); - return; - } - - int selected = comMavenHome.getSelectedIndex(); - if (selected == mavenHomeDataModel.getSize() - 1) { - // browse - comMavenHome.setSelectedIndex(lastSelected); - SwingUtilities.invokeLater(SettingsPanel.this::browseAddNewRuntime); - return; - } - - listDataChanged(); - lastSelected = selected; + listItemChangedListener = (ActionEvent e) -> { + if (SEPARATOR.equals(comMavenHome.getSelectedItem())) { + comMavenHome.setSelectedIndex(lastSelected); + return; } + int selected = comMavenHome.getSelectedIndex(); + if (selected == mavenHomeDataModel.getSize() - 1) { + // browse + comMavenHome.setSelectedIndex(lastSelected); + SwingUtilities.invokeLater(SettingsPanel.this::browseAddNewRuntime); + return; + } + listDataChanged(); + lastSelected = selected; }; + comIndex.setSelectedIndex(0); listener = new ActionListenerImpl(); comIndex.addActionListener(listener); @@ -889,6 +884,10 @@ private void btnIndexActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS }//GEN-LAST:event_btnIndexActionPerformed private void btnGoalsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGoalsActionPerformed + showGlobalMavenGoalCustomizer(); + }//GEN-LAST:event_btnGoalsActionPerformed + + public static void showGlobalMavenGoalCustomizer() { NbGlobalActionGoalProvider provider = Lookup.getDefault().lookup(NbGlobalActionGoalProvider.class); assert provider != null; try { @@ -907,7 +906,7 @@ private void btnGoalsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS } catch (Exception ex) { Exceptions.printStackTrace(ex); } - }//GEN-LAST:event_btnGoalsActionPerformed + } private void btnOptionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOptionsActionPerformed GlobalOptionsPanel pnl = new GlobalOptionsPanel(); @@ -1033,7 +1032,7 @@ private void browseAddNewRuntime() { chooser.setFileHidingEnabled(false); int selected = comMavenHome.getSelectedIndex(); String path = getSelectedRuntime(selected); - if (path == null || path.trim().length() == 0) { + if (path == null || path.isBlank()) { path = new File(System.getProperty("user.home")).getAbsolutePath(); //NOI18N } if (path.length() > 0) { @@ -1146,9 +1145,9 @@ public void run() { cbEnableIndexDownload.setSelected(RepositoryPreferences.isIndexDownloadEnabled()); cbEnableMultiThreading.setSelected(RepositoryPreferences.isMultiThreadedIndexExtractionEnabled()); switch (RepositoryPreferences.getIndexDateCutoffFilter()) { - case 5: rb5Years.setSelected(true); break; - case 2: rb2Years.setSelected(true); break; - default: rbFullIndex.setSelected(true); break; + case 5 -> rb5Years.setSelected(true); + case 2 -> rb2Years.setSelected(true); + default -> rbFullIndex.setSelected(true); } comBinaries.setSelectedItem(MavenSettings.getDefault().getBinaryDownloadStrategy()); comJavadoc.setSelectedItem(MavenSettings.getDefault().getJavadocDownloadStrategy()); diff --git a/java/nashorn.execution/manifest.mf b/java/nashorn.execution/manifest.mf index 688ca6534e4e..e2e0d1fbf36e 100644 --- a/java/nashorn.execution/manifest.mf +++ b/java/nashorn.execution/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.nashorn.execution/1 Comment: OpenIDE-Module-Layer: org/netbeans/modules/nashorn/execution/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/nashorn/execution/Bundle.properties -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 AutoUpdate-Show-In-Client: false OpenIDE-Module-Recommends: org.netbeans.libs.graaljs diff --git a/java/projectimport.eclipse.core/manifest.mf b/java/projectimport.eclipse.core/manifest.mf index c3a54ee47122..7671c698efa7 100644 --- a/java/projectimport.eclipse.core/manifest.mf +++ b/java/projectimport.eclipse.core/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.projectimport.eclipse.core/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectimport/eclipse/core/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/projectimport/eclipse/core/resources/layer.xml -OpenIDE-Module-Specification-Version: 2.55 +OpenIDE-Module-Specification-Version: 2.56 diff --git a/java/projectimport.eclipse.j2se/nbproject/project.properties b/java/projectimport.eclipse.j2se/nbproject/project.properties index 22fcf61f71ec..b73b64c71d0e 100644 --- a/java/projectimport.eclipse.j2se/nbproject/project.properties +++ b/java/projectimport.eclipse.j2se/nbproject/project.properties @@ -17,4 +17,4 @@ is.eager=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.53.0 +spec.version.base=1.54.0 diff --git a/java/refactoring.java/nbproject/org-netbeans-modules-refactoring-java.sig b/java/refactoring.java/nbproject/org-netbeans-modules-refactoring-java.sig index a37bcbcd6106..d3a2c7a6f210 100644 --- a/java/refactoring.java/nbproject/org-netbeans-modules-refactoring-java.sig +++ b/java/refactoring.java/nbproject/org-netbeans-modules-refactoring-java.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.86.0 +#Version 1.87.0 CLSS public abstract interface com.sun.source.doctree.DocTreeVisitor<%0 extends java.lang.Object, %1 extends java.lang.Object> meth public abstract {com.sun.source.doctree.DocTreeVisitor%0} visitAttribute(com.sun.source.doctree.AttributeTree,{com.sun.source.doctree.DocTreeVisitor%1}) @@ -36,6 +36,7 @@ meth public {com.sun.source.doctree.DocTreeVisitor%0} visitEscape(com.sun.source meth public {com.sun.source.doctree.DocTreeVisitor%0} visitHidden(com.sun.source.doctree.HiddenTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitIndex(com.sun.source.doctree.IndexTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitProvides(com.sun.source.doctree.ProvidesTree,{com.sun.source.doctree.DocTreeVisitor%1}) +meth public {com.sun.source.doctree.DocTreeVisitor%0} visitRawText(com.sun.source.doctree.RawTextTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitSnippet(com.sun.source.doctree.SnippetTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitSpec(com.sun.source.doctree.SpecTree,{com.sun.source.doctree.DocTreeVisitor%1}) meth public {com.sun.source.doctree.DocTreeVisitor%0} visitSummary(com.sun.source.doctree.SummaryTree,{com.sun.source.doctree.DocTreeVisitor%1}) @@ -97,7 +98,6 @@ meth public abstract {com.sun.source.tree.TreeVisitor%0} visitPrimitiveType(com. meth public abstract {com.sun.source.tree.TreeVisitor%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.tree.TreeVisitor%1}) -meth public abstract {com.sun.source.tree.TreeVisitor%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.tree.TreeVisitor%1}) meth public abstract {com.sun.source.tree.TreeVisitor%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.tree.TreeVisitor%1}) @@ -181,7 +181,6 @@ meth public {com.sun.source.util.TreeScanner%0} visitPrimitiveType(com.sun.sourc meth public {com.sun.source.util.TreeScanner%0} visitProvides(com.sun.source.tree.ProvidesTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitRequires(com.sun.source.tree.RequiresTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitReturn(com.sun.source.tree.ReturnTree,{com.sun.source.util.TreeScanner%1}) -meth public {com.sun.source.util.TreeScanner%0} visitStringTemplate(com.sun.source.tree.StringTemplateTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitch(com.sun.source.tree.SwitchTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSwitchExpression(com.sun.source.tree.SwitchExpressionTree,{com.sun.source.util.TreeScanner%1}) meth public {com.sun.source.util.TreeScanner%0} visitSynchronized(com.sun.source.tree.SynchronizedTree,{com.sun.source.util.TreeScanner%1}) diff --git a/java/refactoring.java/nbproject/project.properties b/java/refactoring.java/nbproject/project.properties index 5710dd7e9763..482f48c8d29e 100644 --- a/java/refactoring.java/nbproject/project.properties +++ b/java/refactoring.java/nbproject/project.properties @@ -18,7 +18,7 @@ javac.source=1.8 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.87.0 +spec.version.base=1.88.0 #test configs test.config.find.includes=\ **/FindUsagesSuite.class diff --git a/java/selenium2.java/manifest.mf b/java/selenium2.java/manifest.mf index 4cfe059c3f70..0cf4740e372b 100644 --- a/java/selenium2.java/manifest.mf +++ b/java/selenium2.java/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.selenium2.java OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/selenium2/java/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.selenium2.java -OpenIDE-Module-Specification-Version: 1.27 +OpenIDE-Module-Specification-Version: 1.28 diff --git a/java/selenium2.maven/manifest.mf b/java/selenium2.maven/manifest.mf index de9ee94c810a..d89d654739d0 100644 --- a/java/selenium2.maven/manifest.mf +++ b/java/selenium2.maven/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.selenium2.maven OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/selenium2/maven/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.selenium2.maven.Selenium2MavenSupportImpl -OpenIDE-Module-Specification-Version: 1.27 +OpenIDE-Module-Specification-Version: 1.28 diff --git a/java/spellchecker.bindings.java/manifest.mf b/java/spellchecker.bindings.java/manifest.mf index 1f8c7b95bd5e..2b0ca3a6fa46 100644 --- a/java/spellchecker.bindings.java/manifest.mf +++ b/java/spellchecker.bindings.java/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.spellchecker.bindings.java/1 OpenIDE-Module-Layer: org/netbeans/modules/spellchecker/bindings/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/spellchecker/bindings/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 diff --git a/java/spi.debugger.jpda.ui/manifest.mf b/java/spi.debugger.jpda.ui/manifest.mf index b9424caae663..d8b15b9f20b5 100644 --- a/java/spi.debugger.jpda.ui/manifest.mf +++ b/java/spi.debugger.jpda.ui/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.spi.debugger.jpda.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/ui/spi/Bundle.properties -OpenIDE-Module-Specification-Version: 3.28 +OpenIDE-Module-Specification-Version: 3.29 diff --git a/java/spi.java.hints/nbproject/project.properties b/java/spi.java.hints/nbproject/project.properties index e49df00fcdc6..40ef24534260 100644 --- a/java/spi.java.hints/nbproject/project.properties +++ b/java/spi.java.hints/nbproject/project.properties @@ -15,9 +15,9 @@ # specific language governing permissions and limitations # under the License. is.autoload=true -javac.source=1.8 +javac.release=17 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.59.0 +spec.version.base=1.60.0 requires.nb.javac=true javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/HintsRunner.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/HintsRunner.java index bdff5482f841..3022d0e6d3a9 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/HintsRunner.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/HintsRunner.java @@ -21,7 +21,7 @@ import org.netbeans.modules.java.hints.providers.spi.HintDescription; import com.sun.source.util.TreePath; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; @@ -39,7 +39,8 @@ public class HintsRunner { @CheckForNull public static Map> computeErrors(CompilationInfo info, Iterable hints, AtomicBoolean cancel) { - return new HintsInvoker(HintsSettings.getSettingsFor(info.getFileObject()), cancel).computeHints(info, new TreePath(info.getCompilationUnit()), hints, new LinkedList<>()); + return new HintsInvoker(HintsSettings.getSettingsFor(info.getFileObject()), cancel) + .computeHints(info, new TreePath(info.getCompilationUnit()), hints, new ArrayList<>()); } } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/PatternConvertor.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/PatternConvertor.java index dca7744c46a6..027504bbaa27 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/PatternConvertor.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/PatternConvertor.java @@ -23,7 +23,8 @@ import org.netbeans.spi.java.hints.HintContext; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.List; +import java.util.Map; import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NonNull; import org.netbeans.modules.java.hints.providers.spi.HintDescription.Worker; @@ -67,7 +68,7 @@ public abstract class PatternConvertor { Collection result = new ArrayList<>(patterns.size()); for (String pattern : patterns) { - PatternDescription pd = PatternDescription.create(pattern, Collections.emptyMap()); + PatternDescription pd = PatternDescription.create(pattern, Map.of()); HintDescription desc = HintDescriptionFactory.create() // .setDisplayName("Pattern Matches") @@ -86,8 +87,7 @@ private static final class WorkerImpl implements Worker { @Override public Collection createErrors(HintContext ctx) { ErrorDescription ed = ErrorDescriptionFactory.forTree(ctx, ctx.getPath(), "Found pattern occurrence"); - - return Collections.singleton(ed); + return List.of(ed); } } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/CodeHintProviderImpl.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/CodeHintProviderImpl.java index 6665f17c1a3b..391e86051cc7 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/CodeHintProviderImpl.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/CodeHintProviderImpl.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; @@ -80,10 +79,6 @@ public class CodeHintProviderImpl implements HintProvider { @Override public Map> computeHints() { - return computeHints(findLoader(), "META-INF/nb-hints/hints"); - } - - private Map> computeHints(ClassLoader l, String path) { Map> result = new HashMap<>(); for (ClassWrapper c : FSWrapper.listClasses()) { @@ -116,7 +111,7 @@ public static void processClass(ClassWrapper clazz, Map createErrors(org.netbeans.spi.java return null; } - if (result instanceof Iterable) { + if (result instanceof Iterable iterable) { List out = new LinkedList<>(); - for (ErrorDescription ed : NbCollections.iterable(NbCollections.checkedIteratorByFilter(((Iterable) result).iterator(), ErrorDescription.class, false))) { + for (ErrorDescription ed : NbCollections.iterable(NbCollections.checkedIteratorByFilter(iterable.iterator(), ErrorDescription.class, false))) { out.add(ed); } return out; } - if (result instanceof ErrorDescription) { - return Collections.singletonList((ErrorDescription) result); + if (result instanceof ErrorDescription desc) { + return List.of(desc); } //XXX: log if result was ignored... @@ -358,13 +353,7 @@ Method getMethod() throws NoSuchMethodException, ClassNotFoundException { } - private static final class DelegatingCustomizerProvider implements CustomizerProvider { - - private final Class component; - - public DelegatingCustomizerProvider(Class component) { - this.component = component; - } + private record DelegatingCustomizerProvider(Class component) implements CustomizerProvider { @Override public JComponent getCustomizer(Preferences prefs) { diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/FSWrapper.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/FSWrapper.java index 3c134fe7ffeb..8494a88d8b0c 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/FSWrapper.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/FSWrapper.java @@ -194,12 +194,7 @@ String getName() { String getConstantValue() { Object constantValue = folder.getAttribute("constantValue"); - - if (constantValue instanceof String) { - return (String) constantValue; - } - - return null; + return constantValue instanceof String string ? string : null; } } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/ReflectiveCustomizerProvider.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/ReflectiveCustomizerProvider.java index cc9a294f55a6..a1e989668804 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/ReflectiveCustomizerProvider.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/code/ReflectiveCustomizerProvider.java @@ -44,16 +44,7 @@ * * @author lahvac */ -public class ReflectiveCustomizerProvider implements CustomizerProvider { - private final String hintClassName; - private final String hintId; - private final List options; - - public ReflectiveCustomizerProvider(String hintClassName, String hintId, List options) { - this.hintClassName = hintClassName; - this.hintId = hintId; - this.options = options; - } +record ReflectiveCustomizerProvider(String hintClassName, String hintId, List options) implements CustomizerProvider { @Override public JComponent getCustomizer(Preferences prefs) { @@ -92,9 +83,7 @@ public CustomizerImpl(Preferences prefs, String hintClassName, String hintId, Li constraints.weighty = 1; add(new JPanel(), constraints); - } catch (IllegalArgumentException ex) { - Exceptions.printStackTrace(ex); - } catch (SecurityException ex) { + } catch (IllegalArgumentException | SecurityException ex) { Exceptions.printStackTrace(ex); } } @@ -118,7 +107,7 @@ private void createIntegerOption(OptionDescriptor option, Preferences prefs) { add(l, constraints); JComponent field; - int val = prefs.getInt(option.preferencesKey, ((Integer)option.defaultValue).intValue()); + int val = prefs.getInt(option.preferencesKey, ((Integer)option.defaultValue)); if (iopt.step() > 0) { val = Math.min(iopt.maxValue(), Math.max(iopt.minValue(), val)); prefs.putInt(option.preferencesKey, val); @@ -188,15 +177,7 @@ private JComponent createBooleanOption(OptionDescriptor option, Preferences pref } - private static final class ActionListenerImpl implements ActionListener, ChangeListener { - private final String key; - private final Preferences prefs; - - public ActionListenerImpl(String key, Preferences prefs) { - this.key = key; - this.prefs = prefs; - } - + private record ActionListenerImpl(String key, Preferences prefs) implements ActionListener, ChangeListener { @Override public void actionPerformed(ActionEvent e) { JCheckBox checkBox = ((JCheckBox)e.getSource()); @@ -208,33 +189,15 @@ public void stateChanged(ChangeEvent e) { Integer i = (Integer)((JSpinner)e.getSource()).getValue(); prefs.putInt(key, i); } - } } - - public static final class OptionDescriptor { - public final String preferencesKey; - public final Object defaultValue; - public final String displayName; - public final String tooltip; - /** - * The original Annotation object, type-specific parameters. - */ - public final Object parameters; - - public OptionDescriptor( - String preferencesKey, - Object defaultValue, - String displayName, String tooltip, - Object parameters) { - this.preferencesKey = preferencesKey; - this.defaultValue = defaultValue; - this.displayName = displayName; - this.tooltip = tooltip; - this.parameters = parameters; - } - + + /** + * @param parameters The original Annotation object, type-specific parameters. + */ + public record OptionDescriptor( + String preferencesKey, Object defaultValue, String displayName, String tooltip, Object parameters) { } } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/ElementBasedHintProvider.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/ElementBasedHintProvider.java index 15d177b1f538..4d5a7a999c17 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/ElementBasedHintProvider.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/ElementBasedHintProvider.java @@ -21,7 +21,6 @@ import java.util.Collection; import org.netbeans.api.java.source.CompilationInfo; -import org.netbeans.modules.java.hints.providers.spi.HintDescription; /** * XXX: this is an ugly hack! diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintDescription.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintDescription.java index f459f22baaf6..c377bbe89568 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintDescription.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintDescription.java @@ -31,27 +31,9 @@ * * @author Jan Lahoda */ -public final class HintDescription { - - private final HintMetadata metadata; - private final Trigger trigger; - private final Worker worker; - private final AdditionalQueryConstraints additionalConstraints; - private final String hintText; - private final Set options; - - private HintDescription(HintMetadata metadata, Trigger trigger, Worker worker, AdditionalQueryConstraints additionalConstraints, String hintText, Set options) { - this.metadata = metadata; - this.trigger = trigger; - this.worker = worker; - this.additionalConstraints = additionalConstraints; - this.hintText = hintText; - this.options = options; - } - - static HintDescription create(HintMetadata metadata, Trigger trigger, Worker worker, AdditionalQueryConstraints additionalConstraints, String hintText, Set options) { - return new HintDescription(metadata, trigger, worker, additionalConstraints, hintText, options); - } +public record HintDescription( + HintMetadata metadata, Trigger trigger, Worker worker, + AdditionalQueryConstraints additionalConstraints, String hintText, Set options) { @Override public String toString() { @@ -88,14 +70,13 @@ public static interface Worker { } - public static final class AdditionalQueryConstraints { - public final Set requiredErasedTypes; + public record AdditionalQueryConstraints(Set requiredErasedTypes) { public AdditionalQueryConstraints(Set requiredErasedTypes) { this.requiredErasedTypes = Collections.unmodifiableSet(new HashSet<>(requiredErasedTypes)); } - private static final AdditionalQueryConstraints EMPTY = new AdditionalQueryConstraints(Collections.emptySet()); + private static final AdditionalQueryConstraints EMPTY = new AdditionalQueryConstraints(Set.of()); public static AdditionalQueryConstraints empty() { return EMPTY; } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintDescriptionFactory.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintDescriptionFactory.java index 19973339ceaf..f43a18b139c2 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintDescriptionFactory.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintDescriptionFactory.java @@ -20,7 +20,6 @@ package org.netbeans.modules.java.hints.providers.spi; import java.util.Arrays; -import java.util.Collections; import java.util.EnumSet; import java.util.Set; import org.netbeans.api.annotations.common.NonNull; @@ -40,7 +39,6 @@ public class HintDescriptionFactory { private AdditionalQueryConstraints additionalConstraints; private String hintText; private Set options; - private boolean finished; private HintDescriptionFactory() { } @@ -103,7 +101,7 @@ public HintDescription produce() { if (this.additionalConstraints == null) { this.additionalConstraints = AdditionalQueryConstraints.empty(); } - return HintDescription.create(metadata, trigger, worker, additionalConstraints, hintText, options != null ? options : Collections.emptySet()); + return new HintDescription(metadata, trigger, worker, additionalConstraints, hintText, options != null ? options : Set.of()); } } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java index 8e729eda51e0..36a8dee27bd9 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.EnumSet; -import java.util.HashSet; import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.Set; @@ -210,7 +209,7 @@ public enum Options { HEAVY; public static Set fromHintOptions(Hint.Options... options) { - Set result = new HashSet<>(); + Set result = EnumSet.noneOf(Options.class); for (Hint.Options opt : options) { result.add(valueOf(opt.name())); diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintProvider.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintProvider.java index 2266ddb25dad..9e51edc10738 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintProvider.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintProvider.java @@ -21,8 +21,6 @@ import java.util.Collection; import java.util.Map; -import org.netbeans.modules.java.hints.providers.spi.HintDescription; -import org.netbeans.modules.java.hints.providers.spi.HintMetadata; public interface HintProvider { diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/Trigger.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/Trigger.java index b2a19bc6eafb..5bbbfb01d295 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/Trigger.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/Trigger.java @@ -21,7 +21,6 @@ import com.sun.source.tree.Tree; import com.sun.source.tree.Tree.Kind; import java.util.Arrays; -import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -35,7 +34,7 @@ public abstract class Trigger { private static final String[] NO_OPTIONS = new String[0]; - private Set options = Collections.emptySet(); + private Set options = Set.of(); Trigger() {} @@ -45,14 +44,14 @@ public boolean hasOption(String opt) { public void setOptions(String[] opts) { if (opts == null || opts.length == 0) { - options = Collections.emptySet(); + options = Set.of(); } else { options = new HashSet<>(Arrays.asList(opts)); } } public String[] getOptions() { - return options.isEmpty() ? NO_OPTIONS : options.toArray(new String[0]); + return options.isEmpty() ? NO_OPTIONS : options.toArray(String[]::new); } /**Invoke the given hint's worker on the specified {@link Tree.Kind}(s). diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/JavaFixImpl.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/JavaFixImpl.java index 06a55fab4089..edc1b6bf09c0 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/JavaFixImpl.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/JavaFixImpl.java @@ -22,7 +22,6 @@ import com.sun.source.util.TreePath; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.IdentityHashMap; import java.util.List; @@ -67,7 +66,7 @@ public String getText() { public ChangeInfo implement() throws Exception { FileObject file = Accessor.INSTANCE.getFile(jf); - BatchUtilities.fixDependencies(file, Collections.singletonList(jf), new IdentityHashMap<>()); + BatchUtilities.fixDependencies(file, List.of(jf), new IdentityHashMap<>()); JavaSource js = JavaSource.forFileObject(file); @@ -79,7 +78,7 @@ public ChangeInfo implement() throws Exception { Accessor.INSTANCE.process(jf, wc, true, resourceContentChanges, /*Ignored in editor:*/new ArrayList<>()); Map> resourceContentDiffs = new HashMap<>(); BatchUtilities.addResourceContentChanges(resourceContentChanges, resourceContentDiffs); - JavaSourceAccessor.getINSTANCE().createModificationResult(resourceContentDiffs, Collections.emptyMap()).commit(); + JavaSourceAccessor.getINSTANCE().createModificationResult(resourceContentDiffs, Map.of()).commit(); }); result.commit(); @@ -91,8 +90,8 @@ public ChangeInfo implement() throws Exception { @Override public boolean equals(Object obj) { - if (obj instanceof JavaFixImpl) { - return jf.equals(((JavaFixImpl)obj).jf); + if (obj instanceof JavaFixImpl javaFixImpl) { + return jf.equals(javaFixImpl.jf); } return super.equals(obj); } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/RulesManagerImpl.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/RulesManagerImpl.java index bf3708c84d3b..50c0781d9e4c 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/RulesManagerImpl.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/RulesManagerImpl.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.LinkedList; import java.util.Map; import java.util.Map.Entry; import java.util.WeakHashMap; @@ -76,7 +75,7 @@ public void reload() { private final Map> compoundPathCache = new WeakHashMap<>(); /** - * Holds a refernce to a composite CP created from the ClasspathInfo. Attaches as listener + * Holds a reference to a composite CP created from the ClasspathInfo. Attaches as listener * to the ClasspathInfo, so it should live at least as so long as the original ClasspathInfo. * Does not reference CPInfo, so it may be stored as a WHM value - but it references CPInfo components. * GC may free Holders together with their original CPInfos. @@ -86,11 +85,12 @@ private static final class Holder implements ChangeListener { public Holder(ClasspathInfo cpInfo) { cpInfo.addChangeListener(this); - LinkedList cps = new LinkedList<>(); - cps.add(cpInfo.getClassPath(PathKind.BOOT)); - cps.add(cpInfo.getClassPath(PathKind.COMPILE)); - cps.add(cpInfo.getClassPath(PathKind.SOURCE)); - compound = ClassPathSupport.createProxyClassPath(cps.toArray(new ClassPath[0])); + ClassPath[] cps = new ClassPath[] { + cpInfo.getClassPath(PathKind.BOOT), + cpInfo.getClassPath(PathKind.COMPILE), + cpInfo.getClassPath(PathKind.SOURCE) + }; + compound = ClassPathSupport.createProxyClassPath(cps); } @Override @@ -113,7 +113,7 @@ public void stateChanged(ChangeEvent e) { if (from != null) { // not cached, probably not invoked that much - compound = ClassPathSupport.createProxyClassPath(from.toArray(new ClassPath[0])); + compound = ClassPathSupport.createProxyClassPath(from.toArray(ClassPath[]::new)); } else { OK: if (info != null) { synchronized (compoundPathCache) { @@ -148,13 +148,8 @@ public void stateChanged(ChangeEvent e) { public static void sortByMetadata(Collection listedHints, Map> into) { for (HintDescription hd : listedHints) { - Collection h = into.get(hd.getMetadata()); - - if (h == null) { - into.put(hd.getMetadata(), h = new ArrayList<>()); - } - - h.add(hd); + into.computeIfAbsent(hd.getMetadata(), k -> new ArrayList<>()) + .add(hd); } } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java index 244f9d2cb2f2..7081b179a542 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java @@ -63,7 +63,6 @@ import com.sun.tools.javac.main.JavaCompiler; import com.sun.tools.javac.parser.JavacParser; import com.sun.tools.javac.parser.Lexer; -import com.sun.tools.javac.parser.Parser; import com.sun.tools.javac.parser.ParserFactory; import com.sun.tools.javac.parser.Scanner; import com.sun.tools.javac.parser.ScannerFactory; @@ -257,22 +256,17 @@ public static List findArrayValue(AnnotationTree at, String name } public static boolean isPureMemberSelect(Tree mst, boolean allowVariables) { - switch (mst.getKind()) { - case IDENTIFIER: return allowVariables || ((IdentifierTree) mst).getName().charAt(0) != '$'; - case MEMBER_SELECT: return isPureMemberSelect(((MemberSelectTree) mst).getExpression(), allowVariables); - default: return false; - } + return switch (mst.getKind()) { + case IDENTIFIER -> allowVariables || ((IdentifierTree) mst).getName().charAt(0) != '$'; + case MEMBER_SELECT -> isPureMemberSelect(((MemberSelectTree) mst).getExpression(), allowVariables); + default -> false; + }; } public static Map> sortOutHints(Iterable hints, Map> output) { for (HintDescription d : hints) { - Collection h = output.get(d.getMetadata().displayName); - - if (h == null) { - output.put(d.getMetadata().displayName, h = new LinkedList<>()); - } - - h.add(d); + output.computeIfAbsent(d.getMetadata().displayName, k -> new LinkedList<>()) + .add(d); } return output; @@ -288,7 +282,7 @@ public static List listAllHints(Set cps) { } } - result.addAll(listClassPathHints(Collections.emptySet(), cps)); + result.addAll(listClassPathHints(Set.of(), cps)); return result; } @@ -311,9 +305,9 @@ public static List listClassPathHints(Set sourceCPs, Set cps = new HashSet<>(sourceCPs); - cps.add(ClassPathSupport.createClassPath(roots.toArray(new FileObject[0]))); + cps.add(ClassPathSupport.createClassPath(roots.toArray(FileObject[]::new))); - ClassPath cp = ClassPathSupport.createProxyClassPath(cps.toArray(new ClassPath[0])); + ClassPath cp = ClassPathSupport.createProxyClassPath(cps.toArray(ClassPath[]::new)); for (ClassPathBasedHintProvider p : Lookup.getDefault().lookupAll(ClassPathBasedHintProvider.class)) { result.addAll(p.computeHints(cp, new AtomicBoolean())); @@ -350,6 +344,7 @@ private static Tree parseAndAttribute(CompilationInfo info, JavacTaskImpl jti, S return parseAndAttribute(info, jti, pattern, scope, new SourcePositions[1], errors); } + @SuppressWarnings("NestedAssignment") private static Tree parseAndAttribute(CompilationInfo info, JavacTaskImpl jti, String pattern, Scope scope, SourcePositions[] sourcePositions, Collection> errors) { Context c = jti.getContext(); JavaCompiler.instance(c); //force reasonable initialization order @@ -506,7 +501,7 @@ private static Tree parseAndAttribute(CompilationInfo info, JavacTaskImpl jti, S newMembers.add(make.ExpressionStatement(make.Identifier("$$1$"))); newMembers.addAll(members.subList(syntheticOffset, members.size())); - patternTree = make.Class(mt, "$", Collections.emptyList(), null, Collections.emptyList(), newMembers); + patternTree = make.Class(mt, "$", List.of(), null, List.of(), newMembers); } else { patternTree = members.get(0 + syntheticOffset); } @@ -548,7 +543,7 @@ private static boolean isError(TypeMirror type) { } private static boolean isStatement(String pattern) { - return pattern.trim().endsWith(";"); + return pattern.stripTrailing().endsWith(";"); } private static boolean isErrorTree(Tree t) { @@ -585,16 +580,14 @@ public void report(JCDiagnostic diag) { }; try { CharBuffer buf = CharBuffer.wrap((stmt+"\u0000").toCharArray(), 0, stmt.length()); - ParserFactory factory = ParserFactory.instance(context); + NBParserFactory factory = (NBParserFactory) ParserFactory.instance(context); ScannerFactory scannerFactory = ScannerFactory.instance(context); Names names = Names.instance(context); - Parser parser = new JackpotJavacParser(context, (NBParserFactory) factory, scannerFactory.newScanner(buf, false), false, false, CancelService.instance(context), names); - if (parser instanceof JavacParser) { - if (pos != null) - pos[0] = new ParserSourcePositions((JavacParser)parser); - return parser.parseStatement(); + JavacParser parser = new JackpotJavacParser(context, factory, scannerFactory.newScanner(buf, false), false, false, CancelService.instance(context), names); + if (pos != null) { + pos[0] = new ParserSourcePositions(parser); } - return null; + return parser.parseStatement(); } finally { compiler.log.useSource(prev); compiler.log.popDiagnosticHandler(discardHandler); @@ -614,19 +607,18 @@ public void report(JCDiagnostic diag) { }; try { CharBuffer buf = CharBuffer.wrap((expr+"\u0000").toCharArray(), 0, expr.length()); - ParserFactory factory = ParserFactory.instance(context); + NBParserFactory factory = (NBParserFactory) ParserFactory.instance(context); ScannerFactory scannerFactory = ScannerFactory.instance(context); Names names = Names.instance(context); Scanner scanner = scannerFactory.newScanner(buf, false); - Parser parser = new JackpotJavacParser(context, (NBParserFactory) factory, scanner, false, false, CancelService.instance(context), names); - if (parser instanceof JavacParser) { - if (pos != null) - pos[0] = new ParserSourcePositions((JavacParser)parser); - JCExpression result = parser.parseExpression(); + JavacParser parser = new JackpotJavacParser(context, factory, scanner, false, false, CancelService.instance(context), names); + if (pos != null) { + pos[0] = new ParserSourcePositions(parser); + } + JCExpression result = parser.parseExpression(); - if (!onlyFullInput || scanner.token().kind == TokenKind.EOF) { - return result; - } + if (!onlyFullInput || scanner.token().kind == TokenKind.EOF) { + return result; } return null; } finally { @@ -705,7 +697,7 @@ public static boolean isMultistatementWildcardTree(Tree tree) { private static long inc; public static Scope constructScope(CompilationInfo info, Map constraints) { - return constructScope(info, constraints, Collections.emptyList()); + return constructScope(info, constraints, List.of()); } public static Scope constructScope(CompilationInfo info, Map constraints, Iterable auxiliaryImports) { @@ -822,42 +814,7 @@ public Scope reduce(Scope r1, Scope r2) { } - private static final class ScopeDescription { - private final Map constraints; - private final Iterable auxiliaryImports; - - public ScopeDescription(Map constraints, Iterable auxiliaryImports) { - this.constraints = constraints; - this.auxiliaryImports = auxiliaryImports; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final ScopeDescription other = (ScopeDescription) obj; - if (this.constraints != other.constraints && (this.constraints == null || !this.constraints.equals(other.constraints))) { - return false; - } - if (this.auxiliaryImports != other.auxiliaryImports && (this.auxiliaryImports == null || !this.auxiliaryImports.equals(other.auxiliaryImports))) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 47 * hash + (this.constraints != null ? this.constraints.hashCode() : 0); - hash = 47 * hash + (this.auxiliaryImports != null ? this.auxiliaryImports.hashCode() : 0); - return hash; - } - - } + private record ScopeDescription(Map constraints, Iterable auxiliaryImports) {} // private static Scope constructScope2(CompilationInfo info, Map constraints) { // JavacScope s = (JavacScope) info.getTrees().getScope(new TreePath(info.getCompilationUnit())); @@ -909,15 +866,9 @@ public static Set findSuppressedWarnings(CompilationInfo info, Tree leaf = path.getLeaf(); switch (leaf.getKind()) { - case METHOD: - handleSuppressWarnings(info, path, ((MethodTree) leaf).getModifiers(), keys); - break; - case CLASS: - handleSuppressWarnings(info, path, ((ClassTree) leaf).getModifiers(), keys); - break; - case VARIABLE: - handleSuppressWarnings(info, path, ((VariableTree) leaf).getModifiers(), keys); - break; + case METHOD -> handleSuppressWarnings(info, path, ((MethodTree) leaf).getModifiers(), keys); + case CLASS -> handleSuppressWarnings(info, path, ((ClassTree) leaf).getModifiers(), keys); + case VARIABLE -> handleSuppressWarnings(info, path, ((VariableTree) leaf).getModifiers(), keys); } path = path.getParentPath(); @@ -1145,15 +1096,10 @@ private boolean shouldBeGeneralized(@NonNull Element el) { if (el.getModifiers().contains(Modifier.PRIVATE)) { return true; } - - switch (el.getKind()) { - case LOCAL_VARIABLE: - case EXCEPTION_PARAMETER: - case PARAMETER: - return true; - } - - return false; + return switch (el.getKind()) { + case LOCAL_VARIABLE, EXCEPTION_PARAMETER, PARAMETER -> true; + default -> false; + }; } @Override @@ -1188,7 +1134,7 @@ public Void visitNewClass(NewClassTree node, Void p) { return null; } - NewClassTree nue = make.NewClass(node.getEnclosingExpression(), Collections.singletonList(make.Identifier("$" + currentVariableIndex++ + "$")), make.Identifier("$" + currentVariableIndex++), Collections.singletonList(make.Identifier("$" + currentVariableIndex++ + "$")), null); + NewClassTree nue = make.NewClass(node.getEnclosingExpression(), List.of(make.Identifier("$" + currentVariableIndex++ + "$")), make.Identifier("$" + currentVariableIndex++), List.of(make.Identifier("$" + currentVariableIndex++ + "$")), null); tree2Variable.put(node, nue); @@ -1247,7 +1193,7 @@ public void setImports(List importsToAdd) {} @Override public Set getImports() { - return Collections.emptySet(); + return Set.of(); } @Override @@ -1578,15 +1524,7 @@ public static boolean isFakeClass(Tree t) { return wildcardTreeName.toString().startsWith("$$"); } - private static final class OffsetSourcePositions implements SourcePositions { - - private final SourcePositions delegate; - private final long offset; - - public OffsetSourcePositions(SourcePositions delegate, long offset) { - this.delegate = delegate; - this.offset = offset; - } + private record OffsetSourcePositions(SourcePositions delegate, long offset) implements SourcePositions { @Override public long getStartPosition(CompilationUnitTree cut, Tree tree) { @@ -1600,16 +1538,8 @@ public long getEndPosition(CompilationUnitTree cut, Tree tree) { } - private static final class OffsetDiagnostic implements Diagnostic { - private final Diagnostic delegate; - private final SourcePositions sp; - private final long offset; - - public OffsetDiagnostic(Diagnostic delegate, SourcePositions sp, long offset) { - this.delegate = delegate; - this.sp = sp; - this.offset = offset; - } + private record OffsetDiagnostic( + Diagnostic delegate, SourcePositions sp, long offset) implements Diagnostic { @Override public Diagnostic.Kind getKind() { @@ -1633,9 +1563,7 @@ public long getStartPosition() { @Override public long getEndPosition() { - if (delegate instanceof JCDiagnostic) { - JCDiagnostic dImpl = (JCDiagnostic) delegate; - + if (delegate instanceof JCDiagnostic dImpl) { return dImpl.getDiagnosticPosition().getEndPosition(new EndPosTable() { @Override public int getEndPos(JCTree tree) { return (int) sp.getEndPosition(null, tree); @@ -1673,13 +1601,7 @@ public String getMessage(Locale locale) { } - private static class ParserSourcePositions implements SourcePositions { - - private final JavacParser parser; - - private ParserSourcePositions(JavacParser parser) { - this.parser = parser; - } + private record ParserSourcePositions(JavacParser parser) implements SourcePositions { @Override public long getStartPosition(CompilationUnitTree file, Tree tree) { diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchSearch.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchSearch.java index b5abcb3f1427..329637569792 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchSearch.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchSearch.java @@ -210,7 +210,7 @@ private static void getLocalVerifiedSpans(Collection resourc toRegisterSet.add(cpInfo.getClassPath(PathKind.SOURCE)); } - toRegister = !toRegisterSet.isEmpty() ? toRegisterSet.toArray(new ClassPath[0]) : null; + toRegister = !toRegisterSet.isEmpty() ? toRegisterSet.toArray(ClassPath[]::new) : null; if (toRegister != null) { GlobalPathRegistry.getDefault().register(ClassPath.SOURCE, toRegister); @@ -359,8 +359,8 @@ public static Folder[] convert(Collection list) { Folder[] result = new Folder[list.size()]; int i=0; for (Object item:list) { - if (item instanceof FileObject) - result[i] = new Folder((FileObject) item); + if (item instanceof FileObject fileObject) + result[i] = new Folder(fileObject); else result[i] = new Folder((NonRecursiveFolder) item); i++; diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchUtilities.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchUtilities.java index 1091f025797a..7ae901cf98b9 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchUtilities.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchUtilities.java @@ -18,8 +18,6 @@ */ package org.netbeans.modules.java.hints.spiimpl.batch; -import com.sun.tools.javac.api.JavacTaskImpl; -import com.sun.tools.javac.util.Log; import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.Method; @@ -27,7 +25,6 @@ import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; @@ -173,7 +170,7 @@ public void cannotVerifySpan(Resource r) { addResourceContentChanges(resourceContentChanges, result); - return Collections.singletonList(JavaSourceAccessor.getINSTANCE().createModificationResult(result, Collections.emptyMap())); + return List.of(JavaSourceAccessor.getINSTANCE().createModificationResult(result, Map.of())); } public static void addResourceContentChanges(final Map resourceContentChanges, final Map> result) { @@ -201,10 +198,8 @@ public static void addResourceContentChanges(final Map resou } String newContent = encoding.newDecoder().decode(ByteBuffer.wrap(e.getValue())).toString(); - result.put(e.getKey(), DiffUtilities.diff2ModificationResultDifference(e.getKey(), null, Collections.emptyMap(), origContent[0], newContent, s[0])); - } catch (BadLocationException ex) { - Exceptions.printStackTrace(ex); - } catch (IOException ex) { + result.put(e.getKey(), DiffUtilities.diff2ModificationResultDifference(e.getKey(), null, Map.of(), origContent[0], newContent, s[0])); + } catch (BadLocationException | IOException ex) { Exceptions.printStackTrace(ex); } } @@ -345,8 +340,7 @@ public static boolean applyFixes(WorkingCopy copy, Map> pro } if (!changes.isEmpty()) { - ModificationResult perFixResult = JavaSourceAccessor.getINSTANCE().createModificationResult(changes, Collections.emptyMap()); - + ModificationResult perFixResult = JavaSourceAccessor.getINSTANCE().createModificationResult(changes, Map.of()); changesPerFix.put(f, perFixResult); } } @@ -377,7 +371,7 @@ public static Collection applyFixes(final MapemptyMap())); + return List.of(JavaSourceAccessor.getINSTANCE().createModificationResult(result, Map.of())); } public static Collection getSourceGroups(Iterable prjs) { @@ -399,14 +393,8 @@ public static Map> sortFiles(Collection files = m.get(cpCategorizer); - - if (files == null) { - m.put(cpCategorizer, files = new LinkedList<>()); - } - - files.add(f); + m.computeIfAbsent(cpCategorizer, k -> new LinkedList<>()) + .add(f); } Map> result = new IdentityHashMap<>(); @@ -514,11 +502,7 @@ public static boolean fixDependencies(FileObject file, Iterable seen = alreadyProcessed.get(p); - - if (seen == null) { - alreadyProcessed.put(p, seen = new HashSet<>()); - } + Set seen = alreadyProcessed.computeIfAbsent(p, k -> new HashSet<>()); if (seen.add(updateTo)) { for (ProjectDependencyUpgrader up : Lookup.getDefault().lookupAll(ProjectDependencyUpgrader.class)) { diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/ProgressHandleWrapper.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/ProgressHandleWrapper.java index 90fe247dca46..a02b1b3f550f 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/ProgressHandleWrapper.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/ProgressHandleWrapper.java @@ -180,11 +180,7 @@ public void finish() { public static int[] prepareParts(int count) { int[] result = new int[count]; - - for (int cntr = 0; cntr < count; cntr++) { - result[cntr] = 1; - } - + Arrays.fill(result, 1); return result; } @@ -200,12 +196,7 @@ public static interface ProgressHandleAbstraction { } - private static final class ProgressHandleBasedProgressHandleAbstraction implements ProgressHandleAbstraction { - private final ProgressHandle delegate; - public ProgressHandleBasedProgressHandleAbstraction(ProgressHandle delegate) { - this.delegate = delegate; - } - + private record ProgressHandleBasedProgressHandleAbstraction(ProgressHandle delegate) implements ProgressHandleAbstraction { @Override public void start(int totalWork) { delegate.start(totalWork); @@ -227,12 +218,7 @@ public void finish() { } } - private static final class AnalysisContextBasedProgressHandleAbstraction implements ProgressHandleAbstraction { - private final Context delegate; - AnalysisContextBasedProgressHandleAbstraction(Context delegate) { - this.delegate = delegate; - } - + private record AnalysisContextBasedProgressHandleAbstraction(Context delegate) implements ProgressHandleAbstraction { @Override public void start(int totalWork) { delegate.start(totalWork); @@ -254,12 +240,7 @@ public void finish() { } } - private static final class ProgressHandleWrapperBasedProgressHandleAbstraction implements ProgressHandleAbstraction { - private final ProgressHandleWrapper delegate; - public ProgressHandleWrapperBasedProgressHandleAbstraction(ProgressHandleWrapper delegate) { - this.delegate = delegate; - } - + private record ProgressHandleWrapperBasedProgressHandleAbstraction(ProgressHandleWrapper delegate) implements ProgressHandleAbstraction { @Override public void start(int totalWork) { delegate.startNextPart(totalWork); diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/Scopes.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/Scopes.java index 4fbe7ac1b226..88039aec29bf 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/Scopes.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/Scopes.java @@ -97,9 +97,7 @@ public MapIndices getIndexMapper(Iterable hints) { public static MapIndices getDefaultIndicesMapper() { return (FileObject root, ProgressHandleWrapper progress, boolean recursive) -> { IndexEnquirer e = findIndexEnquirer(root, progress, recursive); - - if (e != null) return e; - else return new BatchSearch.FileSystemBasedIndexEnquirer(root, recursive); + return e != null ? e : new BatchSearch.FileSystemBasedIndexEnquirer(root, recursive); }; } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/hints/HintsInvoker.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/hints/HintsInvoker.java index 2e3eb6d6d8ab..3957ae21c06b 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/hints/HintsInvoker.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/hints/HintsInvoker.java @@ -31,15 +31,12 @@ import org.netbeans.editor.GuardedDocument; import org.netbeans.editor.MarkBlock; import org.netbeans.editor.MarkBlockChain; -import org.openide.filesystems.FileObject; - import com.sun.source.tree.Tree.Kind; import com.sun.source.util.TreePath; import com.sun.source.util.Trees; import java.io.IOException; import java.util.ArrayDeque; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Deque; @@ -47,11 +44,14 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.annotation.processing.ProcessingEnvironment; import javax.lang.model.SourceVersion; import javax.lang.model.type.TypeKind; @@ -62,7 +62,6 @@ import org.netbeans.spi.java.hints.HintContext; import org.netbeans.modules.java.hints.providers.spi.HintDescription; import org.netbeans.modules.java.hints.providers.spi.HintMetadata; -import org.netbeans.modules.java.hints.providers.spi.Trigger; import org.netbeans.modules.java.hints.providers.spi.Trigger.Kinds; import org.netbeans.modules.java.hints.providers.spi.Trigger.PatternDescription; import org.netbeans.modules.java.hints.spiimpl.options.HintsSettings; @@ -88,7 +87,9 @@ */ public class HintsInvoker { - private final Map timeLog = new HashMap<>(); + private static final Logger LOG = Logger.getLogger(HintsInvoker.class.getName()); + + private final Map timeLog = new LinkedHashMap<>(); private final HintsSettings settings; private final int caret; @@ -162,9 +163,9 @@ private List computeHints(CompilationInfo info, TreePath start } } - List errors = join(computeHints(info, startAt, descs, new LinkedList<>())); + List errors = join(computeHints(info, startAt, descs, new ArrayList<>())); - dumpTimeSpentInHints(); + printHintMetrics(); return errors; } @@ -182,8 +183,6 @@ public List computeHints(CompilationInfo info, return join(computeHints(info, new TreePath(info.getCompilationUnit()), hints, problems)); } - private static final Iterable> TRIGGER_KINDS = Arrays.asList(Kinds.class, PatternDescription.class); - @CheckForNull public Map> computeHints(CompilationInfo info, TreePath startAt, @@ -198,34 +197,31 @@ public Map> computeHints(CompilationInfo boolean recursive, Iterable hints, Collection problems) { - Map, List> triggerKind2Hints = new HashMap<>(); - for (Class c : TRIGGER_KINDS) { - triggerKind2Hints.put(c, new ArrayList<>()); - } + Map, List> triggerKind2Hints = Map.of( + Kinds.class, new ArrayList<>(), + PatternDescription.class, new ArrayList<>() + ); + SourceVersion srcVersion = info.getSourceVersion(); for (HintDescription hd : hints) { SourceVersion hVersion = hd.getMetadata().sourceVersion; - if (hVersion != null && - (srcVersion.compareTo(hVersion) < 0)) { + if (hVersion != null && srcVersion.compareTo(hVersion) < 0) { continue; } - List sorted = triggerKind2Hints.get(hd.getTrigger().getClass()); - - sorted.add(hd); + triggerKind2Hints.get(hd.getTrigger().getClass()) + .add(hd); } if (caret != -1) { TreePath tp = info.getTreeUtilities().pathFor(caret); return computeSuggestions(info, tp, true, triggerKind2Hints, problems); + } else if (from != -1 && to != -1) { + return computeHintsInSpan(info, triggerKind2Hints, problems); + } else if (!recursive) { + return computeSuggestions(info, startAt, false, triggerKind2Hints, problems); } else { - if (from != (-1) && to != (-1)) { - return computeHintsInSpan(info, triggerKind2Hints, problems); - } else if (!recursive) { - return computeSuggestions(info, startAt, false, triggerKind2Hints, problems); - } else { - return computeHintsImpl(info, startAt, triggerKind2Hints, problems); - } + return computeHintsImpl(info, startAt, triggerKind2Hints, problems); } } @@ -241,7 +237,7 @@ private Map> computeHintsImpl(Compilatio if (!kindBasedHints.isEmpty()) { long kindStart = System.currentTimeMillis(); - new ScannerImpl(info, cancel, sortByKinds(kindBasedHints), problems).scan(startAt, errors); + new ScannerImpl(info, cancel, sortByKinds(kindBasedHints)).scan(startAt, errors); long kindEnd = System.currentTimeMillis(); @@ -315,7 +311,7 @@ private Map> computeHintsInSpan(Compilat if (!kindBasedHints.isEmpty()) { long kindStart = System.currentTimeMillis(); - new ScannerImpl(info, cancel, sortByKinds(kindBasedHints), problems).scan(path, errors); + new ScannerImpl(info, cancel, sortByKinds(kindBasedHints)).scan(path, errors); long kindEnd = System.currentTimeMillis(); @@ -381,7 +377,7 @@ private Map> computeSuggestions(Compilat TreePath proc = workOn; while (proc != null) { - new ScannerImpl(info, cancel, hints, problems).scanDoNotGoDeeper(proc, errors); + new ScannerImpl(info, cancel, hints).scanDoNotGoDeeper(proc, errors); if (!up) break; proc = proc.getParentPath(); } @@ -469,13 +465,8 @@ private static Map> sortByKinds(List hints = result.get(k); - - if (hints == null) { - result.put(k, hints = new ArrayList<>()); - } - - hints.add(hd); + result.computeIfAbsent(k, l -> new LinkedList<>()) + .add(hd); } } @@ -486,13 +477,8 @@ private static Map> sortByPatterns(Lis Map> result = new HashMap<>(); for (HintDescription hd : kindBasedHints) { - List hints = result.get((PatternDescription) hd.getTrigger()); - - if (hints == null) { - result.put((PatternDescription) hd.getTrigger(), hints = new ArrayList<>()); - } - - hints.add(hd); + result.computeIfAbsent((PatternDescription) hd.getTrigger(), k -> new LinkedList<>()) + .add(hd); } return result; @@ -502,11 +488,8 @@ public static Map> computePatternTests(Map> patternTests = new HashMap<>(); for (Entry> e : patternHints.entrySet()) { String p = e.getKey().getPattern(); - List descs = patternTests.get(p); - if (descs == null) { - patternTests.put(p, descs = new LinkedList<>()); - } - descs.add(e.getKey()); + patternTests.computeIfAbsent(p, k -> new LinkedList<>()) + .add(e.getKey()); } return patternTests; } @@ -572,36 +555,6 @@ private Map> doComputeHints(CompilationI return errors; } -// public static void computeHints(URI file, ProcessingEnvironment env, CompilationUnitTree cut, RulesManager m) { -// Map hints = m.getKindBasedHints(); -// -// if (hints.isEmpty()) { -// return ; -// } -// -// List errors = new LinkedList(); -// -// File af = new File(file.getPath()); -// FileObject f = FileUtil.toFileObject(af); -// -// new ScannerImpl(f, env, hints).scan(cut, errors); -// -// for (ErrorDescription ed : errors) { -// Diagnostic.Kind k; -// -// switch (ed.getSeverity()) { -// case ERROR: -// k = Diagnostic.Kind.ERROR; -// break; -// default: -// k = Diagnostic.Kind.WARNING; -// break; -// } -// -// env.getMessager().printMessage(k, ed.getDescription()); -// } -// } - public Map getTimeLog() { return timeLog; } @@ -610,27 +563,14 @@ private final class ScannerImpl extends CancellableTreePathScanner> suppresWarnings = new ArrayDeque<>(); private final CompilationInfo info; - private final FileObject file; private final ProcessingEnvironment env; private final Map> hints; - private final Collection problems; - public ScannerImpl(CompilationInfo info, AtomicBoolean cancel, Map> hints, Collection problems) { + public ScannerImpl(CompilationInfo info, AtomicBoolean cancel, Map> hints) { super(cancel); this.info = info; - this.file = null; this.env = null; this.hints = hints; - this.problems = problems; - } - - public ScannerImpl(FileObject file, ProcessingEnvironment env, Map> hints, Collection problems) { - super(new AtomicBoolean()); - this.info = null; - this.file = file; - this.env = env; - this.hints = hints; - this.problems = problems; } private void runAndAdd(TreePath path, List rules, Map> d) { @@ -711,34 +651,22 @@ public void scanDoNotGoDeeper(TreePath path, Map current = suppresWarnings.size() == 0 ? null : suppresWarnings.peek(); + switch (path.getLeaf().getKind()) { + case ANNOTATION_TYPE, CLASS, ENUM, INTERFACE, METHOD, VARIABLE -> { + Set current = suppresWarnings.isEmpty() ? null : suppresWarnings.peek(); Set nju = current == null ? new HashSet<>() : new HashSet<>(current); Element e = getTrees().getElement(path); - if ( e != null) { + if (e != null) { for (AnnotationMirror am : e.getAnnotationMirrors()) { String name = ((TypeElement)am.getAnnotationType().asElement()).getQualifiedName().toString(); - if ( "java.lang.SuppressWarnings".equals(name) ) { // NOI18N - Map elementValues = am.getElementValues(); - for (Map.Entry entry : elementValues.entrySet()) { - if( "value".equals(entry.getKey().getSimpleName().toString()) ) { // NOI18N - Object value = entry.getValue().getValue(); - if ( value instanceof List) { - for (Object av : (List)value) { - if( av instanceof AnnotationValue ) { - Object wname = ((AnnotationValue)av).getValue(); - if ( wname instanceof String ) { - nju.add((String)wname); - } - } + if ("java.lang.SuppressWarnings".equals(name)) { // NOI18N + for (Map.Entry entry : am.getElementValues().entrySet()) { + if ("value".equals(entry.getKey().getSimpleName().toString()) && entry.getValue().getValue() instanceof List list) { // NOI18N + for (Object obj : list) { + if (obj instanceof AnnotationValue av && av.getValue() instanceof String str) { + nju.add(str); } } } @@ -746,9 +674,9 @@ private boolean pushSuppressWarrnings(TreePath path) { } } } - suppresWarnings.push(nju); return true; + } } return false; } @@ -766,11 +694,10 @@ static boolean isInGuarded(CompilationInfo info, TreePath tree) { try { Document doc = info.getDocument(); - if (doc instanceof GuardedDocument) { - final int start = (int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), tree.getLeaf()); - final int end = (int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), tree.getLeaf()); - final GuardedDocument gdoc = (GuardedDocument) doc; - final boolean[] ret = { false }; + if (doc instanceof GuardedDocument gdoc) { + int start = (int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), tree.getLeaf()); + int end = (int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), tree.getLeaf()); + boolean[] ret = { false }; gdoc.render(() -> { // MarkBlockChain should only be accessed under doc's readlock to guarantee a stability of the offsets. MarkBlockChain guardedBlockChain = gdoc.getGuardedBlockChain(); @@ -798,33 +725,19 @@ private Collection runHint(HintDescription hd, HintC } } - public static Map> merge(Map> to, K key, Collection value) { - List toColl = to.get(key); - - if (toColl == null) { - to.put(key, toColl = new LinkedList<>()); - } - - toColl.addAll(value); - - return to; + private static void merge(Map> to, K key, Collection value) { + to.computeIfAbsent(key, k -> new LinkedList<>()) + .addAll(value); } - public static Map> mergeAll(Map> to, Map> what) { + private static void mergeAll(Map> to, Map> what) { for (Entry> e : what.entrySet()) { - List toColl = to.get(e.getKey()); - - if (toColl == null) { - to.put(e.getKey(), toColl = new LinkedList<>()); - } - - toColl.addAll(e.getValue()); + to.computeIfAbsent(e.getKey(), k -> new LinkedList<>()) + .addAll(e.getValue()); } - - return to; } - public static List join(Map> errors) { + private static List join(Map> errors) { if (errors == null) return null; List result = new LinkedList<>(); @@ -836,30 +749,35 @@ public static List join(Map hint2SpentTime = new HashMap<>(); + private final Map hint2SpentTime = new HashMap<>(); private void reportSpentTime(String id, long nanoTime) { - if (!logTimeSpentInHints) return; - - Long prev = hint2SpentTime.get(id); - - if (prev == null) { - prev = (long) 0; + if (!LOG.isLoggable(Level.FINE)) { + return; } - - hint2SpentTime.put(id, prev + nanoTime); + HintMetric metric = hint2SpentTime.computeIfAbsent(id, k -> new HintMetric()); + metric.invocations++; + metric.time += nanoTime; + metric.cancelled = cancel.get(); } - private void dumpTimeSpentInHints() { - if (!logTimeSpentInHints) return; - - List> l = new ArrayList<>(hint2SpentTime.entrySet()); - - l.sort((Entry o1, Entry o2) -> (int) Math.signum(o1.getValue() - o2.getValue())); + private void printHintMetrics() { + if (!LOG.isLoggable(Level.FINE)) { + return; + } + hint2SpentTime.entrySet().stream() + .sorted((e1, e2) -> Long.compare(e2.getValue().time, e1.getValue().time)) + .forEach((e) -> LOG.fine(e.getValue() + ": " + e.getKey())); + LOG.fine("hint processing " + (cancel.get() ? "cancelled" : "complete")); // NOI18N + } - for (Entry e : l) { - System.err.println(e.getKey() + "=" + String.format("%3.2f", e.getValue() / 1000000.0)); + private static final class HintMetric { + private long time; + private int invocations; + private boolean cancelled; + @Override + public String toString() { + return "{time=" + String.format("%3.2f", time / 1_000_000.0) + "ms, invocations=" + invocations + ", cancelled=" + cancelled + '}'; // NOI18N } } } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/hints/HintsTask.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/hints/HintsTask.java index 85913226ade1..2ead0b94f2ed 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/hints/HintsTask.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/hints/HintsTask.java @@ -41,7 +41,6 @@ import org.netbeans.api.java.source.support.CaretAwareJavaSourceTaskFactory; import org.netbeans.api.java.source.support.EditorAwareJavaSourceTaskFactory; import org.netbeans.editor.BaseDocument; -import org.netbeans.lib.editor.util.swing.DocumentUtilities; import org.netbeans.modules.java.hints.providers.spi.PositionRefresherHelper; import org.netbeans.modules.java.hints.providers.spi.PositionRefresherHelper.DocumentVersion; import org.netbeans.modules.java.hints.spiimpl.options.HintsSettings; @@ -104,7 +103,6 @@ public void run(CompilationInfo info) { return; } } - long version = doc != null ? DocumentUtilities.getDocumentVersion(doc) : 0; long startTime = System.currentTimeMillis(); int caret = CaretAwareJavaSourceTaskFactory.getLastPosition(info.getFileObject()); @@ -207,8 +205,8 @@ public List getErrorDescriptionsAt(CompilationInfo info, Conte private static void setVersion(Document doc) { for (PositionRefresherHelper h : MimeLookup.getLookup("text/x-java").lookupAll(PositionRefresherHelper.class)) { - if (h instanceof HintPositionRefresherHelper) { - ((HintPositionRefresherHelper) h).setVersion(doc, new DocumentVersion(doc)); + if (h instanceof HintPositionRefresherHelper hp) { + hp.setVersion(doc, new DocumentVersion(doc)); } } } @@ -234,8 +232,8 @@ public List getErrorDescriptionsAt(CompilationInfo info, Conte private static void setVersion(Document doc, int caret) { for (PositionRefresherHelper h : MimeLookup.getLookup("text/x-java").lookupAll(PositionRefresherHelper.class)) { - if (h instanceof SuggestionsPositionRefresherHelper) { - ((SuggestionsPositionRefresherHelper) h).setVersion(doc, new SuggestionsDocumentVersion(doc, caret)); + if (h instanceof SuggestionsPositionRefresherHelper sp) { + sp.setVersion(doc, new SuggestionsDocumentVersion(doc, caret)); } } } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/options/HintsSettings.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/options/HintsSettings.java index 2d4fdbbbad38..8d278d3098ad 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/options/HintsSettings.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/options/HintsSettings.java @@ -85,11 +85,12 @@ public Severity getSeverity(HintMetadata hint) { if (s == null) return overrideSeverity != null ? overrideSeverity : hint != null ? hint.severity : null; - if ("ERROR".equals(s)) return Severity.ERROR; - else if ("WARNING".equals(s)) return Severity.VERIFIER; - else if ("CURRENT_LINE_WARNING".equals(s)) return Severity.HINT; - - return overrideSeverity != null ? overrideSeverity : hint != null ? hint.severity : null; + return switch (s) { + case "ERROR" -> Severity.ERROR; + case "WARNING" -> Severity.VERIFIER; + case "CURRENT_LINE_WARNING" -> Severity.HINT; + default -> overrideSeverity != null ? overrideSeverity : hint != null ? hint.severity : null; + }; } @Override diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/CopyFinderBasedBulkSearch.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/CopyFinderBasedBulkSearch.java index 87a77110fcdc..d77f1428c576 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/CopyFinderBasedBulkSearch.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/CopyFinderBasedBulkSearch.java @@ -23,14 +23,12 @@ import com.sun.source.util.TreePath; import java.io.InputStream; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicBoolean; -import javax.lang.model.type.TypeMirror; import org.netbeans.api.java.source.CompilationInfo; import org.netbeans.modules.java.hints.providers.spi.HintDescription.AdditionalQueryConstraints; import org.netbeans.api.java.source.matching.Matcher; @@ -51,18 +49,17 @@ public CopyFinderBasedBulkSearch() { @Override public Map> match(CompilationInfo info, AtomicBoolean cancel, TreePath toSearch, BulkPattern pattern, Map timeLog) { Parameters.notNull("info", info); + Map> result = new HashMap<>(); TreePath topLevel = new TreePath(info.getCompilationUnit()); - - for (Entry e : ((BulkPatternImpl) pattern).pattern2Code.entrySet()) { - for (Occurrence od : Matcher.create(info).setCancel(new AtomicBoolean()).setUntypedMatching().setCancel(cancel).match(Pattern.createPatternWithFreeVariables(new TreePath(topLevel, e.getKey()), Collections.emptyMap()))) { - Collection c = result.get(e.getValue()); + Matcher matcher = Matcher.create(info) + .setUntypedMatching() + .setCancel(cancel); - if (c == null) { - result.put(e.getValue(), c = new LinkedList<>()); - } - - c.add(od.getOccurrenceRoot()); + for (Entry e : ((BulkPatternImpl) pattern).pattern2Code.entrySet()) { + for (Occurrence od : matcher.match(Pattern.createPatternWithFreeVariables(new TreePath(topLevel, e.getKey()), Map.of()))) { + result.computeIfAbsent(e.getValue(), k -> new LinkedList<>()) + .add(od.getOccurrenceRoot()); } } @@ -71,8 +68,20 @@ public Map> match(CompilationInfo info, AtomicBoole @Override public boolean matches(CompilationInfo info, AtomicBoolean cancel, TreePath toSearch, BulkPattern pattern) { - //XXX: performance - return !match(info, cancel, toSearch, pattern).isEmpty(); + Parameters.notNull("info", info); + + TreePath topLevel = new TreePath(info.getCompilationUnit()); + Matcher matcher = Matcher.create(info) + .setUntypedMatching() + .setCancel(cancel); + + for (Tree tree : ((BulkPatternImpl) pattern).pattern2Code.keySet()) { + if (!matcher.match(Pattern.createPatternWithFreeVariables(new TreePath(topLevel, tree), Map.of())).isEmpty()) { + return true; + } + } + + return false; } @Override @@ -109,7 +118,7 @@ private static final class BulkPatternImpl extends BulkPattern { private final Map pattern2Code; public BulkPatternImpl(Collection additionalConstraints, Map pattern2Code) { - super(new LinkedList(pattern2Code.values()), null, null, new LinkedList(additionalConstraints)); + super(new LinkedList<>(pattern2Code.values()), null, null, new LinkedList<>(additionalConstraints)); this.pattern2Code = pattern2Code; } diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/NFA.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/NFA.java index 6cd4e4cdd7b7..685b827a4715 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/NFA.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/NFA.java @@ -31,7 +31,6 @@ public class NFA { /*XXX: private*/ final int stateCount; private final int startingState; - private final Set inputs; private final Map, State> transitionTable; private final Map finalStates; @@ -40,11 +39,10 @@ public class NFA { private NFA(int startingState, int stateCount, Set inputs, Map, State> transitionTable, Map finalStates) { this.startingState = startingState; this.stateCount = stateCount; - this.inputs = inputs; this.transitionTable = transitionTable; this.finalStates = finalStates; - startingStateObject = State.create().mutableOr(startingState); + startingStateObject = new State().mutableOr(startingState); } public State getStartingState() { @@ -56,11 +54,11 @@ public State transition(final State active, final I input) { for (int i : active) { // for (int i = active.nextSetBit(0); i >= 0; i = active.nextSetBit(i+1)) { - State target = transitionTable.get(Key.create(i, input)); + State target = transitionTable.get(new Key(i, input)); if (target != null) { if (result == null) { - result = State.create(); + result = new State(); } result.mutableOr(target); @@ -97,7 +95,7 @@ public static NFA create(int startingState, int stateCount, Set } public State join(State s1, State s2) { - State bs = State.create(); + State bs = new State(); bs.mutableOr(s1); bs.mutableOr(s2); @@ -105,61 +103,18 @@ public State join(State s1, State s2) { return bs; } - public static final class Key { - private final int state; - private final I input; - - private Key(int state, I input) { - this.state = state; - this.input = input; - } - - public static Key create(int state, I input) { - return new Key<>(state, input); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Key other = (Key) obj; - if (this.state != other.state) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 83 * hash + this.state; - hash = 83 * hash + (this.input != null ? this.input.hashCode() : 0); - return hash; - } - + public record Key(int state, I input) { @Override public String toString() { return "[" + state + ", " + input + "]"; } - } public static final class State extends HashSet { - private State() { + public State() { super(4); } - public static State create() { - return new State(); - } - public State mutableOr(int state) { add(state); return this; diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/NFABasedBulkSearch.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/NFABasedBulkSearch.java index 9036adfbfe8f..c8bf02136c6c 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/NFABasedBulkSearch.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/pm/NFABasedBulkSearch.java @@ -130,11 +130,8 @@ public Void scan(Iterable nodes, TreePath p) { } private void addOccurrence(Res r, TreePath currentPath) { - Collection occurrences = occurringPatterns.get(r); - if (occurrences == null) { - occurringPatterns.put(r, occurrences = new LinkedList<>()); - } - occurrences.add(currentPath); + occurringPatterns.computeIfAbsent(r, k -> new LinkedList<>()) + .add(currentPath); } }.scan(tree, tree.getParentPath()); @@ -173,6 +170,7 @@ public BulkPattern create(Collection code, Collection { public Scanner() { super(patternIdentifiers, cancel); @@ -191,8 +189,8 @@ public Void scan(Tree t, Void v) { if (Utilities.isMultistatementWildcardTree(t) || multiModifiers(t)) { int target = nextState[0]++; - setBit(transitionTable, NFA.Key.create(currentState[0], new Input(Kind.IDENTIFIER, "$", false)), target); - setBit(transitionTable, NFA.Key.create(target, UP), currentState[0]); + setBit(transitionTable, new NFA.Key(currentState[0], new Input(Kind.IDENTIFIER, "$", false)), target); + setBit(transitionTable, new NFA.Key(target, UP), currentState[0]); content.add(currentContent = new ArrayList<>()); @@ -205,10 +203,8 @@ public Void scan(Tree t, Void v) { if (!bt.isStatic()) { switch (bt.getStatements().size()) { - case 1: - singletonStatement = bt.getStatements().get(0); - break; - case 2: + case 1 -> singletonStatement = bt.getStatements().get(0); + case 2 -> { if (Utilities.isMultistatementWildcardTree(bt.getStatements().get(0))) { singletonStatement = bt.getStatements().get(1); } else { @@ -216,12 +212,12 @@ public Void scan(Tree t, Void v) { singletonStatement = bt.getStatements().get(0); } } - break; - case 3: + } + case 3 -> { if (Utilities.isMultistatementWildcardTree(bt.getStatements().get(0)) && Utilities.isMultistatementWildcardTree(bt.getStatements().get(2))) { singletonStatement = bt.getStatements().get(1); } - break; + } } } @@ -238,15 +234,15 @@ public Void scan(Tree t, Void v) { int target = currentState[0]; - setBit(transitionTable, NFA.Key.create(backup, new Input(Kind.BLOCK, null, false)), currentState[0] = nextState[0]++); - setBit(transitionTable, NFA.Key.create(currentState[0], new Input(Kind.IDENTIFIER, "(", false)), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(backup, new Input(Kind.BLOCK, null, false)), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(currentState[0], new Input(Kind.IDENTIFIER, "(", false)), currentState[0] = nextState[0]++); for (StatementTree st : bt.getStatements()) { scan(st, null); } - setBit(transitionTable, NFA.Key.create(currentState[0], UP), currentState[0] = nextState[0]++); - setBit(transitionTable, NFA.Key.create(currentState[0], UP), target); + setBit(transitionTable, new NFA.Key(currentState[0], UP), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(currentState[0], UP), target); currentState[0] = target; return null; @@ -285,11 +281,11 @@ public Void scan(Tree t, Void v) { if (StatementTree.class.isAssignableFrom(t.getKind().asInterface()) && t != pattern) { int target = currentState[0]; - setBit(transitionTable, NFA.Key.create(backup, new Input(Kind.BLOCK, null, false)), currentState[0] = nextState[0]++); - setBit(transitionTable, NFA.Key.create(currentState[0], new Input(Kind.IDENTIFIER, "(", false)), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(backup, new Input(Kind.BLOCK, null, false)), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(currentState[0], new Input(Kind.IDENTIFIER, "(", false)), currentState[0] = nextState[0]++); handleTree(i, goDeeper, t, bypass); - setBit(transitionTable, NFA.Key.create(currentState[0], UP), currentState[0] = nextState[0]++); - setBit(transitionTable, NFA.Key.create(currentState[0], UP), target); + setBit(transitionTable, new NFA.Key(currentState[0], UP), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(currentState[0], UP), target); currentState[0] = target; } @@ -300,11 +296,11 @@ public Void scan(Tree t, Void v) { @Override public Void scan(Iterable nodes, Void p) { - setBit(transitionTable, NFA.Key.create(currentState[0], new Input(Kind.IDENTIFIER, "(", false)), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(currentState[0], new Input(Kind.IDENTIFIER, "(", false)), currentState[0] = nextState[0]++); try { return super.scan(nodes, p); } finally { - setBit(transitionTable, NFA.Key.create(currentState[0], UP), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(currentState[0], UP), currentState[0] = nextState[0]++); } } @@ -312,26 +308,26 @@ private void handleTree(Input i, boolean[] goDeeper, Tree t, Input[] bypass) { int backup = currentState[0]; int target = nextState[0]++; - setBit(transitionTable, NFA.Key.create(backup, i), currentState[0] = nextState[0]++); + setBit(transitionTable, new NFA.Key(backup, i), currentState[0] = nextState[0]++); if (goDeeper[0]) { super.scan(t, null); } else { new CollectIdentifiers(patternIdentifiers, cancel).scan(t, null); int aux = nextState[0]++; - setBit(transitionTable, NFA.Key.create(backup, new Input(Kind.MEMBER_SELECT, i.name, false)), aux); - setBit(transitionTable, NFA.Key.create(aux, new Input(Kind.IDENTIFIER, "$", false)), aux = nextState[0]++); - setBit(transitionTable, NFA.Key.create(aux, UP), aux = nextState[0]++); - setBit(transitionTable, NFA.Key.create(aux, UP), target); + setBit(transitionTable, new NFA.Key(backup, new Input(Kind.MEMBER_SELECT, i.name, false)), aux); + setBit(transitionTable, new NFA.Key(aux, new Input(Kind.IDENTIFIER, "$", false)), aux = nextState[0]++); + setBit(transitionTable, new NFA.Key(aux, UP), aux = nextState[0]++); + setBit(transitionTable, new NFA.Key(aux, UP), target); } - setBit(transitionTable, NFA.Key.create(currentState[0], UP), target); + setBit(transitionTable, new NFA.Key(currentState[0], UP), target); if (bypass[0] != null) { int intermediate = nextState[0]++; - setBit(transitionTable, NFA.Key.create(backup, bypass[0]), intermediate); - setBit(transitionTable, NFA.Key.create(intermediate, UP), target); + setBit(transitionTable, new NFA.Key(backup, bypass[0]), intermediate); + setBit(transitionTable, new NFA.Key(intermediate, UP), target); } currentState[0] = target; @@ -353,13 +349,8 @@ private void handleTree(Input i, boolean[] goDeeper, Tree t, Input[] bypass) { } private static void setBit(Map, NFA.State> transitionTable, NFA.Key input, int state) { - NFA.State target = transitionTable.get(input); - - if (target == null) { - transitionTable.put(input, target = NFA.State.create()); - } - - target.mutableOr(state); + transitionTable.computeIfAbsent(input, k -> new NFA.State()) + .mutableOr(state); } private static Input normalizeInput(Tree t, boolean[] goDeeper, Input[] bypass) { @@ -396,13 +387,13 @@ private static Input normalizeInput(Tree t, boolean[] goDeeper, Input[] bypass) String name; - switch (t.getKind()) { - case CLASS: name = ((ClassTree)t).getSimpleName().toString(); break; - case VARIABLE: name = ((VariableTree)t).getName().toString(); break; - case METHOD: name = ((MethodTree)t).getName().toString(); break; - case BOOLEAN_LITERAL: name = ((LiteralTree) t).getValue().toString(); break; - default: name = null; - } + name = switch (t.getKind()) { + case CLASS -> ((ClassTree)t).getSimpleName().toString(); + case VARIABLE -> ((VariableTree)t).getName().toString(); + case METHOD -> ((MethodTree)t).getName().toString(); + case BOOLEAN_LITERAL -> ((LiteralTree) t).getValue().toString(); + default -> null; + }; if (name != null) { if (!name.isEmpty() && name.charAt(0) == '$') { @@ -561,7 +552,7 @@ public Map matchesImpl(InputStream encoded, AtomicBoolean cance read = encoded.read(); } - identifiers.add(new String(baos.toByteArray(), StandardCharsets.UTF_8)); + identifiers.add(baos.toString(StandardCharsets.UTF_8)); } Map patternsAndFrequencies = new HashMap<>(); @@ -591,7 +582,7 @@ public Map matchesImpl(InputStream encoded, AtomicBoolean cance } read = encoded.read(); - name = new String(baos.toByteArray(), StandardCharsets.UTF_8); + name = baos.toString(StandardCharsets.UTF_8); } else { name = null; } @@ -670,7 +661,8 @@ public static class BulkPatternImpl extends BulkPattern { private final NFA nfa; - private BulkPatternImpl(List patterns, List> identifiers, List>> requiredContent, List additionalConstraints, NFA nfa) { + private BulkPatternImpl(List patterns, List> identifiers, + List>> requiredContent, List additionalConstraints, NFA nfa) { super(patterns, identifiers, requiredContent, additionalConstraints); this.nfa = nfa; } @@ -681,73 +673,23 @@ NFA toNFA() { } - private static final class Res { - private final String pattern; - private final int patternIndex; - - public Res(String pattern, int patternIndex) { - this.pattern = pattern; - this.patternIndex = patternIndex; - } - - } - - private static final class Input { - private final Kind kind; - private final String name; - private final boolean end; - - private Input(Kind kind, String name, boolean end) { - this.kind = kind; - this.name = name; - this.end = end; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Input other = (Input) obj; - if (this.kind != other.kind) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - if (this.end != other.end) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 47 * hash + (this.kind != null ? this.kind.hashCode() : 17); - hash = 47 * hash + (this.name != null ? this.name.hashCode() : 0); - hash = 47 * hash + (this.end ? 1 : 0); - return hash; - } + private record Res(String pattern, int patternIndex) {} + private record Input(Kind kind, String name, boolean end) { @Override public String toString() { return kind + ", " + name + ", " + end; } - } private static final Input UP = new Input(null, null, true); private static boolean isIdentifierAcceptable(CharSequence content) { - if (content.length() == 0) return false; - if (content.charAt(0) == '$' || content.charAt(0) == '<') return false; + if (content.isEmpty() || content.charAt(0) == '$' || content.charAt(0) == '<') { + return false; + } String stringValue = content.toString(); - if (stringValue.contentEquals("java") || "lang".equals(stringValue)) return false; - return true; + return !(stringValue.contentEquals("java") || "lang".equals(stringValue)); } private static class CollectIdentifiers extends CancellableTreeScanner { diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/processor/JavaHintsAnnotationProcessor.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/processor/JavaHintsAnnotationProcessor.java index 76eec043375c..d6b93efd18a6 100644 --- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/processor/JavaHintsAnnotationProcessor.java +++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/processor/JavaHintsAnnotationProcessor.java @@ -22,7 +22,6 @@ import java.lang.reflect.Array; import java.util.Map.Entry; import java.util.*; -import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.annotation.processing.Processor; @@ -51,8 +50,6 @@ @ServiceProvider(service=Processor.class, position=100) public class JavaHintsAnnotationProcessor extends LayerGeneratingProcessor { - private static final Logger LOG = Logger.getLogger(JavaHintsAnnotationProcessor.class.getName()); - @Override protected boolean handleProcess(Set annotations, RoundEnvironment roundEnv) throws LayerGenerationException { if (!roundEnv.processingOver()) { @@ -134,8 +131,8 @@ private void generateTypeList(String annotationName, RoundEnvironment roundEnv) dumpAnnotation(builder, fieldFolder, var, am, true); } - if (var.getConstantValue() instanceof String) { - fieldFolder.stringvalue("constantValue", (String) var.getConstantValue()); + if (var.getConstantValue() instanceof String value) { + fieldFolder.stringvalue("constantValue", value); } fieldFolder.write(); @@ -147,20 +144,11 @@ private void generateTypeList(String annotationName, RoundEnvironment roundEnv) AnnotationMirror hintMirror = findAnnotation(e.getAnnotationMirrors(), "org.netbeans.spi.java.hints.Hint"); if (hintMirror != null) { - String qualifiedName; - switch (e.getKind()) { - case METHOD: case CONSTRUCTOR: - qualifiedName = e.getEnclosingElement().asType().toString() + "." + e.getSimpleName().toString() + e.asType().toString(); - break; - case FIELD: case ENUM_CONSTANT: - qualifiedName = e.getEnclosingElement().asType().toString() + "." + e.getSimpleName().toString(); - break; - case ANNOTATION_TYPE: case CLASS: - case ENUM: case INTERFACE: - default: - qualifiedName = e.asType().toString(); - break; - } + String qualifiedName = switch (e.getKind()) { + case METHOD, CONSTRUCTOR -> e.getEnclosingElement().asType().toString() + "." + e.getSimpleName().toString() + e.asType().toString(); + case FIELD, ENUM_CONSTANT -> e.getEnclosingElement().asType().toString() + "." + e.getSimpleName().toString(); + default -> e.asType().toString(); + }; try { File keywordsFile = layer(e) @@ -260,8 +248,8 @@ private T getAttributeValue(AnnotationMirror annotation, String attribute, C Class componentType = clazz.getComponentType(); for (Object attr : attributes) { - if (attr instanceof AnnotationValue) { - attr = ((AnnotationValue) attr).getValue(); + if (attr instanceof AnnotationValue annotationValue) { + attr = annotationValue.getValue(); } if (componentType.isAssignableFrom(attr.getClass())) { @@ -310,12 +298,8 @@ private boolean verifyHintAnnotationAcceptable(Element hint) { if (id == null || id.isEmpty()) { switch (hint.getKind()) { - case CLASS: - case METHOD: - break; //OK - default: - //compiler should have already warned about this - return false; + case CLASS, METHOD -> {} // OK + default -> { return false; } // compiler should have already warned about this } } diff --git a/java/spi.java.hints/src/org/netbeans/spi/java/hints/ErrorDescriptionFactory.java b/java/spi.java.hints/src/org/netbeans/spi/java/hints/ErrorDescriptionFactory.java index bd583e1c9db3..721432b57d5e 100644 --- a/java/spi.java.hints/src/org/netbeans/spi/java/hints/ErrorDescriptionFactory.java +++ b/java/spi.java.hints/src/org/netbeans/spi/java/hints/ErrorDescriptionFactory.java @@ -36,7 +36,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.EnumSet; import java.util.LinkedHashSet; import java.util.LinkedList; @@ -52,16 +51,15 @@ import org.netbeans.api.java.source.GeneratorUtilities; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.JavaSource.Phase; -import org.netbeans.api.java.source.Task; import org.netbeans.api.java.source.TreePathHandle; import org.netbeans.api.java.source.WorkingCopy; import org.netbeans.api.lexer.TokenSequence; -import org.netbeans.api.options.OptionsDisplayer; import org.netbeans.modules.analysis.api.CodeAnalysis; import org.netbeans.modules.analysis.spi.Analyzer.WarningDescription; import org.netbeans.modules.java.hints.providers.spi.HintMetadata; import org.netbeans.modules.java.hints.providers.spi.HintMetadata.Options; import org.netbeans.modules.java.hints.spiimpl.Hacks.InspectAndTransformOpener; +import org.netbeans.modules.java.hints.spiimpl.JavaFixImpl; import org.netbeans.modules.java.hints.spiimpl.SPIAccessor; import org.netbeans.modules.java.hints.spiimpl.SyntheticFix; import org.netbeans.modules.java.hints.spiimpl.options.HintsSettings; @@ -87,10 +85,6 @@ public class ErrorDescriptionFactory { private ErrorDescriptionFactory() { } -// public static ErrorDescription forTree(HintContext context, String text, Fix... fixes) { -// return forTree(context, context.getContext(), text, fixes); -// } - public static ErrorDescription forTree(HintContext context, TreePath tree, String text, Fix... fixes) { return forTree(context, tree.getLeaf(), text, fixes); } @@ -169,48 +163,50 @@ public static ErrorDescription forName(HintContext context, Tree tree, String te return null; } - @SuppressWarnings("fallthrough") private static int[] computeNameSpan(Tree tree, HintContext context) { + CompilationInfo info = context.getInfo(); switch (tree.getKind()) { - case LABELED_STATEMENT: - return context.getInfo().getTreeUtilities().findNameSpan((LabeledStatementTree) tree); - case METHOD: - return context.getInfo().getTreeUtilities().findNameSpan((MethodTree) tree); - case ANNOTATION_TYPE: - case CLASS: - case ENUM: - case INTERFACE: - return context.getInfo().getTreeUtilities().findNameSpan((ClassTree) tree); - case VARIABLE: - return context.getInfo().getTreeUtilities().findNameSpan((VariableTree) tree); - case MEMBER_SELECT: + case LABELED_STATEMENT -> { + return info.getTreeUtilities().findNameSpan((LabeledStatementTree) tree); + } + case METHOD -> { + return info.getTreeUtilities().findNameSpan((MethodTree) tree); + } + case ANNOTATION_TYPE, CLASS, ENUM, INTERFACE -> { + return info.getTreeUtilities().findNameSpan((ClassTree) tree); + } + case VARIABLE -> { + return info.getTreeUtilities().findNameSpan((VariableTree) tree); + } + case MEMBER_SELECT -> { //XXX: MemberSelectTree mst = (MemberSelectTree) tree; - int[] span = context.getInfo().getTreeUtilities().findNameSpan(mst); + int[] span = info.getTreeUtilities().findNameSpan(mst); if (span == null) { - int end = (int) context.getInfo().getTrees().getSourcePositions().getEndPosition(context.getInfo().getCompilationUnit(), tree); + int end = (int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), tree); span = new int[] {end - mst.getIdentifier().length(), end}; } return span; - case METHOD_INVOCATION: + } + case METHOD_INVOCATION -> { return computeNameSpan(((MethodInvocationTree) tree).getMethodSelect(), context); - case BLOCK: - Collection prefix = context.getMultiVariables().get("$$1$"); - - if (prefix != null) { - BlockTree bt = (BlockTree) tree; - - if (bt.getStatements().size() > prefix.size()) { - return computeNameSpan(bt.getStatements().get(prefix.size()), context); + } + default -> { + if (tree.getKind() == Kind.BLOCK) { + Collection prefix = context.getMultiVariables().get("$$1$"); + if (prefix != null) { + BlockTree bt = (BlockTree) tree; + if (bt.getStatements().size() > prefix.size()) { + return computeNameSpan(bt.getStatements().get(prefix.size()), context); + } } } - default: - int start = (int) context.getInfo().getTrees().getSourcePositions().getStartPosition(context.getInfo().getCompilationUnit(), tree); - if ( StatementTree.class.isAssignableFrom(tree.getKind().asInterface()) - && tree.getKind() != Kind.EXPRESSION_STATEMENT - && tree.getKind() != Kind.BLOCK) { - TokenSequence ts = context.getInfo().getTokenHierarchy().tokenSequence(); + int start = (int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), tree); + if (StatementTree.class.isAssignableFrom(tree.getKind().asInterface()) + && tree.getKind() != Kind.EXPRESSION_STATEMENT + && tree.getKind() != Kind.BLOCK) { + TokenSequence ts = info.getTokenHierarchy().tokenSequence(); ts.move(start); if (ts.moveNext()) { return new int[] {ts.offset(), ts.offset() + ts.token().length()}; @@ -218,9 +214,11 @@ private static int[] computeNameSpan(Tree tree, HintContext context) { } return new int[] { start, - Math.min((int) context.getInfo().getTrees().getSourcePositions().getEndPosition(context.getInfo().getCompilationUnit(), tree), - findLineEnd(context.getInfo(), start)), + Math.min((int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), tree), + findLineEnd(info, start)), }; + } + } } @@ -242,14 +240,13 @@ static List resolveDefaultFixes(HintContext ctx, Fix... provided) { Set suppressWarningsKeys = new LinkedHashSet<>(); for (String key : hm.suppressWarnings) { - if (key == null || key.length() == 0) { + if (key == null || key.isEmpty()) { break; } suppressWarningsKeys.add(key); } - auxiliaryFixes.add(new DisableConfigure(ctx.getInfo().getFileObject(), hm, true, SPIAccessor.getINSTANCE().getHintSettings(ctx))); auxiliaryFixes.add(new DisableConfigure(ctx.getInfo().getFileObject(), hm, false, null)); @@ -261,7 +258,7 @@ static List resolveDefaultFixes(HintContext ctx, Fix... provided) { } if (!suppressWarningsKeys.isEmpty()) { - auxiliaryFixes.addAll(createSuppressWarnings(ctx.getInfo(), ctx.getPath(), suppressWarningsKeys.toArray(new String[0]))); + auxiliaryFixes.addAll(createSuppressWarnings(ctx.getInfo(), ctx.getPath(), suppressWarningsKeys.toArray(String[]::new))); } List result = new LinkedList<>(); @@ -298,18 +295,10 @@ private static class DisableConfigure implements Fix, SyntheticFix { @Override public String getText() { String displayName = metadata.displayName; - String key; - switch (metadata.kind) { - case INSPECTION: - key = disable ? "FIX_DisableHint" : "FIX_ConfigureHint"; - break; - case ACTION: - key = disable ? "FIX_DisableSuggestion" : "FIX_ConfigureSuggestion"; - break; - default: - throw new IllegalStateException(); - } - + String key = switch (metadata.kind) { + case INSPECTION -> disable ? "FIX_DisableHint" : "FIX_ConfigureHint"; + case ACTION -> disable ? "FIX_DisableSuggestion" : "FIX_ConfigureSuggestion"; + }; return NbBundle.getMessage(ErrorDescriptionFactory.class, key, displayName); } @@ -367,14 +356,7 @@ public CharSequence getSortText() { } - private static class InspectFix implements Fix, SyntheticFix { - private final @NonNull HintMetadata metadata; - private final boolean transform; - - InspectFix(@NonNull HintMetadata metadata, boolean transform) { - this.metadata = metadata; - this.transform = transform; - } + private record InspectFix(@NonNull HintMetadata metadata, boolean transform) implements Fix, SyntheticFix { @Override @Messages({ @@ -404,33 +386,6 @@ public ChangeInfo implement() throws Exception { return null; } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (this.getClass() != obj.getClass()) { - return false; - } - final InspectFix other = (InspectFix) obj; - if (this.metadata != other.metadata && (this.metadata == null || !this.metadata.equals(other.metadata))) { - return false; - } - if (this.transform != other.transform) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 43 * hash + (this.metadata != null ? this.metadata.hashCode() : 0); - hash = 43 * hash + (this.transform ? 1 : 0); - return hash; - } - - } /** Creates a fix, which when invoked adds @SuppresWarnings(keys) to @@ -461,7 +416,13 @@ static Fix createSuppressWarningsFix(CompilationInfo compilationInfo, TreePath t } if (treePath.getLeaf().getKind() != Kind.COMPILATION_UNIT) { - return new FixImpl(TreePathHandle.create(treePath, compilationInfo), compilationInfo.getFileObject(), keys); + class SyntheticJavaFixImpl extends JavaFixImpl implements SyntheticFix { + public SyntheticJavaFixImpl(JavaFix jf) { + super(jf); + } + } + FixImpl javaFix = new FixImpl(TreePathHandle.create(treePath, compilationInfo), compilationInfo.getFileObject(), keys); + return new SyntheticJavaFixImpl(javaFix); } else { return null; } @@ -487,12 +448,7 @@ static List createSuppressWarnings(CompilationInfo compilationInfo, TreePat } Fix f = createSuppressWarningsFix(compilationInfo, treePath, keys); - - if (f != null) { - return Collections.singletonList(f); - } else { - return Collections.emptyList(); - } + return f != null ? List.of(f) : List.of(); } private static boolean isSuppressWarningsSupported(CompilationInfo info) { @@ -505,13 +461,14 @@ private static boolean isSuppressWarningsSupported(CompilationInfo info) { private static final Set DECLARATION = EnumSet.of(Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE, Kind.METHOD, Kind.VARIABLE); - private static final class FixImpl implements Fix, SyntheticFix { + private static final class FixImpl extends JavaFix { - private String keys[]; - private TreePathHandle handle; - private FileObject file; + private final String keys[]; + private final TreePathHandle handle; + private final FileObject file; public FixImpl(TreePathHandle handle, FileObject file, String... keys) { + super(handle); this.keys = keys; this.handle = handle; this.file = file; @@ -531,88 +488,72 @@ public String getText() { return NbBundle.getMessage(ErrorDescriptionFactory.class, "LBL_FIX_Suppress_Waning", keyNames.toString() ); // NOI18N } - @Override - public ChangeInfo implement() throws IOException { - JavaSource js = JavaSource.forFileObject(file); - - js.runModificationTask(new Task() { - @Override - public void run(WorkingCopy copy) throws IOException { - copy.toPhase(Phase.RESOLVED); //XXX: performance - TreePath path = handle.resolve(copy); + public void performRewrite(TransformationContext ctx) throws IOException { + WorkingCopy copy = ctx.getWorkingCopy(); + TreePath path = ctx.getPath(); - while (path != null && path.getLeaf().getKind() != Kind.COMPILATION_UNIT && !DECLARATION.contains(path.getLeaf().getKind())) { - path = path.getParentPath(); - } + while (path != null && path.getLeaf().getKind() != Kind.COMPILATION_UNIT && !DECLARATION.contains(path.getLeaf().getKind())) { + path = path.getParentPath(); + } - if (path == null || path.getLeaf().getKind() == Kind.COMPILATION_UNIT) { - return ; - } + if (path == null || path.getLeaf().getKind() == Kind.COMPILATION_UNIT) { + return ; + } - Tree top = path.getLeaf(); - ModifiersTree modifiers = null; - TreePath lambdaPath = null; - - switch (top.getKind()) { - case ANNOTATION_TYPE: - case CLASS: - case ENUM: - case INTERFACE: - modifiers = ((ClassTree) top).getModifiers(); - break; - case METHOD: - modifiers = ((MethodTree) top).getModifiers(); - break; - case VARIABLE: { - if (path.getParentPath() != null && - path.getParentPath().getLeaf().getKind() == Tree.Kind.LAMBDA_EXPRESSION) { - // check if the variable is an implict parameter. If so, it must be turned into explicit - TreePath typePath = TreePath.getPath(path.getParentPath(), ((VariableTree)top).getType()); - if (copy.getTreeUtilities().isSynthetic(typePath)) { - lambdaPath = path.getParentPath(); - } - } - modifiers = ((VariableTree) top).getModifiers(); - } - break; - default: assert false : "Unhandled Tree.Kind"; // NOI18N + Tree top = path.getLeaf(); + TreePath lambdaPath = null; + + ModifiersTree modifiers = switch (top.getKind()) { + case ANNOTATION_TYPE, CLASS, ENUM, INTERFACE -> ((ClassTree) top).getModifiers(); + case METHOD -> ((MethodTree) top).getModifiers(); + case VARIABLE -> { + TreePath parent = path.getParentPath(); + if (parent != null && parent.getLeaf().getKind() == Tree.Kind.LAMBDA_EXPRESSION) { + // check if the variable is an implict parameter. If so, it must be turned into explicit + TreePath typePath = TreePath.getPath(parent, ((VariableTree)top).getType()); + if (copy.getTreeUtilities().isSynthetic(typePath)) { + lambdaPath = parent; + } } + yield ((VariableTree) top).getModifiers(); + } + default -> { + assert false : "Unhandled Tree.Kind"; // NOI18N + yield null; + } + }; - if (modifiers == null) { - return ; - } + if (modifiers == null) { + return ; + } - TypeElement el = copy.getElements().getTypeElement("java.lang.SuppressWarnings"); // NOI18N + TypeElement el = copy.getElements().getTypeElement("java.lang.SuppressWarnings"); // NOI18N - if (el == null) { - return ; - } + if (el == null) { + return ; + } - LiteralTree[] keyLiterals = new LiteralTree[keys.length]; + LiteralTree[] keyLiterals = new LiteralTree[keys.length]; - for (int i = 0; i < keys.length; i++) { - keyLiterals[i] = copy.getTreeMaker(). - Literal(keys[i]); - } + for (int i = 0; i < keys.length; i++) { + keyLiterals[i] = copy.getTreeMaker(). + Literal(keys[i]); + } - if (lambdaPath != null) { - LambdaExpressionTree let = (LambdaExpressionTree)lambdaPath.getLeaf(); - for (VariableTree var : let.getParameters()) { - TreePath typePath = TreePath.getPath(lambdaPath, var.getType()); - if (copy.getTreeUtilities().isSynthetic(typePath)) { - Tree imported = copy.getTreeMaker().Type(copy.getTrees().getTypeMirror(typePath)); - copy.rewrite(var.getType(), imported); - } - } + if (lambdaPath != null) { + LambdaExpressionTree let = (LambdaExpressionTree)lambdaPath.getLeaf(); + for (VariableTree var : let.getParameters()) { + TreePath typePath = TreePath.getPath(lambdaPath, var.getType()); + if (copy.getTreeUtilities().isSynthetic(typePath)) { + Tree imported = copy.getTreeMaker().Type(copy.getTrees().getTypeMirror(typePath)); + copy.rewrite(var.getType(), imported); } - - ModifiersTree nueMods = GeneratorUtilities.get(copy).appendToAnnotationValue(modifiers, el, "value", keyLiterals); - - copy.rewrite(modifiers, nueMods); } - }).commit(); + } - return null; + ModifiersTree nueMods = GeneratorUtilities.get(copy).appendToAnnotationValue(modifiers, el, "value", keyLiterals); + + copy.rewrite(modifiers, nueMods); } @Override @@ -644,5 +585,5 @@ public int hashCode() { hash = 79 * hash + (this.file != null ? this.file.hashCode() : 0); return hash; } + } } -} diff --git a/java/spi.java.hints/src/org/netbeans/spi/java/hints/HintSeverity.java b/java/spi.java.hints/src/org/netbeans/spi/java/hints/HintSeverity.java index d694ac4d8bcd..873dc194b382 100644 --- a/java/spi.java.hints/src/org/netbeans/spi/java/hints/HintSeverity.java +++ b/java/spi.java.hints/src/org/netbeans/spi/java/hints/HintSeverity.java @@ -34,15 +34,11 @@ public enum HintSeverity { CURRENT_LINE_WARNING; public Severity toEditorSeverity() { - switch ( this ) { - case ERROR: - return Severity.ERROR; - case WARNING: - return Severity.VERIFIER; - case CURRENT_LINE_WARNING: - return Severity.HINT; - default: - return null; - } + return switch (this) { + case ERROR -> Severity.ERROR; + case WARNING -> Severity.VERIFIER; + case CURRENT_LINE_WARNING -> Severity.HINT; + default -> null; + }; } } diff --git a/java/spi.java.hints/src/org/netbeans/spi/java/hints/JavaFixUtilities.java b/java/spi.java.hints/src/org/netbeans/spi/java/hints/JavaFixUtilities.java index 7b9d123cb324..5a7f1ff58c41 100644 --- a/java/spi.java.hints/src/org/netbeans/spi/java/hints/JavaFixUtilities.java +++ b/java/spi.java.hints/src/org/netbeans/spi/java/hints/JavaFixUtilities.java @@ -120,7 +120,6 @@ import org.openide.filesystems.FileUtil; import org.openide.loaders.DataFolder; import org.openide.loaders.DataObject; -import org.openide.loaders.DataObjectNotFoundException; import org.openide.modules.SpecificationVersion; import org.openide.text.PositionBounds; import org.openide.util.Exceptions; @@ -165,9 +164,9 @@ static Fix rewriteFix(CompilationInfo info, String displayName, TreePath what, f } } params.put(e.getKey(), TreePathHandle.create(e.getValue(), info)); - if (e.getValue() instanceof Callable) { + if (e.getValue() instanceof Callable callable) { try { - extraParamsData.put(e.getKey(), ((Callable) e.getValue()).call()); + extraParamsData.put(e.getKey(), callable.call()); } catch (Exception ex) { Exceptions.printStackTrace(ex); } @@ -352,7 +351,7 @@ private static void checkDependency(CompilationInfo copy, Element e, boolean can } } - private static java.util.regex.Pattern SPEC_VERSION = java.util.regex.Pattern.compile("[0-9]+(\\.[0-9]+)+"); + private static final java.util.regex.Pattern SPEC_VERSION = java.util.regex.Pattern.compile("[0-9]+(\\.[0-9]+)+"); static SpecificationVersion computeSpecVersion(CompilationInfo info, Element el) { if (!Utilities.isJavadocSupported(info)) return null; @@ -772,8 +771,7 @@ private Tree handleIdentifier(String name, Tree node) { TreePath tp = parameters.get(name); if (tp != null) { - if (tp.getLeaf() instanceof Hacks.RenameTree) { - Hacks.RenameTree rt = (Hacks.RenameTree) tp.getLeaf(); + if (tp.getLeaf() instanceof Hacks.RenameTree rt) { return make.setLabel(rt.originalTree, rt.newName); } if (!parameterNames.containsKey(name)) { @@ -993,10 +991,9 @@ public Number visitExpressionStatement(ExpressionStatementTree node, Void p) { @Override public Number visitLiteral(LiteralTree node, Void p) { - if (node.getValue() instanceof Number) { - return (Number) node.getValue(); + if (node.getValue() instanceof Number number) { + return number; } - return super.visitLiteral(node, p); } @@ -1006,138 +1003,128 @@ public Number visitBinary(BinaryTree node, Void p) { Number right = scan(node.getRightOperand(), p); if (left != null && right != null) { - Number result = null; - switch (node.getKind()) { - case MULTIPLY: - if (left instanceof Double || right instanceof Double) { - result = left.doubleValue() * right.doubleValue(); - } else if (left instanceof Float || right instanceof Float) { - result = left.floatValue() * right.floatValue(); - } else if (left instanceof Long || right instanceof Long) { - result = left.longValue() * right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() * right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case DIVIDE: - if (left instanceof Double || right instanceof Double) { - result = left.doubleValue() / right.doubleValue(); - } else if (left instanceof Float || right instanceof Float) { - result = left.floatValue() / right.floatValue(); - } else if (left instanceof Long || right instanceof Long) { - result = left.longValue() / right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() / right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case REMAINDER: - if (left instanceof Double || right instanceof Double) { - result = left.doubleValue() % right.doubleValue(); - } else if (left instanceof Float || right instanceof Float) { - result = left.floatValue() % right.floatValue(); - } else if (left instanceof Long || right instanceof Long) { - result = left.longValue() % right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() % right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case PLUS: - if (left instanceof Double || right instanceof Double) { - result = left.doubleValue() + right.doubleValue(); - } else if (left instanceof Float || right instanceof Float) { - result = left.floatValue() + right.floatValue(); - } else if (left instanceof Long || right instanceof Long) { - result = left.longValue() + right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() + right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case MINUS: - if (left instanceof Double || right instanceof Double) { - result = left.doubleValue() - right.doubleValue(); - } else if (left instanceof Float || right instanceof Float) { - result = left.floatValue() - right.floatValue(); - } else if (left instanceof Long || right instanceof Long) { - result = left.longValue() - right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() - right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case LEFT_SHIFT: - if (left instanceof Long || right instanceof Long) { - result = left.longValue() << right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() << right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case RIGHT_SHIFT: - if (left instanceof Long || right instanceof Long) { - result = left.longValue() >> right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() >> right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case UNSIGNED_RIGHT_SHIFT: - if (left instanceof Long || right instanceof Long) { - result = left.longValue() >>> right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() >>> right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case AND: - if (left instanceof Long || right instanceof Long) { - result = left.longValue() & right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() & right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case XOR: - if (left instanceof Long || right instanceof Long) { - result = left.longValue() ^ right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() ^ right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - - case OR: - if (left instanceof Long || right instanceof Long) { - result = left.longValue() | right.longValue(); - } else if (left instanceof Integer || right instanceof Integer) { - result = left.intValue() | right.intValue(); - } else { - throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); - } - break; - } + Number result = switch (node.getKind()) { + case MULTIPLY -> { + if (left instanceof Double || right instanceof Double) { + yield left.doubleValue() * right.doubleValue(); + } else if (left instanceof Float || right instanceof Float) { + yield left.floatValue() * right.floatValue(); + } else if (left instanceof Long || right instanceof Long) { + yield left.longValue() * right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() * right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case DIVIDE -> { + if (left instanceof Double || right instanceof Double) { + yield left.doubleValue() / right.doubleValue(); + } else if (left instanceof Float || right instanceof Float) { + yield left.floatValue() / right.floatValue(); + } else if (left instanceof Long || right instanceof Long) { + yield left.longValue() / right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() / right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case REMAINDER -> { + if (left instanceof Double || right instanceof Double) { + yield left.doubleValue() % right.doubleValue(); + } else if (left instanceof Float || right instanceof Float) { + yield left.floatValue() % right.floatValue(); + } else if (left instanceof Long || right instanceof Long) { + yield left.longValue() % right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() % right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case PLUS -> { + if (left instanceof Double || right instanceof Double) { + yield left.doubleValue() + right.doubleValue(); + } else if (left instanceof Float || right instanceof Float) { + yield left.floatValue() + right.floatValue(); + } else if (left instanceof Long || right instanceof Long) { + yield left.longValue() + right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() + right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case MINUS -> { + if (left instanceof Double || right instanceof Double) { + yield left.doubleValue() - right.doubleValue(); + } else if (left instanceof Float || right instanceof Float) { + yield left.floatValue() - right.floatValue(); + } else if (left instanceof Long || right instanceof Long) { + yield left.longValue() - right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() - right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case LEFT_SHIFT -> { + if (left instanceof Long || right instanceof Long) { + yield left.longValue() << right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() << right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case RIGHT_SHIFT -> { + if (left instanceof Long || right instanceof Long) { + yield left.longValue() >> right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() >> right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case UNSIGNED_RIGHT_SHIFT -> { + if (left instanceof Long || right instanceof Long) { + yield left.longValue() >>> right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() >>> right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case AND -> { + if (left instanceof Long || right instanceof Long) { + yield left.longValue() & right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() & right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case XOR -> { + if (left instanceof Long || right instanceof Long) { + yield left.longValue() ^ right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() ^ right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + case OR -> { + if (left instanceof Long || right instanceof Long) { + yield left.longValue() | right.longValue(); + } else if (left instanceof Integer || right instanceof Integer) { + yield left.intValue() | right.intValue(); + } else { + throw new IllegalStateException("left=" + left.getClass() + ", right=" + right.getClass()); + } + } + default -> null; + }; if (result != null) { rewrite(node, make.Literal(result)); @@ -1154,25 +1141,23 @@ public Number visitUnary(UnaryTree node, Void p) { Number op = scan(node.getExpression(), p); if (op != null) { - Number result = null; - switch (node.getKind()) { - case UNARY_MINUS: - if (op instanceof Double) { - result = -op.doubleValue(); - } else if (op instanceof Float) { - result = -op.floatValue(); - } else if (op instanceof Long) { - result = -op.longValue(); - } else if (op instanceof Integer) { - result = -op.intValue(); - } else { - throw new IllegalStateException("op=" + op.getClass()); - } - break; - case UNARY_PLUS: - result = op; - break; - } + Number result = switch (node.getKind()) { + case UNARY_MINUS -> { + if (op instanceof Double) { + yield -op.doubleValue(); + } else if (op instanceof Float) { + yield -op.floatValue(); + } else if (op instanceof Long) { + yield -op.longValue(); + } else if (op instanceof Integer) { + yield -op.intValue(); + } else { + throw new IllegalStateException("op=" + op.getClass()); + } + } + case UNARY_PLUS -> op; + default -> null; + }; if (result != null) { rewrite(node, make.Literal(result)); @@ -1273,12 +1258,12 @@ public Number visitModifiers(ModifiersTree node, Void p) { Set actualFlags = EnumSet.noneOf(Modifier.class); boolean[] actualAnnotationsMask = new boolean[0]; - if (actualContent instanceof Object[] && ((Object[]) actualContent)[0] instanceof Set) { - actualFlags.addAll(NbCollections.checkedSetByFilter((Set) ((Object[]) actualContent)[0], Modifier.class, false)); + if (actualContent instanceof Object[] objects && objects[0] instanceof Set set) { + actualFlags.addAll(NbCollections.checkedSetByFilter(set, Modifier.class, false)); } - if (actualContent instanceof Object[] && ((Object[]) actualContent)[1] instanceof boolean[]) { - actualAnnotationsMask = (boolean[]) ((Object[]) actualContent)[1]; + if (actualContent instanceof Object[] objects && objects[1] instanceof boolean[] booleans) { + actualAnnotationsMask = booleans; } nue = origMods; @@ -1295,10 +1280,15 @@ public Number visitModifiers(ModifiersTree node, Void p) { int ai = 0; OUTER: for (AnnotationTree a : origMods.getAnnotations()) { - if (actualAnnotationsMask.length <= ai || actualAnnotationsMask[ai++]) continue; + if (actualAnnotationsMask.length <= ai || actualAnnotationsMask[ai++]) { + continue; + } for (Iterator it = annotations.iterator(); it.hasNext();) { AnnotationTree toCheck = it.next(); - Collection match = org.netbeans.api.java.source.matching.Matcher.create(info).setTreeTopSearch().setSearchRoot(new TreePath(getCurrentPath(), a)).match(Pattern.createSimplePattern(new TreePath(getCurrentPath(), toCheck))); + Collection match = org.netbeans.api.java.source.matching.Matcher.create(info) + .setTreeTopSearch() + .setSearchRoot(new TreePath(getCurrentPath(), a)) + .match(Pattern.createSimplePattern(new TreePath(getCurrentPath(), toCheck))); if (!match.isEmpty()) { //should be kept: @@ -1398,7 +1388,7 @@ private T resolveOptionalValue(T in) { private ExpressionTree negate(ExpressionTree original, Tree parent, boolean nullOnPlainNeg) { ExpressionTree newTree; switch (original.getKind()) { - case PARENTHESIZED: + case PARENTHESIZED -> { ExpressionTree expr = ((ParenthesizedTree) original).getExpression(); ExpressionTree negatedOrNull = negate(expr, original, nullOnPlainNeg); if (negatedOrNull != null) { @@ -1414,47 +1404,30 @@ private ExpressionTree negate(ExpressionTree original, Tree parent, boolean null return make.Unary(Kind.LOGICAL_COMPLEMENT, original); } */ - - case INSTANCE_OF: + } + case INSTANCE_OF -> { return make.Unary(Kind.LOGICAL_COMPLEMENT, make.Parenthesized(original)); - - case LOGICAL_COMPLEMENT: + } + case LOGICAL_COMPLEMENT -> { newTree = ((UnaryTree) original).getExpression(); while (newTree.getKind() == Kind.PARENTHESIZED && !JavaFixUtilities.requiresParenthesis(((ParenthesizedTree) newTree).getExpression(), original, parent)) { newTree = ((ParenthesizedTree) newTree).getExpression(); } - break; - case NOT_EQUAL_TO: - newTree = negateBinaryOperator(original, Kind.EQUAL_TO, false); - break; - case EQUAL_TO: - newTree = negateBinaryOperator(original, Kind.NOT_EQUAL_TO, false); - break; - case BOOLEAN_LITERAL: - newTree = make.Literal(!(Boolean) ((LiteralTree) original).getValue()); - break; - case CONDITIONAL_AND: - newTree = negateBinaryOperator(original, Kind.CONDITIONAL_OR, true); - break; - case CONDITIONAL_OR: - newTree = negateBinaryOperator(original, Kind.CONDITIONAL_AND, true); - break; - case LESS_THAN: - newTree = negateBinaryOperator(original, Kind.GREATER_THAN_EQUAL, false); - break; - case LESS_THAN_EQUAL: - newTree = negateBinaryOperator(original, Kind.GREATER_THAN, false); - break; - case GREATER_THAN: - newTree = negateBinaryOperator(original, Kind.LESS_THAN_EQUAL, false); - break; - case GREATER_THAN_EQUAL: - newTree = negateBinaryOperator(original, Kind.LESS_THAN, false); - break; - default: + } + case NOT_EQUAL_TO -> newTree = negateBinaryOperator(original, Kind.EQUAL_TO, false); + case EQUAL_TO -> newTree = negateBinaryOperator(original, Kind.NOT_EQUAL_TO, false); + case BOOLEAN_LITERAL -> newTree = make.Literal(!(Boolean) ((LiteralTree) original).getValue()); + case CONDITIONAL_AND -> newTree = negateBinaryOperator(original, Kind.CONDITIONAL_OR, true); + case CONDITIONAL_OR -> newTree = negateBinaryOperator(original, Kind.CONDITIONAL_AND, true); + case LESS_THAN -> newTree = negateBinaryOperator(original, Kind.GREATER_THAN_EQUAL, false); + case LESS_THAN_EQUAL -> newTree = negateBinaryOperator(original, Kind.GREATER_THAN, false); + case GREATER_THAN -> newTree = negateBinaryOperator(original, Kind.LESS_THAN_EQUAL, false); + case GREATER_THAN_EQUAL -> newTree = negateBinaryOperator(original, Kind.LESS_THAN, false); + default -> { if (nullOnPlainNeg) return null; newTree = make.Unary(Kind.LOGICAL_COMPLEMENT, original); + } } if (JavaFixUtilities.requiresParenthesis(newTree, original, parent)) { @@ -1587,18 +1560,12 @@ public static boolean isPrimary(@NonNull Tree tree) { public static boolean requiresParenthesis(Tree inner, Tree original, Tree outter) { if (!ExpressionTree.class.isAssignableFrom(inner.getKind().asInterface()) || outter == null) return false; if (!ExpressionTree.class.isAssignableFrom(outter.getKind().asInterface())) { - boolean condition = false; - switch (outter.getKind()) { - case IF: - condition = original == ((IfTree)outter).getCondition(); - break; - case WHILE_LOOP: - condition = original == ((WhileLoopTree)outter).getCondition(); - break; - case DO_WHILE_LOOP: - condition = original == ((DoWhileLoopTree)outter).getCondition(); - break; - } + boolean condition = switch (outter.getKind()) { + case IF -> original == ((IfTree)outter).getCondition(); + case WHILE_LOOP -> original == ((WhileLoopTree)outter).getCondition(); + case DO_WHILE_LOOP -> original == ((DoWhileLoopTree)outter).getCondition(); + default -> false; + }; return condition && inner.getKind() != Tree.Kind.PARENTHESIZED; } @@ -1710,25 +1677,20 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { Tree parentLeaf = what.getParentPath().getLeaf(); switch (parentLeaf.getKind()) { - case ANNOTATION: + case ANNOTATION -> { AnnotationTree at = (AnnotationTree) parentLeaf; - AnnotationTree newAnnot; - - newAnnot = make.removeAnnotationAttrValue(at, (ExpressionTree) leaf); - + AnnotationTree newAnnot = make.removeAnnotationAttrValue(at, (ExpressionTree) leaf); wc.rewrite(at, newAnnot); - break; - case BLOCK: + } + case BLOCK -> { BlockTree bt = (BlockTree) parentLeaf; - wc.rewrite(bt, make.removeBlockStatement(bt, (StatementTree) leaf)); - break; - case CASE: + } + case CASE -> { CaseTree caseTree = (CaseTree) parentLeaf; - wc.rewrite(caseTree, make.removeCaseStatement(caseTree, (StatementTree) leaf)); - break; - case CLASS: + } + case CLASS -> { ClassTree classTree = (ClassTree) parentLeaf; ClassTree nueClassTree; @@ -1745,16 +1707,16 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { } wc.rewrite(classTree, nueClassTree); - break; - case UNION_TYPE: + } + case UNION_TYPE -> { UnionTypeTree disjunct = (UnionTypeTree) parentLeaf; List alternatives = new LinkedList(disjunct.getTypeAlternatives()); alternatives.remove(leaf); wc.rewrite(disjunct, make.UnionType(alternatives)); - break; - case METHOD: + } + case METHOD -> { MethodTree mTree = (MethodTree) parentLeaf; MethodTree newMethod; @@ -1769,8 +1731,8 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { } wc.rewrite(mTree, newMethod); - break; - case METHOD_INVOCATION: + } + case METHOD_INVOCATION -> { MethodInvocationTree iTree = (MethodInvocationTree) parentLeaf; MethodInvocationTree newInvocation; @@ -1783,13 +1745,12 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { } wc.rewrite(iTree, newInvocation); - break; - case MODIFIERS: + } + case MODIFIERS -> { ModifiersTree modsTree = (ModifiersTree) parentLeaf; - wc.rewrite(modsTree, make.removeModifiersAnnotation(modsTree, (AnnotationTree) leaf)); - break; - case NEW_CLASS: + } + case NEW_CLASS -> { NewClassTree newCTree = (NewClassTree) parentLeaf; NewClassTree newNCT; @@ -1802,13 +1763,12 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { } wc.rewrite(newCTree, newNCT); - break; - case PARAMETERIZED_TYPE: + } + case PARAMETERIZED_TYPE -> { ParameterizedTypeTree parTree = (ParameterizedTypeTree) parentLeaf; - wc.rewrite(parTree, make.removeParameterizedTypeTypeArgument(parTree, (ExpressionTree) leaf)); - break; - case SWITCH: + } + case SWITCH -> { SwitchTree switchTree = (SwitchTree) parentLeaf; SwitchTree newSwitch; @@ -1819,8 +1779,8 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { } wc.rewrite(switchTree, newSwitch); - break; - case TRY: + } + case TRY -> { TryTree tryTree = (TryTree) parentLeaf; TryTree newTry; @@ -1837,11 +1797,11 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { } wc.rewrite(tryTree, newTry); - break; - case EXPRESSION_STATEMENT: + } + case EXPRESSION_STATEMENT -> { doRemoveFromParent(wc, what.getParentPath()); - break; - case ASSIGNMENT: + } + case ASSIGNMENT -> { AssignmentTree assignmentTree = (AssignmentTree) parentLeaf; if (leaf == assignmentTree.getVariable()) { if (wc.getTreeUtilities().isExpressionStatement(assignmentTree.getExpression())) { @@ -1852,18 +1812,10 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { } else { throw new UnsupportedOperationException(); } - break; - case AND_ASSIGNMENT: - case DIVIDE_ASSIGNMENT: - case LEFT_SHIFT_ASSIGNMENT: - case MINUS_ASSIGNMENT: - case MULTIPLY_ASSIGNMENT: - case OR_ASSIGNMENT: - case PLUS_ASSIGNMENT: - case REMAINDER_ASSIGNMENT: - case RIGHT_SHIFT_ASSIGNMENT: - case UNSIGNED_RIGHT_SHIFT_ASSIGNMENT: - case XOR_ASSIGNMENT: + } + case AND_ASSIGNMENT, DIVIDE_ASSIGNMENT, LEFT_SHIFT_ASSIGNMENT, MINUS_ASSIGNMENT, + MULTIPLY_ASSIGNMENT, OR_ASSIGNMENT, PLUS_ASSIGNMENT, REMAINDER_ASSIGNMENT, + RIGHT_SHIFT_ASSIGNMENT, UNSIGNED_RIGHT_SHIFT_ASSIGNMENT, XOR_ASSIGNMENT -> { CompoundAssignmentTree compoundAssignmentTree = (CompoundAssignmentTree) parentLeaf; if (leaf == compoundAssignmentTree.getVariable()) { if (wc.getTreeUtilities().isExpressionStatement(compoundAssignmentTree.getExpression())) { @@ -1874,10 +1826,10 @@ private void doRemoveFromParent(WorkingCopy wc, TreePath what) { } else { throw new UnsupportedOperationException(); } - break; - default: + } + default -> { wc.rewrite(what.getLeaf(), make.Block(Collections.emptyList(), false)); - break; + } } } @@ -1894,38 +1846,36 @@ public Void scan(Tree tree, Void p) { if (el == e) { Tree parentLeaf = treePath.getParentPath().getLeaf(); switch (parentLeaf.getKind()) { - case ASSIGNMENT: + case ASSIGNMENT -> { AssignmentTree assignmentTree = (AssignmentTree) parentLeaf; if (tree == assignmentTree.getVariable()) { if (!info.getTreeUtilities().isExpressionStatement(assignmentTree.getExpression()) && canHaveSideEffects(assignmentTree.getExpression())) { ret.set(false); + return null; } } else { ret.set(false); + return null; } - break; - case AND_ASSIGNMENT: - case DIVIDE_ASSIGNMENT: - case LEFT_SHIFT_ASSIGNMENT: - case MINUS_ASSIGNMENT: - case MULTIPLY_ASSIGNMENT: - case OR_ASSIGNMENT: - case PLUS_ASSIGNMENT: - case REMAINDER_ASSIGNMENT: - case RIGHT_SHIFT_ASSIGNMENT: - case UNSIGNED_RIGHT_SHIFT_ASSIGNMENT: - case XOR_ASSIGNMENT: + } + case AND_ASSIGNMENT, DIVIDE_ASSIGNMENT, LEFT_SHIFT_ASSIGNMENT, MINUS_ASSIGNMENT, + MULTIPLY_ASSIGNMENT, OR_ASSIGNMENT, PLUS_ASSIGNMENT, REMAINDER_ASSIGNMENT, + RIGHT_SHIFT_ASSIGNMENT, UNSIGNED_RIGHT_SHIFT_ASSIGNMENT, XOR_ASSIGNMENT -> { CompoundAssignmentTree compoundAssignmentTree = (CompoundAssignmentTree) parentLeaf; if (tree == compoundAssignmentTree.getVariable()) { if (!info.getTreeUtilities().isExpressionStatement(compoundAssignmentTree.getExpression()) && canHaveSideEffects(compoundAssignmentTree.getExpression())) { ret.set(false); + return null; } } else { ret.set(false); + return null; } - break; - default: + } + default -> { ret.set(false); + return null; + } } } } @@ -1943,14 +1893,11 @@ private static boolean canHaveSideEffects(Tree tree) { public Void scan(Tree tree, Void p) { if (tree != null) { switch (tree.getKind()) { - case METHOD_INVOCATION: - case NEW_CLASS: - case POSTFIX_DECREMENT: - case POSTFIX_INCREMENT: - case PREFIX_DECREMENT: - case PREFIX_INCREMENT: + case METHOD_INVOCATION, NEW_CLASS, POSTFIX_DECREMENT, POSTFIX_INCREMENT, + PREFIX_DECREMENT, PREFIX_INCREMENT -> { ret.set(true); - break; + return null; + } } } return super.scan(tree, p); @@ -2003,8 +1950,6 @@ public void performChange() { source = DataObject.find(toMove); sourceFolder = source.getFolder(); source.move(targetFolder); - } catch (DataObjectNotFoundException ex) { - ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } @@ -2014,8 +1959,6 @@ public void performChange() { public void undoChange() { try { source.move(sourceFolder); - } catch (DataObjectNotFoundException ex) { - ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } diff --git a/java/spi.java.hints/src/org/netbeans/spi/java/hints/MatcherUtilities.java b/java/spi.java.hints/src/org/netbeans/spi/java/hints/MatcherUtilities.java index 1392707b8373..05f28856dc37 100644 --- a/java/spi.java.hints/src/org/netbeans/spi/java/hints/MatcherUtilities.java +++ b/java/spi.java.hints/src/org/netbeans/spi/java/hints/MatcherUtilities.java @@ -25,7 +25,6 @@ import com.sun.source.tree.Tree; import com.sun.source.util.TreePath; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -52,20 +51,25 @@ public static boolean matches(@NonNull HintContext ctx, @NonNull TreePath variab public static boolean matches(@NonNull HintContext ctx, @NonNull TreePath variable, @NonNull String pattern, boolean fillInVariablesHack) { return matches(ctx, variable, pattern, ctx.getVariables(), ctx.getMultiVariables(), ctx.getVariableNames(), - fillInVariablesHack ? ctx.getConstraints() : Collections.emptyMap()); + fillInVariablesHack ? ctx.getConstraints() : Map.of()); } public static boolean matches(@NonNull HintContext ctx, @NonNull TreePath variable, @NonNull String pattern, Map outVariables, Map> outMultiVariables, Map outVariables2Names) { - return matches(ctx, variable, pattern, outVariables, outMultiVariables, outVariables2Names, Collections.emptyMap()); + return matches(ctx, variable, pattern, outVariables, outMultiVariables, outVariables2Names, Map.of()); } public static boolean matches(@NonNull HintContext ctx, @NonNull TreePath variable, @NonNull String pattern, Map outVariables, Map> outMultiVariables, Map outVariables2Names, Map variable2Type) { - Pattern p = PatternCompiler.compile(ctx.getInfo(), pattern, variable2Type, Collections.emptyList()); + Pattern p = PatternCompiler.compile(ctx.getInfo(), pattern, variable2Type, List.of()); Map variables = new HashMap<>(ctx.getVariables()); Map> multiVariables = new HashMap<>(ctx.getMultiVariables()); Map variables2Names = new HashMap<>(ctx.getVariableNames()); - Iterable occurrences = Matcher.create(ctx.getInfo()).setCancel(new AtomicBoolean()).setPresetVariable(variables, multiVariables, variables2Names).setSearchRoot(variable).setTreeTopSearch().match(p); + Iterable occurrences = Matcher.create(ctx.getInfo()) + .setCancel(new AtomicBoolean()) + .setPresetVariable(variables, multiVariables, variables2Names) + .setSearchRoot(variable) + .setTreeTopSearch() + .match(p); if (occurrences.iterator().hasNext()) { Occurrence od = occurrences.iterator().next(); @@ -80,7 +84,7 @@ public static boolean matches(@NonNull HintContext ctx, @NonNull TreePath variab } public static boolean matches(@NonNull HintContext ctx, @NonNull Collection variable, @NonNull String pattern, Map outVariables, Map> outMultiVariables, Map outVariables2Names) { - Scope s = Utilities.constructScope(ctx.getInfo(), Collections.emptyMap()); + Scope s = Utilities.constructScope(ctx.getInfo(), Map.of()); Tree patternTree = Utilities.parseAndAttribute(ctx.getInfo(), pattern, s); List patternTrees; @@ -89,7 +93,7 @@ public static boolean matches(@NonNull HintContext ctx, @NonNull CollectionemptyMap()); - Iterable occurrences = Matcher.create(ctx.getInfo()).setCancel(new AtomicBoolean()).setPresetVariable(variables, multiVariables, variables2Names).setSearchRoot(variableIt.next()).setTreeTopSearch().match(p); + Pattern p = Pattern.createPatternWithFreeVariables(patternTreePath, Map.of()); + Iterable occurrences = Matcher.create(ctx.getInfo()) + .setCancel(new AtomicBoolean()) + .setPresetVariable(variables, multiVariables, variables2Names) + .setSearchRoot(variableIt.next()) + .setTreeTopSearch() + .match(p); if (!occurrences.iterator().hasNext()) { return false; diff --git a/java/spi.java.hints/src/org/netbeans/spi/java/hints/support/TransformationSupport.java b/java/spi.java.hints/src/org/netbeans/spi/java/hints/support/TransformationSupport.java index 99b6a86421ff..bea7d8f66ac7 100644 --- a/java/spi.java.hints/src/org/netbeans/spi/java/hints/support/TransformationSupport.java +++ b/java/spi.java.hints/src/org/netbeans/spi/java/hints/support/TransformationSupport.java @@ -60,8 +60,8 @@ */ public final class TransformationSupport { - private String jackpotPattern; - private Transformer transformer; + private final String jackpotPattern; + private final Transformer transformer; private AtomicBoolean cancel = new AtomicBoolean(); private TransformationSupport(String jackpotPattern, Transformer transformer) { @@ -202,9 +202,12 @@ private static Collection performTransformation(fi for (HintDescription hd : PatternConvertor.create(inputJackpotPattern)) { final String triggerPattern = ((Trigger.PatternDescription) hd.getTrigger()).getPattern(); - descriptions.add(HintDescriptionFactory.create().setTrigger(hd.getTrigger()). - setTriggerOptions(hd.getTrigger().getOptions()). - setWorker((HintContext ctx) -> { + descriptions.add( + HintDescriptionFactory.create() + .setTrigger(hd.getTrigger()) + .setTriggerOptions(hd.getTrigger() + .getOptions()) + .setWorker((HintContext ctx) -> { final Map> constraintsHandles = new HashMap<>(); for (Map.Entry c : ctx.getConstraints().entrySet()) { @@ -232,8 +235,9 @@ private static Collection performTransformation(fi } }.toEditorFix(); - return Collections.singletonList(ErrorDescriptionFactory.createErrorDescription(Severity.WARNING, "", Collections.singletonList(fix), ctx.getInfo().getFileObject(), 0, 0)); - }).produce()); + return List.of(ErrorDescriptionFactory.createErrorDescription(Severity.WARNING, "", List.of(fix), ctx.getInfo().getFileObject(), 0, 0)); + }).produce() + ); } diff --git a/java/spring.beans/nbproject/project.properties b/java/spring.beans/nbproject/project.properties index 6a38244341fe..0e1acf518543 100644 --- a/java/spring.beans/nbproject/project.properties +++ b/java/spring.beans/nbproject/project.properties @@ -18,7 +18,7 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.65.0 +spec.version.base=1.66.0 #for SpringModelAnnotationsTest requires.nb.javac=true diff --git a/java/testng.ant/manifest.mf b/java/testng.ant/manifest.mf index 12fef5f2be30..79f0664a318d 100644 --- a/java/testng.ant/manifest.mf +++ b/java/testng.ant/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.testng.ant OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/testng/ant/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.testng.ant.AntTestNGSupport -OpenIDE-Module-Specification-Version: 2.40 +OpenIDE-Module-Specification-Version: 2.41 diff --git a/java/testng.maven/manifest.mf b/java/testng.maven/manifest.mf index 4ba758b1d611..53117e652289 100644 --- a/java/testng.maven/manifest.mf +++ b/java/testng.maven/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.testng.maven OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/testng/maven/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.testng.maven.MavenTestNGSupport -OpenIDE-Module-Specification-Version: 2.41 +OpenIDE-Module-Specification-Version: 2.42 diff --git a/java/testng.ui/manifest.mf b/java/testng.ui/manifest.mf index 700350dd3404..d9e5dc5d18cd 100644 --- a/java/testng.ui/manifest.mf +++ b/java/testng.ui/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.testng.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/testng/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.34 +OpenIDE-Module-Specification-Version: 1.35 diff --git a/java/testng/manifest.mf b/java/testng/manifest.mf index ed834ddc4f84..ec863fb99f46 100644 --- a/java/testng/manifest.mf +++ b/java/testng/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.testng OpenIDE-Module-Layer: org/netbeans/modules/testng/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/testng/Bundle.properties -OpenIDE-Module-Specification-Version: 2.45 +OpenIDE-Module-Specification-Version: 2.46 diff --git a/java/websvc.jaxws21/manifest.mf b/java/websvc.jaxws21/manifest.mf index 333bdf66654f..57bcd8ab2f46 100644 --- a/java/websvc.jaxws21/manifest.mf +++ b/java/websvc.jaxws21/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.jaxws21/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/jaxws21/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 OpenIDE-Module-Layer: org/netbeans/modules/websvc/jaxws21/layer.xml OpenIDE-Module-Provides: com.sun.xml.ws.spi.ProviderImpl diff --git a/java/websvc.jaxws21api/manifest.mf b/java/websvc.jaxws21api/manifest.mf index 995dd14ddff1..35e56d9905f3 100644 --- a/java/websvc.jaxws21api/manifest.mf +++ b/java/websvc.jaxws21api/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.jaxws21api/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/jaxws21api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 OpenIDE-Module-Requires: org.openide.modules.ModuleFormat2 OpenIDE-Module-Needs: com.sun.xml.ws.spi.ProviderImpl, com.sun.xml.bind OpenIDE-Module-Hide-Classpath-Packages: javax.jws.**, javax.xml.ws.**, javax.xml.soap.**, javax.annotation.** diff --git a/java/websvc.saas.codegen.java/manifest.mf b/java/websvc.saas.codegen.java/manifest.mf index 70950fd33144..d4b237c1132e 100644 --- a/java/websvc.saas.codegen.java/manifest.mf +++ b/java/websvc.saas.codegen.java/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.saas.codegen.java OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/codegen/java/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 OpenIDE-Module-Layer: org/netbeans/modules/websvc/saas/codegen/java/layer.xml AutoUpdate-Show-In-Client: false OpenIDE-Module-Provides: org.netbeans.modules.websvc.saas.codegen.java diff --git a/java/whitelist/manifest.mf b/java/whitelist/manifest.mf index 00878d5876d3..d109104fab87 100644 --- a/java/whitelist/manifest.mf +++ b/java/whitelist/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.whitelist OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/whitelist/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/whitelist/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.48 +OpenIDE-Module-Specification-Version: 1.49 diff --git a/java/xml.jaxb/manifest.mf b/java/xml.jaxb/manifest.mf index 96d3c4aa88e3..99a8f3aef758 100644 --- a/java/xml.jaxb/manifest.mf +++ b/java/xml.jaxb/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 OpenIDE-Module: org.netbeans.modules.xml.jaxb/1 OpenIDE-Module-Layer: org/netbeans/modules/xml/jaxb/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/jaxb/Bundle.properties diff --git a/java/xml.tools.java/manifest.mf b/java/xml.tools.java/manifest.mf index 8dcb8a3a1bc6..bc17f2083ad2 100644 --- a/java/xml.tools.java/manifest.mf +++ b/java/xml.tools.java/manifest.mf @@ -3,7 +3,7 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.xml.tools.java OpenIDE-Module-Layer: org/netbeans/modules/xml/tools/java/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/tools/java/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 diff --git a/javafx/javafx2.editor/nbproject/project.properties b/javafx/javafx2.editor/nbproject/project.properties index fb186b6041a4..9fc2135ace36 100644 --- a/javafx/javafx2.editor/nbproject/project.properties +++ b/javafx/javafx2.editor/nbproject/project.properties @@ -18,7 +18,7 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.46.0 +spec.version.base=1.47.0 requires.nb.javac=true test.config.stable.includes=**/JavaFXCSSModuleTest.class diff --git a/javafx/javafx2.kit/manifest.mf b/javafx/javafx2.kit/manifest.mf index 525d515cb4ac..731bd58d9871 100644 --- a/javafx/javafx2.kit/manifest.mf +++ b/javafx/javafx2.kit/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javafx2.kit OpenIDE-Module-Layer: org/netbeans/modules/javafx2/kit/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javafx2/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 diff --git a/javafx/javafx2.platform/manifest.mf b/javafx/javafx2.platform/manifest.mf index 5d471f5feb5b..f86131c8b67c 100644 --- a/javafx/javafx2.platform/manifest.mf +++ b/javafx/javafx2.platform/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javafx2.platform OpenIDE-Module-Layer: org/netbeans/modules/javafx2/platform/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javafx2/platform/Bundle.properties -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 diff --git a/javafx/javafx2.project/manifest.mf b/javafx/javafx2.project/manifest.mf index ffb2ac536e33..733e6acab459 100644 --- a/javafx/javafx2.project/manifest.mf +++ b/javafx/javafx2.project/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javafx2.project OpenIDE-Module-Layer: org/netbeans/modules/javafx2/project/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javafx2/project/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 diff --git a/javafx/javafx2.samples/manifest.mf b/javafx/javafx2.samples/manifest.mf index 8b1cc74a9fd1..ee7db35a15e5 100644 --- a/javafx/javafx2.samples/manifest.mf +++ b/javafx/javafx2.samples/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javafx2.samples OpenIDE-Module-Layer: org/netbeans/modules/javafx2/samples/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javafx2/samples/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 diff --git a/javafx/javafx2.scenebuilder/manifest.mf b/javafx/javafx2.scenebuilder/manifest.mf index b2c1a6d03ed7..35f15fd7fece 100644 --- a/javafx/javafx2.scenebuilder/manifest.mf +++ b/javafx/javafx2.scenebuilder/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.javafx2.scenebuilder OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javafx2/scenebuilder/Bundle.properties -OpenIDE-Module-Specification-Version: 1.42 +OpenIDE-Module-Specification-Version: 1.43 diff --git a/javafx/maven.htmlui/manifest.mf b/javafx/maven.htmlui/manifest.mf index 70a501047b37..de95dec06961 100644 --- a/javafx/maven.htmlui/manifest.mf +++ b/javafx/maven.htmlui/manifest.mf @@ -6,4 +6,4 @@ OpenIDE-Module-Requires: org.netbeans.api.templates.wizard OpenIDE-Module-Recommends: org.netbeans.modules.ko4j.debugging,org.netbeans.modules.ko4j.editing OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/htmlui/Bundle.properties OpenIDE-Module-Needs: org.netbeans.api.templates.wizard, javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/nb/autoupdate.pluginimporter/manifest.mf b/nb/autoupdate.pluginimporter/manifest.mf index fdfcfaa1d9f7..a15b8580666f 100644 --- a/nb/autoupdate.pluginimporter/manifest.mf +++ b/nb/autoupdate.pluginimporter/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.autoupdate.pluginimporter OpenIDE-Module-Install: org/netbeans/modules/autoupdate/pluginimporter/Installer.class OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/autoupdate/pluginimporter/Bundle.properties -OpenIDE-Module-Specification-Version: 1.45 +OpenIDE-Module-Specification-Version: 1.46 diff --git a/nb/bugzilla.exceptionreporter/manifest.mf b/nb/bugzilla.exceptionreporter/manifest.mf index b17a827c9cb5..cfed76d4c4bb 100644 --- a/nb/bugzilla.exceptionreporter/manifest.mf +++ b/nb/bugzilla.exceptionreporter/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true OpenIDE-Module: org.netbeans.modules.bugzilla.exceptionreporter OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugzilla/exceptionreporter/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 diff --git a/nb/deadlock.detector/manifest.mf b/nb/deadlock.detector/manifest.mf index 8cfa17151461..91515922b0c7 100644 --- a/nb/deadlock.detector/manifest.mf +++ b/nb/deadlock.detector/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.deadlock.detector OpenIDE-Module-Install: org/netbeans/modules/deadlock/detector/Installer.class OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/deadlock/detector/Bundle.properties -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 Main-Class: org.netbeans.modules.deadlock.detector.DeadlockReporter diff --git a/nb/ide.branding.kit/manifest.mf b/nb/ide.branding.kit/manifest.mf index 92a09b434fcc..c1d055223bb3 100644 --- a/nb/ide.branding.kit/manifest.mf +++ b/nb/ide.branding.kit/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ide.branding.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/branding/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.53 +OpenIDE-Module-Specification-Version: 1.54 diff --git a/nb/ide.branding/manifest.mf b/nb/ide.branding/manifest.mf index 5f1e9e6241f2..d1f4ce898aa9 100644 --- a/nb/ide.branding/manifest.mf +++ b/nb/ide.branding/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ide.branding/1 OpenIDE-Module-Layer: org/netbeans/modules/ide/branding/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/branding/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 AutoUpdate-Show-In-Client: false diff --git a/nb/ide.dashboard/manifest.mf b/nb/ide.dashboard/manifest.mf index 86d5da13fb85..a9949d0eec9b 100644 --- a/nb/ide.dashboard/manifest.mf +++ b/nb/ide.dashboard/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 -OpenIDE-Module-Specification-Version: 0.2 +OpenIDE-Module-Specification-Version: 0.3 OpenIDE-Module: org.netbeans.modules.ide.dashboard/0 OpenIDE-Module-Layer: org/netbeans/modules/ide/dashboard/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/dashboard/Bundle.properties diff --git a/nb/ide.dashboard/nbproject/project.xml b/nb/ide.dashboard/nbproject/project.xml index 3ef59521d167..898523e0b33c 100644 --- a/nb/ide.dashboard/nbproject/project.xml +++ b/nb/ide.dashboard/nbproject/project.xml @@ -66,41 +66,6 @@ 1.69 - - org.netbeans.modules.projectapi - - - - 1 - 1.95 - - - - org.netbeans.modules.projectui - - - - 1.83 - - - - org.netbeans.modules.projectuiapi.base - - - - 1 - 1.110 - - - - org.netbeans.modules.utilities - - - - 1 - 1.85 - - org.openide.awt diff --git a/nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/resources/layer.xml b/nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/resources/layer.xml index 5cd0557fdf43..6efee0c281ea 100644 --- a/nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/resources/layer.xml +++ b/nb/ide.dashboard/src/org/netbeans/modules/ide/dashboard/resources/layer.xml @@ -22,54 +22,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - diff --git a/nb/o.n.upgrader/manifest.mf b/nb/o.n.upgrader/manifest.mf index 51b65be10101..d0c992fc0769 100644 --- a/nb/o.n.upgrader/manifest.mf +++ b/nb/o.n.upgrader/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.upgrader -OpenIDE-Module-Specification-Version: 4.60 +OpenIDE-Module-Specification-Version: 4.61 OpenIDE-Module-Localizing-Bundle: org/netbeans/upgrade/Bundle.properties AutoUpdate-Essential-Module: true diff --git a/nb/uihandler.exceptionreporter/manifest.mf b/nb/uihandler.exceptionreporter/manifest.mf index 9e15640ac934..c8c3be8bcf90 100644 --- a/nb/uihandler.exceptionreporter/manifest.mf +++ b/nb/uihandler.exceptionreporter/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.uihandler.exceptionreporter OpenIDE-Module-Install: org/netbeans/modules/uihandler/exceptionreporter/Installer.class OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/uihandler/exceptionreporter/Bundle.properties -OpenIDE-Module-Specification-Version: 1.54 +OpenIDE-Module-Specification-Version: 1.55 AutoUpdate-Show-In-Client: false diff --git a/nb/updatecenters/manifest.mf b/nb/updatecenters/manifest.mf index c47185e4f271..57bdd9b18582 100644 --- a/nb/updatecenters/manifest.mf +++ b/nb/updatecenters/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/updatecenters/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 OpenIDE-Module: org.netbeans.modules.updatecenters/1 OpenIDE-Module-Layer: org/netbeans/modules/updatecenters/resources/mf-layer.xml diff --git a/nb/welcome/l10n.list b/nb/welcome/l10n.list deleted file mode 100644 index 5b49a4595ca6..000000000000 --- a/nb/welcome/l10n.list +++ /dev/null @@ -1,22 +0,0 @@ -# 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. -# -# diff -read global -${l10n-module}/release/docs/images/*.png -${l10n-module}/release/docs/images/*.gif -${l10n-module}/release/docs/*.html diff --git a/nb/welcome/licenseinfo.xml b/nb/welcome/licenseinfo.xml deleted file mode 100644 index a40ee1a2a2b2..000000000000 --- a/nb/welcome/licenseinfo.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd - src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent - src/org/netbeans/modules/welcome/resources/xhtml-special.ent - src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent - - DTDs and XMLSchemata are used at runtime to enable html entity resolution in RSS feeds. - - - src/org/netbeans/modules/welcome/resources/sel_btn_right.png - src/org/netbeans/modules/welcome/resources/btn_right.png - src/org/netbeans/modules/welcome/resources/content_banner.png - src/org/netbeans/modules/welcome/resources/nb_logo.png - src/org/netbeans/modules/welcome/resources/incubator_logo.png - src/org/netbeans/modules/welcome/resources/incubator_logo_dark.png - src/org/netbeans/modules/welcome/resources/broken_image.gif - src/org/netbeans/modules/welcome/resources/tab_rollover.png - src/org/netbeans/modules/welcome/resources/picture_frame.png - src/org/netbeans/modules/welcome/resources/btn_left.png - src/org/netbeans/modules/welcome/resources/welcome.gif - src/org/netbeans/modules/welcome/resources/apache_feather_dark.png - src/org/netbeans/modules/welcome/resources/startpage.gif - src/org/netbeans/modules/welcome/resources/sel_btn_center.png - src/org/netbeans/modules/welcome/resources/tab_selected_dark.png - src/org/netbeans/modules/welcome/resources/nb_logo_dark.png - src/org/netbeans/modules/welcome/resources/sel_btn_left.png - src/org/netbeans/modules/welcome/resources/apache_feather.png - src/org/netbeans/modules/welcome/resources/tab_rollover_dark.png - src/org/netbeans/modules/welcome/resources/tab_selected.png - src/org/netbeans/modules/welcome/resources/content_banner_dark.png - src/org/netbeans/modules/welcome/resources/btn_center.png - release/docs/images/background.png - release/docs/images/banner-left.png - release/docs/images/banner-right.png - release/docs/images/blue.png - release/docs/images/circle1.gif - release/docs/images/circle2.gif - release/docs/images/circle3.gif - release/docs/images/circle4.gif - release/docs/images/circle5.gif - release/docs/images/circle6.gif - release/docs/images/down-left.png - release/docs/images/down-right.png - release/docs/images/spacer.png - release/docs/images/up-left.png - release/docs/images/up-right.png - - - - diff --git a/nb/welcome/manifest.mf b/nb/welcome/manifest.mf deleted file mode 100644 index 144aa4cdc806..000000000000 --- a/nb/welcome/manifest.mf +++ /dev/null @@ -1,9 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module-Install: org/netbeans/modules/welcome/Installer.class -OpenIDE-Module-Specification-Version: 1.66 -OpenIDE-Module: org.netbeans.modules.welcome/1 -OpenIDE-Module-Layer: org/netbeans/modules/welcome/resources/layer.xml -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/welcome/Bundle.properties -AutoUpdate-Show-In-Client: false - - diff --git a/nb/welcome/nbproject/project.properties b/nb/welcome/nbproject/project.properties deleted file mode 100644 index 66cdde220d49..000000000000 --- a/nb/welcome/nbproject/project.properties +++ /dev/null @@ -1,22 +0,0 @@ -# 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. -javac.compilerargs=-Xlint:unchecked -javac.source=1.8 - -test.config.stableBTD.includes=**/*Test.class -test.config.stableBTD.excludes=\ - **/FeedbackSurveyTest.class diff --git a/nb/welcome/nbproject/project.xml b/nb/welcome/nbproject/project.xml deleted file mode 100644 index 317d9771eae1..000000000000 --- a/nb/welcome/nbproject/project.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.netbeans.modules.welcome - - - org.netbeans.api.progress - - - - 1 - 1.40 - - - - org.netbeans.api.progress.nb - - - - 1.40 - - - - org.netbeans.modules.options.api - - - - 1 - 1.5 - - - - org.netbeans.modules.projectapi - - - - 1 - 1.13 - - - - org.netbeans.modules.projectui - - - - 1.32 - - - - org.netbeans.modules.projectuiapi - - - - 1 - 1.78 - - - - org.netbeans.modules.projectuiapi.base - - - - 1 - 1.78 - - - - org.openide.awt - - - - 7.82 - - - - org.openide.dialogs - - - - 6.6 - - - - org.openide.filesystems - - - - 9.0 - - - - org.openide.loaders - - - - 7.61 - - - - org.openide.modules - - - - 7.25 - - - - org.openide.nodes - - - - 6.2 - - - - org.openide.util.ui - - - - 9.3 - - - - org.openide.util - - - - 9.3 - - - - org.openide.util.lookup - - - - 8.0 - - - - org.openide.windows - - - - 6.2 - - - - - - unit - - org.netbeans.libs.junit4 - - - - org.netbeans.modules.nbjunit - - - - - org.netbeans.modules.projectapi.nb - - - - - - - diff --git a/nb/welcome/release/docs/GUIExamplesDescription.html b/nb/welcome/release/docs/GUIExamplesDescription.html deleted file mode 100644 index cdff1667987f..000000000000 --- a/nb/welcome/release/docs/GUIExamplesDescription.html +++ /dev/null @@ -1,74 +0,0 @@ - - - -GUI Form Examples - - - - - -
-

GUI Form Example Descriptions

-

- -This project contains three visual forms that were designed with the IDE's -GUI Builder.

-

To open an example form in the GUI Builder:

-
    -
  1. In the IDE's Projects window, navigate to the default package node within the
    - Source Packages directory.
  2. -
    -
  3. Double-click the node of the sample form you want to view. -

    The IDE launches the GUI Builder and displays the chosen form. -

  4. -
- -
- -

Contact Editor

-

This complex form is similar to Windows dialogs typically used to display and -edit database information. The example illustrates the full range of GUI Builder -features, including alignment, anchoring, sizing, indentation, and runtime -auto-resizing behavior. To view a detailed tutorial including flash demonstrations -showing how to build this form, see -Designing a Swing GUI in NetBeans IDE.

- -
- -

Antenna Preferences

-

This example illustrates a type of table-based form commonly used to display -related information in visually coherent groups. The GUI Builder's advanced -alignment features enable you to group and size non-adjacent components -(such as labels, textfields, and buttons) consistently without the need to merge cells manually. -

- -
- -

Find

-

This simple form illustrates a straight-forward layout often used in various -applications requiring basic search functionality. The GUI Builder's alignment -and sizing features enable you to quickly construct such forms while ensuring -that they localize predictably. -

- - - diff --git a/nb/welcome/release/docs/SwingInteropDescription.html b/nb/welcome/release/docs/SwingInteropDescription.html deleted file mode 100644 index 7320212cea66..000000000000 --- a/nb/welcome/release/docs/SwingInteropDescription.html +++ /dev/null @@ -1,78 +0,0 @@ - - - -Swing Interop - - - - - -
-

Swing Interop Sample Description

-

- -This project demonstrates the use of JavaFX 2.0 components in a Swing based application.

- -
- -

JavaFX2-in-Swing in NetBeans 7.1

-

Building the sample SwingInterop produces in project dist/ subdirectory -a JAR file, a HTML file and two JNLP files - one to enable standalone -application launch, the other to enable launch as applet within the HTML page. -Note that the application is not a JavaFX 2.0 application and -the built files do not follow the JavaFX 2.0 deployment -model as described at JavaFX website. The JNLP files -are pre-FX WebStart files, extended only by the reference to the -required JavaFX 2.0+ runtime, which must be present in the system -in order to run the application. The application itself launches -either as standard Swing application or as (pre-FX) applet. -To run the sample outside of NetBeans IDE do one of the following:

-
    -
  • java -jar SwingInterop.jar
  • -
  • double-click SwingInterop_application.jnlp
  • -
  • open SwingInterop.html in a browser with installed JavaFX plug-in
  • -
- -

Creating JavaFX2-in-Swing projects

-

NetBeans 7.1 supports either pure Java2SE (Swing) projects or pure -JavaFX 2.0+ projects, but does not provide specific support for -JavaFX2-in-Swing projects. Such support will be included in NetBeans 7.2. -Before NetBeans 7.2 is available, the following workarounds can be followed:

-
    -
  1. Use SwingInterop sample as starting point and modify its contents - as required. Note that the main.class property must be updated - manually in nbproject/project.properties to point to the main class of - your modified project.
  2. -
  3. To start from scratch, create a new JavaFX Preloader project (in menu - File->New Project->JavaFX->JavaFX Preloader). Replace build.xml by - build.xml taken from the SwingInterop sample (and preferably edit - <project> name in it). Copy the whole web/ subdirectory from - SwingInterop sample to the new project. In nbproject/project.properties - add manually the property main.class and set it to the true - main class name when your java sources are ready.
  4. -
-

-Use Run to run the application within the IDE.
-Use Clean and Build to obtain the deployment files as described above.

- - - diff --git a/nb/welcome/release/docs/images/background.png b/nb/welcome/release/docs/images/background.png deleted file mode 100644 index 8b5f10d87976..000000000000 Binary files a/nb/welcome/release/docs/images/background.png and /dev/null differ diff --git a/nb/welcome/release/docs/images/banner-left.png b/nb/welcome/release/docs/images/banner-left.png deleted file mode 100644 index bedd1b10bb34..000000000000 Binary files a/nb/welcome/release/docs/images/banner-left.png and /dev/null differ diff --git a/nb/welcome/release/docs/images/banner-right.png b/nb/welcome/release/docs/images/banner-right.png deleted file mode 100644 index 2804deac4f74..000000000000 Binary files a/nb/welcome/release/docs/images/banner-right.png and /dev/null differ diff --git a/nb/welcome/release/docs/images/blue.png b/nb/welcome/release/docs/images/blue.png deleted file mode 100644 index 0d42fdd803da..000000000000 Binary files a/nb/welcome/release/docs/images/blue.png and /dev/null differ diff --git a/nb/welcome/release/docs/images/circle1.gif b/nb/welcome/release/docs/images/circle1.gif deleted file mode 100644 index 282cd65dc0a6..000000000000 Binary files a/nb/welcome/release/docs/images/circle1.gif and /dev/null differ diff --git a/nb/welcome/release/docs/images/circle2.gif b/nb/welcome/release/docs/images/circle2.gif deleted file mode 100644 index 40755abccbda..000000000000 Binary files a/nb/welcome/release/docs/images/circle2.gif and /dev/null differ diff --git a/nb/welcome/release/docs/images/circle3.gif b/nb/welcome/release/docs/images/circle3.gif deleted file mode 100644 index 9d3365b0fa6f..000000000000 Binary files a/nb/welcome/release/docs/images/circle3.gif and /dev/null differ diff --git a/nb/welcome/release/docs/images/circle4.gif b/nb/welcome/release/docs/images/circle4.gif deleted file mode 100644 index 58b56cc0a615..000000000000 Binary files a/nb/welcome/release/docs/images/circle4.gif and /dev/null differ diff --git a/nb/welcome/release/docs/images/circle5.gif b/nb/welcome/release/docs/images/circle5.gif deleted file mode 100644 index cf248cf0655a..000000000000 Binary files a/nb/welcome/release/docs/images/circle5.gif and /dev/null differ diff --git a/nb/welcome/release/docs/images/circle6.gif b/nb/welcome/release/docs/images/circle6.gif deleted file mode 100644 index 403f8da773d6..000000000000 Binary files a/nb/welcome/release/docs/images/circle6.gif and /dev/null differ diff --git a/nb/welcome/release/docs/images/down-left.png b/nb/welcome/release/docs/images/down-left.png deleted file mode 100644 index 6552e8e7b2e8..000000000000 Binary files a/nb/welcome/release/docs/images/down-left.png and /dev/null differ diff --git a/nb/welcome/release/docs/images/down-right.png b/nb/welcome/release/docs/images/down-right.png deleted file mode 100644 index 7315cec97da9..000000000000 Binary files a/nb/welcome/release/docs/images/down-right.png and /dev/null differ diff --git a/nb/welcome/release/docs/images/spacer.png b/nb/welcome/release/docs/images/spacer.png deleted file mode 100644 index e82310890743..000000000000 Binary files a/nb/welcome/release/docs/images/spacer.png and /dev/null differ diff --git a/nb/welcome/release/docs/images/up-left.png b/nb/welcome/release/docs/images/up-left.png deleted file mode 100644 index 07c915dfb159..000000000000 Binary files a/nb/welcome/release/docs/images/up-left.png and /dev/null differ diff --git a/nb/welcome/release/docs/images/up-right.png b/nb/welcome/release/docs/images/up-right.png deleted file mode 100644 index 6016896be6cf..000000000000 Binary files a/nb/welcome/release/docs/images/up-right.png and /dev/null differ diff --git a/nb/welcome/release/docs/netbeans.css b/nb/welcome/release/docs/netbeans.css deleted file mode 100644 index 9b58672df62a..000000000000 --- a/nb/welcome/release/docs/netbeans.css +++ /dev/null @@ -1,1006 +0,0 @@ -/* - * 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 special styles used eg in JavaDoc */ -@import url("nb_special.css"); - -/* Generic Elements ------------------------------------------------- */ - -BODY { - background-color: #ffffff; - - scrollbar-3dlight-color: #FFFFFF; - scrollbar-arrow-color: #FFFFFF; - scrollbar-track-color: #FFFFFF; - scrollbar-darkshadow-color: #FFFFFF; - scrollbar-face-color: #06548F; - scrollbar-highlight-color: #FFFFFF; - scrollbar-shadow-color: #FFFFFF; - - font-size: 12px; - font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - color: #000000; - - margin-top:0px; - margin-left:10px; - margin-right:8px; - margin-bottom:16px; - - padding:0px; - min-width:780px; -} - -a:link, a:visited { - color: #045491; - font-weight : bold; - text-decoration: none; -} - -a:link:hover, a:visited:hover { - color: #045491; - font-weight : bold; - text-decoration : underline; -} - -TD { - font-size: 12px; - font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - color: #000000; -} - -H1 { - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - border-bottom:1px solid #AFAFAF; - clear:both; - font-size: 16px; - font-weight:bold; - margin:0px; - padding:0px; - color:#D20005; -} - -H2 { - font-size: 14px; - font-weight:bold; - margin:0px; - border-bottom:1px solid #808080; - margin-top:5px; - margin-bottom:5px; - color:#D20005; -} - -H3 { - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - font-size: 13px; - font-weight:bold; - margin:0px; - padding:0px; - color:#D20005; -} - -h4 { - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - color:#D20005; -} - -H5 { - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - font-size: 13px; - font-weight:bold; - padding-bottom:0px; - margin-bottom:0px; - border-bottom:1px solid #AFAFAF; - color:#0E1B55; - clear:both; -} - -H3.tutorial { - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - font-size: 13px; - font-weight:bold; - padding-bottom:0px; - margin-bottom:0px; - border-bottom:1px solid #AFAFAF; - color:#0E1B55; - clear:both; -} - -FORM { - padding:0px; - margin:0px; -} - -/* Header ----------------------------------------------------------- */ -#header { - display:block; - border:0px; - height:61px; - background-image:url("images/v4/bg_topt.gif"); - background-repeat:repeat-x; - vertical-align:top; - position:relative; -} - -.iLogo { - border:0px; -} - -#logo { - float:left; -} - -/* menu */ -#menu { - display:block; - float:left; -} - -#menu SPAN { - display:none; -} - -.iMenu { - vertical-align:top; - border:0px; -} - -#choose { - display:block; - float:right; - z-index:30; -} - -#langmenu { - font-size:10px; - display:none; - visibility:hidden; - background-color:#2180B5; - position:absolute; - right:0px; - top:0px; - z-index:20; - border-left:1px solid #ffffff; - padding-top:0px; - padding-bottom:5px; - text-align:right; -} - -#langmenuunder { - display:none; - visibility:hidden; - position:absolute; - right:0px; - top:0px; - z-index:19; - width:250px; - height:500px; -/* border:1px solid #dddddd; */ -} - -#langmenu A { - z-index:21; - display:block; - padding-top:4px; - padding-right:8px; - background-color:#2180B5; - height:21px; - width:197px; - color:#ffffff; - font-weight:bold; - text-align:right; - vertical-align:middle; - border-bottom: 1px solid #4D99C4; - /* text-decoration:none; ? */ -} - -.langselect { - font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - margin-right:5px; - margin-top:3px; - font-size:10px; - font-weight:bold; - width:120px; - text-align:right; - background-color:#4D99C4; - color:#ffffff; -} - -/* Left Menu Elements ----------------------------------------------- */ - -.leftnavtitle { - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - font-size: 22px; - font-weight:normal; - margin-top:4px; - margin-bottom:20px; - padding-bottom:0px; - border-bottom:1px solid #AFAFAF; - color:#0E1B55; - clear:both; -} - -.moduletitle { - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - font-size: 22px; - font-weight:normal; - margin-top:4px; - margin-bottom:20px; - padding-bottom:0px; - border-bottom:1px solid #AFAFAF; - color:#0E1B55; - clear:both; - background-image:url('images/v4/bg_icon.gif'); - background-repeat:no-repeat; - background-position:right; -} - -.leftmenuarrow { - margin-top:8px; - background-image:url("images/v4/arr_r3.gif"); - background-repeat:no-repeat; - background-color:#ffffff; - font-weight:bold; - padding-bottom:10px; - border-bottom:1px solid #EFEFEF; -} - -.leftmenuarrdn { - margin-top:8px; - background-image:url("images/v4/arr_dn.gif"); - background-repeat:no-repeat; - background-color:#ffffff; - font-weight:bold; - padding-bottom:10px; - border-bottom:1px solid #EFEFEF; -} - -.leftmenuplus { - margin-top:8px; - background-image:url("images/v4/menu_mark_plus.gif"); - background-repeat:no-repeat; - background-color:#ffffff; - font-weight:bold; - padding-bottom:10px; - border-bottom:1px solid #EFEFEF; -} - -.leftmenusq { - margin-top:8px; - background-image:url("images/v4/menu_mark_sq.gif"); - background-repeat:no-repeat; - background-color:#ffffff; - font-weight:bold; - padding-bottom:10px; - border-bottom:1px solid #EFEFEF; -} - -.leftmenug { - margin-top:8px; - background-image:url("images/v4/menu_mark_gt.gif"); - background-repeat:no-repeat; - background-color:#ffffff; - font-weight:bold; - padding-bottom:10px; - border-bottom:1px solid #EFEFEF; -} - -.leftsubmenug { - margin-top:6px; - background-image:url("images/v4/menu_mark_gt.gif"); - background-repeat:no-repeat; - background-color:#ffffff; -} - -.leftsubmenusq { - margin-top:6px; - background-image:url("images/v4/menu_mark_ssq.gif"); - background-repeat:no-repeat; - background-color:#ffffff; -} - -.leftmenuminus { - margin-top:8px; - background-image:url("images/v4/menu_mark_minus.gif"); - background-repeat:no-repeat; - background-color:#ffffff; - font-weight:bold; - padding-bottom:10px; - border-bottom:1px solid #EFEFEF; -} - -.leftmenuitem { - margin-left:15px; - padding:0px; - border:0px; -} - -.leftsubmenuitem { - margin-left:15px; - padding:0px; - border:0px; -} - -.leftmenuitem SELECT { - font-size:10px; - font-weight:bold; - font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - color:#3F3F3F; - width:140px; -} - -/* Mainarea -------------------------------------------------------- */ - -#content { - margin-left:6px; - background-color:#ffffff; - margin-right:30px; -} - -#contentRight { - font-size: 11px; - color: #4E4E4E; - display:block; - background-color:#ffffff; - width:196px; -} - -#newsticker { - height:41px; - background-color:#3494CA; - vertical-align:middle; - margin-bottom:11px; -} - -#newstickertext { - padding-top:13px; - float:left; - height:28px; - vertical-align:middle; - - font-size: 12px; - font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - color: #ffffff; -} - -#newstickerxml { - padding-top:15px; - float:right; - height:26px; - vertical-align:middle; - - font-size: 10px; - font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - font-weight:bold; - color: #ffffff; -} - -#newstickerxml A { - color: #ffffff; - text-decoration:none; -} - -#promo { - background-color:#ffffff; - height:80px; - margin-bottom:5px; -} - -#promotext { - padding-top:0px; - padding-right:20px; - font-size: 11px; - font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - font-weight:bold; - color: #000000; - line-height:15px; -} - -/* padding-left:180px; */ - -#promourl { - padding-top:10px; - padding-left:20px; - font-size: 11px; -} - -#promourl A { - display:block; - color:#045491; - text-decoration:none; - #height:25px; - width:260px; - margin-bottom:6px; - margin-right:10px; -} - -#promourll { - float:left; -} - -.titlehead { - border-bottom:1px solid #AFAFAF; - clear:both; -} - -/* - background-image:url("images/v4/banner_beta2_tall.png"); - background-repeat:no-repeat; -*/ - -#mainart { - margin-top:5px; - background-color:#ffffff; - margin-bottom:20px; - min-height:255px; - height: auto; - _height: 255px; -} - -#mainarttext { - padding-top:12px; - padding-left:185px; - padding-right:20px; -} - -.article { - background-image:url("images/v4/bg_article.gif"); - background-repeat:no-repeat; -} - -.articledate { - color: #4E4E4E; - font-size:11px; - margin-left:15px; -} - -.articletitle { - margin-left:15px; - font-weight:bold; - font-size:12px; -} - -.articleperex { - margin-left:15px; -} - -.articleborder { - margin-left:15px; - margin-top:9px; - background-image:url("images/v4/bg_art_dot.gif"); - background-repeat:repeat-x; - height:10px; -} - -.articleall { - margin-top:9px; - text-align:right; - font-weight:bold; -} - -#articleall { - margin-top:9px; - text-align:right; - font-weight:bold; -} - -#mainstory { - margin-top:9px; - margin-right:5px; - background-color:#ffffff; - clear:both; -} - -#mainstory B { - display:block; - font-size:12px; - padding-bottom:5px; -} - -#search { - font-size: 10px; - display:block; - height:41px; - background-color:#E7E7E7; - font-weight:bold; - color:#000000; - vertical-align:middle; - margin-bottom:19px; -} - -/* SEARCH */ - -#search A { - color:#000000; - text-decoration:none; -} - -#search A:Link { - color:#000000; - text-decoration:none; -} - -#search A:visited { - color:#000000; - text-decoration:none; -} - -#search A:hover { - color:#000000; - text-decoration:underline; -} - -.va { - vertical-align:middle; - text-align:center; - padding-top:11px; -} - -.searchinp { - width:100px; - height:15px; - border-top:1px solid #B7B7B7; - border-left:1px solid #B7B7B7; - border-right:1px solid #ffffff; - border-bottom:1px solid #ffffff; - vertical-align:middle; - font-size:10px; -} - -.searchsub { - width:34px; - height:15px; - vertical-align:middle; -} - -.inp { - width:112px; - height:15px; - border-top:1px solid #B7B7B7; - border-left:1px solid #B7B7B7; - border-right:1px solid #E7E7E7; - border-bottom:1px solid #E7E7E7; - vertical-align:middle; - font-size:10px; -} - -/* LOGIN */ -#login { - font-size: 10px; - display:block; - font-weight:bold; - text-align:left; - padding-bottom:5px; - border-bottom:1px solid #B7B7B7; -} - -#login TD { - font-weight:bold; - font-size: 10px; -} - -.logininp { - width:83px; - height:15px; - border-top:1px solid #B7B7B7; - border-left:1px solid #B7B7B7; - border-right:1px solid #E7E7E7; - border-bottom:1px solid #E7E7E7; - vertical-align:middle; - font-size:10px; -} - -#logout { - font-size:10px; - display:block; - text-align:left; - border-bottom:1px solid #B7B7B7; - padding:7px; - clear:both; -} - -.logoutbtn { - text-align:right; - margin-top:5px; -} - -#toplogin { - display:block; - float:right; - margin-right:5px; - margin-top:4px; - color:#ffffff; - font-size:10px; -} - -.toplogininp { - width:83px; - height:13px; - border-top:1px solid #B7B7B7; - border-left:1px solid #B7B7B7; - border-right:1px solid #E7E7E7; - border-bottom:1px solid #E7E7E7; - vertical-align:middle; - font-size:9px; - margin:0px; - padding:0px; -} - -.rarticle { - margin-top:8px; - background-image:url("images/v4/arr_r3.gif"); - background-repeat:no-repeat; - background-color:#ffffff; -} - -.rarticletitle { - margin-left:15px; - font-weight:bold; - font-size:10px; -} - -.rarticletext { - margin-left:15px; - margin-right:10px; - font-size:10px; -} - -.rtext { - margin-right:10px; - font-size:10px; - margin-top:8px; -} - -.rrrarticle { - margin-top:8px; - background-image:url("images/v4/tl.gif"); - background-repeat:no-repeat; - background-position: 0px 2px; - background-color:#ffffff; -} - -.nic18 { - height:18px; -} - -.clear { - clear:both; -} - -/* ---------------------------------------------- -FOOTER ---------------------------------------------- -*/ - -#footer { - display:block; - padding-top:1px; - padding-left:6px; - padding-right:6px; - margin-left:6px; - margin-top:6px; - border-top:1px solid #9BB2BF; - background-color:#C2DFEF; - height:15px; - clear: both; - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - font-size:9px; - color: #517FAE; -} - -#footer A { - font-weight:bold; - text-decoration:none; -} - -#footer A:Visited { - font-weight:bold; - text-decoration:none; -} - -#footer A:Link { - font-weight:bold; - text-decoration:none; -} - -#footer A:Active { - font-weight:bold; - text-decoration:none; -} - -#footer A:Hover { - font-weight:bold; - text-decoration:underline; -} - -/* ---------------------------------------------- -INNER SPECIFIC ---------------------------------------------- -*/ - -#inheader { - border:0px; - height:61px; - background-image:url("images/v4/bg_topa.gif"); - background-repeat:repeat-x; - vertical-align:top; - position:relative; -} - -#print { - float:right; - clear:both; - padding-bottom:5px; -} - -#leftmenu { - font-size: 11px; - width:164px; - margin-right:10px; -} - -#contentLeft { - background-color:#ffffff; - padding-top:10px; - padding-bottom:20px; -} - -A.down { - font-size:11px; - font-weight:bold; - text-decoration:none; -} - -A.down:Visited { - text-decoration:none; -} - -A.down:Link { - text-decoration:none; -} - -A.down:Active { - text-decoration:none; -} - -#contentLeft SELECT { - font-size:10px; - width:150px; -} - -#contentLeft .sub { - border:0px; -} - -#contentLeft .email { - font-size:10px; - border-top:1px solid #808080; - border-left:1px solid #808080; - border-right:1px solid #D5D1C8; - border-bottom:1px solid #D5D1C8; - width:250px; -} - -#contentLeft H4 { - font-size:12px; - font-weight:bold; - border:0px; - margin:0px; - color:#D20005; -} - -#innav { - font-size:11px; - font-weight:bold; - color:#D20005; - clear:both; - padding-left:174px; -} - -.inhd { - margin-top:18px; - margin-bottom:20px; - padding-bottom:1px; - border-bottom:1px solid #AFAFAF; - clear:both; -} - -.imgarticle { - margin-top:1px; - font-size:12px; - background-image:url("images/v4/ill_blank.jpg"); - background-repeat:no-repeat; - background-color:#ffffff; - margin-bottom:20px; - padding-left:120px; - padding-top:5px; - min-height:75px; - height: auto; - _height: 75px; -} - -.imgarticle .amain { - font-size:12px; - font-weight:bold; - margin-top:10px; -} - -/* opera hack */ -.hideelement { - display:block; -} - -/* ---------------------------------------------- -DOWNLOAD SPECIFIC ---------------------------------------------- -*/ - -.tblheader { - background-color:#CAD7F0; - color:#000000; - font-weight:bold; - padding:3px; -} - -.tbltd1 { - background-color:#F2F2F2; - padding:3px; -} - -.tbltd0 { - background-color:#FAFAFA; - padding:3px; -} - -.tbltd2 { - background-color:#FFFFFF; - padding:3px; -} - -.textbox TEXTAREA { - width:80%; - height:200px; -} - -#licence { - width:80%; - height:200px; -} - -/* ---------------------------------------------- -OTHER STYLES ---------------------------------------------- -*/ - -.red { - color:#D20005; - font-weight:bold; - font-size:13px; -} - -.redmiddle { - color:#D20005; - font-weight:bold; - font-size:12px; -} - -.redsmall { - color:#D20005; - font-size:9px; -} - -.m5 { - margin-bottom:5px; -} - -.ml15 { - margin-left:15px; -} - -.threelinesarticle { - background-image:url("images/v4/tl.gif"); - background-repeat:no-repeat; - background-position: 0px 4px; - padding-left:15px; - font-size:12px; - font-weight:bold; -} - -.rarticlepd { - margin-top:8px; - background-image:url("images/v4/arr_g.gif"); - background-repeat:no-repeat; - background-color:#ffffff; -} - -.related { - background-image:url("images/v4/icon_cross.gif"); - background-repeat:no-repeat; - background-position: 0px 6px; - background-color:#ffffff; - padding-left:20px; - color:#D20005; - font-size:14px; - font-weight:bold; -} - -.relatedtext { - margin-left:28px; - margin-top:14px; - margin-right:14px; - margin-bottom:14px; - font-size:12px; -} - -.title { - font-size:14px; - font-weight:bold; - color:#D20005; -} - -.colblue { - font-weight:bold; - color:#036FAB; -} - -.colred { - font-weight:bold; - color:#D20004; -} - -.colblack { - font-weight:bold; - color:#000000; -} - -.examplecode { - font-family: "Courier New", monospace; - background-color: #ffffcc; -} - -/*style for tutorials*/ -.indent { - margin-left:15px; -} - - -/* Styles FROM OLD netbeans.css ------------------------------------- */ - -.tmtext { - font-size: 10px; - line-height: 1.2em; -} - -pre,samp,code,tt { - font-family: "Courier New", monospace; -} - -.titlec { - /* Same as

*/ - font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; - clear:both; - font-size: 13px; - font-weight:bold; - margin:0px; - padding:0px; - color:#D20005; -} - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/Bundle.properties b/nb/welcome/src/org/netbeans/modules/welcome/Bundle.properties deleted file mode 100644 index db1b70cc32d3..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/Bundle.properties +++ /dev/null @@ -1,59 +0,0 @@ -# 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. - - -LBL_Tab_Title=Start Page - -ACS_Welcome_DESC=Welcome window providing basic information about IDE. - -OpenIDE-Module-Short-Description=Shows welcome content after the first startup of the IDE. -OpenIDE-Module-Long-Description=\ - The Welcome module provides a screen with introductory information about using the IDE. \ - The screen appears when you start the IDE for the first time. \ - You can choose basic commands and open help topics directly from this screen. -OpenIDE-Module-Name=Welcome Screen -OpenIDE-Module-Display-Category=Help - - -# FeedbackSurvey - -# {0} id of the user -# {1,number,0} memory info, Important: use proper formatting to avoid invalid chars in the URL -MSG_FeedbackSurvey_URL= -#NOI18N -MSG_FeedbackSurvey_MinimalStartups=4 -#NOI18N -MSG_FeedbackSurvey_AskTimes=3 -# 3 weeks = 168 * 3 * 3600 * 1000 -#NOI18N -MSG_FeedbackSurvey_Delay=1814400000 -# 24h = 24 * 3600 * 1000 -#NOI18N -MSG_FeedbackSurveyAgain=86400000 - -MSG_FeedbackSurvey_Message=Help us improve the NetBeans IDE
Fill in a five-question user satisfaction survey now. -MSG_FeedbackSurvey_Title=NetBeans Users Satisfaction Survey -MSG_FeedbackSurvey_Yes=&Go to Survey -MSG_FeedbackSurvey_Later=&Remind Later -MSG_FeedbackSurvey_Never=&Skip Survey - -ACSD_FeedbackSurvey_Yes=Goes to survey -ACSD_FeedbackSurvey_Later=Reminds later -ACSD_FeedbackSurvey_Never=Skips survey - -# Display name for options export -Welcome.Options.Export.displayName=Start Page diff --git a/nb/welcome/src/org/netbeans/modules/welcome/Bundle_test.properties b/nb/welcome/src/org/netbeans/modules/welcome/Bundle_test.properties deleted file mode 100644 index 09dcce301f88..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/Bundle_test.properties +++ /dev/null @@ -1,25 +0,0 @@ -# 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. - -# FeedbackSurvey - testing values -#MSG_FeedbackSurvey_URL=http://ide.netbeans.org/survey.html -MSG_FeedbackSurvey_URL=http://services.netbeans.org/appl2/?mod=satisfaction&action=start&userid={0}&memory={1,number,0} -MSG_FeedbackSurvey_MinimalStartups=4 -# 5 min = 5 * 60 * 1000 -MSG_FeedbackSurvey_Delay=300000 -# 2 min = 2 * 60 * 1000 -MSG_FeedbackSurveyAgain=120000 diff --git a/nb/welcome/src/org/netbeans/modules/welcome/FeedbackSurvey.java b/nb/welcome/src/org/netbeans/modules/welcome/FeedbackSurvey.java deleted file mode 100644 index db228cc96d7d..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/FeedbackSurvey.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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.welcome; - -import java.io.IOException; -import java.lang.management.ManagementFactory; -import java.lang.management.OperatingSystemMXBean; -import java.net.URL; -import java.net.URLConnection; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.prefs.Preferences; -import javax.management.AttributeNotFoundException; -import javax.management.JMException; -import javax.management.MBeanServer; -import javax.swing.JButton; -import org.openide.DialogDisplayer; -import org.openide.NotifyDescriptor; -import org.openide.awt.HtmlBrowser; -import org.openide.awt.Mnemonics; -import org.openide.util.Exceptions; -import org.openide.util.NbBundle; -import org.openide.util.NbPreferences; - -/** Shows feedback survey dialog and sends the user to predefined page. - * - * @author Jaroslav Tulach - */ -final class FeedbackSurvey { - private static final Logger LOG = Logger.getLogger(FeedbackSurvey.class.getName()); - - private FeedbackSurvey() { - } - - public static void start() { - final Preferences p = NbPreferences.root().node("/org/netbeans/modules/autoupdate"); // NOI18N - String id = p.get ("ideIdentity", "unknown"); // NOI18N - long mem = -1L; - try { - OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean(); - MBeanServer mserver = ManagementFactory.getPlatformMBeanServer(); - // w/o dependency on Sun's JDK - // long mem = ((com.sun.management.OperatingSystemMXBean)osBean).getTotalPhysicalMemorySize(); - mem = (Long)mserver.getAttribute(osBean.getObjectName(), "TotalPhysicalMemorySize"); // NOI18N - } catch (AttributeNotFoundException ex) { - // Can be thrown on non-Sun JDKs: - Logger.getLogger(FeedbackSurvey.class.getName()).log(Level.INFO, ex.getMessage()); - } catch (IllegalArgumentException | SecurityException | NoSuchMethodError | JMException ex) { - Exceptions.printStackTrace(ex); - } - String url = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_URL", id, mem); - if (url.length() == 0) { - return; - } - try { - Preferences prefs = NbPreferences.forModule(FeedbackSurvey.class); - - long time = prefs.getLong("feedback.survey.show.at", 0); // NOI18N - if (time == 0) { - time = System.currentTimeMillis() + bundledInt("MSG_FeedbackSurvey_Delay"); // NOI18N - prefs.putLong("feedback.survey.show.at", time); // NOI18N - } - - int invocations = prefs.getInt("feedback.survey.startups", 0); // NOI18N - if (invocations < bundledInt("MSG_FeedbackSurvey_MinimalStartups")) { // NOI18N - prefs.putInt("feedback.survey.startups", invocations + 1); // NOI18N - return; - } - - if (System.currentTimeMillis() < time) { - LOG.log(Level.FINE, "Not enough time passed"); - return; - } - - int counts = prefs.getInt("feedback.survey.show.count", 0); // NOI18N - if (counts >= bundledInt("MSG_FeedbackSurvey_AskTimes")) { // NOI18N - return; - } - - URL u = new URL(url); - URLConnection conn = u.openConnection(); - String type = conn.getContentType(); - if (type == null || !type.startsWith("text/html")) { // NOI18N - LOG.log(Level.INFO, "Wrong mimetype - {0} - skipping survey", conn.getContentType()); // NOI18N - return; - } - - prefs.putInt("feedback.survey.show.count", counts + 1); // NOI18N - - if (showDialog(u)) { - // ok - prefs.putLong("feedback.survey.show.at", Long.MAX_VALUE); // NOI18N - } else { - prefs.putLong("feedback.survey.show.at", System.currentTimeMillis() + bundledInt("MSG_FeedbackSurveyAgain")); // NOI18N - } - } catch (IOException ex) { - LOG.log(Level.INFO, "Cannot connect to {0}, skipping feedback survey", url); // NOI18N - LOG.log(Level.FINE, ex.getMessage(), ex); - } - } - - private static long bundledInt(String msg) { - return Long.parseLong(NbBundle.getMessage(FeedbackSurvey.class, msg)); - } - - private static boolean showDialog(URL whereTo) { - String msg = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Message"); - String tit = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Title"); - String yes = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Yes"); - String later = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Later"); - String never = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Never"); - - NotifyDescriptor nd = new NotifyDescriptor.Message(msg, NotifyDescriptor.QUESTION_MESSAGE); - nd.setTitle(tit); - //Object[] buttons = { yes, later, never }; - JButton yesButton = new JButton(); - yesButton.getAccessibleContext().setAccessibleDescription( - NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Yes")); - Mnemonics.setLocalizedText(yesButton, yes); - JButton laterButton = new JButton(); - laterButton.getAccessibleContext().setAccessibleDescription( - NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Later")); - Mnemonics.setLocalizedText(laterButton, later); - JButton neverButton = new JButton(); - neverButton.getAccessibleContext().setAccessibleDescription( - NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Never")); - Mnemonics.setLocalizedText(neverButton, never); - Object[] buttons = { yesButton, laterButton, neverButton }; - nd.setOptions(buttons); - Object res = DialogDisplayer.getDefault().notify(nd); - - if (res == yesButton) { - HtmlBrowser.URLDisplayer.getDefault().showURL(whereTo); - return true; - } else { - if( res == neverButton ) { - Preferences prefs = NbPreferences.forModule(FeedbackSurvey.class); - prefs.putInt("feedback.survey.show.count", (int)bundledInt("MSG_FeedbackSurvey_AskTimes")); // NOI18N - } - return false; - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/Installer.java b/nb/welcome/src/org/netbeans/modules/welcome/Installer.java deleted file mode 100644 index a3481736331e..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/Installer.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.welcome; - -import java.util.Set; -import org.openide.modules.ModuleInstall; -import org.openide.windows.Mode; -import org.openide.windows.TopComponent; -import org.openide.windows.WindowManager; -import org.openide.windows.WindowSystemEvent; -import org.openide.windows.WindowSystemListener; - -/** - * Checks the feedback survey. - */ -public class Installer extends ModuleInstall implements Runnable { - - @Override public void restored() { - WindowManager.getDefault().invokeWhenUIReady(this); - WindowManager.getDefault().addWindowSystemListener( new WindowSystemListener() { - - @Override - public void beforeLoad( WindowSystemEvent event ) { - } - - @Override - public void afterLoad( WindowSystemEvent event ) { - } - - @Override - public void beforeSave( WindowSystemEvent event ) { - WindowManager.getDefault().removeWindowSystemListener( this); - WelcomeComponent topComp = null; - boolean isEditorShowing = false; - Set tcs = TopComponent.getRegistry().getOpened(); - for (Mode mode : WindowManager.getDefault().getModes()) { - TopComponent tc = mode.getSelectedTopComponent(); - if (tc instanceof WelcomeComponent) { - topComp = (WelcomeComponent) tc; - } - if( null != tc && WindowManager.getDefault().isEditorTopComponent( tc ) ) - isEditorShowing = true; - } - if( WelcomeOptions.getDefault().isShowOnStartup() && isEditorShowing ) { - if(topComp == null){ - topComp = WelcomeComponent.findComp(); - } - //activate welcome screen at shutdown to avoid editor initialization - //before the welcome screen is activated again at startup - topComp.open(); - topComp.requestActive(); - } else if( topComp != null ) { - topComp.close(); - } - } - - @Override - public void afterSave( WindowSystemEvent event ) { - } - }); - } - - @Override - public void run() { - FeedbackSurvey.start(); - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ShowWelcomeAction.java b/nb/welcome/src/org/netbeans/modules/welcome/ShowWelcomeAction.java deleted file mode 100644 index ee70397a1872..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ShowWelcomeAction.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.welcome; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Set; -import org.openide.awt.ActionID; -import org.openide.awt.ActionReference; -import org.openide.awt.ActionRegistration; - -import org.openide.util.NbBundle.Messages; -import org.openide.windows.TopComponent; - -/** - * Show the welcome screen. - * @author Richard Gregor - */ -@ActionID(id = "org.netbeans.modules.welcome.ShowWelcomeAction", category = "Help") -@ActionRegistration(displayName = "#LBL_Action", iconBase="org/netbeans/modules/welcome/resources/welcome.gif", iconInMenu=false) -@ActionReference(path = "Menu/Help", name = "org-netbeans-modules-welcome-ShowWelcomeAction", position = 1400) -@Messages("LBL_Action=Start &Page") -public class ShowWelcomeAction implements ActionListener { - - @Override public void actionPerformed(ActionEvent e) { - WelcomeComponent topComp = null; - Set tcs = TopComponent.getRegistry().getOpened(); - for (TopComponent tc: tcs) { - if (tc instanceof WelcomeComponent) { - topComp = (WelcomeComponent) tc; - break; - } - } - if(topComp == null){ - topComp = WelcomeComponent.findComp(); - } - - topComp.open(); - topComp.requestActive(); - } - -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/WelcomeComponent.java b/nb/welcome/src/org/netbeans/modules/welcome/WelcomeComponent.java deleted file mode 100644 index 7a2ac787470f..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/WelcomeComponent.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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.welcome; - -import java.lang.ref.WeakReference; -import org.openide.util.NbBundle; -import org.openide.windows.*; -import java.awt.*; -import javax.swing.*; -import org.netbeans.modules.welcome.content.Constants; -import org.netbeans.modules.welcome.ui.StartPageContent; -import org.openide.ErrorManager; -import org.openide.nodes.Node; -import org.openide.util.NbPreferences; - -/** - * The welcome screen. - * @author Richard Gregor, S. Aubrecht - */ -public class WelcomeComponent extends TopComponent { - static final long serialVersionUID=6021472310161712674L; - private static WeakReference component = - new WeakReference(null); - private JComponent content; - - private boolean initialized = false; - - private WelcomeComponent(){ - setLayout(new BorderLayout()); - setName(NbBundle.getMessage(WelcomeComponent.class, "LBL_Tab_Title")); //NOI18N - content = null; - initialized = false; - putClientProperty( "activateAtStartup", Boolean.TRUE ); //NOI18N - putClientProperty( "KeepNonPersistentTCInModelWhenClosed", Boolean.TRUE ); //NOI18N - } - - @Override protected String preferredID(){ - return "WelcomeComponent"; //NOI18N - } - - /** - * #38900 - lazy addition of GUI components - */ - - private void doInitialize() { - initAccessibility(); - - if( null == content ) { - WelcomeOptions.getDefault().incrementStartCounter(); - - JScrollPane scroll = new JScrollPane(new StartPageContent()); - scroll.setBorder(BorderFactory.createEmptyBorder()); - scroll.getViewport().setOpaque(false); - scroll.setOpaque(false); - scroll.getViewport().setPreferredSize(new Dimension(Constants.START_PAGE_MIN_WIDTH,100)); - JScrollBar vertical = scroll.getVerticalScrollBar(); - if( null != vertical ) { - vertical.setBlockIncrement(30*Constants.FONT_SIZE); - vertical.setUnitIncrement(Constants.FONT_SIZE); - } - content = scroll; - add( content, BorderLayout.CENTER ); - setFocusable( false ); - } - } - - /* Singleton accessor. As WelcomeComponent is persistent singleton this - * accessor makes sure that WelcomeComponent is deserialized by window system. - * Uses known unique TopComponent ID "Welcome" to get WelcomeComponent instance - * from window system. "Welcome" is name of settings file defined in module layer. - */ - public static WelcomeComponent findComp() { - WelcomeComponent wc = component.get(); - if (wc == null) { - TopComponent tc = WindowManager.getDefault().findTopComponent("Welcome"); // NOI18N - if (tc != null) { - if (tc instanceof WelcomeComponent) { - wc = (WelcomeComponent)tc; - component = new WeakReference(wc); - } else { - //Incorrect settings file? - IllegalStateException exc = new IllegalStateException - ("Incorrect settings file. Unexpected class returned." // NOI18N - + " Expected:" + WelcomeComponent.class.getName() // NOI18N - + " Returned:" + tc.getClass().getName()); // NOI18N - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, exc); - //Fallback to accessor reserved for window system. - wc = WelcomeComponent.createComp(); - } - } else { - //WelcomeComponent cannot be deserialized - //Fallback to accessor reserved for window system. - wc = WelcomeComponent.createComp(); - } - } - return wc; - } - - /* Singleton accessor reserved for window system ONLY. Used by window system to create - * WelcomeComponent instance from settings file when method is given. Use findComp - * to get correctly deserialized instance of WelcomeComponent. */ - public static WelcomeComponent createComp() { - WelcomeComponent wc = component.get(); - if(wc == null) { - wc = new WelcomeComponent(); - component = new WeakReference(wc); - } - return wc; - } - - /** Overriden to explicitely set persistence type of WelcomeComponent - * to PERSISTENCE_ALWAYS */ - @Override public int getPersistenceType() { - return TopComponent.PERSISTENCE_ONLY_OPENED; - } - - private void initAccessibility(){ - getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(WelcomeComponent.class, "ACS_Welcome_DESC")); // NOI18N - } - - /** - * Called when TopComponent is about to be shown. - * Shown here means the component is selected or resides in it own cell - * in container in its Mode. The container is visible and not minimized. - *

Note: component - * is considered to be shown, even its container window - * is overlapped by another window.

- * @since 2.18 - * - * #38900 - lazy addition of GUI components - * - */ - @Override protected void componentShowing() { - if (!initialized) { - initialized = true; - doInitialize(); - } - if( null != content && getComponentCount() == 0 ) { - //notify components down the hierarchy tree that they should - //refresh their content (e.g. RSS feeds) - add( content, BorderLayout.CENTER ); - } - super.componentShowing(); - setActivatedNodes( new Node[] {} ); - } - - private static boolean firstTimeOpen = true; - @Override - protected void componentOpened() { - super.componentOpened(); - if( firstTimeOpen ) { - firstTimeOpen = false; - if( !WelcomeOptions.getDefault().isShowOnStartup() ) { - close(); - } - } - } - - @Override - protected void componentClosed() { - super.componentClosed(); - TopComponentGroup group = WindowManager.getDefault().findTopComponentGroup("InitialLayout"); //NOI18N - if( null != group ) { - group.open(); - boolean firstTimeClose = NbPreferences.forModule(WelcomeComponent.class).getBoolean("firstTimeClose", true); //NOI18N - NbPreferences.forModule(WelcomeComponent.class).putBoolean("firstTimeClose", false); //NOI18N - if( firstTimeClose ) { - TopComponent tc = WindowManager.getDefault().findTopComponent("projectTabLogical_tc"); //NOI18N - if( null != tc && tc.isOpened() ) - tc.requestActive(); - } - } - } - - @Override protected void componentHidden() { - super.componentHidden(); - if( null != content ) { - //notify components down the hierarchy tree that they no long - //need to periodically refresh their content (e.g. RSS feeds) - remove( content ); - } - } - - @Override - public void requestFocus() { - if( null != content ) - content.requestFocus(); - } - - @Override - public boolean requestFocusInWindow() { - if( null != content ) - return content.requestFocusInWindow(); - return super.requestFocusInWindow(); - } -} - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/WelcomeOptions.java b/nb/welcome/src/org/netbeans/modules/welcome/WelcomeOptions.java deleted file mode 100644 index 65a9a06393f5..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/WelcomeOptions.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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.welcome; - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.logging.Level; -import java.util.logging.LogRecord; -import java.util.prefs.Preferences; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.Constants; -import org.openide.util.NbBundle; -import org.openide.util.NbPreferences; - -/** - * - * @author S. Aubrecht - */ -public class WelcomeOptions { - - private static WelcomeOptions theInstance; - - private static final String PROP_SHOW_ON_STARTUP = "showOnStartup"; - private static final String PROP_LAST_ACTIVE_TAB = "lastActiveTab"; - private static final String PROP_START_COUNTER = "startCounter"; - - private PropertyChangeSupport propSupport; - - /** Creates a new instance of WelcomeOptions */ - private WelcomeOptions() { - } - - private Preferences prefs() { - return NbPreferences.forModule(WelcomeOptions.class); - } - - public static synchronized WelcomeOptions getDefault() { - if( null == theInstance ) { - theInstance = new WelcomeOptions(); - } - return theInstance; - } - - public void setShowOnStartup( boolean show ) { - boolean oldVal = isShowOnStartup(); - if( oldVal == show ) { - return; - } - prefs().putBoolean(PROP_SHOW_ON_STARTUP, show); - if( null != propSupport ) - propSupport.firePropertyChange( PROP_SHOW_ON_STARTUP, oldVal, show ); - - LogRecord rec = new LogRecord(Level.INFO, "USG_SHOW_START_PAGE"); //NOI18N - rec.setParameters(new Object[] {show} ); - rec.setLoggerName(Constants.USAGE_LOGGER.getName()); - rec.setResourceBundle(NbBundle.getBundle(BundleSupport.BUNDLE_NAME)); - rec.setResourceBundleName(BundleSupport.BUNDLE_NAME); - - Constants.USAGE_LOGGER.log(rec); - - } - - public boolean isShowOnStartup() { - return prefs().getBoolean(PROP_SHOW_ON_STARTUP, false); - } - - public void setLastActiveTab( int tabIndex ) { - int oldVal = getLastActiveTab(); - prefs().putInt(PROP_LAST_ACTIVE_TAB, tabIndex); - if( null != propSupport ) - propSupport.firePropertyChange( PROP_LAST_ACTIVE_TAB, oldVal, tabIndex ); - } - - public int getLastActiveTab() { - return prefs().getInt(PROP_LAST_ACTIVE_TAB, -1); - } - - public boolean isSecondStart() { - return prefs().getInt(PROP_START_COUNTER, -1) == 2; - } - - public void incrementStartCounter() { - int count = prefs().getInt(PROP_START_COUNTER, 0) + 1; - if( count > 3 ) - return; //we're just interested in the first and second start so don't bother any more then - prefs().putInt( PROP_START_COUNTER, count ); - } - - public void addPropertyChangeListener( PropertyChangeListener l ) { - if( null == propSupport ) - propSupport = new PropertyChangeSupport( this ); - propSupport.addPropertyChangeListener( l ); - } - - public void removePropertyChangeListener( PropertyChangeListener l ) { - if( null == propSupport ) - return; - propSupport.removePropertyChangeListener( l ); - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/ActionButton.java b/nb/welcome/src/org/netbeans/modules/welcome/content/ActionButton.java deleted file mode 100644 index dad7f075e105..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/ActionButton.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.MouseEvent; -import javax.swing.Action; -import javax.swing.Icon; -import org.openide.awt.StatusDisplayer; - -public class ActionButton extends LinkButton { - - private Action action; - private String urlString; - private boolean visited = false; - - public ActionButton( Action a, String urlString, boolean showBorder, String usageTrackingId ) { - this( a, urlString, Utils.getLinkColor(), showBorder, usageTrackingId ); - } - - public ActionButton( Action a, String urlString, Color foreground, boolean showBorder, String usageTrackingId ) { - super( a.getValue( Action.NAME ).toString(), foreground, showBorder, usageTrackingId ); - this.action = a; - this.urlString = urlString; - Object icon = a.getValue( Action.SMALL_ICON ); - if(icon instanceof Icon) - setIcon( (Icon)icon ); - Object tooltip = a.getValue( Action.SHORT_DESCRIPTION ); - if( null != tooltip ) - setToolTipText( tooltip.toString() ); - } - - @Override - public void actionPerformed(ActionEvent e) { - logUsage(); - if( null != action ) { - action.actionPerformed( e ); - } - if( null != urlString ) - visited = true; - } - - @Override - protected void onMouseExited(MouseEvent e) { - super.onMouseExited( e ); - if( null != urlString ) { - StatusDisplayer.getDefault().setStatusText( "" ); //NOI18N - } - } - - @Override - protected void onMouseEntered(MouseEvent e) { - super.onMouseEntered( e ); - if( null != urlString ) { - StatusDisplayer.getDefault().setStatusText( urlString ); - } - } - - @Override - protected boolean isVisited() { - return visited; - } - - private static final long serialVersionUID = 1L; -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/BundleSupport.java b/nb/welcome/src/org/netbeans/modules/welcome/content/BundleSupport.java deleted file mode 100644 index 002d7e546bf5..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/BundleSupport.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.welcome.content; - -import java.text.MessageFormat; -import javax.swing.JComponent; -import org.openide.util.NbBundle; - -public class BundleSupport { - - public static final String BUNDLE_NAME = "org.netbeans.modules.welcome.resources.Bundle"; // NOI18N - - private static final String LABEL_PREFIX = "LBL_"; // NOI18N - private static final String URL_PREFIX = "URL_"; // NOI18N - private static final String CATEGORY_PREFIX = "CATEGORY_"; // NOI18N - private static final String TEMPLATE_PREFIX = "TEMPLATE_"; // NOI18N - private static final String ACN_PREFIX = "ACN_"; // NOI18N - private static final String ACD_PREFIX = "ACD_"; // NOI18N - private static final String MNM_PREFIX = "MNM_"; // NOI18N - - public static String getLabel(String bundleKey) { - return NbBundle.getBundle(BUNDLE_NAME).getString(LABEL_PREFIX + bundleKey); - } - - public static String getURL(String bundleKey) { - return NbBundle.getBundle(BUNDLE_NAME).getString(URL_PREFIX + bundleKey); - } - - public static char getMnemonic(String bundleKey) { - return NbBundle.getBundle(BUNDLE_NAME).getString(MNM_PREFIX + bundleKey).charAt(0); - } - - public static String getSampleCategory(String bundleKey) { - return NbBundle.getBundle(BUNDLE_NAME).getString(CATEGORY_PREFIX + bundleKey); - } - - public static String getSampleTemplate(String bundleKey) { - return NbBundle.getBundle(BUNDLE_NAME).getString(TEMPLATE_PREFIX + bundleKey); - } - - public static String getAccessibilityName(String bundleKey) { - return NbBundle.getBundle(BUNDLE_NAME).getString(ACN_PREFIX + bundleKey); - } - - public static String getAccessibilityName(String bundleKey, String param) { - return MessageFormat.format( NbBundle.getBundle(BUNDLE_NAME).getString(ACN_PREFIX + bundleKey), param ); - } - - public static String getAccessibilityDescription(String bundleKey, String param) { - return MessageFormat.format( NbBundle.getBundle(BUNDLE_NAME).getString(ACD_PREFIX + bundleKey), param ); - } - - public static void setAccessibilityProperties(JComponent component, String bundleKey) { - String aName = NbBundle.getBundle(BUNDLE_NAME).getString(ACN_PREFIX + bundleKey); - String aDescr = NbBundle.getBundle(BUNDLE_NAME).getString(ACD_PREFIX + bundleKey); - - component.getAccessibleContext().setAccessibleName(aName); - component.getAccessibleContext().setAccessibleDescription(aDescr); - } - - public static String getMessage( String key, Object param ) { - return MessageFormat.format( NbBundle.getBundle(BUNDLE_NAME).getString(key), param ); - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/ButtonBorder.java b/nb/welcome/src/org/netbeans/modules/welcome/content/ButtonBorder.java deleted file mode 100644 index 56228441f279..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/ButtonBorder.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.Component; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.Insets; -import javax.swing.border.Border; -import org.openide.util.ImageUtilities; - -/** - * - * @author S. Aubrecht - */ -public class ButtonBorder implements Border { - - private final Image imgLeft; - private final Image imgRight; - private final Image imgCenter; - - private ButtonBorder( boolean mouseOver ) { - if( mouseOver ) { - imgLeft = ImageUtilities.loadImage("org/netbeans/modules/welcome/resources/sel_btn_left.png"); - imgRight = ImageUtilities.loadImage("org/netbeans/modules/welcome/resources/sel_btn_right.png"); - imgCenter = ImageUtilities.loadImage("org/netbeans/modules/welcome/resources/sel_btn_center.png"); - } else { - imgLeft = ImageUtilities.loadImage("org/netbeans/modules/welcome/resources/btn_left.png"); - imgRight = ImageUtilities.loadImage("org/netbeans/modules/welcome/resources/btn_right.png"); - imgCenter = ImageUtilities.loadImage("org/netbeans/modules/welcome/resources/btn_center.png"); - } - } - - private static Border regularBorder; - private static Border mouseoverBorder; - - public static Border createRegular() { - if( null == regularBorder ) - regularBorder = new ButtonBorder(false); - return regularBorder; - } - - public static Border createMouseOver() { - if( null == mouseoverBorder ) - mouseoverBorder = new ButtonBorder(true); - return mouseoverBorder; - } - - @Override - public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { - g.drawImage(imgLeft, x, y, imgLeft.getWidth(c), height, c); - - g.drawImage(imgRight, x+width-imgRight.getWidth(c), y, imgRight.getWidth(c), height, c); - - g.drawImage(imgCenter, x+imgLeft.getWidth(c), y, - x+width-imgLeft.getWidth(c)-imgRight.getWidth(c), height, c); - - } - - @Override - public Insets getBorderInsets(Component c) { - return new Insets(12, 12, 12, 12); - } - - @Override - public boolean isBorderOpaque() { - return false; - } - -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/CombinationRSSFeed.java b/nb/welcome/src/org/netbeans/modules/welcome/content/CombinationRSSFeed.java deleted file mode 100644 index 540d004c6168..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/CombinationRSSFeed.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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.welcome.content; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import javax.xml.parsers.ParserConfigurationException; -import org.netbeans.modules.welcome.content.RSSFeed.ErrorCatcher; -import org.netbeans.modules.welcome.content.RSSFeed.FeedHandler; -import org.netbeans.modules.welcome.content.RSSFeed.FeedItem; -import org.openide.util.NbPreferences; -import org.openide.xml.XMLUtil; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; - -/** - * Combines two RSS feeds into one. - * - * @author S. Aubrecht - */ -public class CombinationRSSFeed extends RSSFeed { - - private String url1; - private String url2; - private int maxItemCount; - - /** Creates a new instance of CombinationRSSFeed */ - public CombinationRSSFeed( String url1, String url2, boolean showProxyButton, int maxItemCount ) { - super( showProxyButton ); - this.maxItemCount = maxItemCount; - this.url1 = url1; - this.url2 = url2; - } - - @Override - protected List buildItemList() throws SAXException, ParserConfigurationException, IOException { - XMLReader reader = XMLUtil.createXMLReader( false, true ); - FeedHandler handler = new FeedHandler( getMaxItemCount() ); - reader.setContentHandler( handler ); - reader.setEntityResolver( new RSSEntityResolver() ); - reader.setErrorHandler( new ErrorCatcher() ); - reader.parse( findInputSource(new URL(url1)) ); - - ArrayList res = new ArrayList( 2*getMaxItemCount() ); - res.addAll( handler.getItemList() ); - - handler = new FeedHandler( getMaxItemCount() ); - reader.setContentHandler( handler ); - reader.parse( findInputSource(new URL(url2)) ); - - res.addAll( handler.getItemList() ); - - List items = sortNodes( res ); - if( items.size() > getMaxItemCount() ) { - items = items.subList( 0, getMaxItemCount() ); - } - return items; - } - - private ArrayList sortNodes( ArrayList res ) { - res.sort(new DateFeedItemComparator()); - return res; - } - - @Override - protected void clearCache() { - try { - NbPreferences.forModule( RSSFeed.class ).remove( url2path( new URL(url1))) ; - NbPreferences.forModule( RSSFeed.class ).remove( url2path( new URL(url2))) ; - } catch( MalformedURLException mE ) { - //ignore - } - } - - @Override - protected int getMaxItemCount() { - return this.maxItemCount; - } - - private static class DateFeedItemComparator implements Comparator { - private static DateFormat dateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH ); // NOI18N - private static DateFormat dateFormatLong = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH ); // NOI18N - private static DateFormat dateFormatShort = new SimpleDateFormat( "EEE, dd MMM yyyy", Locale.ENGLISH ); // NOI18N - - public int compare(FeedItem item1, FeedItem item2) { - Date date1 = extractDate( item1 ); - Date date2 = extractDate( item2 ); - - if( null == date1 && null == date2 ) - return 0; - else if( null == date1 ) - return 1; - else if( null == date2 ) - return -1; - if( date1.after( date2 ) ) { - return -1; - } else if( date1.before( date2 ) ) { - return 1; - } - return 0; - } - - private Date extractDate( FeedItem item ) { - try { - if( null != item.dateTime ) - return dateFormat.parse( item.dateTime ); - } catch( ParseException pE ) { - try { - return dateFormatShort.parse( item.dateTime ); - } catch( ParseException otherPE ) { - try { - return dateFormatLong.parse( item.dateTime ); - } catch( ParseException e ) { - //ignore - } - } - } - return null; - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/Constants.java b/nb/welcome/src/org/netbeans/modules/welcome/content/Constants.java deleted file mode 100644 index e1e4585fc02a..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/Constants.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.BasicStroke; -import java.awt.Font; -import java.awt.Stroke; -import java.util.logging.Logger; -import javax.swing.BorderFactory; -import javax.swing.border.Border; - -/** - * - * @author S. Aubrecht - */ -public interface Constants { - - static final String COLOR_SECTION_HEADER = "SectionHeaderColor"; //NOI18N - static final String COLOR_BIG_BUTTON = "BigButtonColor"; //NOI18N - static final String COLOR_BOTTOM_BAR = "BottomBarColor"; //NOI18N - static final String COLOR_BORDER = "BorderColor"; //NOI18N - static final String COLOR_TAB_BACKGROUND = "TabBackgroundColor"; //NOI18N - static final String COLOR_TAB_BORDER1 = "TabBorder1Color"; //NOI18N - static final String COLOR_TAB_BORDER2 = "TabBorder2Color"; //NOI18N - static final String COLOR_TAB_FOREGROUND = "TabForegroundColor"; //NOI18N - - static final String COLOR_RSS_DATE = "RssDateTimeColor"; //NOI18N - static final String COLOR_RSS_DETAILS = "RssDetailsColor"; //NOI18N - static final String COLOR_HEADER = "HeaderForegroundColor"; //NOI18N - - static final int FONT_SIZE = Utils.getDefaultFontSize(); - static final String FONT_NAME = BundleSupport.getLabel( "FONT_NAME" ); //NOI18N - static final Font BUTTON_FONT = new Font( FONT_NAME, Font.PLAIN, FONT_SIZE+1 ); - static final Font RSS_DESCRIPTION_FONT = new Font( FONT_NAME, Font.PLAIN, FONT_SIZE-1 ); - static final Font TAB_FONT = new Font( FONT_NAME, Font.PLAIN, FONT_SIZE+1 ); //NOI18N - static final Font SECTION_HEADER_FONT = new Font( FONT_NAME, Font.BOLD, FONT_SIZE+7 ); //NOI18N - static final Font GET_STARTED_FONT = new Font( FONT_NAME, Font.PLAIN, FONT_SIZE+1 ) ; //NOI18N - static final Font CONTENT_HEADER_FONT = new Font( FONT_NAME, Font.BOLD, FONT_SIZE+13 ) ; //NOI18N - - static final String APACHE_LOGO_IMAGE = "org/netbeans/modules/welcome/resources/apache_feather.png"; // NOI18N - static final String INCUBATOR_LOGO_IMAGE = "org/netbeans/modules/welcome/resources/incubator_logo.png"; // NOI18N - static final String NETBEANS_LOGO_IMAGE = "org/netbeans/modules/welcome/resources/nb_logo.png"; // NOI18N - - static final String IMAGE_CONTENT_BANNER = "org/netbeans/modules/welcome/resources/content_banner.png"; // NOI18N - - static final String IMAGE_TAB_SELECTED = "org/netbeans/modules/welcome/resources/tab_selected.png"; // NOI18N - static final String IMAGE_TAB_ROLLOVER = "org/netbeans/modules/welcome/resources/tab_rollover.png"; // NOI18N - - static final String BROKEN_IMAGE = "org/netbeans/modules/welcome/resources/broken_image.gif"; // NOI18N - static final String IMAGE_PICTURE_FRAME = "org/netbeans/modules/welcome/resources/picture_frame.png"; // NOI18N - - static final Stroke LINK_IN_FOCUS_STROKE = new BasicStroke(1, BasicStroke.CAP_SQUARE, - BasicStroke.JOIN_BEVEL, 0, new float[] {0, 2}, 0); - static final String LINK_IN_FOCUS_COLOR = "LinkInFocusColor"; //NOI18N - static final String LINK_COLOR = "LinkColor"; //NOI18N - static final String VISITED_LINK_COLOR = "VisitedLinkColor"; //NOI18N - - static final int RSS_FEED_TIMER_RELOAD_MILLIS = 60*60*1000; - - static final int TEXT_INSETS_LEFT = 10; - static final int TEXT_INSETS_RIGHT = 10; - - static final Border HEADER_TEXT_BORDER = BorderFactory.createEmptyBorder( 1, TEXT_INSETS_LEFT, 1, TEXT_INSETS_RIGHT ); - - static final int START_PAGE_MIN_WIDTH = 700; - - static final Logger USAGE_LOGGER = Logger.getLogger("org.netbeans.ui.metrics.projects"); //NOI18N -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/ContentSection.java b/nb/welcome/src/org/netbeans/modules/welcome/content/ContentSection.java deleted file mode 100644 index f18d6fbf4c37..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/ContentSection.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.Rectangle; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; - -/** - * - * @author S. Aubrecht - */ -public class ContentSection extends JPanel implements Constants { - - private static final int PANEL_MAX_WIDTH = 800; - private boolean maxSize; - - public ContentSection( String title, JComponent content, boolean maxSize ) { - this( content, maxSize, 0 ); - JLabel lblTitle = new JLabel( title ); - lblTitle.setFont( SECTION_HEADER_FONT ); - - lblTitle.setBorder( BorderFactory.createEmptyBorder(0, 0, 20, 0) ); - lblTitle.setForeground( Utils.getColor( COLOR_SECTION_HEADER ) ); - add( lblTitle, new GridBagConstraints(0,0,1,1,0.0,0.0, - GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(6,0,0,0),0,0) ); - } - - public ContentSection( JComponent titleComponent, JComponent content, boolean maxSize ) { - this( content, maxSize, 8 ); - if( null != titleComponent ) { - add( titleComponent, new GridBagConstraints(0,0,1,1,1.0,0.0, - GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(0,0,15,0),0,0) ); - } - } - - public ContentSection( JComponent content, boolean maxSize ) { - this( content, maxSize, 0 ); - } - - private ContentSection( JComponent content, boolean maxSize, int leftInsets ) { - super( new GridBagLayout() ); - setOpaque(false); - this.maxSize = maxSize; - add( content, new GridBagConstraints(0,1,2,1,1.0,1.0, - GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,leftInsets,0,0),0,0) ); - - setBorder( BorderFactory.createEmptyBorder(22,35,15,35) ); - } - - @Override - public void setSize(Dimension d) { - if( maxSize && d.width > PANEL_MAX_WIDTH ) { - d = new Dimension( d ); - d.width = PANEL_MAX_WIDTH; - } - super.setSize(d); - } - - @Override - public void setBounds(Rectangle r) { - if( maxSize && r.width > PANEL_MAX_WIDTH ) { - r = new Rectangle( r ); - r.width = PANEL_MAX_WIDTH; - } - super.setBounds(r); - } - - @Override - public void setBounds(int x, int y, int w, int h) { - if( maxSize && w > PANEL_MAX_WIDTH ) { - w = PANEL_MAX_WIDTH; - } - super.setBounds(x,y,w,h); - } - - @Override - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - if( maxSize && d.width > PANEL_MAX_WIDTH ) { - d = new Dimension( d ); - d.width = PANEL_MAX_WIDTH; - } - return d; - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/HttpProxySettings.java b/nb/welcome/src/org/netbeans/modules/welcome/content/HttpProxySettings.java deleted file mode 100644 index 8e1c33ac417f..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/HttpProxySettings.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.welcome.content; - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.prefs.PreferenceChangeEvent; -import java.util.prefs.PreferenceChangeListener; -import java.util.prefs.Preferences; -import org.netbeans.api.options.OptionsDisplayer; -import org.openide.util.NbPreferences; - -/** - * - * @author S. Aubrecht - */ -class HttpProxySettings { - - private static HttpProxySettings theInstance; - private static Preferences proxySettingsNode; - - private PropertyChangeSupport propertySupport = new PropertyChangeSupport( this ); - - public static final String PROXY_SETTINGS = "ProxySettings"; // NOI18N - - /** Creates a new instance of HttpProxySettings */ - private HttpProxySettings() { - initProxyMethodsMaybe(); - } - - public static HttpProxySettings getDefault() { - if( null == theInstance ) { - theInstance = new HttpProxySettings(); - } - return theInstance; - } - - public void addPropertyChangeListener( PropertyChangeListener l ) { - propertySupport.addPropertyChangeListener( l ); - } - - public void removePropertyChangeListener( PropertyChangeListener l ) { - propertySupport.removePropertyChangeListener( l ); - } - - public void showConfigurationDialog() { - OptionsDisplayer.getDefault().open( "General" );//NOI18N - } - - private static synchronized void initProxyMethodsMaybe() { - proxySettingsNode = NbPreferences.root ().node ("/org/netbeans/core"); - assert proxySettingsNode != null; - proxySettingsNode.addPreferenceChangeListener (new PreferenceChangeListener (){ - public void preferenceChange (PreferenceChangeEvent evt) { - if (evt.getKey ().startsWith ("proxy") || evt.getKey ().startsWith ("useProxy")) { - getDefault ().propertySupport.firePropertyChange (PROXY_SETTINGS, null, getDefault()); - } - } - }); - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/LinkButton.java b/nb/welcome/src/org/netbeans/modules/welcome/content/LinkButton.java deleted file mode 100644 index 56a7ea8fd587..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/LinkButton.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.Rectangle; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.logging.Level; -import java.util.logging.LogRecord; -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.border.Border; -import javax.swing.border.EmptyBorder; -import org.openide.awt.GraphicsUtils; -import org.openide.util.NbBundle; - -/** - * - * @author S. Aubrecht - */ -public abstract class LinkButton extends JButton - implements Constants, MouseListener, ActionListener, FocusListener { - - private boolean underline = false; - private final boolean showBorder; - private Font rollOverFont; - private Font regularFont; - - private final Color defaultForeground; - - private static final Border regularBorder = ButtonBorder.createRegular(); - private static final Border mouseoverBorder = ButtonBorder.createMouseOver(); - - private String usageTrackingId; - - public LinkButton( String label, String usageTrackingId ) { - this( label, false, usageTrackingId ); - } - - public LinkButton( String label, boolean showBorder, String usageTrackingId ) { - this( label, Utils.getLinkColor(), showBorder, usageTrackingId ); - } - - public LinkButton( String label, Color foreground, String usageTrackingId ) { - this( label, foreground, false, usageTrackingId ); - } - - public LinkButton( String label, Color foreground, boolean showBorder, String usageTrackingId ) { - super( label ); - this.defaultForeground = foreground; - this.showBorder = showBorder; - if( !showBorder || !Utils.isDefaultButtons() ) - setForeground( defaultForeground ); - setFont( BUTTON_FONT ); - this.usageTrackingId = usageTrackingId; - - if( showBorder ) { - if( !Utils.isDefaultButtons() ) { - setBorder( BorderFactory.createEmptyBorder(6, 12, 6, 12) ); - setMargin( new Insets(12,12,12,12) ); - } - } else { - setBorder( new EmptyBorder(1, 1, 1, 1) ); - setMargin( new Insets(0, 0, 0, 0) ); - } - - setCursor( Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) ); - setHorizontalAlignment( JLabel.LEFT ); - addMouseListener(this); - setFocusable( true ); - - if( !showBorder || !Utils.isDefaultButtons() ) { - setBorderPainted( false ); - setFocusPainted( false ); - setRolloverEnabled( true ); - setContentAreaFilled( false ); - } - - addActionListener( this ); - addFocusListener( this ); - } - - @Override - public void mouseClicked(MouseEvent e) { - } - - @Override - public void mousePressed(MouseEvent e) { - } - - @Override - public void mouseReleased(MouseEvent e) { - } - - @Override - public void mouseEntered(MouseEvent e) { - if( isEnabled() ) { - underline = true; - repaint(); - onMouseEntered( e ); - } - } - - @Override - public void mouseExited(MouseEvent e) { - if( isEnabled() ) { - underline = false; - if( !showBorder ) - setForeground( isVisited() ? Utils.getVisitedLinkColor(): defaultForeground ); - repaint(); - onMouseExited( e ); - } - } - - @Override - protected void paintComponent(Graphics g) { - GraphicsUtils.configureDefaultRenderingHints(g); - Graphics2D g2 = (Graphics2D) g; - if( showBorder && !Utils.isDefaultButtons() ) { - Border b = underline ? mouseoverBorder : regularBorder; - b.paintBorder(this, g2, 0, 0, getWidth(), getHeight()); - } - super.paintComponent(g2); - - if( showBorder && Utils.isDefaultButtons() ) - return; - - Dimension size = getSize(); - if( hasFocus() && isEnabled() ) { - g2.setStroke( LINK_IN_FOCUS_STROKE ); - g2.setColor( Utils.getFocusedLinkColor() ); - g2.drawRect( 0, 0, size.width - 1, size.height - 1 ); - } - } - - @Override - public void focusLost(FocusEvent e) { - } - - @Override - public void focusGained(FocusEvent e) { - Rectangle rect = getBounds(); - rect.grow( 0, FONT_SIZE ); - scrollRectToVisible( rect ); - } - - protected void onMouseExited(MouseEvent e) { - if( null != regularFont ) - super.setFont( regularFont ); - } - - protected void onMouseEntered(MouseEvent e) { - if( null != rollOverFont ) - super.setFont( rollOverFont ); - } - - @Override - public void paint(Graphics g) { - super.paint(g); - if( underline && isEnabled() && !showBorder ) { - g.setColor( getForeground() ); - Font f = getFont(); - FontMetrics fm = getFontMetrics(f); - int iconWidth = 0; - if( null != getIcon() ) { - iconWidth = getIcon().getIconWidth()+getIconTextGap(); - } - int x1 = iconWidth; - int y1 = fm.getHeight(); - int x2 = fm.stringWidth(getText()) + iconWidth; - if( getText().length() > 0 ) - g.drawLine(x1, y1, x2, y1); - } - } - - protected boolean isVisited() { - return false; - } - - public void setUsageTrackingId( String id ) { - this.usageTrackingId = id; - } - - protected void logUsage() { - LogRecord rec = new LogRecord(Level.INFO, "USG_START_PAGE_LINK"); //NOI18N - String id = usageTrackingId; - if( null == id ) - id = getText(); - rec.setParameters(new Object[] {id} ); - rec.setLoggerName(Constants.USAGE_LOGGER.getName()); - rec.setResourceBundle(NbBundle.getBundle(BundleSupport.BUNDLE_NAME)); - rec.setResourceBundleName(BundleSupport.BUNDLE_NAME); - - Constants.USAGE_LOGGER.log(rec); - System.err.println("usage: " + id); - } - - @Override - public void setFont( Font font ) { - super.setFont( font ); - regularFont = font; - if( showBorder ) { - rollOverFont = font.deriveFont( Font.BOLD ); - } else { - rollOverFont = null; - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/Logo.java b/nb/welcome/src/org/netbeans/modules/welcome/content/Logo.java deleted file mode 100644 index aab99a64c24a..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/Logo.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.logging.Level; -import java.util.logging.LogRecord; -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JPanel; -import org.openide.awt.StatusDisplayer; -import org.openide.util.ImageUtilities; -import org.openide.util.NbBundle; - -/** - * - * @author S. Aubrecht - */ -public class Logo extends JPanel implements Constants, MouseListener { - - private String url; - - public static Logo createApacheLogo() { - return new Logo( APACHE_LOGO_IMAGE, BundleSupport.getURL( "ApacheLogo" ) ); // NOI18N - } - - public static Logo createIncubatorLogo() { - return new Logo( INCUBATOR_LOGO_IMAGE, BundleSupport.getURL( "IncubatorLogo" ) ); // NOI18N - } - - public static Logo createNetBeansLogo() { - return new Logo( NETBEANS_LOGO_IMAGE, BundleSupport.getURL( "NetBeansLogo" ) ); // NOI18N - } - - /** Creates a new instance of RecentProjects */ - public Logo( String img, String url ) { - super( new BorderLayout() ); - Icon image = new ImageIcon( ImageUtilities.loadImage(img, true) ); - JLabel label = new JLabel( image ); - label.setBorder( BorderFactory.createEmptyBorder() ); - label.setOpaque( false ); - label.addMouseListener( this ); - setOpaque( false ); - add( label, BorderLayout.CENTER ); - setCursor( Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) ); - this.url = url; - } - - @Override - public void mouseClicked(MouseEvent e) { - LogRecord rec = new LogRecord(Level.INFO, "USG_START_PAGE_LINK"); //NOI18N - rec.setParameters(new Object[] {url} ); - rec.setLoggerName(Constants.USAGE_LOGGER.getName()); - rec.setResourceBundle(NbBundle.getBundle(BundleSupport.BUNDLE_NAME)); - rec.setResourceBundleName(BundleSupport.BUNDLE_NAME); - - Constants.USAGE_LOGGER.log(rec); - Utils.showURL( url ); - } - - @Override - public void mousePressed(MouseEvent e) { - } - - @Override - public void mouseReleased(MouseEvent e) { - } - - @Override - public void mouseEntered(MouseEvent e) { - StatusDisplayer.getDefault().setStatusText( url ); - } - - @Override - public void mouseExited(MouseEvent e) { - StatusDisplayer.getDefault().setStatusText( null ); - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/RSSEntityResolver.java b/nb/welcome/src/org/netbeans/modules/welcome/content/RSSEntityResolver.java deleted file mode 100644 index 42cbdfa96e3f..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/RSSEntityResolver.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.welcome.content; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.xml.sax.EntityResolver; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Entity resolver to make it possible to parse an RSS Feed (Version 0.91) with - * an XMLReader. The license of the specification and the grammar file is - * unclear. As the grammer is not used in the welcome module and the stream is - * manually parsed, only entities need to be resolved by the XML parser. - * The XML stream can contain Latin-1 entities, which are taken - * from the HTML 3.2 specification. Instead of the HTML 3.2 DTDs (SGML), the - * XHTML specification is used as a replacement here. - */ -public class RSSEntityResolver implements EntityResolver { - - private static final Logger LOG = Logger.getLogger(RSSEntityResolver.class.getName()); - private static final Map EMBEDDED_DTDS = new HashMap(); - - static { - String base = "/org/netbeans/modules/welcome/resources/"; - // This entry is intended to map the Netscape RSS publicId to the - // DTD for XHTML 1 - EMBEDDED_DTDS.put("-//Netscape Communications//DTD RSS 0.91//EN", - RSSEntityResolver.class.getResource(base + "xhtml1-transitional.dtd") - .toExternalForm()); - EMBEDDED_DTDS.put("-//W3C//ENTITIES Latin 1 for XHTML//EN", - RSSEntityResolver.class.getResource(base + "xhtml-lat1.ent") - .toExternalForm()); - EMBEDDED_DTDS.put("-//W3C//ENTITIES Symbols for XHTML//EN", - RSSEntityResolver.class.getResource(base + "xhtml-symbol.ent") - .toExternalForm()); - EMBEDDED_DTDS.put("-//W3C//ENTITIES Special for XHTML//EN", - RSSEntityResolver.class.getResource(base + "xhtml-special.ent") - .toExternalForm()); - } - - @Override - public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { - String url = EMBEDDED_DTDS.get(publicId); - LOG.log(Level.FINE, - "Resolving publicId({0}) to: {1}", //NOI18N - new Object[] {publicId, url}); - if (url != null) { - return new InputSource(url); - } else { - return null; - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/RSSFeed.java b/nb/welcome/src/org/netbeans/modules/welcome/content/RSSFeed.java deleted file mode 100644 index cdf3b40c5087..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/RSSFeed.java +++ /dev/null @@ -1,783 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.FontMetrics; -import java.awt.Graphics2D; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.security.SecureRandom; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.prefs.Preferences; -import java.util.zip.GZIPInputStream; -import java.util.zip.Inflater; -import java.util.zip.InflaterInputStream; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.xml.parsers.ParserConfigurationException; -import org.openide.ErrorManager; -import org.openide.awt.Mnemonics; -import org.openide.modules.Places; -import org.openide.util.NbPreferences; -import org.openide.util.RequestProcessor; -import org.openide.util.WeakListeners; -import org.openide.windows.WindowManager; -import org.openide.xml.XMLUtil; -import org.w3c.dom.Node; -import org.xml.sax.Attributes; -import org.xml.sax.ContentHandler; -import org.xml.sax.InputSource; -import org.xml.sax.Locator; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; - -public class RSSFeed extends JPanel implements Constants, PropertyChangeListener { - - private String url; - - private boolean showProxyButton = true; - - private RequestProcessor.Task reloadTimer; - protected long lastReload = 0; - - public static final String FEED_CONTENT_PROPERTY = "feedContent"; - - private static DateFormat parsingDateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH ); // NOI18N - private static DateFormat parsingDateFormatShort = new SimpleDateFormat( "EEE, dd MMM yyyy", Locale.ENGLISH ); // NOI18N - private static DateFormat parsingDateFormatLong = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH ); // NOI18N - private static DateFormat printingDateFormatShort = DateFormat.getDateInstance( DateFormat.SHORT ); - - private final Logger LOGGER = Logger.getLogger( RSSFeed.class.getName() ); - - private int maxDescriptionChars = -1; - - private static final RequestProcessor RP = new RequestProcessor("StartPage"); //NOI18N - - - private static Path getCachePathFor(String path) { - return Places.getCacheSubfile("welcome/" + path).toPath(); // NOI18N - } - - private static boolean cacheExistsFor(String path) { - return Files.exists(getCachePathFor(path)); - } - - public RSSFeed( String url, boolean showProxyButton ) { - super( new BorderLayout() ); - setOpaque(false); - this.url = url; - this.showProxyButton = showProxyButton; - setBorder(null); - - add( buildContentLoadingLabel(), BorderLayout.CENTER ); - - HttpProxySettings.getDefault().addPropertyChangeListener( WeakListeners.propertyChange( this, HttpProxySettings.getDefault() ) ); - } - - public RSSFeed( boolean showProxyButton ) { - this( null, showProxyButton ); - } - - public void setContent( Component content ) { - removeAll(); - add( content, BorderLayout.CENTER ); - firePropertyChange( FEED_CONTENT_PROPERTY, null, content ); - revalidate(); - invalidate(); - repaint(); - } - - public Component getContent() { - return this; - } - - public void reload() { - new Reload().start(); - } - - protected int getMaxItemCount() { - return 5; - } - - protected List buildItemList() throws SAXException, ParserConfigurationException, IOException { - XMLReader reader = XMLUtil.createXMLReader( false, true ); - FeedHandler handler = new FeedHandler( getMaxItemCount() ); - reader.setContentHandler( handler ); - reader.setEntityResolver( new RSSEntityResolver() ); - reader.setErrorHandler( new ErrorCatcher() ); - - InputSource is = findInputSource(new URL(url)); - reader.parse( is ); - - return handler.getItemList(); - } - - - protected final String url2path( URL u ) { - StringBuilder pathSB = new StringBuilder(u.getHost()); - if (u.getPort() != -1) { - pathSB.append(u.getPort()); - } - pathSB.append(u.getPath()); - if( null != u.getQuery() ) - pathSB.append(u.getQuery()); - return pathSB.toString(); - } - - /** Searches either for locally cached copy of URL content of original. - */ - protected InputSource findInputSource( URL u ) throws IOException { - HttpURLConnection httpCon = (HttpURLConnection) u.openConnection(); - httpCon.setUseCaches( true ); - httpCon.setRequestProperty( "Accept-Encoding", "gzip, deflate" ); // NOI18N - - Preferences prefs = NbPreferences.forModule( RSSFeed.class ); - String path = url2path( u ); - String lastModified = prefs.get( path, null ); - if (lastModified != null && cacheExistsFor(path)) { - httpCon.addRequestProperty("If-Modified-Since", lastModified); // NOI18N - } - - if( httpCon instanceof HttpsURLConnection ) { - initSSL( httpCon ); - } - httpCon.connect(); - //if it returns Not modified then we already have the content, return - if( httpCon.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED ) { - //disconnect() should only be used when you won't - //connect to the same site in a while, - //since it disconnects the socket. Only losing - //the stream on an HTTP 1.1 connection will - //maintain the connection waiting and be - //faster the next time around - Path cacheFile = getCachePathFor(path); - LOGGER.log(Level.FINE, "Reading content of {0} from {1}", //NOI18N - new Object[] {u.toString(), cacheFile.toString()}); - return new org.xml.sax.InputSource(new BufferedInputStream(Files.newInputStream(cacheFile))); - } else if( httpCon.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP ) { - String newUrl = httpCon.getHeaderField( "Location"); //NOI18N - if( null != newUrl && !newUrl.isEmpty() ) { - return findInputSource( new URL(newUrl) ); - } - throw new IOException( "Invalid redirection" ); //NOI18N - } - else { - //obtain the encoding returned by the server - String encoding = httpCon.getContentEncoding(); - LOGGER.log(Level.FINER, "Connection encoding: {0}", encoding); //NOI18N - - LOGGER.log(Level.FINER, "ETag: {0}", httpCon.getHeaderField("ETag")); //NOI18N - - InputStream is = null; - if ("gzip".equalsIgnoreCase(encoding)) { //NOI18N - is = new GZIPInputStream(httpCon.getInputStream()); - } - else if ("deflate".equalsIgnoreCase(encoding)) { //NOI18N - is = new InflaterInputStream(httpCon.getInputStream(), new Inflater(true)); - } - else { - is = httpCon.getInputStream(); - } - LOGGER.log( Level.FINE, "Reading {0} from original source and caching", url ); //NOI18N - return new org.xml.sax.InputSource(new CachingInputStream(is, path, httpCon.getHeaderField("Last-Modified"))); //NOI18N - } - } - - /** Inner class error catcher for handling SAXParseExceptions */ - static class ErrorCatcher implements org.xml.sax.ErrorHandler { - private void message(Level level, org.xml.sax.SAXParseException e) { - Logger l = Logger.getLogger(RSSFeed.class.getName()); - l.log(level, "Line number:"+e.getLineNumber()); //NOI18N - l.log(level, "Column number:"+e.getColumnNumber()); //NOI18N - l.log(level, "Public ID:"+e.getPublicId()); //NOI18N - l.log(level, "System ID:"+e.getSystemId()); //NOI18N - l.log(level, "Error message:"+e.getMessage()); //NOI18N - } - - @Override - public void error(org.xml.sax.SAXParseException e) { - message(Level.SEVERE, e); //NOI18N - } - - @Override - public void warning(org.xml.sax.SAXParseException e) { - message(Level.WARNING,e); //NOI18N - } - - @Override - public void fatalError(org.xml.sax.SAXParseException e) { - message(Level.SEVERE,e); //NOI18N - } - } //end of inner class ErrorCatcher - - private class Reload extends Thread { - @Override - public void run() { - try { - lastReload = System.currentTimeMillis(); -// System.err.println("reloading: " + lastReload + "url=" + url); - - List itemList = buildItemList(); - final JPanel contentPanel = new JPanel( new GridBagLayout() ); - contentPanel.setOpaque( false ); - int contentRow = 0; - - Component header = getContentHeader(); - if( null != header ) { - contentPanel.add( header, new GridBagConstraints(0,contentRow++,1,1,0.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.BOTH, - new Insets(0,0,0,0),0,0 ) ); - } - - for( int i=0; i { - setContent(contentPanel); - }); - - //schedule feed reload - reloadTimer = RP.post( this, RSS_FEED_TIMER_RELOAD_MILLIS ); - - } catch (IOException ex) { - SwingUtilities.invokeLater(() -> { - setContent(buildProxyPanel()); - }); - } catch (Exception ex) { - stopReloading(); - try { - // check if this was a cache issue - clearCache(); - buildItemList(); - reload(); - return; - } catch (Exception ignore) {} - SwingUtilities.invokeLater(() -> { - setContent(buildErrorLabel()); - }); - ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); - } - } - } - - protected void clearCache() { - try { - NbPreferences.forModule(RSSFeed.class).remove(url2path(new URL(url))); - } catch(MalformedURLException ignore) {} - } - - protected Component createFeedItemComponent( FeedItem item ) { - JPanel panel = new JPanel( new GridBagLayout() ); - panel.setOpaque( false ); - int row = 0; - if( item.dateTime != null) { - JLabel label = new JLabel(); - label.setFont( RSS_DESCRIPTION_FONT ); - label.setForeground( Utils.getRssDateColor() ); - label.setText( formatDateTime( item.dateTime ) ); - panel.add( label, new GridBagConstraints(2,row,1,1,0.0,0.0, - GridBagConstraints.EAST,GridBagConstraints.NONE, - new Insets(0,TEXT_INSETS_LEFT+5,2,TEXT_INSETS_RIGHT),0,0 ) ); - } - - WebLink linkButton = new WebLink( stripHtml(item.title), item.link, - Utils.getRssHeaderColor(), false ); - linkButton.getAccessibleContext().setAccessibleName( - BundleSupport.getAccessibilityName( "WebLink", item.title ) ); //NOI18N - linkButton.getAccessibleContext().setAccessibleDescription( - BundleSupport.getAccessibilityDescription( "WebLink", item.link ) ); //NOI18N - linkButton.setFont( BUTTON_FONT ); - panel.add( linkButton, new GridBagConstraints(0,row++,1,1,1.0,0.0, - GridBagConstraints.WEST,GridBagConstraints.NONE, - new Insets(0,0,2,TEXT_INSETS_RIGHT),0,0 ) ); - - - if (item.description != null) { - JLabel label = new JLabel("" + trimHtml(item.description) ); - label.setFont( RSS_DESCRIPTION_FONT ); - label.setForeground(Utils.getRssDetailsColor()); - panel.add( label, new GridBagConstraints(0,row++,4,1,0.0,0.0, - GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL, - new Insets(0,0,0,TEXT_INSETS_RIGHT),0,0 ) ); - } - return panel; - } - - protected static String getTextContent(Node node) { - Node child = node.getFirstChild(); - if( null == child ) - return null; - - return child.getNodeValue(); - } - - protected String formatDateTime( String strDateTime ) { - try { - Date date = parsingDateFormat.parse( strDateTime ); - return printingDateFormatShort.format( date ); - } catch( NumberFormatException nfE ) { - //ignore - } catch( ParseException pE ) { - try { - Date date = parsingDateFormatShort.parse( strDateTime ); - return printingDateFormatShort.format( date ); - } catch( NumberFormatException nfE ) { - //ignore - } catch( ParseException otherPE ) { - try { - Date date = parsingDateFormatLong.parse( strDateTime ); - return printingDateFormatShort.format( date ); - } catch( NumberFormatException nfE ) { - //ignore - } catch( ParseException e ) { - //ignore - } - } - } - return strDateTime; - } - - private static final long serialVersionUID = 1L; - - @Override - public void removeNotify() { - stopReloading(); - maxDescriptionChars = -1; - super.removeNotify(); - } - - @Override - public void addNotify() { - super.addNotify(); - getMaxDecsriptionLength(); - WindowManager.getDefault().invokeWhenUIReady( new Runnable() { - @Override - public void run() { - startReloading(); - } - }); - } - - protected void startReloading() { - if( null == reloadTimer && !Boolean.getBoolean("netbeans.full.hack")) { - if( System.currentTimeMillis() - lastReload >= RSS_FEED_TIMER_RELOAD_MILLIS ) { - reload(); - } else { - reloadTimer = RP.post( new Reload(), - Math.max(1, (int)(RSS_FEED_TIMER_RELOAD_MILLIS - (System.currentTimeMillis() - lastReload))) ); - } - } - } - - protected void stopReloading() { - if( null != reloadTimer ) { - reloadTimer.cancel(); - reloadTimer = null; - } - } - - private String trimHtml( String htmlSnippet ) { - String res = stripHtml(htmlSnippet); - int maxLen = getMaxDecsriptionLength(); - if( maxLen > 0 && res.length() > maxLen ) { - res = res.substring( 0, maxLen ) + "..."; // NOI18N - } - return res; - } - - private String stripHtml( String htmlSnippet ) { - return htmlSnippet.replaceAll( "<[^>]*>", "" ) // NOI18N - .replace( " ", " " ) // NOI18N - .trim(); - } - - protected int getMaxDecsriptionLength() { - if( maxDescriptionChars < 0 && getWidth() > 0 ) { - if( getWidth() <= 0 ) { - SwingUtilities.invokeLater( new Runnable() { - @Override - public void run() { - getMaxDecsriptionLength(); - } - }); - return 200; - } - try { - Graphics2D g = (Graphics2D)getGraphics(); - FontMetrics fm = g.getFontMetrics( RSS_DESCRIPTION_FONT ); - double charWidth = fm.getStringBounds( "Ab c", g ).getWidth() / 4; - double feedWidth = getWidth() - 30; - maxDescriptionChars = (int)(1.8 * feedWidth / charWidth); - } catch( Throwable e ) { - maxDescriptionChars = 200; - } - } - return maxDescriptionChars; - } - - protected Component getContentHeader() { - return null; - } - - private JComponent buildProxyPanel() { - Component header = getContentHeader(); - JPanel panel = new JPanel(new GridBagLayout()); - panel.setOpaque( false ); - - int row = 0; - if( null != header ) { - panel.add( header, new GridBagConstraints(0,row++,1,1,1.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); - } - - panel.add( new JLabel(BundleSupport.getLabel("ErrCannotConnect")), // NOI18N - new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); - if( showProxyButton ) { - JButton button = new JButton(); - Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "ProxyConfig" ) ); // NOI18N - button.setOpaque( false ); - button.addActionListener( new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - HttpProxySettings.getDefault().showConfigurationDialog(); - } - }); - panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); - } - return panel; - } - - private JComponent buildContentLoadingLabel() { - JLabel label = new JLabel( BundleSupport.getLabel( "ContentLoading" ) ); // NOI18N - label.setHorizontalAlignment( JLabel.CENTER ); - label.setVerticalAlignment( JLabel.CENTER ); - label.setOpaque( false ); - Component header = getContentHeader(); - if( null != header ) { - JPanel panel = new JPanel( new GridBagLayout() ); - panel.setOpaque( false ); - panel.add( header, new GridBagConstraints(0,0,1,1,1.0,1.0, - GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); - panel.add( label, new GridBagConstraints(0,1,1,1,1.0,1.0, - GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); - panel.setBorder( BorderFactory.createEmptyBorder(40, 0, 40, 0)); - return panel; - } - label.setBorder( BorderFactory.createEmptyBorder(40, 0, 40, 0)); - return label; - } - - private JComponent buildErrorLabel() { - Component header = getContentHeader(); - JPanel panel = new JPanel(new GridBagLayout()); - panel.setOpaque( false ); - - int row = 0; - if( null != header ) { - panel.add( header, new GridBagConstraints(0,row++,1,1,1.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); - } - - panel.add( new JLabel(BundleSupport.getLabel("ErrLoadingFeed")), // NOI18N - new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); - JButton button = new JButton(); - Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "Reload" ) ); // NOI18N - button.setOpaque( false ); - button.addActionListener( new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - lastReload = 0; - reload(); - } - }); - panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); - return panel; - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - if( HttpProxySettings.PROXY_SETTINGS.equals( evt.getPropertyName() ) ) { - removeAll(); - add( buildContentLoadingLabel(), BorderLayout.CENTER ); - lastReload = 0; - reload(); - } - } - - static class FeedHandler implements ContentHandler { - private FeedItem currentItem; - private StringBuffer textBuffer; - private int maxItemCount; - private ArrayList itemList; - - public FeedHandler( int maxItemCount ) { - this.maxItemCount = maxItemCount; - itemList = new ArrayList( maxItemCount ); - } - - @Override - public void setDocumentLocator(Locator locator) { - } - - @Override - public void startDocument() throws SAXException { - } - - @Override - public void endDocument() throws SAXException { - } - - @Override - public void startPrefixMapping(String prefix, String uri) throws SAXException { - } - - @Override - public void endPrefixMapping(String prefix) throws SAXException { - } - - @Override - public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { - if( itemList.size() < maxItemCount ) { - if( "item".equals( localName ) - || "entry".equals( localName ) ) { // NOI18N - currentItem = new FeedItem(); - } else if( "link".equals( localName ) // NOI18N - || "pubDate".equals( localName ) // NOI18N - || "date".equals( localName ) // NOI18N - || "published".equals( localName ) // NOI18N - || "description".equals( localName ) // NOI18N - || "content".equals( localName ) // NOI18N - || "title".equals( localName ) ) { // NOI18N - textBuffer = new StringBuffer( 110 ); - - if( "link".equals(localName) && null != currentItem && null != atts.getValue("href") ) - currentItem.link = fixFeedItemUrl(atts.getValue("href")); - } else if( "enclosure".equals( localName ) && null != currentItem ) { //NOI18N - currentItem.enclosureUrl = atts.getValue( "url" ); //NOI18N - } - } - } - - @Override - public void endElement(String uri, String localName, String qName) throws SAXException { - if( itemList.size() < maxItemCount ) { - if( "item".equals( localName ) - || "entry".equals( localName ) ) { // NOI18N - if( null != currentItem && currentItem.isValid() ) { - itemList.add( currentItem ); - } - currentItem = null; - } else if( null != currentItem && null != textBuffer ) { - String text = textBuffer.toString().trim(); - textBuffer = null; - if( 0 == text.length() ) - text = null; - - if( "link".equals( localName ) && null == currentItem.link ) { // NOI18N - currentItem.link = fixFeedItemUrl(text); - } else if( "pubDate".equals( localName ) // NOI18N - || "published".equals( localName ) - || "date".equals( localName ) ) { // NOI18N - currentItem.dateTime = text; - } else if( "title".equals( localName ) ) { // NOI18N - currentItem.title = text; - } else if( "description".equals( localName ) - || "content".equals(localName) ) { // NOI18N - currentItem.description = text; - } - } - } - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - if( null != textBuffer ) - textBuffer.append( ch, start, length ); - } - - @Override - public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { - } - - @Override - public void processingInstruction(String target, String data) throws SAXException { - } - - @Override - public void skippedEntity(String name) throws SAXException { - } - - public ArrayList getItemList() { - return itemList; - } - - protected String fixFeedItemUrl(String url) { - if( null != url && (url.contains(".netbeans.org") || url.contains("/netbeans.org")) ) {//NOI18N - if( url.contains("?") ) { - url = url + "&"; - } else { - url = url + "?"; - } - url += "utm_source=netbeans&utm_campaign=welcomepage"; - } - return url; - } - } - - protected static class FeedItem { - public String title; - public String link; - public String description; - public String dateTime; - public String enclosureUrl; - - public boolean isValid() { - return null != title && null != link; - } - } - - static class CachingInputStream extends FilterInputStream { - private OutputStream os; - private String modTime; - private String path; - - CachingInputStream (InputStream is, String path, String time) - throws IOException { - super(is); - Path storage = getCachePathFor(path); - os = new BufferedOutputStream(Files.newOutputStream(storage)); - modTime = time; - this.path = path; - } - - @Override - public void close() throws IOException { - super.close(); - if (modTime != null) { - NbPreferences.forModule(RSSFeed.class).put(path, modTime); - } - os.close(); - } - - @Override - public int read() throws IOException { - int val = super.read(); - os.write(val); - return val; - } - - @Override - public int read(byte[] b, int off, int len) throws IOException { - int res = super.read(b, off, len); - if (res != -1) { - os.write(b, off, res); - } - return res; - } - } - - public static void initSSL( HttpURLConnection httpCon ) throws IOException { - if( httpCon instanceof HttpsURLConnection ) { - HttpsURLConnection https = ( HttpsURLConnection ) httpCon; - - try { - TrustManager[] trustAllCerts = new TrustManager[]{ - new X509TrustManager() { - @Override - public X509Certificate[] getAcceptedIssuers() { - return new X509Certificate[0]; - } - - @Override - public void checkClientTrusted( X509Certificate[] certs, String authType ) { - } - - @Override - public void checkServerTrusted( X509Certificate[] certs, String authType ) { - } - } }; - SSLContext sslContext = SSLContext.getInstance( "SSL" ); //NOI18N - sslContext.init( null, trustAllCerts, new SecureRandom() ); - https.setHostnameVerifier( new HostnameVerifier() { - @Override - public boolean verify( String hostname, SSLSession session ) { - return true; - } - } ); - https.setSSLSocketFactory( sslContext.getSocketFactory() ); - } catch( Exception ex ) { - throw new IOException( ex ); - } - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/RSSFeedReaderPanel.java b/nb/welcome/src/org/netbeans/modules/welcome/content/RSSFeedReaderPanel.java deleted file mode 100644 index ec3c0abb3dfd..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/RSSFeedReaderPanel.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import javax.swing.JComponent; -import javax.swing.JPanel; - -/** - * - * @author S. Aubrecht - */ -public class RSSFeedReaderPanel extends JPanel implements PropertyChangeListener { - - private static final int FEED_PANEL_MAX_WIDTH = 600; - - /** Creates a new instance of AbstractFeedReaderPanel */ - public RSSFeedReaderPanel( String url ) { - super( new BorderLayout() ); - setOpaque(false); - add( buildContent( url, false ), BorderLayout.CENTER ); - setMaximumSize( new Dimension(FEED_PANEL_MAX_WIDTH, Integer.MAX_VALUE) ); - } - - /** Creates a new instance of AbstractFeedReaderPanel */ - public RSSFeedReaderPanel( String key, boolean showProxyButton ) { - super( new BorderLayout() ); - setOpaque(false); - add( buildContent( BundleSupport.getURL( key ), showProxyButton ), BorderLayout.CENTER ); - } - - protected JComponent buildContent( String url, boolean showProxyButton ) { - RSSFeed feed = new RSSFeed( url, showProxyButton ); - feed.addPropertyChangeListener( RSSFeed.FEED_CONTENT_PROPERTY, this ); - return feed; - } - - protected void feedContentLoaded() { - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - if( RSSFeed.FEED_CONTENT_PROPERTY.equals( evt.getPropertyName() ) ) { - feedContentLoaded(); - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/RecentProjectsPanel.java b/nb/welcome/src/org/netbeans/modules/welcome/content/RecentProjectsPanel.java deleted file mode 100644 index 9955d86eb8f1..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/RecentProjectsPanel.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.BorderLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.AbstractAction; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import org.netbeans.api.progress.ProgressUtils; -import org.netbeans.api.project.Project; -import org.netbeans.api.project.ProjectManager; -import org.netbeans.api.project.ui.OpenProjects; -import org.netbeans.modules.project.ui.api.RecentProjects; -import org.netbeans.modules.project.ui.api.UnloadedProjectInformation; -import org.openide.DialogDisplayer; -import org.openide.NotifyDescriptor; -import org.openide.filesystems.FileObject; -import org.openide.filesystems.URLMapper; -import org.openide.util.RequestProcessor; -import org.openide.util.Utilities; - -/** - * Panel showing all recent projects as clickable buttons. - * - * @author S. Aubrecht - */ -public class RecentProjectsPanel extends JPanel implements Constants, Runnable { - - private static final int MAX_PROJECTS = 10; - private PropertyChangeListener changeListener; - - private static final RequestProcessor RP = new RequestProcessor("RecentProjects"); //NOI18N - - /** Creates a new instance of RecentProjectsPanel */ - public RecentProjectsPanel() { - super( new BorderLayout() ); - setOpaque(false); - } - - @Override - public void addNotify() { - super.addNotify(); - removeAll(); - add( startBuildingContent(), BorderLayout.CENTER ); - RecentProjects.getDefault().addPropertyChangeListener( getPropertyChangeListener() ); - } - - @Override - public void removeNotify() { - super.removeNotify(); - RecentProjects.getDefault().removePropertyChangeListener( getPropertyChangeListener() ); - } - - private PropertyChangeListener getPropertyChangeListener() { - if( null == changeListener ) { - changeListener = new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent e) { - if( RecentProjects.PROP_RECENT_PROJECT_INFO.equals( e.getPropertyName() ) ) { - SwingUtilities.invokeLater(RecentProjectsPanel.this); - } - } - }; - } - return changeListener; - } - - @Override - public void run() { - removeAll(); - add( rebuildContent(RecentProjects.getDefault().getRecentProjectInformation()), BorderLayout.CENTER ); - invalidate(); - revalidate(); - repaint(); - } - - private JPanel startBuildingContent() { - JPanel panel = new JPanel( new BorderLayout() ); - panel.setOpaque( false ); - JLabel lbl = new JLabel(BundleSupport.getLabel( "LoadingProjects" )); - lbl.setHorizontalAlignment(JLabel.CENTER); - panel.add( lbl, BorderLayout.CENTER ); - - loadProjects(); - - return panel; - } - - private void loadProjects() { - RP.post(new Runnable() { - - @Override - public void run() { - List projects = new ArrayList(RecentProjects.getDefault().getRecentProjectInformation()); - final List existingProjects = new ArrayList(projects.size()); - for( UnloadedProjectInformation p : projects ) { - try { - File projectDir = Utilities.toFile( p.getURL().toURI() ); - if( !projectDir.exists() || !projectDir.isDirectory() ) - continue; - existingProjects.add(p); - if( existingProjects.size() >= MAX_PROJECTS ) - break; - } catch( Exception e ) { - Logger.getLogger( RecentProjectsPanel.class.getName() ).log( Level.FINER, null, e ); - } - } - SwingUtilities.invokeLater(new Runnable() { - - @Override - public void run() { - removeAll(); - add( rebuildContent(existingProjects), BorderLayout.CENTER ); - invalidate(); - revalidate(); - repaint(); - } - }); - } - }); - } - - private JPanel rebuildContent(List projects) { - JPanel panel = new JPanel( new GridBagLayout() ); - panel.setOpaque( false ); - int row = 0; - for( UnloadedProjectInformation p : projects ) { - addProject( panel, row++, p ); - if( row >= MAX_PROJECTS ) - break; - } - if( 0 == row ) { - panel.add( new JLabel(BundleSupport.getLabel( "NoRecentProject" )), //NOI18N - new GridBagConstraints( 0,row,1,1,1.0,1.0, - GridBagConstraints.CENTER, GridBagConstraints.NONE, - new Insets(10,10,10,10), 0, 0 ) ); - } else { - panel.add( new JLabel(), new GridBagConstraints( 0,row,1,1,0.0,1.0, - GridBagConstraints.CENTER, GridBagConstraints.NONE, - new Insets(0,0,0,0), 0, 0 ) ); - } - return panel; - } - - private void addProject( JPanel panel, int row, final UnloadedProjectInformation project ) { - OpenProjectAction action = new OpenProjectAction( project ); - ActionButton b = new ActionButton( action, project.getURL().toString(), false, "RecentProject" ); //NOI18N - b.setFont( BUTTON_FONT ); - b.getAccessibleContext().setAccessibleName( b.getText() ); - b.getAccessibleContext().setAccessibleDescription( - BundleSupport.getAccessibilityDescription( "RecentProject", b.getText() ) ); //NOI18N - b.setIcon(project.getIcon()); - panel.add( b, new GridBagConstraints( 0,row,1,1,1.0,0.0, - GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(2,2,2,2), 0, 0 ) ); - } - - private class OpenProjectAction extends AbstractAction { - private final UnloadedProjectInformation project; - public OpenProjectAction( UnloadedProjectInformation project ) { - super( project.getDisplayName(), project.getIcon() ); - this.project = project; - } - - @Override - public void actionPerformed(ActionEvent e) { - Runnable r = new Runnable() { - @Override - public void run() { - URL url = project.getURL(); - Project prj = null; - - FileObject dir = URLMapper.findFileObject( url ); - if ( dir != null && dir.isFolder() ) { - try { - prj = ProjectManager.getDefault().findProject( dir ); - } - catch ( IOException ioEx ) { - // Ignore invalid folders - } - } - - if ( prj != null ) { - OpenProjects.getDefault().open( new Project[] { prj }, false, true ); - } else { - String msg = BundleSupport.getMessage("ERR_InvalidProject", project.getDisplayName()); //NOI18N - NotifyDescriptor nd = new NotifyDescriptor.Message( msg ); - DialogDisplayer.getDefault().notify( nd ); - startBuildingContent(); - } - } - }; - ProgressUtils.runOffEventDispatchThread( r, BundleSupport.getLabel("OPEN_RECENT_PROJECT"), new AtomicBoolean(false), false ); - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/Utils.java b/nb/welcome/src/org/netbeans/modules/welcome/content/Utils.java deleted file mode 100644 index 2ebbff71d524..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/Utils.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.Color; -import java.awt.Font; -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Method; -import java.net.URL; -import java.util.ResourceBundle; -import javax.swing.Action; -import javax.swing.UIManager; -import org.openide.ErrorManager; -import org.openide.awt.HtmlBrowser; -import org.openide.cookies.InstanceCookie; -import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileUtil; -import org.openide.loaders.DataObject; -import org.openide.modules.Places; -import org.openide.util.NbBundle; - -/** - * - * @author S. Aubrecht - */ -public class Utils { - - /** Creates a new instance of Utils */ - private Utils() { - } - - public static void showURL(String href) { - try { - HtmlBrowser.URLDisplayer displayer = HtmlBrowser.URLDisplayer.getDefault(); - if (displayer != null) { - displayer.showURL(new URL(href)); - } - } catch (Exception e) {} - } - - static int getDefaultFontSize() { - Integer customFontSize = (Integer)UIManager.get("customFontSize"); // NOI18N - if (customFontSize != null) { - return customFontSize.intValue(); - } else { - Font systemDefaultFont = UIManager.getFont("TextField.font"); // NOI18N - return (systemDefaultFont != null) - ? systemDefaultFont.getSize() - : 11; - } - } - - public static Action findAction( String key ) { - FileObject fo = FileUtil.getConfigFile(key); - - if (fo != null && fo.isValid()) { - try { - DataObject dob = DataObject.find(fo); - InstanceCookie ic = dob.getCookie(InstanceCookie.class); - - if (ic != null) { - Object instance = ic.instanceCreate(); - if (instance instanceof Action) { - Action a = (Action) instance; - return a; - } - } - } catch (Exception e) { - ErrorManager.getDefault().notify(ErrorManager.WARNING, e); - return null; - } - } - return null; - } - - public static Color getColor( String resId ) { - ResourceBundle bundle = NbBundle.getBundle("org.netbeans.modules.welcome.resources.Bundle"); // NOI18N - try { - Integer rgb = Integer.decode(bundle.getString(resId)); - return new Color(rgb.intValue()); - } catch( NumberFormatException nfE ) { - ErrorManager.getDefault().notify( ErrorManager.INFORMATIONAL, nfE ); - return Color.BLACK; - } - } - - public static Color getLinkColor() { - Color res = UIManager.getColor("nb.html.link.foreground"); //NOI18N - if( null == res ) - res = getColor( Constants.LINK_COLOR ); - return res; - } - - public static Color getFocusedLinkColor() { - Color res = UIManager.getColor("nb.html.link.foreground.focus"); //NOI18N - if( null == res ) - res = getColor( Constants.LINK_IN_FOCUS_COLOR ); - return res; - } - - public static Color getVisitedLinkColor() { - Color res = UIManager.getColor("nb.html.link.foreground.visited"); //NOI18N - if( null == res ) - res = getColor( Constants.VISITED_LINK_COLOR ); - return res; - } - - public static Color getBottomBarColor() { - Color res = UIManager.getColor("nb.startpage.bottombar.background"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_BOTTOM_BAR ); - return res; - } - - public static Color getTopBarForeground() { - Color res = UIManager.getColor("nb.startpage.topbar.foreground"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_TAB_FOREGROUND ); - return res; - } - - public static Color getTopBarColor() { - Color res = UIManager.getColor("nb.startpage.topbar.background"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_TAB_BACKGROUND ); - return res; - } - - public static Color getBorderColor() { - Color res = UIManager.getColor("nb.startpage.border.color"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_BORDER ); - return res; - } - - public static Color getTabBorder1Color() { - Color res = UIManager.getColor("nb.startpage.tab.border1.color"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_TAB_BORDER1 ); - return res; - } - - public static Color getTabBorder2Color() { - Color res = UIManager.getColor("nb.startpage.tab.border2.color"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_TAB_BORDER2 ); - return res; - } - - public static Color getRssHeaderColor() { - Color res = UIManager.getColor("nb.startpage.rss.header.color"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_HEADER ); - return res; - } - - public static Color getRssDetailsColor() { - Color res = UIManager.getColor("nb.startpage.rss.details.color"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_RSS_DETAILS ); - return res; - } - - public static Color getRssDateColor() { - Color res = UIManager.getColor("nb.startpage.rss.date.color"); //NOI18N - if( null == res ) - res = getColor( Constants.COLOR_RSS_DATE ); - return res; - } - - public static boolean isDefaultButtons() { - return UIManager.getBoolean( "nb.startpage.defaultbuttonborder" ); //NOI18N - } - - public static boolean isSimpleTabs() { - return UIManager.getBoolean( "nb.startpage.simpletabs" ); //NOI18N - } - - public static File getCacheStore() throws IOException { - return Places.getCacheSubdirectory("welcome"); // NOI18N - } - - /** - * Try to extract the URL from the given DataObject using reflection. - * (The DataObject should be URLDataObject in most cases) - */ - public static String getUrlString(DataObject dob) { - try { - Method m = dob.getClass().getDeclaredMethod( "getURLString", new Class[] {} ); //NOI18N - m.setAccessible( true ); - Object res = m.invoke( dob ); - if( null != res ) { - return res.toString(); - } - } catch (Exception ex) { - //ignore - } - return null; - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/WebLink.java b/nb/welcome/src/org/netbeans/modules/welcome/content/WebLink.java deleted file mode 100644 index cf5edb06ef1d..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/content/WebLink.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.welcome.content; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.MouseEvent; -import org.openide.awt.StatusDisplayer; - -/** - * - * @author S. Aubrecht - */ -public class WebLink extends LinkButton { - - private String url; - - /** Creates a new instance of WebLink */ - public WebLink( String key, boolean showBorder ) { - this( BundleSupport.getLabel( key ), BundleSupport.getURL( key ), showBorder ); - } - - public WebLink( String label, String url, boolean showBorder ) { - super( label, showBorder, url ); - this.url = url; - - getAccessibleContext().setAccessibleName( - BundleSupport.getAccessibilityName( "WebLink", label ) ); //NOI18N - getAccessibleContext().setAccessibleDescription( - BundleSupport.getAccessibilityDescription( "WebLink", url ) ); //NOI18N - - setUsageTrackingId(url); - } - - public WebLink( String label, String url, Color foreground, boolean showBorder ) { - super( label, foreground, showBorder, url ); - this.url = url; - - setUsageTrackingId(url); - } - - @Override - public void actionPerformed(ActionEvent e) { - logUsage(); - Utils.showURL( url ); - } - - @Override - protected void onMouseExited(MouseEvent e) { - super.onMouseExited( e ); - StatusDisplayer.getDefault().setStatusText( "" ); - } - - @Override - protected void onMouseEntered(MouseEvent e) { - super.onMouseEntered( e ); - StatusDisplayer.getDefault().setStatusText( url ); - } -} - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties b/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties deleted file mode 100644 index 26bf064ae0c7..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties +++ /dev/null @@ -1,196 +0,0 @@ -# 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. -# -# Web Links -# - -WelcomePage/GettingStartedLinks/whatsnew.url=What's New - -WelcomePage/GettingStartedLinks/community.url=Community Corner - -WelcomePage/GettingStartedLinks/tour.url=Take a Tour - -WelcomePage/GettingStartedLinks/sampleproject.instance=Try a Sample Project - -WelcomePage/TutorialsLinks/tutorial1.url=Java SE Applications -WelcomePage/TutorialsLinks/tutorial4.url=PHP and HTML5 Applications - - -LBL_MoreTutorials=More Demos and Tutorials >> -#NOI18N -URL_MoreTutorials=http://netbeans.org/kb/index.html?utm_source=netbeans&utm_campaign=welcomepage - -ACD_LearnMore=Open default web browser with documentation to learn more about {0} - - -# -# RSS Feeds -# -LBL_Blogs=Blogs -#NOI18N -URL_Blogs=https://blogs.apache.org/netbeans/feed/entries/atom - -#NOI18N -URL_News=http://www.netbeans.org/news.xml - -LBL_AllNews=All News >> -#NOI18N -URL_AllNews=http://netbeans.org/community/news/index.html?utm_source=netbeans&utm_campaign=welcomepage -ACN_AllNews=Show all news -ACD_AllNews=Open the list of all news articles in the default web browser - - -LBL_AllArticles=All Tutorials >> -#NOI18N -URL_AllArticles=https://netbeans.apache.org/help/index.html -ACN_AllArticles=Show all tutorials -ACD_AllArticles=Open the list of all tutorials in the default web browser - -LBL_AllBlogs=All News >> -#NOI18N -URL_AllBlogs=https://blogs.apache.org/netbeans/ -ACN_AllBlogs=Show all blogs -ACD_AllBlogs=Open the list of all blogs in the default web browser - -LBL_AllOnlineDocs=All Online Documentation >> -#NOI18N -URL_AllOnlineDocs=https://netbeans.apache.org/help/index.html -ACN_AllOnlineDocs=Show all online documentation -ACD_AllOnlineDocs=Open the list of all documentation in the default web browser - -# -# Other -# -ACD_SampleProject=Create a new sample project for {0} -ACD_GettingStarted=Open default web browser with documentation to get started with {0} -ACN_WebLink=Web link to {0} -ACD_WebLink=Open URL {0} in the default browser - -LBL_ShowOnStartup=Show On Startup -ACN_ShowOnStartup=Show Welcome Screen on startup -ACD_ShowOnStartup=Checkbox to show or hide the Welcome Screen on next NetBeans startup - -#NOI18N -URL_IncubatorLogo=http://incubator.apache.org -#NOI18N -URL_ApacheLogo=http://www.apache.org -#NOI18N -URL_NetBeansLogo=https://netbeans.apache.org/ - -LBL_ContentLoading=Content is loading... -LBL_ErrLoadingFeed=Error while loading content - -LBL_ErrCannotConnect=Cannot connect to internet. -LBL_ProxyConfig=&Proxy Configuration... - -LBL_Reload=Reload - -LBL_LearnAndDiscoverTab=Learn & Discover -LBL_MyNetBeansTab=My NetBeans -LBL_WhatsNewTab=What's New - -LBL_WelcomeToNetBeans=Welcome to NetBeans IDE -#Recent Projects -LBL_SectionRecentProjects=Recent Projects -#Blogs -LBL_SectionBlogs=News -#Featured Demo -LBL_SectionDemo=Featured Demo -#News & Tutorials -LBL_SectionNewsAndTutorials=News & Tutorials - -LBL_SectionDemosAndTutorials=Demos & Tutorials -#NOI18N -URL_SectionDemosAndTutorials=http://netbeans.org/kb?utm_source=netbeans&utm_campaign=welcomepage - -#NOI18N -URL_Demo=http://www.netbeans.org/demos.xml -LBL_NoScreenShot= - -LBL_NoRecentProject= -ACD_RecentProject=Open recent project: {0} -LBL_LoadingProjects=loading projects... - -LBL_AddPlugins=Add Plugins >> - -ERR_InvalidProject={0} is not a valid NetBeans project. - -LBL_InstallPlugins=Install Plugins -LBL_InstallPluginsDescr=Add support for other languages and technologies by installing plugins from the NetBeans Update Center. - -LBL_InstallPluginsFullIDE=Install Plugins -LBL_InstallPluginsDescrFullIDE=Add support for other languages and technologies by installing plugins from the NetBeans Update Center. - -LBL_ActivateFeaturesFullIDE=Activate Features -LBL_ActivateFeaturesDescrFullIDE=NetBeans turns on functionality as you use it. Start creating and opening projects and the IDE will just activate the features you need, making your experience quicker and cleaner. Alternatively, you can activate features manually. - -# -# Colors -# -#NOI18N -ScreenBackgroundColor=0xFFFFFF -#NOI18N -TabForegroundColor=0xFFFFFF -#NOI18N -MouseOverTabColor=0xE5E5E5 -#NOI18N -SectionHeaderColor=0x666A6E -#NOI18N -BigButtonColor=0x23569D - -# links & buttons -#NOI18N -ButtonTextColor=0x164B7B -# default text color in RSS panels -#NOI18N -DefaultTextColor=0x000000 -# date & time field in RSS panels -#NOI18N -RssDateTimeColor=0xA5073E -# mouse-over link color -#NOI18N -LinkInFocusColor=0x000000 -# links in RSS feed panels -#NOI18N -LinkColor=0x23569D -# visited link color -#NOI18N -VisitedLinkColor=0x5591D2 -#NOI18N -RssDetailsColor=0x454545 -#NOI18N -HeaderForegroundColor=0x1D2153 -#NOI18N -BottomBarColor=0x23569D -#NOI18N -BorderColor=0xA2A2A2 -#NOI18N -TabBackgroundColor=0x021A72 -#NOI18N -TabBorder1Color=0x4571AE -#NOI18N -TabBorder2Color=0x021A72 - -#NOI18N -URL_TopBarLogo=https://netbeans.apache.org?utm_source=netbeans&utm_campaign=welcomepage - -USG_START_PAGE_LINK=Start page link/action: {0} -USG_SHOW_START_PAGE=Show start page at startup: {0} - -LBL_OPEN_RECENT_PROJECT=Open Recent Project -#The default font face name for all text in the Start Page -LBL_FONT_NAME=Arial diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/Welcome.settings b/nb/welcome/src/org/netbeans/modules/welcome/resources/Welcome.settings deleted file mode 100644 index 8d256f8b443b..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/Welcome.settings +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/apache_feather.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/apache_feather.png deleted file mode 100644 index ffa1d2fb6973..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/apache_feather.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/apache_feather_dark.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/apache_feather_dark.png deleted file mode 100644 index ffa1d2fb6973..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/apache_feather_dark.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/broken_image.gif b/nb/welcome/src/org/netbeans/modules/welcome/resources/broken_image.gif deleted file mode 100644 index a65aea351639..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/broken_image.gif and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_center.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_center.png deleted file mode 100644 index 9d2e48664fee..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_center.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_left.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_left.png deleted file mode 100644 index a1dab9b618fb..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_left.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_right.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_right.png deleted file mode 100644 index 420e3736dbc4..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/btn_right.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/community.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/community.url deleted file mode 100644 index 796c6088c1e1..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/community.url +++ /dev/null @@ -1 +0,0 @@ -https://netbeans.apache.org/community/index.html diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/content_banner.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/content_banner.png deleted file mode 100644 index e645e71d137d..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/content_banner.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/content_banner_dark.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/content_banner_dark.png deleted file mode 100644 index 2839164901dc..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/content_banner_dark.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/incubator_logo.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/incubator_logo.png deleted file mode 100644 index 812da03995f1..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/incubator_logo.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/incubator_logo_dark.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/incubator_logo_dark.png deleted file mode 100644 index 812da03995f1..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/incubator_logo_dark.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/layer.xml b/nb/welcome/src/org/netbeans/modules/welcome/resources/layer.xml deleted file mode 100644 index d8744740e3e0..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/layer.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/nb_logo.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/nb_logo.png deleted file mode 100644 index e3ea89f6b048..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/nb_logo.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/nb_logo_dark.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/nb_logo_dark.png deleted file mode 100644 index e3ea89f6b048..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/nb_logo_dark.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/picture_frame.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/picture_frame.png deleted file mode 100644 index 38b758cc7b01..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/picture_frame.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_center.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_center.png deleted file mode 100644 index bb1791bd4f78..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_center.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_left.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_left.png deleted file mode 100644 index e917da1418b2..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_left.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_right.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_right.png deleted file mode 100644 index 025773d27f3e..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/sel_btn_right.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/startpage.gif b/nb/welcome/src/org/netbeans/modules/welcome/resources/startpage.gif deleted file mode 100644 index 0bfa10faa9be..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/startpage.gif and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_rollover.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_rollover.png deleted file mode 100644 index b0a56f6583c7..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_rollover.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_rollover_dark.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_rollover_dark.png deleted file mode 100644 index 7bbae1814bb3..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_rollover_dark.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_selected.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_selected.png deleted file mode 100644 index 7af14e94570d..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_selected.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_selected_dark.png b/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_selected_dark.png deleted file mode 100644 index 94f7dc82c691..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/tab_selected_dark.png and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tour.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tour.url deleted file mode 100644 index 7ef6d8a2df5f..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tour.url +++ /dev/null @@ -1 +0,0 @@ -https://netbeans.apache.org/ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1.url deleted file mode 100644 index f24e0fffdaed..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial1.url +++ /dev/null @@ -1 +0,0 @@ -https://netbeans.apache.org/kb/docs/java/index.html \ No newline at end of file diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial4.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial4.url deleted file mode 100644 index d1c2fb7d18cf..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/tutorial4.url +++ /dev/null @@ -1 +0,0 @@ -https://netbeans.apache.org/kb/docs/php/index.html \ No newline at end of file diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/welcome.gif b/nb/welcome/src/org/netbeans/modules/welcome/resources/welcome.gif deleted file mode 100644 index 0bfa10faa9be..000000000000 Binary files a/nb/welcome/src/org/netbeans/modules/welcome/resources/welcome.gif and /dev/null differ diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/whatsnew.url b/nb/welcome/src/org/netbeans/modules/welcome/resources/whatsnew.url deleted file mode 100644 index e457bab2b078..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/whatsnew.url +++ /dev/null @@ -1 +0,0 @@ -https://netbeans.apache.org/download/index.html diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent b/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent deleted file mode 100644 index 17b5626e38f3..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-special.ent b/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-special.ent deleted file mode 100644 index bb6eb898e24d..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-special.ent +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent b/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent deleted file mode 100644 index f16465f28ae1..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd b/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd deleted file mode 100644 index c2a2c78a69d5..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd +++ /dev/null @@ -1,1248 +0,0 @@ - - - - - - -%HTMLlat1; - - -%HTMLsymbol; - - -%HTMLspecial; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/AbstractTab.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/AbstractTab.java deleted file mode 100644 index cead825a3dd0..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/AbstractTab.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.BorderLayout; -import javax.swing.JComponent; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.Constants; - -/** - * Base class for inner tabs in the Welcome Page - * - * @author S. Aubrecht - */ -abstract class AbstractTab extends JPanel implements Constants { - - private boolean initialized = false; - - public AbstractTab( String title ) { - super( new BorderLayout() ); - setName( title ); - setOpaque(false); - } - - @Override - public void addNotify() { - super.addNotify(); - if( !initialized ) { - add( new ContentHeader(getName()), BorderLayout.NORTH ); - add( buildContent(), BorderLayout.CENTER ); - add( new BottomBar(), BorderLayout.SOUTH ); - initialized = true; - } - } - - protected abstract JComponent buildContent(); -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/Blogs.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/Blogs.java deleted file mode 100644 index af29fcd9458a..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/Blogs.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.BorderLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.RSSFeedReaderPanel; -import org.netbeans.modules.welcome.content.WebLink; - -/** - * - * @author S. Aubrecht - */ -class Blogs extends RSSFeedReaderPanel { - - public Blogs() { - super( "Blogs", false ); // NOI18N - - add( buildBottomContent(), BorderLayout.SOUTH ); - } - - protected JComponent buildBottomContent() { - WebLink allBlogs = new WebLink( "AllBlogs", true ); // NOI18N - BundleSupport.setAccessibilityProperties( allBlogs, "AllBlogs" ); //NOI18N - - JPanel panel = new JPanel( new GridBagLayout() ); - panel.setOpaque(false); - panel.add( allBlogs, new GridBagConstraints(1,0,1,1,0.0,0.0,GridBagConstraints.SOUTHEAST,GridBagConstraints.HORIZONTAL,new Insets(5,5,0,5),0,0) ); - panel.add( new JLabel(), new GridBagConstraints(0,0,1,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(0,0,0,0),0,0) ); - - return panel; - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/BottomBar.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/BottomBar.java deleted file mode 100644 index c4615d1bb0b7..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/BottomBar.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import javax.swing.JLabel; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.Constants; -import org.netbeans.modules.welcome.content.Logo; -import org.netbeans.modules.welcome.content.Utils; - -/** - * - * @author S. Aubrecht - */ -class BottomBar extends JPanel { - - public BottomBar() { - super( new GridBagLayout() ); - setOpaque(true); - setBackground( Utils.getBottomBarColor() ); - - add( Logo.createApacheLogo(), new GridBagConstraints(0,0,1,1,0.0,0.0, - GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,12,0,5),0,0 ) ); - - add( new JLabel(), new GridBagConstraints(1,0,1,1,1.0,0.0, - GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0 ) ); - - } - -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/ContentHeader.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/ContentHeader.java deleted file mode 100644 index 61c8d46a6095..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/ContentHeader.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.RenderingHints; -import javax.swing.BorderFactory; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.UIManager; -import org.netbeans.modules.welcome.content.Constants; -import org.netbeans.modules.welcome.content.Utils; -import org.openide.util.ImageUtilities; - -/** - * - * @author S. Aubrecht - */ -public class ContentHeader extends JPanel implements Constants { - - private static final Image IMG_BANNER; - private static final Color COL_BANNER_LEFT; - private static final Color COL_BANNER_RIGHT; - - static { - String imgName = UIManager.getString( "nb.startpage.imagename.contentheader"); //NOI18N - if( null == imgName ) - imgName = IMAGE_CONTENT_BANNER; - IMG_BANNER = ImageUtilities.loadImage(imgName, true); - Color c = UIManager.getColor( "nb.startpage.contentheader.color1" ); //NOI18N - if( null == c ) - c = new Color(235, 0, 71); - COL_BANNER_LEFT = c; - - c = UIManager.getColor( "nb.startpage.contentheader.color2" ); //NOI18N - if( null == c ) - c = new Color(0, 116, 226); - COL_BANNER_RIGHT = c; - }; - - private final JLabel lblTitle = new JLabel(); - - private final Color COL_GRADIENT_START = new Color( 249, 255, 249 ); - private final Color COL_GRADIENT_END = new Color( 237, 241, 244 ); - - public ContentHeader( String title ) { - setLayout( new BorderLayout() ); - lblTitle.setText( title ); - lblTitle.setFont( CONTENT_HEADER_FONT ); - lblTitle.setForeground( Utils.getTopBarForeground() ); - add( lblTitle, BorderLayout.WEST ); - setBorder( BorderFactory.createEmptyBorder( 12+18, 34, 15, 34 ) ); - } - - @Override - protected void paintComponent( Graphics g ) { - Graphics2D g2d = ( Graphics2D ) g; - int width = getWidth(); - int height = getHeight(); - - RenderingHints rh = new RenderingHints( - RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_BICUBIC); - - g2d.setRenderingHints(rh); - g2d.setColor( Utils.getBorderColor() ); - g2d.drawRect( 0, 0, width, 12 ); - - if( UIManager.getBoolean( "nb.startpage.defaultbackground" ) ) { //NOI18N - g2d.setColor( UIManager.getColor("Tree.background") ); //NOI18N - } else { - g2d.setPaint( new GradientPaint( 0, 0, COL_GRADIENT_START, 0, 12, COL_GRADIENT_END ) ); - } - g2d.fillRect( 1, 0, width-2, 12 ); - - int imgWidth = IMG_BANNER.getWidth( this ); - int imgX = (width - imgWidth)/2; - g2d.drawImage( IMG_BANNER, imgX, 13, imgWidth, height-13, this ); - if( imgX > 0 ) { - g2d.setPaint( COL_BANNER_LEFT ); - g2d.fillRect( 0, 13, imgX, height-13 ); - g2d.setPaint( COL_BANNER_RIGHT ); - g2d.fillRect( width-imgX-1, 13, imgX+1, height-13 ); - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/GetStarted.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/GetStarted.java deleted file mode 100644 index b6f83db2c0c5..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/GetStarted.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.JLabel; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.ActionButton; -import org.netbeans.modules.welcome.content.Constants; -import org.netbeans.modules.welcome.content.Utils; -import org.openide.cookies.InstanceCookie; -import org.openide.cookies.OpenCookie; -import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileUtil; -import org.openide.loaders.DataFolder; -import org.openide.loaders.DataObject; - -/** - * - * @author S. Aubrecht - */ -class GetStarted extends JPanel implements Constants { - - private int row; - private InstallConfig ic; - - /** Creates a new instance of RecentProjects */ - public GetStarted() { - super( new GridBagLayout() ); - setOpaque(false); - ic = InstallConfig.getDefault(); - buildContent(); - } - - private void buildContent() { - String rootName = "WelcomePage/GettingStartedLinks"; // NOI18N - FileObject root = FileUtil.getConfigFile( rootName ); - if( null == root ) { - Logger.getLogger(GetStarted.class.getName()).log(Level.INFO, - "Start page content not found: " + "FileObject: " + rootName ); //NOI18N - return; - } - DataFolder folder = DataFolder.findFolder( root ); - if( null == folder ) { - Logger.getLogger(GetStarted.class.getName()).log(Level.INFO, - "Start page content not found: " + "DataFolder: " + rootName ); //NOI18N - return; - } - DataObject[] children = folder.getChildren(); - if( null == children ) { - Logger.getLogger(GetStarted.class.getName()).log(Level.INFO, - "Start page content not found: " + "DataObject: " + rootName ); //NOI18N - return; - } - for( int i=0; i enabledPackNames = new HashSet(10); - private Set availablePackNames = new HashSet(10); - - private static final String javaSEPackName = "org.netbeans.modules.java.kit"; //NOI18N - - private static final String ergonomicsPackName = "org.netbeans.modules.ide.ergonomics"; //NOI18N - - private static final String[] packNames = new String[] { - //java se - "org.netbeans.modules.java.kit", //NOI18N - //java web & ee - "org.netbeans.modules.j2ee.kit", //NOI18N - //java me - "org.netbeans.modules.mobility.kit", //NOI18N - //java ruby - "org.netbeans.modules.ruby.kit", //NOI18N - //c/c++ - "org.netbeans.modules.cnd.kit", //NOI18N - //php - "org.netbeans.modules.php.kit", //NOI18N - //groovy - "org.netbeans.modules.groovy.kit", //NOI18N - }; - - - private InstallConfig() { - for( ModuleInfo mi : Lookup.getDefault().lookupAll(ModuleInfo.class) ) { - - ergonomics = ergonomics || isErgonomicsPack(mi); - - if( !isPack(mi) ) - continue; - - if( mi.isEnabled() ) { - enabledPackNames.add(mi.getCodeNameBase()); - } else { - somePacksDisabled = true; - } - availablePackNames.add(mi.getCodeNameBase()); - } - } - - private static InstallConfig theInstance; - - public static InstallConfig getDefault() { - if( null == theInstance ) - theInstance = new InstallConfig(); - return theInstance; - } - - public boolean isErgonomicsEnabled() { - return ergonomics; - } - - public boolean somePacksDisabled() { - return somePacksDisabled; - } - - public void setSomePacksDisabled(boolean somePacksDisabled) { - this.somePacksDisabled = somePacksDisabled; - } - - - private boolean isPack( ModuleInfo mi ) { - String moduleName = mi.getCodeNameBase(); - for( String pn : packNames ) { - if( moduleName.startsWith(pn) ) - return true; - } - return false; - } - - private boolean isErgonomicsPack( ModuleInfo mi ) { - String moduleName = mi.getCodeNameBase(); - return moduleName.startsWith(ergonomicsPackName) && mi.isEnabled(); - } - - private boolean isPackEnabled(String prefName) { - for( String name : enabledPackNames ) { - if( name.contains(prefName) ) - return true; - } - return false; - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/LearnAndDiscoverTab.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/LearnAndDiscoverTab.java deleted file mode 100644 index ca3ed63e17ad..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/LearnAndDiscoverTab.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.GridLayout; -import javax.swing.JComponent; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.ContentSection; - -/** - * 'Learn & Discover' tab of the Start Page - * - * @author S. Aubrecht - */ -class LearnAndDiscoverTab extends AbstractTab { - - public LearnAndDiscoverTab() { - super(BundleSupport.getLabel( "LearnAndDiscoverTab" )); //NOI18N - } - - @Override - protected JComponent buildContent() { - JPanel panel = new JPanel(new GridLayout(1,0)); - panel.setOpaque(false); - panel.add(new ContentSection( new GetStarted(), false )); - - panel.add( new ContentSection( BundleSupport.getLabel("SectionDemosAndTutorials"), new Tutorials(), false )); //NOI18N - - return panel; - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/MyNetBeansTab.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/MyNetBeansTab.java deleted file mode 100644 index edf80faabc95..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/MyNetBeansTab.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.GridLayout; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.ContentSection; -import org.netbeans.modules.welcome.content.RecentProjectsPanel; - -/** - * - * @author S. Aubrecht - */ -class MyNetBeansTab extends AbstractTab { - - public MyNetBeansTab() { - super(BundleSupport.getLabel( "MyNetBeansTab")); //NOI18N - } - - @Override - protected JComponent buildContent() { - JPanel main = new JPanel( new GridLayout(1,0) ); - main.setOpaque(false); - main.setBorder(BorderFactory.createEmptyBorder()); - - main.add( new ContentSection( BundleSupport.getLabel( "SectionRecentProjects" ), //NOI18N - new RecentProjectsPanel(), false ) ); - - - main.add( new ContentSection( new PluginsPanel(true), false ) ); - - InstallConfig ic = InstallConfig.getDefault(); - - if( ic.isErgonomicsEnabled() ) { - main.add( new ContentSection( new PluginsPanel(false), false ) ); - } - - return main; - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/PluginsPanel.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/PluginsPanel.java deleted file mode 100644 index d8276b701892..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/PluginsPanel.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import javax.swing.AbstractAction; -import javax.swing.JLabel; -import javax.swing.JPanel; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.Constants; -import org.netbeans.modules.welcome.content.LinkButton; -import org.netbeans.modules.welcome.content.Utils; -import org.openide.awt.Actions; -import org.openide.util.Exceptions; - -/** - * - * @author S. Aubrecht - */ -class PluginsPanel extends JPanel implements Constants { - - public PluginsPanel( boolean showInstallPlugins ) { - super( new GridBagLayout() ); - setOpaque(false); - if( showInstallPlugins ) { - InstallConfig ic = InstallConfig.getDefault(); - - if( ic.isErgonomicsEnabled() ) { - addInstallPlugins(BundleSupport.getLabel("InstallPluginsFullIDE"), BundleSupport.getLabel("InstallPluginsDescrFullIDE")); - } else { - addInstallPlugins(BundleSupport.getLabel("InstallPlugins"), BundleSupport.getLabel("InstallPluginsDescr")); - } - - } else { - addActivateFeatures( BundleSupport.getLabel("ActivateFeaturesFullIDE"), BundleSupport.getLabel("ActivateFeaturesDescrFullIDE")); - } - } - - private void addActivateFeatures( String label, String description ) { - LinkButton b = new LinkButton(label, Utils.getLinkColor(), true, "ActivateFeatures" ) { //NOI18N - - @Override - public void actionPerformed(ActionEvent e) { - logUsage(); - new ShowPluginManagerAction("installed").actionPerformed(e); //NOI18N - } - }; - b.setFont(GET_STARTED_FONT); - add( b, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,5,5), 0, 0)); - add( new JLabel(description), new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(20,9,5,5), 0, 0)); - add( new JLabel(), new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0, 0)); - } - - private void addInstallPlugins( String label, String description ) { - LinkButton b = new LinkButton(label, Utils.getLinkColor(), true, "InstallPlugins") { //NOI18N - - @Override - public void actionPerformed(ActionEvent e) { - logUsage(); - new ShowPluginManagerAction("available").actionPerformed(e); //NOI18N - } - }; - b.setFont(GET_STARTED_FONT); - add( b, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,5,5), 0, 0)); - add( new JLabel(description), new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(20,9,5,5), 0, 0)); - add( new JLabel(), new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0, 0)); - } - - // XXX why is this an Action when it is only invoked directly? - private static class ShowPluginManagerAction extends AbstractAction { - private final String initialTab; - public ShowPluginManagerAction(String initialTab) { - super( BundleSupport.getLabel( "AddPlugins" ) ); //NOI18N - this.initialTab = initialTab; - } - - @Override - public void actionPerformed(ActionEvent e) { - try { - Actions.forID("System", "org.netbeans.modules.autoupdate.ui.actions.PluginManagerAction").actionPerformed(new ActionEvent(e.getSource(), 100, initialTab)); - } catch (Exception ex) { - Exceptions.printStackTrace(ex); - } - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/ShowNextTime.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/ShowNextTime.java deleted file mode 100644 index ea868905d26e..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/ShowNextTime.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import javax.swing.JCheckBox; -import javax.swing.JPanel; -import javax.swing.SwingConstants; -import org.netbeans.modules.welcome.WelcomeOptions; -import org.netbeans.modules.welcome.content.BundleSupport; -import org.netbeans.modules.welcome.content.Constants; -import org.netbeans.modules.welcome.content.Utils; - -/** - * - * @author S. Aubrecht - */ -class ShowNextTime extends JPanel - implements ActionListener, Constants, PropertyChangeListener { - - private JCheckBox button; - - /** Creates a new instance of RecentProjects */ - public ShowNextTime() { - super( new BorderLayout() ); - setOpaque(false); - - button = new JCheckBox( BundleSupport.getLabel( "ShowOnStartup" ) ); // NOI18N - button.setSelected( WelcomeOptions.getDefault().isShowOnStartup() ); - button.setOpaque( false ); - button.setForeground( Utils.getTopBarForeground() ); - button.setHorizontalTextPosition( SwingConstants.LEFT ); - BundleSupport.setAccessibilityProperties( button, "ShowOnStartup" ); //NOI18N - add( button, BorderLayout.CENTER ); - button.addActionListener( this ); - } - - @Override - public void actionPerformed(ActionEvent e) { - WelcomeOptions.getDefault().setShowOnStartup( button.isSelected() ); - } - - @Override - public void addNotify() { - super.addNotify(); - WelcomeOptions.getDefault().addPropertyChangeListener( this ); - } - - @Override - public void removeNotify() { - super.removeNotify(); - WelcomeOptions.getDefault().removePropertyChangeListener( this ); - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - button.setSelected( WelcomeOptions.getDefault().isShowOnStartup() ); - } - - -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/StartPageContent.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/StartPageContent.java deleted file mode 100644 index c3c8d31a06e7..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/StartPageContent.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.Color; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.UIManager; -import org.netbeans.modules.welcome.content.Constants; - -/** - * - * @author S. Aubrecht - */ -public class StartPageContent extends JPanel implements Constants { - - private static final Color COLOR_TOP_START = new Color(46, 110, 172); - private static final Color COLOR_TOP_END = new Color(255, 255, 255); - private static final Color COLOR_BOTTOM_START = new Color(255, 255, 255); - private static final Color COLOR_BOTTOM_END = new Color(241, 246, 252); - - public StartPageContent() { - super( new GridBagLayout() ); - - JComponent tabs = new TabbedPane( new LearnAndDiscoverTab(), - new MyNetBeansTab(), - new WhatsNewTab()); - tabs.setBorder(BorderFactory.createEmptyBorder(10,15,15,15)); - tabs.setOpaque(false); - - add( tabs, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(27,0,0,0), 0, 0) ); - - add( new JLabel(), new GridBagConstraints(0, 2, 1, 1, 0.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0), 0, 0) ); - } - - @Override - protected void paintComponent(Graphics g) { - if( UIManager.getBoolean( "nb.startpage.defaultbackground" ) ) { //NOI18N - super.paintComponent( g ); - } else { - Graphics2D g2d = (Graphics2D) g; - int width = getWidth(); - int height = getHeight(); - int gradientStop = height / 2; - int bottomStart = gradientStop + gradientStop/2; - - g2d.setPaint(new GradientPaint(0, 0, COLOR_TOP_START, 0, gradientStop, COLOR_TOP_END)); - g2d.fillRect(0, 0, width, gradientStop); - g2d.setPaint( COLOR_TOP_END ); - g2d.fillRect( 0, gradientStop, width, bottomStart ); - - g2d.setPaint(new GradientPaint(0, bottomStart, COLOR_BOTTOM_START, 0, height, COLOR_BOTTOM_END)); - g2d.fillRect(0, bottomStart, width, height); - } - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/TabContentPane.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/TabContentPane.java deleted file mode 100644 index 4381d11e99fa..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/TabContentPane.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.GridBagLayout; -import javax.swing.JPanel; -import javax.swing.UIManager; -import org.netbeans.modules.welcome.content.Utils; - -/** - * - * @author S. Aubrecht - */ -class TabContentPane extends JPanel { - - public TabContentPane() { - super( new GridBagLayout() ); - setOpaque(false); - setMinimumSize(new Dimension(41, 85)); - } - - @Override - protected void paintComponent(Graphics g) { - Graphics2D g2d = (Graphics2D) g; - int width = getWidth(); - int height = getHeight(); - - g2d.setColor(UIManager.getColor( "Tree.background") ); - g2d.fillRect(0, 0, width, height); - g2d.setColor( Utils.getBorderColor() ); - g2d.drawLine( 0,0, 0, height); - g2d.drawLine( width-1,0, width-1, height); - } -} diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/TabbedPane.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/TabbedPane.java deleted file mode 100644 index cf47ee116506..000000000000 --- a/nb/welcome/src/org/netbeans/modules/welcome/ui/TabbedPane.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * 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.welcome.ui; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.GridLayout; -import java.awt.Image; -import java.awt.Insets; -import java.awt.RenderingHints; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.Arrays; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.border.Border; -import org.netbeans.modules.welcome.WelcomeOptions; -import org.netbeans.modules.welcome.content.Constants; -import org.netbeans.modules.welcome.content.Logo; -import org.netbeans.modules.welcome.content.Utils; -import org.openide.util.ImageUtilities; - -/** - * - * @author S. Aubrecht - */ -class TabbedPane extends JPanel implements Constants {// , Scrollable { - - private final JComponent[] tabs; - private final TabButton[] buttons; - private final JComponent tabHeader; - private final JPanel tabContent; - private boolean[] tabAdded; - private int selTabIndex = -1; - - public TabbedPane( JComponent ... tabs ) { - super( new BorderLayout() ); - - setOpaque(false); - - this.tabs = tabs; - tabAdded = new boolean[tabs.length]; - Arrays.fill(tabAdded, false); - - // vlv: print - for( JComponent c : tabs ) { - c.putClientProperty("print.printable", Boolean.TRUE); // NOI18N - c.putClientProperty("print.name", c.getName()); // NOI18N - } - - ActionListener al = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - TabButton btn = (TabButton) e.getSource(); - switchTab( btn.getTabIndex() ); - WelcomeOptions.getDefault().setLastActiveTab( btn.getTabIndex() ); - } - }; - - buttons = new TabButton[tabs.length]; - for( int i=0; i= 0 ) { - buttons[selTabIndex].setSelected(false); - } - JComponent compToShow = tabs[tabIndex]; - JComponent compToHide = selTabIndex >= 0 ? tabs[selTabIndex] : null; - selTabIndex = tabIndex; - buttons[selTabIndex].setSelected(true); - - if( null != compToHide ) - compToHide.setVisible( false ); - - compToShow.setVisible( true ); - compToShow.requestFocusInWindow(); - } - - @Override - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - if( null != getParent() && null != getParent().getParent() ) { - Component scroll = getParent().getParent(); - if( scroll.getWidth() > 0 ) { - if( d.width > scroll.getWidth() ) { - d.width = Math.max(scroll.getWidth(), START_PAGE_MIN_WIDTH+(int)(((FONT_SIZE-11)/11.0)*START_PAGE_MIN_WIDTH)); - } else if( d.width < scroll.getWidth() ) { - d.width = scroll.getWidth(); - } - } - } - d.width = Math.min( d.width, 1000 ); - return d; - } - - private static final Color colBackground = Utils.getTopBarColor(); - - private static final Image imgSelected; - private static final Image imgRollover; - - static { - String imgName = UIManager.getString( "nb.startpage.tab.imagename.selected" ); //NOI18N - if( null == imgName ) { - imgName = IMAGE_TAB_SELECTED; - } - imgSelected = ImageUtilities.loadImage( imgName, true ); - - imgName = UIManager.getString( "nb.startpage.tab.imagename.rollover" ); //NOI18N - if( null == imgName ) { - imgName = IMAGE_TAB_ROLLOVER; - } - imgRollover = ImageUtilities.loadImage( imgName, true ); - } - - private static class TabButton extends JPanel { - private boolean isSelected = false; - private ActionListener actionListener; - private final int tabIndex; - private final JLabel lblTitle = new JLabel(); - private boolean isMouseOver = false; - - public TabButton( String title, int tabIndex ) { - super( new BorderLayout() ); - lblTitle.setText( title ); - add( lblTitle, BorderLayout.CENTER ); - this.tabIndex = tabIndex; - setOpaque( true ); - lblTitle.setFont( TAB_FONT ); - lblTitle.setForeground( Utils.getTopBarForeground() ); - lblTitle.setHorizontalAlignment( JLabel.CENTER ); - setFocusable(true); - setBackground( colBackground ); - - addKeyListener( new KeyAdapter() { - - @Override - public void keyPressed(KeyEvent e) { - if( e.getKeyCode() == KeyEvent.VK_SPACE || e.getKeyCode() == KeyEvent.VK_ENTER ) { -// setSelected( !isSelected ); - if( null != actionListener ) { - actionListener.actionPerformed( new ActionEvent( TabButton.this, 0, "clicked") ); - } - } - } - }); - - addMouseListener( new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { -// setSelected( !isSelected ); - if( null != actionListener ) { - actionListener.actionPerformed( new ActionEvent( TabButton.this, 0, "clicked") ); - } - } - - @Override - public void mouseEntered(MouseEvent e) { - if( !isSelected ) { - setCursor( Cursor.getPredefinedCursor( Cursor.HAND_CURSOR ) ); - } else { - setCursor( Cursor.getDefaultCursor() ); - } - isMouseOver = true; - repaint(); - } - - @Override - public void mouseExited(MouseEvent e) { - setCursor( Cursor.getDefaultCursor() ); - isMouseOver = false; - repaint(); - } - }); - - addFocusListener( new FocusListener() { - @Override - public void focusGained(FocusEvent e) { - isMouseOver = true; - repaint(); - } - @Override - public void focusLost(FocusEvent e) { - isMouseOver = false; - repaint(); - } - }); - } - - @Override - protected void paintComponent( Graphics g ) { - Graphics2D g2d = ( Graphics2D ) g; - if( isSelected ) { - g2d.drawImage( imgSelected, 0, 0, getWidth(), getHeight(), this ); - } else if( isMouseOver || isFocusOwner() || lblTitle.isFocusOwner() ) { - g2d.drawImage( imgRollover, 0, 0, getWidth(), getHeight(), this ); - } else { - super.paintComponent( g ); - } - } - - public void addActionListener( ActionListener l ) { - assert null == actionListener; - this.actionListener = l; - } - - public void setSelected( boolean sel ) { - this.isSelected = sel; - - setFocusable(!sel); - repaint(); - } - - public int getTabIndex() { - return tabIndex; - } - } - - private class TabHeader extends JPanel { - - private final ShowNextTime showNextTime = new ShowNextTime(); - - public TabHeader( TabButton ... buttons ) { - super( new GridBagLayout() ); - setOpaque(false); - JPanel panelButtons = new JPanel( new GridLayout( 1, 0 ) ); - panelButtons.setOpaque( false ); - for( int i=0; i contents = new HashMap(); - private static Map outputs = new HashMap(); - public static void registerURL(String u, String content) { - contents.put(u, new ByteArrayInputStream(content.getBytes())); - } - public static void registerURL(String u, InputStream content) { - contents.put(u, content); - } - - public static byte[] getOutputForURL(String u) { - MC out = outputs.get(u); - Assert.assertNotNull("No output for " + u, out); - return out.out.toByteArray(); - } - - public static String getRequestParameter(String u, String param) { - MC out = outputs.get(u); - Assert.assertNotNull("No output for " + u, out); - return out.params.get(param.toLowerCase()); - } - - protected URLConnection openConnection(URL u) throws IOException { - return new MC(u); - } - - private static final class MC extends URLConnection { - private InputStream values; - private ByteArrayOutputStream out; - private Map params; - - public MC(URL u) { - super(u); - outputs.put(u.toExternalForm(), this); - params = new HashMap(); - } - - public void connect() throws IOException { - if (values != null) { - return; - } - values = contents.remove(url.toExternalForm()); - if (values == null) { - throw new IOException("No such content: " + url); - } - } - - public InputStream getInputStream() throws IOException { - connect(); - return values; - } - - public OutputStream getOutputStream() throws IOException { - if (out == null) { - out = new ByteArrayOutputStream(); - } - return out; - } - - public void setRequestProperty(String key, String value) { - super.setRequestProperty(key, value); - params.put(key.toLowerCase(), value); - } - - @Override - public String getContentType() { - return "text/html"; - } - - - } -} diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps index ae6e7b9e92d6..4b559a9e7796 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps @@ -26,6 +26,7 @@ ide/db.sql.visualeditor/external/javacc-7.0.10.jar java/performance/external/jav java/maven.embedder/external/apache-maven-3.9.8-bin.zip ide/slf4j.api/external/slf4j-api-1.7.36.jar java/maven.embedder/external/apache-maven-3.9.8-bin.zip platform/o.apache.commons.codec/external/commons-codec-1.16.1.jar java/maven.embedder/external/apache-maven-3.9.8-bin.zip ide/c.google.guava.failureaccess/external/failureaccess-1.0.2.jar +java/maven.embedder/external/apache-maven-3.9.8-bin.zip ide/c.google.guava/external/guava-33.2.1-jre.jar java/maven.embedder/external/apache-maven-3.9.8-bin.zip java/maven.indexer/external/javax.annotation-api-1.3.2.jar # Used to parse data during build, but need to as a lib for ide cluster @@ -53,16 +54,16 @@ enterprise/websvc.restlib/external/osgi.core-8.0.0.jar platform/libs.osgi/extern extide/gradle/external/gradle-7.4-bin.zip enterprise/libs.amazon/external/ion-java-1.0.2.jar extide/gradle/external/gradle-7.4-bin.zip ide/c.google.guava.failureaccess/external/failureaccess-1.0.2.jar extide/gradle/external/gradle-7.4-bin.zip ide/c.jcraft.jzlib/external/jzlib-1.1.3.jar -extide/gradle/external/gradle-7.4-bin.zip ide/libs.commons_compress/external/commons-compress-1.26.1.jar +extide/gradle/external/gradle-7.4-bin.zip ide/libs.commons_compress/external/commons-compress-1.26.2.jar extide/gradle/external/gradle-7.4-bin.zip ide/o.apache.commons.lang/external/commons-lang-2.6.jar -extide/gradle/external/gradle-7.4-bin.zip ide/o.eclipse.jgit/external/org.eclipse.jgit-5.7.0.202003110725-r.jar +extide/gradle/external/gradle-7.4-bin.zip ide/o.eclipse.jgit/external/org.eclipse.jgit-6.10.0.202406032230-r.jar extide/gradle/external/gradle-7.4-bin.zip java/debugger.jpda.truffle/external/antlr4-runtime-4.7.2.jar extide/gradle/external/gradle-7.4-bin.zip java/maven.embedder/external/apache-maven-3.9.8-bin.zip extide/gradle/external/gradle-7.4-bin.zip platform/libs.junit4/external/hamcrest-core-1.3.jar extide/gradle/external/gradle-7.4-bin.zip platform/libs.junit4/external/junit-4.13.2.jar extide/gradle/external/gradle-7.4-bin.zip platform/libs.testng/external/jcommander-1.78.jar extide/gradle/external/gradle-7.4-bin.zip enterprise/cloud.oracle/external/httpclient-4.5.13.jar -extide/gradle/external/gradle-7.4-bin.zip platform/o.apache.commons.codec/external/commons-codec-1.16.1.jar +extide/gradle/external/gradle-7.4-bin.zip platform/o.apache.commons.codec/external/commons-codec-1.17.0.jar extide/gradle/external/gradle-7.4-bin.zip platform/libs.batik.read/external/xml-apis-1.4.01.jar # These are the endorsed version of the javaee apis and create libraries, so they are better kept separate @@ -95,8 +96,8 @@ nb/ide.launcher/external/launcher-external-binaries-1-94a19f0.zip platform/o.n.b nb/ide.launcher/external/launcher-external-binaries-1-94a19f0.zip harness/apisupport.harness/external/launcher-external-binaries-1-94a19f0.zip # only one is part of the product: -java/libs.javacapi/external/nb-javac-jdk-22.0.1+8-api.jar java/libs.nbjavacapi/external/nb-javac-jdk-22.0.1+8-api.jar -java/libs.javacapi/external/nb-javac-jdk-22.0.1+8.jar java/libs.nbjavacapi/external/nb-javac-jdk-22.0.1+8.jar +java/libs.javacapi/external/nb-javac-jdk-23+35-api.jar java/libs.nbjavacapi/external/nb-javac-jdk-23+35-api.jar +java/libs.javacapi/external/nb-javac-jdk-23+35.jar java/libs.nbjavacapi/external/nb-javac-jdk-23+35.jar # Used only in unittests for mysql db specific tests ide/db.metadata.model/external/mysql-connector-j-8.0.31.jar ide/db.mysql/external/mysql-connector-j-8.0.31.jar @@ -122,3 +123,7 @@ ide/libs.graalsdk/external/nativeimage-24.0.0.jar ide/libs.graalsdk.system/exter ide/libs.graalsdk/external/polyglot-24.0.0.jar ide/libs.graalsdk.system/external/polyglot-24.0.0.jar ide/libs.graalsdk/external/word-24.0.0.jar ide/libs.graalsdk.system/external/word-24.0.0.jar +# Intentionally duplicated (in web.jspparser only as unittest dependency and copied to make license handling easier) +enterprise/web.jspparser/external/jakarta.servlet.jsp.jstl-api-1.2.7.jar enterprise/libs.jstl/external/jakarta.servlet.jsp.jstl-api-1.2.7.jar +enterprise/web.jspparser/external/jakarta.servlet.jsp.jstl-1.2.6.jar enterprise/libs.jstl/external/jakarta.servlet.jsp.jstl-1.2.6.jar +enterprise/web.jspparser/external/commons-logging-1.3.1.jar platform/o.apache.commons.logging/external/commons-logging-1.3.1.jar \ No newline at end of file diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java index 8f90235fe54c..2ce060fda13f 100644 --- a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java @@ -495,7 +495,7 @@ protected void initialize() { removeUserdirCheckbox.doClick(); } - if (nbBasePresent) { + if (nbBasePresent && Boolean.getBoolean(CHECK_FOR_UPDATES_PROPERTY)) { checkForUpdatesCheckbox.setSelected(true); System.setProperty(CHECK_FOR_UPDATES_CHECKBOX_PROPERTY, Boolean.TRUE.toString()); diff --git a/nbbuild/javadoctools/template.xml b/nbbuild/javadoctools/template.xml index a8a3cdba2052..8283e61e0a27 100644 --- a/nbbuild/javadoctools/template.xml +++ b/nbbuild/javadoctools/template.xml @@ -134,6 +134,12 @@ cause it to fail. + + + + + + @@ -288,7 +294,7 @@ cause it to fail. - + @@ -321,7 +327,7 @@ cause it to fail. - + diff --git a/nbi/engine/src/org/netbeans/installer/Installer.java b/nbi/engine/src/org/netbeans/installer/Installer.java index faf93f5ed201..8a984936b281 100644 --- a/nbi/engine/src/org/netbeans/installer/Installer.java +++ b/nbi/engine/src/org/netbeans/installer/Installer.java @@ -25,7 +25,6 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.TreeSet; -import org.netbeans.installer.downloader.DownloadManager; import org.netbeans.installer.product.Registry; import org.netbeans.installer.utils.DateUtils; import org.netbeans.installer.utils.EngineUtils; @@ -106,7 +105,6 @@ private Installer(String[] arguments) { // once we have set the local directory (and therefore devised the log // file path) we can start logging safely initializeLogManager(); - initializeDownloadManager(); initializeRegistry(); initializeWizard(); createLockFile(); @@ -213,15 +211,6 @@ private void initializeLogManager() { LogManager.start(); } - private void initializeDownloadManager() { - LogManager.logEntry("... initializing DownloadManager"); - final DownloadManager downloadManager = DownloadManager.getInstance(); - downloadManager.setLocalDirectory(getLocalDirectory()); - downloadManager.setFinishHandler(this); - downloadManager.init(); - LogManager.logExit("... end of initializing DownloadManager"); - } - private void initializeRegistry() { LogManager.logEntry("... initializing Registry"); final Registry registry = Registry.getInstance(); @@ -241,7 +230,6 @@ private void initializeWizard() { // private ////////////////////////////////////////////////////////////////////// private void exitNormally(int errorCode) { Wizard.getInstance().close(); - DownloadManager.getInstance().terminate(); LogManager.stop(); exitImmediately(errorCode); diff --git a/nbi/engine/src/org/netbeans/installer/downloader/Bundle.properties b/nbi/engine/src/org/netbeans/installer/downloader/Bundle.properties deleted file mode 100644 index 636f84fca041..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/Bundle.properties +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# - -##################################################################################### -# DownloadProgress.java -DP.pumping.updated=Downloading from {0} -#NOI18N -DP.pumping.state.changed={0}: {1} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/DownloadListener.java b/nbi/engine/src/org/netbeans/installer/downloader/DownloadListener.java deleted file mode 100644 index 03a3673111ab..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/DownloadListener.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.installer.downloader; - -/** - * - * @author Danila_Dugurov - */ - -/** - * be aware of: If listener contract will be changed - analize carefully all fired events - * Some pices of code based on reflection and invocation, so - * NoSuchMethodException may occures.(It's implementation pitfalls) - */ -public interface DownloadListener { - - /** - * notification that pumping was update means that some pice of bytes downloaded - * or some meta data such as real url, output file name obtain from server. - */ - void pumpingUpdate(String id); - - /** - * This property was separate from pumping update because it's describe pumping as process - * and in pumping update - notify that pumping was changed as entity. - */ - void pumpingStateChange(String id); - - void pumpingAdd(String id); - void pumpingDelete(String id); - - void queueReset(); - - /** - * notification that downloader invoked work. - */ - void pumpsInvoke(); - - - /** - * notification that downloader stoped work. - */ - void pumpsTerminate(); -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/DownloadManager.java b/nbi/engine/src/org/netbeans/installer/downloader/DownloadManager.java deleted file mode 100644 index ab9d3357e748..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/DownloadManager.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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.installer.downloader; - -import java.io.File; -import org.netbeans.installer.downloader.queue.DispatchedQueue; -import org.netbeans.installer.utils.helper.FinishHandler; - -/** - * It's main downloader class. It's singleton. - * Only from here client can access download service and register there own listeners. - * Also from here managed execution of downloding process. - * - * @author Danila_Dugurov - */ -public class DownloadManager { - ///////////////////////////////////////////////////////////////////////////////// - // Static - public static final DownloadManager instance = new DownloadManager(); - - public static DownloadManager getInstance() { - return instance; - } - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private File localDirectory; - private FinishHandler finishHandler; - - private File defaultFolder; - private DispatchedQueue queue; - private File wd; - - private DownloadManager() { - } - - public void init() { - defaultFolder = new File(localDirectory, DOWNLOADS_DIR_NAME); - defaultFolder.mkdirs(); - - wd = new File(localDirectory, WD_DIR_NAME); - wd.mkdirs(); - - queue = new DispatchedQueue(new File(wd, STATE_FILE_NAME)); - queue.reset(); - } - - public PumpingsQueue queue() { - return queue; - } - - public void registerListener(final DownloadListener listener) { - queue.addListener(listener); - } - - public void invoke() { - queue.invoke(); - } - - public void terminate() { - queue.terminate(); - } - - public boolean isActive() { - return queue.isActive(); - } - - public File getWd() { - return wd; - } - - public File defaultFolder() { - return defaultFolder; - } - - public File getLocalDirectory() { - return localDirectory; - } - - public void setLocalDirectory(final File localDirectory) { - this.localDirectory = localDirectory; - } - - public FinishHandler getFinishHandler() { - return finishHandler; - } - - public void setFinishHandler(final FinishHandler finishHandler) { - this.finishHandler = finishHandler; - } - - ///////////////////////////////////////////////////////////////////////////////// - // Constants - public static final String DOWNLOADS_DIR_NAME = - "downloads"; // NOI18N - - public static final String WD_DIR_NAME = - "wd"; // NOI18N - - public static final String STATE_FILE_NAME = - "state.xml"; // NOI18N -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/DownloadProgress.java b/nbi/engine/src/org/netbeans/installer/downloader/DownloadProgress.java deleted file mode 100644 index a51e1f872bf2..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/DownloadProgress.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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.installer.downloader; - -import java.net.URL; -import org.netbeans.installer.utils.helper.Pair; -import org.netbeans.installer.utils.progress.Progress; -import org.netbeans.installer.downloader.Pumping.Section; -import org.netbeans.installer.utils.ResourceUtils; - -/** - * - * @author Danila_Dugurov - */ -public class DownloadProgress implements DownloadListener{ - private Progress progress; - private URL targetUrl; - - public DownloadProgress(Progress progress, URL targetUrl) { - this.progress = progress; - this.targetUrl = targetUrl; - } - - public void pumpingUpdate(String id) { - final Pumping pumping = DownloadManager.instance.queue().getById(id); - - if ((progress == null) || !targetUrl.equals(pumping.declaredURL())) { - return; - } - - progress.setDetail(ResourceUtils.getString( - DownloadProgress.class, - PUMPING_UPDATED_KEY, - pumping.declaredURL())); - - if (pumping.length() > 0) { - final long length = pumping.length(); - long per = 0; - for (Section section: pumping.getSections()) { - final Pair pair = section.getRange(); - per += section.offset() - pair.getFirst(); - } - - progress.setPercentage((int) (per * Progress.COMPLETE / length)); - } - } - - public void pumpingStateChange(String id) { - if (progress == null) return; - - final Pumping pumping = DownloadManager.instance.queue().getById(id); - - progress.setDetail(ResourceUtils.getString( - DownloadProgress.class, - PUMPING_STATE_CHANGED_KEY, - pumping.state().toString().toLowerCase(), - pumping.declaredURL())); - } - - public void pumpingAdd(String id) { - } - - public void pumpingDelete(String id) { - } - - public void queueReset() { - } - - public void pumpsInvoke() { - if (progress == null) return; - } - - public void pumpsTerminate() { - if (progress == null) return; - } - - ///////////////////////////////////////////////////////////////////////////////// - // Constants - public static final String PUMPING_UPDATED_KEY = - "DP.pumping.updated"; // NOI18N - - public static final String PUMPING_STATE_CHANGED_KEY = - "DP.pumping.state.changed"; // NOI18N -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/Pumping.java b/nbi/engine/src/org/netbeans/installer/downloader/Pumping.java deleted file mode 100644 index 0c03bff960e7..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/Pumping.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.installer.downloader; - -import java.io.File; -import java.net.URL; -import org.netbeans.installer.utils.helper.Pair; - -/** - * - * @author Danila_Dugurov - */ - -public interface Pumping { - /** - * It's runtime property of pumping. It means that it's not persistence - * property. So if downloader client maintain it's state persistance - it - * mustn't base on pumpings ids. - */ - String getId(); - - /** - * @return declared pumping url. - */ - URL declaredURL(); - - /** - * @return real pumping url. It is url which was obtain at runtime. It's may be - * the same as declared url if no redirect may occur. - */ - URL realURL(); - - /** - * @return file corresponding to this pumping. - */ - File outputFile(); - - File folder(); - - long length(); - - /** - * @return mode in which downloader process it. So if Single thread mode - it's - * means that only one thread process pumping(so one section invoked). If multi - * thread mode - it's means that downloader allowed to process pumping in more - * then one thread concurrently. But it's not means that downloader do it. - * The issue process or not in multy thread deal with some external issues: - * for example domain police and server side speed reducing for client who try - * to obtain more then one connection at time. Base implementation in any case - * download in one thread. - */ - DownloadMode mode(); - - State state(); - - /** - * one section - one thread. Section - data structure for representation and - * manage downloading unit - */ - Section[] getSections(); - - ///////////////////////////////////////////////////////////////////////////////// - // Inner Classes - public static interface Section { - /** - * range of bytes this section responsible for. - */ - Pair getRange(); - - /** - * absolute offset. Means if range: 12345 - 23456. initially offset equals - * 12345 when section downloaded it's equals 23456. - */ - long offset(); - } - - public enum State { - NOT_PROCESSED, - CONNECTING, - PUMPING, - WAITING, - INTERRUPTED, - FAILED, - FINISHED, - DELETED - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/PumpingsQueue.java b/nbi/engine/src/org/netbeans/installer/downloader/PumpingsQueue.java deleted file mode 100644 index 6f0bacb6d5fc..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/PumpingsQueue.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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.installer.downloader; - -import java.io.File; -import java.net.URL; - -/** - * This interface - entry point for clients. - * It's allow to client create new pumping and monitoring hole pumping process - * - * @author Danila_Dugurov - */ -public interface PumpingsQueue { - - /** - * In synchronious mode listener will be notified - * about any updates in pumping process. - * So the implementation of listeners must be worktime short. - */ - void addListener(DownloadListener listener); - - /** - * Terminate downloading process. Delete all pumpings. - * If downloading process was runnig start it again. - */ - void reset(); - - Pumping getById(String id); - - /** - * return all pumpings in queue. - */ - Pumping[] toArray(); - - /** - * add new pumping. Output file in default folder - */ - Pumping add(URL url); - - /** - * add new pumping. Output file in specified folder - */ - Pumping add(URL url, File folder); - - Pumping delete(String id); - - void delete(URL url); -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/connector/Bundle.properties b/nbi/engine/src/org/netbeans/installer/downloader/connector/Bundle.properties deleted file mode 100644 index 74cd794a9c5f..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/connector/Bundle.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# 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. -# - -##################################################################################### -# MyProxy.java -MP.error.types.conflict=The proxy types {0} and {1} conflict - -##################################################################################### -# MyProxySelector.java -MPS.error.uri.cannot.be.null=URI cannot be null - -##################################################################################### -# URLConnector.java -UC.error.failed.proxy=Failed to connect through {0} to {1} -US.error.failed.configure.proxy=Failed to configure proxy {0} for {1} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxy.java b/nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxy.java deleted file mode 100644 index c1a44884cffb..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxy.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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.installer.downloader.connector; - -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.net.Proxy.Type; -import java.util.HashMap; -import java.util.Map; -import org.netbeans.installer.utils.ResourceUtils; -import org.netbeans.installer.utils.StringUtils; -import org.netbeans.installer.utils.xml.DomExternalizable; -import org.netbeans.installer.utils.xml.DomUtil; -import org.netbeans.installer.utils.xml.visitors.DomVisitor; -import org.netbeans.installer.utils.xml.visitors.RecursiveDomVisitor; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * - * @author Danila_Dugurov - */ -public class MyProxy implements DomExternalizable { - ///////////////////////////////////////////////////////////////////////////////// - // Static - private static final Map type2Type = - new HashMap(); - - static { - type2Type.put(Type.DIRECT, MyProxyType.DIRECT); - type2Type.put(Type.HTTP, MyProxyType.HTTP); - type2Type.put(Type.SOCKS, MyProxyType.SOCKS); - } - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - int port = -1; - String host = StringUtils.EMPTY_STRING; - MyProxyType type = MyProxyType.DIRECT; - - public MyProxy() { - } - - public MyProxy(Proxy proxy) { - type = type2Type.get(proxy.type()); - - final InetSocketAddress address = (InetSocketAddress) proxy.address(); - if (address != null) { - host = address.getHostName(); - port = address.getPort(); - } - } - - public MyProxy(Proxy proxy, MyProxyType type) throws IllegalArgumentException { - this(proxy); - - if (proxy.type() != type.getType()) { - throw new IllegalArgumentException(ResourceUtils.getString( - MyProxy.class, - ERROR_TYPES_CONFLICT_KEY, - proxy.type(), - type.getType())); - } - this.type = type; - } - - public Proxy getProxy() { - return type == MyProxyType.DIRECT ? - Proxy.NO_PROXY : - new Proxy(type.getType(), new InetSocketAddress(host, port)); - } - - public void readXML(Element element) { - final DomVisitor visitor = new RecursiveDomVisitor() { - @Override - public void visit(Element element) { - if (PROXY_TYPE_TAG.equals(element.getNodeName())) { - type = MyProxyType.valueOf( - element.getTextContent().trim().toUpperCase()); - } else if (PROXY_HOST_TAG.equals(element.getNodeName())) { - host = element.getTextContent().trim(); - } else if (PROXY_PORT_TAG.equals(element.getNodeName())) { - port = Integer.parseInt(element.getTextContent().trim()); - } else { - super.visit(element); - } - } - }; - - visitor.visit(element); - } - - public Element writeXML(Document document) { - final Element root = document.createElement(PROXY_TAG); - DomUtil.addElement(root, PROXY_TYPE_TAG, type.toString()); - DomUtil.addElement(root, PROXY_HOST_TAG, host); - DomUtil.addElement(root, PROXY_PORT_TAG, String.valueOf(port)); - return root; - } - - @Override - public boolean equals(Object proxy) { - if (this == proxy) { - return true; - } - - if (proxy == null) { - return false; - } - - if (proxy instanceof MyProxy) { - final MyProxy prox = (MyProxy) proxy; - if (port == prox.port && type == prox.type && host.equals(prox.host)) { - return true; - } - } - return false; - } - - @Override - public int hashCode() { - int result; - result = (host != null ? host.hashCode() : 0); - result = 29 * result + (type != null ? type.hashCode() : 0); - result = 29 * result + port; - return result; - } - - ///////////////////////////////////////////////////////////////////////////////// - // Constants - public static final String ERROR_TYPES_CONFLICT_KEY = - "MP.error.types.conflict"; // NOI18N - - public static final String PROXY_TAG = - "proxy"; // NOI18N - - public static final String PROXY_TYPE_TAG = - "proxy-type"; // NOI18N - - public static final String PROXY_HOST_TAG = - "proxy-host"; // NOI18N - - public static final String PROXY_PORT_TAG = - "proxy-port"; // NOI18N - - public static final String SELECTOR_PROXIES_TAG = - "selector-proxies"; // NOI18N -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxySelector.java b/nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxySelector.java deleted file mode 100644 index 9c91442deca7..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/connector/MyProxySelector.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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.installer.downloader.connector; - -import java.io.IOException; -import java.net.Proxy; -import java.net.ProxySelector; -import java.net.SocketAddress; -import java.net.URI; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.netbeans.installer.utils.FileProxy; -import org.netbeans.installer.utils.ResourceUtils; -import org.netbeans.installer.utils.xml.DomExternalizable; -import org.netbeans.installer.utils.xml.DomUtil; -import org.netbeans.installer.utils.xml.visitors.DomVisitor; -import org.netbeans.installer.utils.xml.visitors.RecursiveDomVisitor; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * - * @author Danila_Dugurov - */ -public class MyProxySelector extends ProxySelector implements DomExternalizable { - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private final Map proxies = - new HashMap(); - - private transient Set byPassSet = new HashSet(); - - public void add(MyProxy proxy) { - proxies.put(proxy.type, proxy); - } - - public void remove(MyProxyType type) { - proxies.remove(type); - } - - public MyProxy getForType(MyProxyType type) { - return proxies.get(type); - } - - public void addByPassHost(String host) { - byPassSet.add(host); - } - - public void clearByPassList() { - byPassSet.clear(); - } - - public String[] getByPass() { - return byPassSet.toArray(new String[0]); - } - - public List select(URI uri) { - if (uri == null) { - throw new IllegalArgumentException(ResourceUtils.getString( - MyProxySelector.class, - ERROR_URI_CANNOT_BE_NULL_KEY)); - } - Proxy proxy = Proxy.NO_PROXY; - if (byPassSet.contains(uri.getHost())) { - return Collections.singletonList(proxy); - } - if (HTTP_SCHEME.equalsIgnoreCase(uri.getScheme()) || - HTTPS_SCHEME.equalsIgnoreCase(uri.getScheme())) { - if (proxies.containsKey(MyProxyType.HTTP)) { - proxy = proxies.get(MyProxyType.HTTP).getProxy(); - } - } else if (FTP_SCHEME.equalsIgnoreCase(uri.getScheme())) { - if (proxies.containsKey(MyProxyType.FTP)) { - proxy = proxies.get(MyProxyType.FTP).getProxy(); - } - } else { - if (proxies.containsKey(MyProxyType.SOCKS)) { - proxy = proxies.get(MyProxyType.SOCKS).getProxy(); - } - } - return Collections.singletonList(proxy); - } - - public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { - //TODO: now very silly selector no any rerang! - } - - public void readXML(Element element) { - final DomVisitor visitor = new RecursiveDomVisitor() { - @Override - public void visit(Element element) { - if (MyProxy.PROXY_TAG.equals(element.getNodeName())) { - final MyProxy proxy = new MyProxy(); - proxy.readXML(element); - add(proxy); - } else { - super.visit(element); - } - } - }; - visitor.visit(element); - } - - public Element writeXML(Document document) { - final Element root = document.createElement(MyProxy.SELECTOR_PROXIES_TAG); - for (MyProxy proxy : proxies.values()) { - DomUtil.addChild(root, proxy); - } - return root; - } - - ///////////////////////////////////////////////////////////////////////////////// - // Constants - public static final String ERROR_URI_CANNOT_BE_NULL_KEY = - "MPS.error.uri.cannot.be.null"; // NOI18N - - public static final String HTTP_SCHEME = - "http"; // NOI18N - - public static final String HTTPS_SCHEME = - "https"; // NOI18N - - public static final String FTP_SCHEME = - "ftp"; // NOI18N -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/connector/URLConnector.java b/nbi/engine/src/org/netbeans/installer/downloader/connector/URLConnector.java deleted file mode 100644 index df2af65c14e3..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/connector/URLConnector.java +++ /dev/null @@ -1,429 +0,0 @@ -/* - * 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.installer.downloader.connector; - -import java.io.File; -import java.io.IOException; -import java.net.*; -import java.util.ArrayList; -import java.util.List; -import org.netbeans.installer.downloader.DownloadManager; -import org.netbeans.installer.utils.ErrorManager; -import org.netbeans.installer.utils.LogManager; -import org.netbeans.installer.utils.ResourceUtils; -import org.netbeans.installer.utils.StringUtils; -import org.netbeans.installer.utils.exceptions.ParseException; -import org.netbeans.installer.utils.helper.Pair; -import org.netbeans.installer.utils.xml.DomUtil; -import org.netbeans.installer.utils.xml.visitors.DomVisitor; -import org.netbeans.installer.utils.xml.visitors.RecursiveDomVisitor; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * - * @author Danila_Dugurov - */ - -public class URLConnector { - ///////////////////////////////////////////////////////////////////////////////// - // Static - private static URLConnector instance; //Singleton - - public static synchronized URLConnector getConnector() { - if (instance != null) { - return instance; - } - - return instance = new URLConnector(new File( - DownloadManager.instance.getWd(), - SETTINGS_FILE_NAME)); - } - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - final MyProxySelector proxySelector = new MyProxySelector(); - - int readTimeout = MINUTE / 3; - int connectTimeout = MINUTE / 3; - boolean doInput = true; - boolean doOutput = false; - boolean useCaches = false; - - boolean useProxy = false; - - private File settingFile; - - private void addSystemProxies() { - addProxyFrom(HTTP_PROXY_HOST_PROPERTY, - HTTPS_PROXY_PORT_PROPERTY, - MyProxyType.HTTP); - addProxyFrom(FTP_PROXY_HOST_PROPERTY, - FTP_PROXY_PORT_PROPERTY, - MyProxyType.FTP); - addProxyFrom(SOCKS_PROXY_HOST_PROPERTY, - SOCKS_PROXY_PORT_PROPERTY, - MyProxyType.SOCKS); - } - - private void addDeploymentProxies() { - addProxyFrom(DEPLOYMENT_PROXY_HTTP_HOST, - DEPLOYMENT_PROXY_HTTP_PORT, - MyProxyType.HTTP); - addProxyFrom(DEPLOYMENT_PROXY_FTP_HOST, - DEPLOYMENT_PROXY_FTP_PORT, - MyProxyType.FTP); - addProxyFrom(DEPLOYMENT_PROXY_SOCKS_HOST, - DEPLOYMENT_PROXY_SOCKS_PORT, - MyProxyType.SOCKS); - - if (DIRECT_CONNECTION_VALUE.equalsIgnoreCase( - System.getProperty(DIRECT_CONNECTION_PROPERTY))) { - useProxy = false; - } - } - - private void configureByPassList() { - addByPassHostsFrom(DEPLOYMENT_PROXY_BYPASS_LIST); - } - - private void addProxyFrom( - final String hostProp, - final String portProp, - final MyProxyType type) { - final String host = System.getProperty(hostProp); - final String stringPort = System.getProperty(portProp); - final int port = stringPort != null ? Integer.parseInt(stringPort) : -1; - - if (host != null && port != -1) { - final Proxy socksProxy = new Proxy( - type.getType(), - new InetSocketAddress(host, port)); - proxySelector.add(new MyProxy(socksProxy, type)); - useProxy = true; - } - } - - private void addByPassHostsFrom(final String byPassProp) { - final String byPassList = System.getProperty(byPassProp); - if (byPassList == null) { - return; - } - for (String host : byPassList.split(PROXY_BYPASS_LIST_SEPARATOR)) { - host = host.trim(); - if (!StringUtils.EMPTY_STRING.equals(host)) { - proxySelector.addByPassHost(host); - } - } - } - - public URLConnector(final File settingFile) { - addSystemProxies(); - addDeploymentProxies(); - configureByPassList(); - this.settingFile = settingFile; - - if (settingFile.exists()) { - load(); - LogManager.log( - "loaded configuration from file: " + settingFile); // NOI18N - } else { - LogManager.log("" + settingFile + // NOI18N - " not exist, default configuration was set"); // NOI18N - } - } - - private void load() { - try { - Document settings = DomUtil.parseXmlFile(settingFile); - final DomVisitor visitor = new RecursiveDomVisitor() { - @Override - public void visit(Element elemet) { - if (READ_TIMEOUT_TAG.equals(elemet.getNodeName())) { - readTimeout = - Integer.parseInt(elemet.getTextContent().trim()); - } else if (CONNECT_TIMEOUT_TAG.equals(elemet.getNodeName())) { - connectTimeout = - Integer.parseInt(elemet.getTextContent().trim()); - } else if (USE_PROXY_TAG.equals(elemet.getNodeName())) { - useProxy = - Boolean.valueOf(elemet.getTextContent().trim()); - } else if (PROXY_TAG.equals(elemet.getNodeName())) { - final MyProxy proxy = new MyProxy(); - proxy.readXML(elemet); - proxySelector.add(proxy); - } else { - super.visit(elemet); - } - } - }; - - visitor.visit(settings); - } catch (IOException e) { - ErrorManager.notifyDebug("I/O error during connector " + // NOI18N - "setting loading. Default configuration was set.", e); // NOI18N - } catch (ParseException e) { - ErrorManager.notifyDebug("Failed to load settings: " + // NOI18N - "corrupted xml. Default configuration set.", e); // NOI18N - } - } - - public synchronized void dump() { - try { - final Document document = DomUtil.parseXmlFile(DEFAULT_SETTINGS_TEXT); - final Element root = document.getDocumentElement(); - - DomUtil.addElement( - root, - READ_TIMEOUT_TAG, - String.valueOf(readTimeout)); - DomUtil.addElement( - root, - CONNECT_TIMEOUT_TAG, - String.valueOf(connectTimeout)); - DomUtil.addElement( - root, - USE_PROXY_TAG, - String.valueOf(useProxy)); - DomUtil.addChild( - root, - proxySelector); - - DomUtil.writeXmlFile(document, settingFile); - } catch (IOException e) { - ErrorManager.notifyDebug("I/O error. Can't " + // NOI18N - "dump configuration", e); - } catch (ParseException e) { - ErrorManager.notifyDebug("fatal error can't parse " + // NOI18N - "", e); // NOI18N - } - } - - public void addProxy(final MyProxy proxy) { - proxySelector.add(proxy); - dump(); - } - - public void removeProxy(final MyProxyType type) { - proxySelector.remove(type); - dump(); - } - - public void addByPassHost(final String host) { - proxySelector.addByPassHost(host); - } - - public void clearByPassList() { - proxySelector.clearByPassList(); - } - - public String[] getByPassHosts() { - return proxySelector.getByPass(); - } - - public void setReadTimeout(final int readTimeout) { - if (readTimeout < 0) { - throw new IllegalArgumentException(); - } - this.readTimeout = readTimeout; - dump(); - } - - public void setConnectTimeout(final int connectTimeout) { - if (connectTimeout < 0) { - throw new IllegalArgumentException(); - } - this.connectTimeout = connectTimeout; - dump(); - } - - public void setUseProxy(final boolean useProxy) { - this.useProxy = useProxy; - - dump(); - } - - public int getReadTimeout() { - return readTimeout; - } - - public int getConnectTimeout() { - return connectTimeout; - } - - public boolean getUseProxy() { - return useProxy; - } - - public Proxy getProxy(final MyProxyType type) { - final MyProxy proxy = proxySelector.getForType(type); - - return (proxy != null) ? proxy.getProxy() : null; - } - - public URLConnection establishConnection( - final URL url) throws IOException { - return establishConnection(url, new ArrayList>(0)); - } - - public URLConnection establishConnection( - final URL url, - final List> headerFields) throws IOException { - Proxy proxy = null; - URI uri = null; - try { - proxy = useProxy ? proxySelector.select(uri = url.toURI()).get(0) : Proxy.NO_PROXY; - final URLConnection connection = getConnectionThroughProxy(url, proxy); - configure(connection, headerFields); - connection.connect(); - return connection; - } catch (URISyntaxException e) { - ErrorManager.notifyDebug(url + " does not comply " + // NOI18N - "with RFC 2396 and cannot be converted to URI", e); // NOI18N - - return url.openConnection(Proxy.NO_PROXY); - } catch (IOException e) { - proxySelector.connectFailed(uri, proxy.address(), e); - - throw (IOException) new IOException(ResourceUtils.getString( - URLConnector.class, - ERROR_FAILED_PROXY_KEY, - proxy, - url)).initCause(e); - } - } - - private URLConnection getConnectionThroughProxy( - final URL url, - final Proxy proxy) throws IOException { - try { - return url.openConnection(proxy); - } catch (SecurityException e) { - ErrorManager.notifyDebug("No permission to connect to " + // NOI18N - "proxy: " + proxy, e); // NOI18N - } catch (IllegalArgumentException e) { - ErrorManager.notifyDebug("Proxy: " + proxy + "has wrong " + // NOI18N - "type.", e); // NOI18N - } catch (UnsupportedOperationException e) { - ErrorManager.notifyDebug(url.getProtocol() + " handler does " + // NOI18N - "not support openConnection through proxy.", e); // NOI18N - } - - throw new IOException(ResourceUtils.getString( - URLConnector.class, - ERROR_FAILED_PROXY_KEY, - proxy, - url)); - } - - private void configure( - final URLConnection connection, - final List> headerFields) { - connection.setConnectTimeout(connectTimeout); - connection.setReadTimeout(readTimeout); - connection.setDoInput(doInput); - connection.setDoOutput(doOutput); - connection.setUseCaches(useCaches); - for (Pair pair : headerFields) { - connection.setRequestProperty(pair.getFirst(), pair.getSecond()); - } - } - - ///////////////////////////////////////////////////////////////////////////////// - // Constants - public static final int SECOND = 1000; - - public static final int MINUTE = 60 * SECOND; - - public static final String SETTINGS_FILE_NAME = - "settings.xml"; // NOI18N - - public static final String HTTP_PROXY_HOST_PROPERTY = - "http.proxyHost"; // NOI18N - - public static final String HTTP_PROXY_PORT_PROPERTY = - "http.proxyPort"; // NOI18N - - public static final String FTP_PROXY_HOST_PROPERTY = - "ftp.proxyHost"; // NOI18N - - public static final String FTP_PROXY_PORT_PROPERTY = - "ftp.proxyPort"; // NOI18N - - public static final String HTTPS_PROXY_HOST_PROPERTY = - "https.proxyHost"; // NOI18N - - public static final String HTTPS_PROXY_PORT_PROPERTY = - "https.proxyPort"; // NOI18N - - public static final String SOCKS_PROXY_HOST_PROPERTY = - "socksProxyHost"; // NOI18N - - public static final String SOCKS_PROXY_PORT_PROPERTY = - "socksProxyPort"; // NOI18N - - public static final String DEPLOYMENT_PROXY_HTTP_HOST = - "deployment.proxy.http.host"; // NOI18N - - public static final String DEPLOYMENT_PROXY_HTTP_PORT = - "deployment.proxy.http.port"; // NOI18N - - public static final String DEPLOYMENT_PROXY_FTP_HOST = - "deployment.proxy.ftp.host"; // NOI18N - - public static final String DEPLOYMENT_PROXY_FTP_PORT = - "deployment.proxy.ftp.port"; // NOI18N - - public static final String DEPLOYMENT_PROXY_SOCKS_HOST = - "deployment.proxy.socks.host"; // NOI18N - - public static final String DEPLOYMENT_PROXY_SOCKS_PORT = - "deployment.proxy.socks.port"; // NOI18N - - public static final String DEPLOYMENT_PROXY_BYPASS_LIST = - "deployment.proxy.bypass.list"; // NOI18N - - public static final String DIRECT_CONNECTION_PROPERTY = - "javaplugin.proxy.config.type"; // NOI18N - - public static final String DIRECT_CONNECTION_VALUE = - "direct"; // NOI18N - - public static final String PROXY_BYPASS_LIST_SEPARATOR = - ",|;"; // NOI18N - - public static final String PROXY_TAG = - "proxy"; // NOI18N - - public static final String USE_PROXY_TAG = - "useProxy"; // NOI18N - - public static final String CONNECT_TIMEOUT_TAG = - "connectTimeout"; // NOI18N - - public static final String READ_TIMEOUT_TAG = - "readTimeout"; // NOI18N - - public static final String DEFAULT_SETTINGS_TEXT = - ""; // NOI18N - - public static final String ERROR_FAILED_PROXY_KEY = - "UC.error.failed.proxy"; // NOI18N -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/Bundle.properties b/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/Bundle.properties deleted file mode 100644 index 8670358d06f0..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/Bundle.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# 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. -# - diff --git a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/ProcessDispatcher.java b/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/ProcessDispatcher.java deleted file mode 100644 index 620f78900acd..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/ProcessDispatcher.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.installer.downloader.dispatcher; - -public interface ProcessDispatcher { - /** - * entry point to add process. This don't give any information when it will be - * processed return false if process discarded. default impl - always true. - */ - boolean schedule(Process process); - - /** - * Force process termination. Deprecated since in any case of implementation - * it will deal with thread.stop() which is deprecated - */ - @Deprecated - void terminate(Process process); - - void setLoadFactor(LoadFactor factor); - - /** - * loadFactor allow managing system resources usages. By default Full - means - * no internal managment In default impl loadFactor impact on frequency of - * blank quantums. - */ - LoadFactor loadFactor(); - - boolean isActive(); - - int activeCount(); - - int waitingCount(); - - void start(); - - /** - * when dispatcher stops it terminate all running processes and also clear - * waiting queue. - */ - void stop(); -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/Bundle.properties b/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/Bundle.properties deleted file mode 100644 index 8670358d06f0..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/Bundle.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# 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. -# - diff --git a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/RoundRobinDispatcher.java b/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/RoundRobinDispatcher.java deleted file mode 100644 index 51f309136af5..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/RoundRobinDispatcher.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * 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.installer.downloader.dispatcher.impl; - -import java.util.LinkedList; -import java.util.Queue; -import java.util.Set; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingQueue; -import org.netbeans.installer.downloader.dispatcher.LoadFactor; -import org.netbeans.installer.downloader.dispatcher.Process; -import org.netbeans.installer.downloader.dispatcher.ProcessDispatcher; -import org.netbeans.installer.utils.ErrorManager; -import org.netbeans.installer.utils.SystemUtils; -import org.netbeans.installer.utils.helper.MutualHashMap; -import org.netbeans.installer.utils.helper.MutualMap; - -/** - * @author Danila_Dugurov - */ -public class RoundRobinDispatcher implements ProcessDispatcher { - ///////////////////////////////////////////////////////////////////////////////// - // Static - private static final Map quantumToSkip = - new HashMap(); - - static { - quantumToSkip.put(LoadFactor.FULL, (byte) 0); - quantumToSkip.put(LoadFactor.AVERAGE, (byte) 2); - quantumToSkip.put(LoadFactor.LOW, (byte) 10); - } - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private final int timeQuantum; - private final WorkersPool pool; - private final BlockingQueue workingQueue; - private final Queue waitingQueue; - private final MutualMap proc2Worker; - private Set makedToStop = new HashSet(); - - private Thread dispatcherThread; - private Terminator terminator = new Terminator(); - private boolean isActive; - private LoadFactor factor; - - public RoundRobinDispatcher( - final int quantum, - final int poolSize) { - if (quantum < 10 || poolSize < 1) { - throw new IllegalArgumentException(); - } - this.timeQuantum = quantum; - this.pool = new WorkersPool(poolSize); - workingQueue = new ArrayBlockingQueue(poolSize); - waitingQueue = new LinkedList(); - proc2Worker = new MutualHashMap(); - factor = LoadFactor.FULL; - } - - public synchronized boolean schedule(final Process process) { - synchronized (waitingQueue) { - waitingQueue.offer(process); - waitingQueue.notify(); - } - return true; - } - - public synchronized void terminate(final Process process) { - synchronized (waitingQueue) { - if (waitingQueue.remove(process)) { - return; - } - } - final Worker stoped = proc2Worker.get(process); - makedToStop.add(stoped); - terminateInternal(process); - } - - public void setLoadFactor(final LoadFactor factor) { - this.factor = factor; - } - - public LoadFactor loadFactor() { - return factor; - } - - private void terminateInternal(final Process process) { - final Worker worker = proc2Worker.get(process); - if (worker == null) { - return; - } - if (worker.isFree()) { - return; - } - if (!terminator.isAlive()) { - terminator.start(); - } - terminator.terminate(process); - SystemUtils.sleep(timeQuantum); - if (terminator.isBusy()) { - terminator.stop(); - terminator = new Terminator(); - } - if (!worker.isFree()) { - worker.stop(); - } - proc2Worker.remove(process); - pool.release(worker); - workingQueue.remove(worker); - } - - public synchronized boolean isActive() { - return isActive; - } - - // for tracknig perpose no synchronization so no sure of correctness - public int activeCount() { - return proc2Worker.size(); - } - - // for tracknig perpose no synchronization so no sure of correctness - public int waitingCount() { - return waitingQueue.size(); - } - - public synchronized void start() { - if (isActive) { - return; - } - dispatcherThread = new Thread(new DispatcherWorker()); - dispatcherThread.setDaemon(true); - dispatcherThread.start(); - isActive = true; - } - - public synchronized void stop() { - if (!isActive) { - return; - } - dispatcherThread.interrupt(); - try { - dispatcherThread.join((timeQuantum) * (pool.capacity() + 3)); - } catch (InterruptedException exit) { - } finally { - //this condition mustn't happens to true - if (dispatcherThread.isAlive()) { - dispatcherThread.stop(); - } - } - waitingQueue.clear(); - isActive = false; - } - - ///////////////////////////////////////////////////////////////////////////////// - // Inner Classes - private class DispatcherWorker implements Runnable { - Worker current; - - public void run() { - while (true) { - if (Thread.interrupted()) { - break; - } - try { - current = workingQueue.poll(); - if (current == null || makedToStop.contains(current)) { - synchronized (waitingQueue) { - if (waitingQueue.isEmpty()) { - waitingQueue.wait(); - } - } - filWorkingQueue(); - continue; - } - invokeCurrent(); - Thread.sleep(timeQuantum); - suspendCurrent(); - if (factor != LoadFactor.FULL) { - Thread.sleep(quantumToSkip.get(factor) * timeQuantum); - } - } catch (InterruptedException exit) { - suspendCurrent(); - break; - } - } - terminateAll(); - } - - private void terminateAll() { - for (Worker worker : workingQueue.toArray(new Worker[0])) { - terminateInternal(proc2Worker.reversedGet(worker)); - } - } - - private void invokeCurrent() { - switch (current.getState()) { - case NEW: - current.start(); - break; - case RUNNABLE: - current.resume(); - break; - case TERMINATED: - break; - default: - current.resume(); - //temprorary while blocking queue not impl. - } - } - - private void suspendCurrent() { - if (current == null) { - return; - } - if (makedToStop.contains(current)) { - return; - } - current.suspend(); - if (current.isAlive() && !current.isFree()) { - workingQueue.offer(current); - } else { - proc2Worker.reversedRemove(current); - pool.release(current); - } - filWorkingQueue(); - } - - private void filWorkingQueue() { - if (waitingQueue.size() == 0 || pool.remaining() == 0) { - return; - } - synchronized (waitingQueue) { - while (workingQueue.remainingCapacity() > 0) { - if (waitingQueue.isEmpty()) { - return; - } - final Worker worker = pool.tryAcquire(); - final Process process = waitingQueue.poll(); - worker.setCurrent(process); - proc2Worker.put(process, worker); - makedToStop.remove(worker); - workingQueue.add(worker); - } - } - } - } - - private class Terminator extends Thread { - private Process current; - - public Terminator() { - setDaemon(true); - } - - public synchronized void terminate(final Process process) { - current = process; - notifyAll(); - } - - @Override - public void run() { - while (true) { - synchronized (this) { - try { - Thread.interrupted(); - if (current == null) { - wait(); - if (current == null) { - continue; - } - } - final Worker worker = proc2Worker.get(current); - worker.resume(); - worker.interrupt(); - try { - current.terminate(); - } catch (Exception ignored) { //may be log? - } - current = null; - } catch (InterruptedException e) { - ErrorManager.notifyDebug( - "Terminator thread interrupted", e); // NOI18N - break; - } - } - } - } - - public synchronized boolean isBusy() { - return current == null; - } - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/Worker.java b/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/Worker.java deleted file mode 100644 index 0f59175176f6..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/Worker.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.installer.downloader.dispatcher.impl; - -import org.netbeans.installer.downloader.dispatcher.Process; -import org.netbeans.installer.utils.ErrorManager; -import org.netbeans.installer.utils.helper.NbiThread; - -/** - * @author Danila_Dugurov - */ -public class Worker extends NbiThread { - ///////////////////////////////////////////////////////////////////////////////// - // Instance - Process current; - - public Worker() { - setDaemon(true); - } - - // if worker busy return false - public synchronized boolean setCurrent(Process newCurrent) { - if (!isFree()) { - return false; - } - this.current = newCurrent; - notifyAll(); - return true; - } - - public synchronized boolean isFree() { - return current == null; - } - - @Override - public void run() { - while (true) { - try { - Thread.interrupted(); - synchronized (this) { - if (current == null) { - wait(); - if (isFree()) { - continue; - } - } - } - current.init(); - current.run(); - } catch (InterruptedException e) { - ErrorManager.notifyDebug("Interrupted", e); // NOI18N - } finally { - synchronized (this) { - current = null; - } - } - } - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/WorkersPool.java b/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/WorkersPool.java deleted file mode 100644 index 4d840d75a713..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/impl/WorkersPool.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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.installer.downloader.dispatcher.impl; - -import static java.lang.Thread.State.NEW; -import java.util.Queue; -import java.util.LinkedList; - -/** - * @author Danila_Dugurov - */ -public class WorkersPool { - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private final int capacity; - - private int inUse; - private Queue freeWorkers = new LinkedList(); - - public WorkersPool(final int poolCapacity) { - this.capacity = poolCapacity; - } - - public int capacity() { - return capacity; - } - - public synchronized int remaining() { - return capacity - inUse; - } - - //noblocking - public synchronized Worker tryAcquire() { - if (inUse == capacity) { - return null; - } - inUse++; - final Worker worker = freeWorkers.poll(); - return worker != null && worker.isAlive() ? worker : new Worker(); - } - - public synchronized Worker acquire() throws InterruptedException { - while (true) { - final Worker worker = tryAcquire(); - if (worker == null) { - wait(); - } else { - return worker; - } - } - } - - public synchronized void release(final Worker worker) { - inUse--; - if (worker.isAlive()) { - freeWorkers.offer(worker); - } else if (NEW == worker.getState()) { - freeWorkers.offer(worker); - } - notify(); - } - - public synchronized void stopWaitingWorkers() { - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/impl/ChannelUtil.java b/nbi/engine/src/org/netbeans/installer/downloader/impl/ChannelUtil.java deleted file mode 100644 index c3505dbbeedf..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/impl/ChannelUtil.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.installer.downloader.impl; - -import java.io.*; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; -import java.util.HashMap; -import java.util.Map; -import org.netbeans.installer.utils.LogManager; -import org.netbeans.installer.utils.helper.MutualHashMap; -import org.netbeans.installer.utils.helper.MutualMap; - -/** - * @author Danila_Dugurov - */ -public class ChannelUtil { - - ///////////////////////////////////////////////////////////////////////////////// - // Constants - public static final int BUFFER_SIZE = 64 * 1024; - - ///////////////////////////////////////////////////////////////////////////////// - // Static - private static final Map channel2ClientsCount = new HashMap(); - private static final MutualMap file2Channel = new MutualHashMap(); - - //so synchronization on file save me from closing channel when - //concurrently another thread try to get fragment. - //No synchronization in methods signiture becouse - //I don't want to block threads wich deal with another resourses(files) - - public static OutputStream channelFragmentAsStream(final File file, final SectionImpl pumpSection) throws FileNotFoundException { - if (file == null || pumpSection == null) throw new IllegalArgumentException(); - synchronized (file) { - if (!file.exists()) throw new FileNotFoundException(); - FileChannel channel; - if (!file2Channel.containsKey(file)) { - channel = new RandomAccessFile(file, "rw").getChannel(); - file2Channel.put(file, channel); - channel2ClientsCount.put(channel, 1); - } else { - channel = file2Channel.get(file); - int count = channel2ClientsCount.get(channel); - channel2ClientsCount.put(channel, ++count); - } - } - return new OutputStream() { - final FileChannel channel = file2Channel.get(file); - final SectionImpl section = pumpSection; - long position = pumpSection.offset(); - long barier = section.length() > 0 ? section.offset() + section.length() : Long.MAX_VALUE; - - ByteBuffer buffer = ByteBuffer.allocate(BUFFER_SIZE); - - public synchronized void write(int b) throws IOException { - if (position + buffer.position() >= barier) return; - if (buffer.remaining() == 0) flush(); - buffer.put((byte) b); - } - - public synchronized void write(byte[] b, int off, int len) throws IOException { - if (b == null) throw new NullPointerException(); - if (off < 0 || off > b.length || (off + len > b.length)) throw new IndexOutOfBoundsException(); - while (len > 0) { - int length = len <= buffer.remaining() ? len: buffer.remaining(); - final long remaining = barier - position - buffer.position(); - if (remaining == 0) break; - length = length <= remaining ? length: (int)remaining; - buffer.put(b, off, length); - if (buffer.remaining() == 0) flush(); - len -= length; - off += length; - } - } - - // close may be invoked asynchroniously so synchronized modifer really need - public synchronized void flush() throws IOException { - final int written = this.channel.write((ByteBuffer) buffer.flip(), position); - position += written; - if (written > 0) section.shiftOffset(written); - buffer.rewind(); - } - - //on close() thread release channel in any case of exceptions - public void close() throws IOException { - try { - if (!channel.isOpen()) return; - flush(); - } finally { - releaseFile(channel); - } - } - }; - } - - private static void releaseFile(final FileChannel channel) { - final File file = file2Channel.reversedGet(channel); - if (file == null) return; - synchronized (file) { - Integer count = channel2ClientsCount.get(channel); - if (count == null) return;//already removed - if (count > 1) { - channel2ClientsCount.put(channel, --count); - } else { - channel2ClientsCount.remove(channel); - file2Channel.reversedRemove(channel); - try { - channel.close(); - } catch (IOException ex) { - LogManager.log("can't close channel", ex); - } - } - } - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/impl/Pump.java b/nbi/engine/src/org/netbeans/installer/downloader/impl/Pump.java deleted file mode 100644 index 6065384a6b84..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/impl/Pump.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * 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.installer.downloader.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.Date; -import org.netbeans.installer.downloader.DownloadConfig; -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.connector.URLConnector; -import org.netbeans.installer.downloader.dispatcher.Process; -import org.netbeans.installer.utils.LogManager; -import org.netbeans.installer.utils.StreamUtils; - -/** - * @author Danila_Dugurov - */ -public class Pump implements Process { - ///////////////////////////////////////////////////////////////////////////////// - // Instance - final PumpingImpl pumping; - URLConnector connector = URLConnector.getConnector(); - - InputStream in; - OutputStream out; - - public Pump(Pumping pumping) { - this.pumping = (PumpingImpl) pumping; - } - - public PumpingImpl pumping() { - return pumping; - } - - public void init() { - } - - public void run() { - if (!initPumping()) return; - pumping.fireChanges("pumpingUpdate"); - if (!processPumping()) return; - } - - private boolean initPumping() { - int attemptCount = 0; - while (attemptCount < MAX_ATTEMPT_COUNT) { - pumping.changeState(Pumping.State.CONNECTING); - try { - final URL url = pumping.declaredURL(); - URLConnection connection = connector.establishConnection(url); - in = connection.getInputStream(); - if (exitOnInterrupt()) return false; - initPumping(connection); - pumping.changeState(Pumping.State.WAITING); - return true; - } catch (IOException ex) { - LogManager.log(ex); - attemptCount++; - try { - pumping.changeState(Pumping.State.WAITING); - Thread.sleep(ATTEMPT_TIME_DELAY); - } catch (InterruptedException exit) { - pumping.changeState(Pumping.State.INTERRUPTED); - return false; - } - } finally { - try { - if (in != null) in.close(); - } catch (IOException ignored) { - LogManager.log(ignored); - } - } - } - pumping.changeState(Pumping.State.FAILED); - return false; - } - - private void initPumping(URLConnection connection) throws IOException { - final Date lastModif = new Date(connection.getLastModified()); - final URL realUrl = connection.getURL(); - final String accept = connection.getHeaderField("Accept-Ranges"); - final boolean acceptBytes = accept != null ? accept.contains("bytes"): false; - final long length = connection.getContentLength(); - pumping.init(realUrl, length, lastModif, acceptBytes); - } - - private boolean processPumping() { - int attemptCount = 0; - while (attemptCount < MAX_ATTEMPT_COUNT) { - pumping.changeState(org.netbeans.installer.downloader.Pumping.State.CONNECTING); - try { - final SectionImpl section = pumping.getSection(); - final URL connectingUrl = pumping.realURL(); - URLConnection connection = connector.establishConnection(connectingUrl, section.headers()); - in = connection.getInputStream(); - if (exitOnInterrupt()) return false; - out = ChannelUtil.channelFragmentAsStream(pumping.outputFile(), section); - pumping.changeState(Pumping.State.PUMPING); - StreamUtils.transferData(in, out); - if (section.length() > 0) { - if (section.offset() != section.start() + section.length()) { - attemptCount++; - continue; - } - } - pumping.changeState(Pumping.State.FINISHED); - return true; - } catch (IOException ex) { - LogManager.log(ex); - if (exitOnInterrupt()) return false; - attemptCount++; - try { - pumping.changeState(Pumping.State.WAITING); - Thread.sleep(ATTEMPT_TIME_DELAY); - } catch (InterruptedException exit) { - pumping.changeState(Pumping.State.INTERRUPTED); - return false; - } - } finally { - if (in != null) try { - in.close(); - } catch (IOException ignored) { - LogManager.log(ignored); - } - if (out != null) try { - out.close(); - } catch (IOException ignored) { - LogManager.log(ignored); - } - } - } - pumping.changeState(Pumping.State.FAILED); - return false; - } - - private boolean exitOnInterrupt() { - if (!Thread.interrupted()) return false; - pumping.changeState(Pumping.State.INTERRUPTED); - return true; - } - - public void terminate() { - if (in != null) try { - in.close(); - } catch (IOException ignored) { - LogManager.log(ignored); - } - if (out != null) try { - out.close(); - } catch (IOException ignored) { - LogManager.log(ignored); - } - } - - ///////////////////////////////////////////////////////////////////////////////// - // Constants - private static final int ATTEMPT_TIME_DELAY = DownloadConfig.REATTEMPT_DELAY; - private static final int MAX_ATTEMPT_COUNT = DownloadConfig.ATTEMPT_COUNT; -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/impl/PumpingImpl.java b/nbi/engine/src/org/netbeans/installer/downloader/impl/PumpingImpl.java deleted file mode 100644 index a94236e8b6ca..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/impl/PumpingImpl.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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.installer.downloader.impl; - -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.DownloadMode; -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; -import org.netbeans.installer.downloader.Pumping.Section; -import org.netbeans.installer.downloader.queue.QueueBase; -import org.netbeans.installer.utils.ErrorManager; -import org.netbeans.installer.utils.StringUtils; -import org.netbeans.installer.utils.exceptions.ParseException; -import org.netbeans.installer.utils.xml.DomExternalizable; -import org.netbeans.installer.utils.xml.DomUtil; -import org.netbeans.installer.utils.xml.visitors.DomVisitor; -import org.netbeans.installer.utils.xml.visitors.RecursiveDomVisitor; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * @author Danila_Dugurov - */ - -public class PumpingImpl implements Pumping, DomExternalizable { - - ///////////////////////////////////////////////////////////////////////////////// - // Static - private static int nextId; - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private final transient String id; - private final QueueBase queue; - - protected URL url; - protected URL realUrl; - protected File folder; - protected File file; - protected long length = -2; - protected boolean acceptBytes = false; - protected Date lastModif = new Date(0); - protected List sections = new LinkedList(); - protected State state = State.NOT_PROCESSED; - protected DownloadMode mode = DownloadMode.SINGLE_THREAD; - - public PumpingImpl(URL url, File folder, QueueBase queue) { - this(queue); - this.url = url; - this.folder = folder; - } - - //before read from xml - public PumpingImpl(QueueBase queue) { - this.id = getClass().getName() + nextId++; - this.queue = queue; - } - - public String getId() { - return id; - } - - public URL declaredURL() { - return url; - } - - public URL realURL() { - return realUrl; - } - - public File outputFile() { - return file; - } - - public File folder() { - return folder; - } - - public long length() { - return length; - } - - public DownloadMode mode() { - return mode; - } - - public State state() { - return state; - } - - public void changeState(State newState) { - this.state = newState; - fireChanges("pumpingStateChange"); - } - - public Section[] getSections() { - return sections.toArray(new Section[sections.size()]); - } - - public void fireChanges(String method) { - queue.fire(method, id); - } - - public SectionImpl getSection() { - if (mode == DownloadMode.SINGLE_THREAD || !acceptBytes) { - if (sections.isEmpty()) sections.add(new SectionImpl(this, 0, length)); - return sections.get(0); - } - throw new UnsupportedOperationException("multi mode not supported yet!"); - } - - public void readXML(Element element) { - final DomVisitor visitor = new RecursiveDomVisitor() { - public void visit(Element element) { - final String name = element.getNodeName(); - if ("url".equals(name)) { - try { - url = StringUtils.parseUrl(element.getTextContent()); - } catch (ParseException e) { - ErrorManager.notifyDebug("Could not parse URL", e); - } - } else if ("realUrl".equals(name)) { - try { - realUrl = StringUtils.parseUrl(element.getTextContent()); - } catch (ParseException e) { - ErrorManager.notifyDebug("Could not parse URL", e); - } - } else if ("length".equals(name)) { - length = Long.valueOf(element.getTextContent()); - } else if ("lastModif".equals(name)) { - lastModif = new Date(Long.valueOf(element.getTextContent())); - } else if ("acceptBytes".equals(name)) { - acceptBytes = Boolean.valueOf(element.getTextContent()); - } else if ("state".equals(name)) { - state = State.valueOf(element.getTextContent()); - } else if ("file".equals(name)) { - if (!"".equals(element.getTextContent().trim())) - file = new File(element.getTextContent()); - } else if ("folder".equals(name)) { - folder = new File(element.getTextContent()); - } else if ("section".equals(name)) { - SectionImpl section = new SectionImpl(PumpingImpl.this); - section.readXML(element); - sections.add(section); - } else - super.visit(element); - } - }; - visitor.visit(element); - } - - public Element writeXML(Document document) { - final Element root = document.createElement("pumping"); - DomUtil.addElement(root, "url", url.toString()); - DomUtil.addElement(root, "realUrl", realUrl != null ? realUrl.toString() : null); - DomUtil.addElement(root, "length", String.valueOf(length)); - DomUtil.addElement(root, "lastModif", String.valueOf(lastModif.getTime())); - DomUtil.addElement(root, "acceptBytes", String.valueOf(acceptBytes)); - DomUtil.addElement(root, "state", state.toString()); - DomUtil.addElement(root, "file", file != null ? file.getAbsolutePath() : null); - DomUtil.addElement(root, "folder", folder.getAbsolutePath()); - for (SectionImpl section : sections) { - DomUtil.addChild(root, section); - } - return root; - } - - public void init(URL realUrl, long length, Date lastModif, boolean acceptBytes) throws IOException { - if (wasModified(realUrl, length, lastModif, acceptBytes)) { - reset(); - this.realUrl = realUrl; - this.length = length; - this.acceptBytes = acceptBytes; - if (lastModif != null) this.lastModif = lastModif; - this.file = PumpingUtil.getFileNameFromURL(folder, this.realUrl.getPath()); - if (file.getParentFile() != null) file.getParentFile().mkdirs(); - file.createNewFile(); - } - } - - public void reset() { - realUrl = null; - length = -2; - acceptBytes = false; - lastModif = new Date(0); - sections = new LinkedList(); - if (file != null) file.delete(); - } - - protected boolean wasModified(URL realUrl, long length, Date lastModif, boolean acceptBytes) { - if (this.realUrl == null || !this.realUrl.equals(realUrl)) return true; - if (this.length == -2 || this.length != length) return true; - if (lastModif != null && this.lastModif.before(lastModif)) return true; - return this.acceptBytes != acceptBytes; - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/impl/PumpingUtil.java b/nbi/engine/src/org/netbeans/installer/downloader/impl/PumpingUtil.java deleted file mode 100644 index 17e0c60aaa7f..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/impl/PumpingUtil.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.installer.downloader.impl; -import java.io.File; - -/** - * - * @author Danila_Dugurov - */ - -public class PumpingUtil { - - - ///////////////////////////////////////////////////////////////////////////////// - // Static - // however may be synchronization by dir more local but now I'm not sure that here - //object that represent dir will be the same when anoth thread need the same dir - - public static synchronized File getFileNameFromURL(File dir, String urlPath) { - String fileName; - if (urlPath.endsWith("/")) fileName = "index.html"; - else if (urlPath.lastIndexOf('/') == -1) fileName = urlPath; - else fileName = urlPath.substring(urlPath.lastIndexOf('/')); - // fileName = fileName.split("[#?]")[0]; - File file = new File(dir, fileName); - int index = 2; - int dotPosition = fileName.lastIndexOf('.'); - while (file.exists()) { - final String insert = "." + index; - String newName; - if (dotPosition == -1) newName = fileName + insert; - else { - final String preffix = fileName.substring(0, dotPosition); - final String suffix = fileName.substring(dotPosition); - newName = preffix + insert + suffix; - } - file = new File(dir, newName); - index++; - } - return file; - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/impl/SectionImpl.java b/nbi/engine/src/org/netbeans/installer/downloader/impl/SectionImpl.java deleted file mode 100644 index 963d5221606b..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/impl/SectionImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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.installer.downloader.impl; - -import org.netbeans.installer.downloader.Pumping.Section; - - -import java.util.Collections; -import java.util.List; -import org.netbeans.installer.utils.helper.Pair; -import org.netbeans.installer.utils.xml.DomExternalizable; -import org.netbeans.installer.utils.xml.DomUtil; -import org.netbeans.installer.utils.xml.visitors.DomVisitor; -import org.netbeans.installer.utils.xml.visitors.RecursiveDomVisitor; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * @author Danila_Dugurov - */ -public class SectionImpl implements Section, DomExternalizable { - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - protected long start; - protected long length; - protected long offset; - private PumpingImpl owner; - - protected SectionImpl(PumpingImpl owner, long start, long length) { - this.owner = owner; - this.start = start; - this.length = length; - this.offset = start; - } - - //before readXML - protected SectionImpl(PumpingImpl owner) { - this.owner = owner; - } - - public Pair getRange() { - return Pair.create(start, start + length); - } - - public long offset() { - return offset; - } - - public long length() { - return length; - } - - public long start() { - return start; - } - - public void shiftOffset(long delta) { - offset += delta; - owner.fireChanges("pumpingUpdate"); - } - - public List> headers() { - if (owner.acceptBytes) { - if (length > 0) { - final long end = start + length - 1; - return Collections.singletonList(Pair.create("Range", "bytes=" + offset + "-" + end)); - } else if (length == -1) { - return Collections.singletonList(Pair.create("Range", "bytes=" + offset + "-")); - } - } else { - offset = start; - } - return Collections.emptyList(); - } - - public void readXML(Element element) { - final DomVisitor visitor = new RecursiveDomVisitor() { - public void visit(Element element) { - final String name = element.getNodeName(); - if ("start".equals(name)) { - start = Long.valueOf(element.getTextContent()); - } else if ("length".equals(name)) { - length = Long.valueOf(element.getTextContent()); - } else if ("offset".equals(name)) { - offset = Long.valueOf(element.getTextContent()); - } else - super.visit(element); - } - }; - visitor.visit(element); - } - - public Element writeXML(Document document) { - final Element root = document.createElement("section"); - DomUtil.addElement(root, "start", String.valueOf(start)); - DomUtil.addElement(root, "length", String.valueOf(length)); - DomUtil.addElement(root, "offset", String.valueOf(offset)); - return root; - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/queue/DispatchedQueue.java b/nbi/engine/src/org/netbeans/installer/downloader/queue/DispatchedQueue.java deleted file mode 100644 index 4f5760bcf112..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/queue/DispatchedQueue.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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.installer.downloader.queue; - -import static org.netbeans.installer.downloader.DownloadConfig.DISPATCHER_POOL; -import static org.netbeans.installer.downloader.DownloadConfig.DISPATCHER_QUANTUM; -import org.netbeans.installer.downloader.DownloadManager; -import org.netbeans.installer.downloader.Pumping; -import static org.netbeans.installer.downloader.Pumping.State; -import org.netbeans.installer.downloader.dispatcher.ProcessDispatcher; -import org.netbeans.installer.downloader.impl.Pump; -import org.netbeans.installer.downloader.dispatcher.impl.RoundRobinDispatcher; -import org.netbeans.installer.downloader.impl.PumpingImpl; - -import java.io.File; -import java.net.URL; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * - * @author Danila_Dugurov - */ -public class DispatchedQueue extends QueueBase { - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private final ProcessDispatcher dispatcher = new RoundRobinDispatcher(DISPATCHER_QUANTUM, DISPATCHER_POOL); - - private final Map pId2p = new LinkedHashMap(); - - public DispatchedQueue(File stateFile) { - super(stateFile); - } - - public synchronized void reset() { - final boolean wasActive = dispatcher.isActive(); - terminate(); - for (String id: id2Pumping.keySet().toArray(new String[0])) { - delete(id); - } - fire("queueReset"); - if (wasActive) invoke(); - } - - public synchronized Pumping add(URL url) { - return add(url, DownloadManager.instance.defaultFolder()); - } - - public synchronized Pumping add(URL url, File folder) { - final PumpingImpl newOne = new PumpingImpl(url, folder, this); - final String id = newOne.getId(); - id2Pumping.put(id, newOne); - if (dispatcher.isActive()) { - final Pump pump = new Pump(newOne); - pId2p.put(id, pump); - dispatcher.schedule(pump); - } - fire("pumpingAdd", id); - return newOne; - } - - public synchronized Pumping delete(String id) { - final PumpingImpl oldOne = id2Pumping.remove(id); - if (oldOne == null) return null; - dispatcher.terminate(pId2p.get(id)); - fire("pumpingDelete", id); - pId2p.remove(id); - if (oldOne.state() != State.FINISHED) - oldOne.reset(); - return oldOne; - } - - public synchronized void delete(URL url) { - for (Pumping pumping: toArray()) { - if (pumping.declaredURL() == url) { - delete(pumping.getId()); - } - } - } - - public synchronized void invoke() { - if (dispatcher.isActive()) return; - fire("pumpsInvoke"); - for (Pumping pumping : toArray()) { - if (pumping.state() != State.FINISHED) { - final Pump newOne = new Pump(pumping); - pId2p.put(pumping.getId(), newOne); - dispatcher.schedule(newOne); - } - } - dispatcher.start(); - } - - public synchronized void terminate() { - if (!dispatcher.isActive()) return; - dispatcher.stop(); - dump(); - fire("pumpsTerminate"); - } - - public synchronized boolean isActive() { - return dispatcher.isActive(); - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/queue/QueueBase.java b/nbi/engine/src/org/netbeans/installer/downloader/queue/QueueBase.java deleted file mode 100644 index 6a0c11f83eaf..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/queue/QueueBase.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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.installer.downloader.queue; - -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.PumpingsQueue; -import org.netbeans.installer.downloader.DownloadListener; -import org.netbeans.installer.downloader.impl.PumpingImpl; -import org.netbeans.installer.utils.LogManager; -import org.netbeans.installer.utils.exceptions.ParseException; -import org.netbeans.installer.utils.exceptions.UnexpectedExceptionError; -import org.netbeans.installer.utils.xml.DomUtil; -import org.netbeans.installer.utils.xml.visitors.DomVisitor; -import org.netbeans.installer.utils.xml.visitors.RecursiveDomVisitor; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import java.io.File; -import java.io.IOException; -import java.lang.ref.WeakReference; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author Danila_Dugurov - */ - -public abstract class QueueBase implements PumpingsQueue { - - ///////////////////////////////////////////////////////////////////////////////// - // Static - /** - * @noinspection unchecked - */ - private static final WeakReference[] EMPTY_ARRAY = new WeakReference[0]; - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private final List> listeners; - - protected final Map id2Pumping = new HashMap(); - - protected File stateFile; - - protected QueueBase(File stateFile) { - this.stateFile = stateFile; - if (stateFile.exists()) { - load(); - LogManager.log("queue state was load from file: " + stateFile); - } else LogManager.log("file not exist, queue is empty!"); - listeners = new ArrayList>(3); - } - - public synchronized void addListener(DownloadListener listener) { - if (!contains(listener)) { - listeners.add(new WeakReference(listener)); - } - } - - private boolean contains(DownloadListener listener) { - for (WeakReference weak : listeners) { - final DownloadListener listen = weak.get(); - if (listen != null && listen.equals(listener)) return true; - } - return false; - } - - public Pumping getById(String id) { - return id2Pumping.get(id); - } - - public Pumping[] toArray() { - return id2Pumping.values().toArray(new Pumping[0]); - } - - public void fire(String methodName, Object... args) { - final List argsClasses = new ArrayList(args.length); - for (Object arg : args) { - argsClasses.add(arg.getClass()); - } - try { - final Method method = DownloadListener.class.getMethod(methodName, argsClasses.toArray(new Class[0])); - notifyListeners(method, args); - } catch (NoSuchMethodException ex) { - throw new UnexpectedExceptionError("Listener contract was changed", ex); - } - } - - private synchronized void notifyListeners(Method mehtod, Object... args) { - WeakReference[] stub = listeners.toArray(EMPTY_ARRAY); - for (WeakReference ref : stub) { - final DownloadListener listener = ref.get(); - if (listener == null) continue; - try { - mehtod.invoke(listener, args); - } catch (IllegalAccessException ignored) { - LogManager.log(ignored); - } catch (InvocationTargetException ignored) { - //undeline throw an exception. - //It's not headache of queue if listener throws exceptions - just log it for debug purpose - LogManager.log(ignored); - } - } - } - - protected void load() { - try { - Document queueState = DomUtil.parseXmlFile(stateFile); - final DomVisitor visitor = new RecursiveDomVisitor() { - public void visit(Element element) { - if ("pumping".equals(element.getNodeName())) { - final PumpingImpl newOne = new PumpingImpl(QueueBase.this); - newOne.readXML(element); - id2Pumping.put(newOne.getId(), newOne); - } else - super.visit(element); - } - }; - visitor.visit(queueState); - } catch (ParseException ex) { - LogManager.log("fail to load queue state - parsing error occurs"); - } catch (IOException ex) { - LogManager.log("I/O error during loading. queue is empty now"); - } - } - - public synchronized void dump() { - try { - final Document document = DomUtil.parseXmlFile(""); - final Element root = document.getDocumentElement(); - for (Pumping puming : toArray()) { - DomUtil.addChild(root, (PumpingImpl) puming); - } - DomUtil.writeXmlFile(document, stateFile); - } catch (ParseException wontHappend) { - LogManager.log(wontHappend); - } catch (IOException io) { - LogManager.log("fail to dump - i/o error occures"); - LogManager.log(io); - } - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/services/FileProvider.java b/nbi/engine/src/org/netbeans/installer/downloader/services/FileProvider.java deleted file mode 100644 index ca054744fab7..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/services/FileProvider.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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.installer.downloader.services; - -import java.io.File; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; -import org.netbeans.installer.downloader.DownloadListener; -import org.netbeans.installer.downloader.DownloadManager; -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.Pumping.State; -import org.netbeans.installer.utils.exceptions.DownloadException; -/** - * - * @author Danila_Dugurov - */ -//todo: may be very general synchronization - optimize! -public class FileProvider { - - ///////////////////////////////////////////////////////////////////////////////// - // Static - private static final FileProvider fileProvider = new FileProvider(); - - public static FileProvider getProvider() { - return fileProvider; - } - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private final DownloadManager downloadManager = DownloadManager.instance; - - private final DownloadListener listener = new MyListener(); - - private final PersistentCache cache = new PersistentCache(); - - private final Map scheduledURL2State = new HashMap(); - - protected FileProvider() { - downloadManager.registerListener(listener); - } - - public synchronized void clearCaches() { - for (URL url: cache.keys()) { - cache.delete(url); - } - } - - public synchronized boolean isInCache(URL url) { - return cache.isIn(url); - } - - public synchronized void asynchDownload(URL url, File folder) { - if (isInCache(url)) return; - if (scheduledURL2State.containsKey(url)) return; - if (!downloadManager.isActive()) downloadManager.invoke(); - scheduledURL2State.put(url, State.NOT_PROCESSED); - downloadManager.queue().add(url, folder != null ? folder: downloadManager.defaultFolder()); - } - - public synchronized File get(URL url) throws DownloadException { - return get(url, null, true); - } - - public synchronized File get(URL url, File folder) throws DownloadException { - return get(url, folder, true); - } - - public synchronized File get(URL url, boolean useCache) throws DownloadException { - return get(url, null, useCache); - } - - public synchronized File get(URL url, File folder, boolean useCache) throws DownloadException { - while (true) { - final File file = tryGet(url); - if (file != null) { - if (useCache) return file; - cache.delete(url); - useCache = true; - } - synchronized (url) { - asynchDownload(url, folder); - try { - url.wait(); - } catch (InterruptedException interrupt) { - throw new DownloadException("download faild " + url, interrupt); - } - } - switch(scheduledURL2State.get(url)) { - case FAILED: { - scheduledURL2State.remove(url); - throw new DownloadException("download faild " + url); - } - case DELETED: { - scheduledURL2State.remove(url); - throw new DownloadException("download faild - externaly deleted " + url); - } - case FINISHED: scheduledURL2State.remove(url); - } - } - } - - public synchronized File tryGet(URL url) { - if (cache.isIn(url)) return cache.getByURL(url); - return null; - } - - public synchronized void manuallyDelete(URL url) { - downloadManager.queue().delete(url); - cache.delete(url); - } - - ///////////////////////////////////////////////////////////////////////////////// - // Inner Classes - private class MyListener extends EmptyQueueListener { - public void pumpingStateChange(String id) { - final Pumping pumping = downloadManager.queue().getById(id); - final URL url = pumping.declaredURL(); - scheduledURL2State.put(url, pumping.state()); - switch(pumping.state()) { - case FINISHED: - cache.put(url, pumping.outputFile()); - case DELETED: - case FAILED: - synchronized(url) { - url.notifyAll(); - } - } - } - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/services/PersistentCache.java b/nbi/engine/src/org/netbeans/installer/downloader/services/PersistentCache.java deleted file mode 100644 index af79762d7e61..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/services/PersistentCache.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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.installer.downloader.services; - -import org.netbeans.installer.downloader.DownloadManager; -import org.netbeans.installer.utils.LogManager; -import org.netbeans.installer.utils.exceptions.ParseException; -import org.netbeans.installer.utils.xml.DomExternalizable; -import org.netbeans.installer.utils.xml.DomUtil; -import org.netbeans.installer.utils.xml.visitors.DomVisitor; -import org.netbeans.installer.utils.xml.visitors.RecursiveDomVisitor; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Map; -import java.util.HashMap; -import org.netbeans.installer.utils.ErrorManager; -import org.netbeans.installer.utils.StringUtils; - -/** - * @author Danila_Dugurov - */ -public class PersistentCache { - - ///////////////////////////////////////////////////////////////////////////////// - // Instance - private File stateFile; - - private final Map url2File = new HashMap(); - - public PersistentCache() { - stateFile = new File(DownloadManager.instance.getWd(), "cacheState.xml"); - if (!stateFile.exists()) { - LogManager.log("cache file not exist so treat it as cache is Empty"); - } else load(); - } - - public boolean isIn(URL url) { - return url2File.containsKey(url) && url2File.get(url).exists(); - } - - public File getByURL(URL url) { - if (!isIn(url)) return null; - return url2File.get(url); - } - - public void put(URL key, File file) { - url2File.put(key, file); - dump(); - } - - public void clear() { - for (File file : url2File.values()) { - file.delete(); - } - } - - public URL[] keys() { - return (URL[]) url2File.keySet().toArray(); - } - - public boolean delete(URL url) { - if (isIn(url)) return url2File.get(url).delete(); - return false; - } - - private void load() { - try { - Document state = DomUtil.parseXmlFile(stateFile); - final DomVisitor visitor = new RecursiveDomVisitor() { - public void visit(Element element) { - final String name = element.getTagName(); - if ("cacheEntry".equals(name)) { - final CacheEntry entry = new CacheEntry(); - entry.readXML(element); - if (entry.file.exists() && entry.file.isFile()) - url2File.put(entry.url, entry.file); - } else - super.visit(element); - } - }; - visitor.visit(state); - } catch (ParseException ex) { - LogManager.log(ex); - } catch (IOException ex) { - LogManager.log(ex); - } - } - - public synchronized void dump() { - try { - final Document document = DomUtil.parseXmlFile(""); - final Element root = document.getDocumentElement(); - for (Map.Entry entry : url2File.entrySet()) { - final CacheEntry cacheEntry = new CacheEntry(entry); - DomUtil.addChild(root, cacheEntry); - } - DomUtil.writeXmlFile(document, stateFile); - } catch (ParseException wontHappend) { - LogManager.log("unparsable xml", wontHappend); - } catch (IOException ex) { - LogManager.log("i/o during loading persistentCache" , ex); - } - } - - ///////////////////////////////////////////////////////////////////////////////// - // Inner Classes - private static class CacheEntry implements DomExternalizable { - - private URL url; - private File file; - - public CacheEntry() {//before read xml - } - - public CacheEntry(Map.Entry entry) { - this.url = entry.getKey(); - this.file = entry.getValue(); - } - - public void readXML(Element element) { - final DomVisitor visitor = new RecursiveDomVisitor() { - public void visit(Element element) { - final String name = element.getTagName(); - if ("file".equals(name)) { - file = new File(element.getTextContent()); - } else if ("url".equals(name)) { - try { - url = StringUtils.parseUrl(element.getTextContent()); - } catch (ParseException e) { - ErrorManager.notifyDebug("Could not parse URL", e); - } - } else { - super.visit(element); - } - } - }; - visitor.visit(element); - } - - public Element writeXML(Document document) { - final Element root = document.createElement("cacheEntry"); - DomUtil.addElement(root, "file", file.getAbsolutePath()); - DomUtil.addElement(root, "url", url.toString()); - return root; - } - } -} diff --git a/nbi/engine/src/org/netbeans/installer/downloader/ui/ProxySettingsDialog.java b/nbi/engine/src/org/netbeans/installer/downloader/ui/ProxySettingsDialog.java deleted file mode 100644 index b4b6707288c3..000000000000 --- a/nbi/engine/src/org/netbeans/installer/downloader/ui/ProxySettingsDialog.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * 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.installer.downloader.ui; - -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.net.Proxy.Type; -import org.netbeans.installer.downloader.DownloadManager; -import org.netbeans.installer.downloader.connector.MyProxy; -import org.netbeans.installer.downloader.connector.MyProxyType; -import org.netbeans.installer.downloader.connector.URLConnector; -import org.netbeans.installer.utils.ErrorManager; -import org.netbeans.installer.utils.StringUtils; -import org.netbeans.installer.utils.helper.swing.NbiButton; -import org.netbeans.installer.utils.helper.swing.NbiCheckBox; -import org.netbeans.installer.utils.helper.swing.NbiDialog; -import org.netbeans.installer.utils.helper.swing.NbiLabel; -import org.netbeans.installer.utils.helper.swing.NbiTextField; -import org.netbeans.installer.utils.helper.swing.NbiTextPane; - -/** - * - * @author Danila_Dugurov - */ -public class ProxySettingsDialog extends NbiDialog { - private URLConnector connector = - URLConnector.getConnector(); - - private NbiTextPane messagePane; - - private NbiLabel proxyHostLabel; - private NbiTextField proxyHostField; - private NbiLabel proxyPortLabel; - private NbiTextField proxyPortField; - private NbiLabel ignoreListLabel; - private NbiTextField ignoreListField; - - private NbiCheckBox useProxyCheckBox; - - private NbiButton applyButton; - private NbiButton closeButton; - - public ProxySettingsDialog() { - super(); - - initComponents(); - } - - public void execute() { - setVisible(true); - - while (isVisible()) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - ErrorManager.notifyDebug("Interrupted", e); - } - } - } - - private void initComponents() { - Proxy proxy = connector.getProxy(MyProxyType.HTTP); - InetSocketAddress address = proxy != null ? - (InetSocketAddress) proxy.address() : null; - - setTitle("Connectivity Problems"); - setLayout(new GridBagLayout()); - - messagePane = new NbiTextPane(); - messagePane.setText("The installation wizard failed to " + - "connect to the registry server. Most likely this is " + - "caused by proxies misconfiguration. Please check the " + - "HTTP proxy settings below and click Apply to change " + - "them. Click Close to exit the installer."); - - useProxyCheckBox = new NbiCheckBox(); - useProxyCheckBox.setText("Use proxy"); - useProxyCheckBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent event) { - if (useProxyCheckBox.isSelected()) { - proxyHostField.setEnabled(true); - proxyPortField.setEnabled(true); - ignoreListField.setEnabled(true); - } else { - proxyHostField.setEnabled(false); - proxyPortField.setEnabled(false); - ignoreListField.setEnabled(false); - } - } - }); - useProxyCheckBox.setSelected(connector.getUseProxy()); - - proxyHostField = new NbiTextField(); - if (address != null) { - proxyHostField.setText(address.getHostName()); - } - - proxyHostLabel = new NbiLabel(); - proxyHostLabel.setLabelFor(proxyHostField); - proxyHostLabel.setText("Host:"); - - proxyPortField = new NbiTextField(); - if (address != null) { - proxyPortField.setText(Integer.toString(address.getPort())); - } - - proxyPortLabel = new NbiLabel(); - proxyPortLabel.setLabelFor(proxyPortField); - proxyPortLabel.setText("Port:"); - - ignoreListField = new NbiTextField(); - - if (address != null) { - ignoreListField.setText(StringUtils.asString( - connector.getByPassHosts(), - ",")); - } - - ignoreListLabel = new NbiLabel(); - ignoreListLabel.setLabelFor(ignoreListField); - ignoreListLabel.setText("Bypass proxy for:"); - - applyButton = new NbiButton(); - applyButton.setText("&Apply"); - applyButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent event) { - Proxy proxy = null; - - if (useProxyCheckBox.isSelected()) { - proxy = new Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress( - proxyHostField.getText(), - Integer.parseInt(proxyPortField.getText()))); - - connector.addProxy(new MyProxy(proxy, MyProxyType.HTTP)); - - connector.clearByPassList(); - for (String host: StringUtils.asList( - ignoreListField.getText(), ",")) { - connector.addByPassHost(host); - } - } - - connector.setUseProxy(useProxyCheckBox.isSelected()); - - setVisible(false); - } - }); - - closeButton = new NbiButton(); - closeButton.setText("&Close"); - closeButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent event) { - DownloadManager.getInstance().getFinishHandler().criticalExit(); - } - }); - - if (useProxyCheckBox.isSelected()) { - proxyHostField.setEnabled(true); - proxyPortField.setEnabled(true); - ignoreListField.setEnabled(true); - } else { - proxyHostField.setEnabled(false); - proxyPortField.setEnabled(false); - ignoreListField.setEnabled(false); - } - - add(messagePane, new GridBagConstraints( - 0, 0, // x, y - 3, 1, // width, height - 1.0, 0.0, // weight-x, weight-y - GridBagConstraints.LINE_START, // anchor - GridBagConstraints.HORIZONTAL, // fill - new Insets(11, 11, 0, 11), // padding - 0, 0)); // padx, pady - ??? - - add(useProxyCheckBox, new GridBagConstraints( - 0, 1, // x, y - 3, 1, // width, height - 1.0, 0.0, // weight-x, weight-y - GridBagConstraints.LINE_START, // anchor - GridBagConstraints.HORIZONTAL, // fill - new Insets(11, 11, 0, 11), // padding - 0, 0)); // padx, pady - ??? - - add(proxyHostLabel, new GridBagConstraints( - 0, 2, // x, y - 1, 1, // width, height - 0.0, 0.0, // weight-x, weight-y - GridBagConstraints.LINE_START, // anchor - GridBagConstraints.HORIZONTAL, // fill - new Insets(6, 11, 0, 0), // padding - 0, 0)); // padx, pady - ??? - - add(proxyHostField, new GridBagConstraints( - 1, 2, // x, y - 2, 1, // width, height - 1.0, 0.0, // weight-x, weight-y - GridBagConstraints.LINE_START, // anchor - GridBagConstraints.HORIZONTAL, // fill - new Insets(6, 6, 0, 11), // padding - 0, 0)); // padx, pady - ??? - - add(proxyPortLabel, new GridBagConstraints( - 0, 3, // x, y - 1, 1, // width, height - 0.0, 0.0, // weight-x, weight-y - GridBagConstraints.LINE_START, // anchor - GridBagConstraints.HORIZONTAL, // fill - new Insets(6, 11, 0, 0), // padding - 0, 0)); // padx, pady - ??? - - add(proxyPortField, new GridBagConstraints( - 1, 3, // x, y - 2, 1, // width, height - 1.0, 0.0, // weight-x, weight-y - GridBagConstraints.LINE_START, // anchor - GridBagConstraints.HORIZONTAL, // fill - new Insets(6, 6, 0, 11), // padding - 0, 0)); // padx, pady - ??? - - add(ignoreListLabel, new GridBagConstraints( - 0, 4, // x, y - 1, 1, // width, height - 0.0, 0.0, // weight-x, weight-y - GridBagConstraints.LINE_START, // anchor - GridBagConstraints.HORIZONTAL, // fill - new Insets(6, 11, 0, 0), // padding - 0, 0)); // padx, pady - ??? - - add(ignoreListField, new GridBagConstraints( - 1, 4, // x, y - 2, 1, // width, height - 1.0, 0.0, // weight-x, weight-y - GridBagConstraints.LINE_START, // anchor - GridBagConstraints.HORIZONTAL, // fill - new Insets(6, 6, 0, 11), // padding - 0, 0)); // padx, pady - ??? - - add(applyButton, new GridBagConstraints( - 1, 5, // x, y - 1, 1, // width, height - 1.0, 1.0, // weight-x, weight-y - GridBagConstraints.SOUTHEAST, // anchor - GridBagConstraints.NONE, // fill - new Insets(17, 11, 11, 0), // padding - 0, 0)); // padx, pady - ??? - add(closeButton, new GridBagConstraints( - 2, 5, // x, y - 1, 1, // width, height - 0.0, 1.0, // weight-x, weight-y - GridBagConstraints.SOUTHEAST, // anchor - GridBagConstraints.NONE, // fill - new Insets(17, 6, 11, 11), // padding - 0, 0)); // padx, pady - ??? - } -} diff --git a/nbi/engine/src/org/netbeans/installer/utils/FileProxy.java b/nbi/engine/src/org/netbeans/installer/utils/FileProxy.java index 0324816161f1..535715d7ae5d 100644 --- a/nbi/engine/src/org/netbeans/installer/utils/FileProxy.java +++ b/nbi/engine/src/org/netbeans/installer/utils/FileProxy.java @@ -24,19 +24,14 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.nio.file.Files; import java.util.HashMap; import java.util.Map; -import org.netbeans.installer.downloader.DownloadManager; -import org.netbeans.installer.downloader.services.FileProvider; import org.netbeans.installer.utils.exceptions.DownloadException; -import org.netbeans.installer.downloader.DownloadProgress; -import org.netbeans.installer.utils.helper.UiMode; import org.netbeans.installer.utils.progress.Progress; -import org.netbeans.installer.downloader.ui.ProxySettingsDialog; import org.netbeans.installer.utils.helper.ExtendedUri; /** @@ -48,9 +43,14 @@ public class FileProxy { private static final String RESOURCE_SCHEME = "resource"; public static final String RESOURCE_SCHEME_PREFIX = RESOURCE_SCHEME + ":"; - private final File tmpDir = new File(DownloadManager.getInstance().getLocalDirectory(), "tmp"); + private final File tmpDir; private final Map cache = new HashMap(); { + try { + tmpDir = Files.createTempDirectory("nbi").toFile(); + } catch (IOException ex) { + throw new IllegalStateException("can not write to temp folder", ex); + } tmpDir.mkdirs(); tmpDir.deleteOnExit(); } @@ -84,10 +84,6 @@ public void deleteFile(URL url) throws IOException { deleteFile(url.toString()); } - public File getFile(URL url) throws DownloadException { - return getFile(url, null, false); - } - public File getFile(String uri) throws DownloadException { return getFile(uri, null, null); } @@ -171,33 +167,8 @@ public File getFile(URI uri, Progress progress, ClassLoader loader, boolean dele out.close(); } catch (IOException ignord) {} } - } else if (uri.getScheme().startsWith("http")) { - try { - final File file = getFile(uri.toURL(), progress, deleteOnExit); - cache.put(cacheKey, file); - return file; - } catch(MalformedURLException ex) { - throw new DownloadException("malformed url: " + uri, ex); - } } throw new DownloadException("unsupported sheme: " + uri.getScheme()); } - - protected File getFile(final URL url, final Progress progress, boolean deleteOnExit) throws DownloadException { - try { - final DownloadProgress dlProgress = new DownloadProgress(progress, url); - DownloadManager.instance.registerListener(dlProgress); - File file = null; - file = FileProvider.getProvider().get(url); - if (deleteOnExit) file.deleteOnExit(); - return file; - } catch (DownloadException e) { - if (UiMode.getCurrentUiMode() == UiMode.SWING) { - new ProxySettingsDialog().execute(); - return getFile(url, progress, deleteOnExit); - } else { - throw e; - } - } - } + } diff --git a/nbi/engine/tests/org/RunAllSuite.java b/nbi/engine/tests/org/RunAllSuite.java index a255afb3fc61..04b00760c32d 100644 --- a/nbi/engine/tests/org/RunAllSuite.java +++ b/nbi/engine/tests/org/RunAllSuite.java @@ -20,11 +20,6 @@ package org; import junit.framework.TestSuite; -import org.connector.ConnectionConfiguratorTest; -import org.connector.ConnectorTest; -import org.connector.ProxySelectorTest; -import org.connector.ProxyTest; -import org.dispatcher.DispatcherTest; import org.util.DomVisitorTest; /** @@ -34,11 +29,6 @@ public class RunAllSuite extends TestSuite { public RunAllSuite() { - addTestSuite(ProxyTest.class); - addTestSuite(ProxySelectorTest.class); - addTestSuite(ConnectionConfiguratorTest.class); - addTestSuite(ConnectorTest.class); - addTestSuite(DispatcherTest.class); addTestSuite(DomVisitorTest.class); //addTestSuite(WindowsRegistryTest.class); //todo: dinamic add test case without manual registration diff --git a/nbi/engine/tests/org/connector/ConnectionConfiguratorTest.java b/nbi/engine/tests/org/connector/ConnectionConfiguratorTest.java deleted file mode 100644 index f2cde1f4fb4d..000000000000 --- a/nbi/engine/tests/org/connector/ConnectionConfiguratorTest.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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.connector; - -import java.io.File; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.MalformedURLException; -import java.net.Proxy; -import java.net.URL; -import java.net.URLConnection; -import java.util.HashSet; -import java.util.Set; -import java.util.logging.FileHandler; -import org.MyTestCase; -import org.netbeans.installer.downloader.DownloadManager; -import org.netbeans.installer.downloader.connector.MyProxy; -import org.netbeans.installer.downloader.connector.MyProxyType; -import org.netbeans.installer.downloader.connector.URLConnector; -import org.util.*; - -/** - * - * @author Danila_Dugurov - */ -public class ConnectionConfiguratorTest extends MyTestCase { - static { - System.setProperty("http.proxyHost", "www.potstava.danilahttp"); - System.setProperty("http.proxyPort", "1234"); - System.setProperty("socksProxyHost", "www.potstava.danilasocks"); - System.setProperty("socksProxyPort", "1234"); - System.setProperty("ftp.proxyHost", "www.potstava.danilaftp"); - System.setProperty("ftp.proxyPort", "1234"); - System.setProperty("deployment.proxy.http.host", "www.miracle.com"); - System.setProperty("deployment.proxy.http.port", "6060"); - System.setProperty("deployment.proxy.bypass.list", "sun.com,www.my.ru , , w3c.go.go,, 12.34.65.2 "); - } - Proxy httpPro; - Proxy ftpPro; - Proxy socksPro; - Proxy deploymentProxy; - - public void setUp() throws Exception { - super.setUp(); - httpPro = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("www.potstava.danilahttp", 1234)); - ftpPro = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("www.potstava.danilaftp", 1234)); - socksPro = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("www.potstava.danilasocks", 1234)); - deploymentProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("www.miracle.com", 6060)); - } - - public void testSystemProxyCatched() { - URLConnector connector = new URLConnector(MyTestCase.testWD); - assertEquals(deploymentProxy, connector.getProxy(MyProxyType.HTTP)); - assertEquals(ftpPro, connector.getProxy(MyProxyType.FTP)); - assertEquals(socksPro, connector.getProxy(MyProxyType.SOCKS)); - } - public void testByPassCatchedAndMyAdd() { - URLConnector connector = new URLConnector(MyTestCase.testWD); - final Set expected = new HashSet(); - expected.add("sun.com"); - expected.add("www.my.ru"); - expected.add("w3c.go.go"); - expected.add("12.34.65.2"); - final Set list = new HashSet(); - for(String str : connector.getByPassHosts()) { - list.add(str); - } - assertEquals(expected, list); - connector.addByPassHost("myNew.one"); - list.clear(); - for(String str : connector.getByPassHosts()) { - list.add(str); - } - expected.add("myNew.one"); - assertEquals(expected, list); - } - - public void testClearAndAddNewByPass() { - URLConnector connector = new URLConnector(MyTestCase.testWD); - assertTrue(connector.getByPassHosts().length > 0); - connector.clearByPassList(); - assertTrue(connector.getByPassHosts().length == 0); - connector.addByPassHost("test.one"); - assertEquals("test.one", connector.getByPassHosts()[0]); - connector.addByPassHost("test.two"); - assertTrue(connector.getByPassHosts().length == 2); - } - - public void testMyOwnProxyAdd() { - URLConnector connector = new URLConnector(MyTestCase.testWD); - MyProxy http = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("www.mpotstava.danilahttp", 1234))); - MyProxy ftp = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("www.mpotstava.danilaftp", 1234)), MyProxyType.FTP); - MyProxy socks = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("www.mpotstava.danilasocks", 1234))); - connector.addProxy(http); - connector.addProxy(ftp); - connector.addProxy(socks); - assertEquals(http.getProxy(), connector.getProxy(MyProxyType.HTTP)); - assertEquals(ftp.getProxy(), connector.getProxy(MyProxyType.FTP)); - assertEquals(socks.getProxy(), connector.getProxy(MyProxyType.SOCKS)); - } - - public void testConnectorPropertiesSetGet() { - URLConnector connector = new URLConnector(MyTestCase.testWD); - connector.setConnectTimeout(1000); - assertEquals(1000, connector.getConnectTimeout()); - connector.setReadTimeout(2000); - assertEquals(2000, connector.getReadTimeout()); - connector.setUseProxy(false); - assertEquals(false, connector.getUseProxy()); - } -} diff --git a/nbi/engine/tests/org/connector/ConnectorTest.java b/nbi/engine/tests/org/connector/ConnectorTest.java deleted file mode 100644 index bd45eeee4718..000000000000 --- a/nbi/engine/tests/org/connector/ConnectorTest.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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.connector; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.net.InetSocketAddress; -import java.net.MalformedURLException; -import java.net.Proxy; -import java.net.URL; -import java.net.URLConnection; -import org.MyTestCase; -import org.netbeans.installer.downloader.connector.MyProxy; -import org.netbeans.installer.downloader.connector.URLConnector; -import org.server.TestDataGenerator; -import org.server.WithServerTestCase; - -/** - * - * @author Danila_Dugurov - */ -public class ConnectorTest extends WithServerTestCase { - - public static URL smallest; - public static URL small; - public static URL noResource; - - static { - try { - smallest = new URL("http://localhost:8080/" + TestDataGenerator.testFiles[0]); - small = new URL("http://127.0.0.1:8080/" + TestDataGenerator.testFiles[1]); - noResource = new URL("http://localhost:8080/kadabra.data"); - } catch (MalformedURLException ex) { - ex.printStackTrace(); - } - } - - public void testDirect() { - URLConnector connector = new URLConnector(MyTestCase.testWD); - URLConnection connection = null; - try { - connection = connector.establishConnection(smallest); - assertEquals(TestDataGenerator.testFileSizes[0], connection.getContentLength()); - connection.getInputStream().close(); - connection = connector.establishConnection(small); - assertEquals(TestDataGenerator.testFileSizes[1], connection.getContentLength()); - connection.getInputStream().close(); - } catch (IOException ex) { - ex.printStackTrace(); - fail(); - } - try { - connection = connector.establishConnection(noResource); - connection.getInputStream().close(); - fail(); - } catch (FileNotFoundException ex) { - } catch (IOException ex) { - ex.printStackTrace(); - fail(); - } finally { - if (connection != null) { - try { - final InputStream in = connection.getInputStream(); - if (in != null) in.close(); - } catch (IOException ignored) {//skip - } - } - } - } - - public void testWithProxy() { - URLConnector connector = new URLConnector(MyTestCase.testWD); - URLConnection connection = null; - try { - connection = connector.establishConnection(smallest); - connection.getInputStream().close(); - } catch (IOException ex) { - ex.printStackTrace(); - fail(); - } - connector.addProxy(new MyProxy(new Proxy(Proxy.Type.HTTP,new InetSocketAddress("www.fake.com", 1234)))); - connector.setUseProxy(true); - try { - connection = connector.establishConnection(smallest); - connection.getInputStream().close(); - fail();//what's the matter?It's seems to me that sometimes for localhost java URLConnection just ignor proxy as argument. - } catch (IOException ex) { - System.out.println(ex.getMessage()); - } - } - - public void testWithProxyWithByPassList() { - URLConnector connector = new URLConnector(MyTestCase.testWD); - connector.addProxy(new MyProxy(new Proxy(Proxy.Type.HTTP,new InetSocketAddress("www.fake.com", 1234)))); - connector.setUseProxy(true); - connector.addByPassHost("127.0.0.1"); - URLConnection connection = null; - try { - connection = connector.establishConnection(smallest); - connection.getInputStream().close(); - fail(); - } catch (IOException ex) { - System.out.println(ex.getMessage()); - } - try { - connection = connector.establishConnection(small); - connection.getInputStream().close(); - } catch (IOException ex) { - ex.printStackTrace(); - fail(); - } - } -} diff --git a/nbi/engine/tests/org/connector/ProxySelectorTest.java b/nbi/engine/tests/org/connector/ProxySelectorTest.java deleted file mode 100644 index 8820bb71b2db..000000000000 --- a/nbi/engine/tests/org/connector/ProxySelectorTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * 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.connector; - -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.MyTestCase; -import org.netbeans.installer.downloader.connector.MyProxy; -import org.netbeans.installer.downloader.connector.MyProxySelector; -import org.netbeans.installer.downloader.connector.MyProxyType; - -/** - * - * @author Danila_Dugurov - */ -public class ProxySelectorTest extends MyTestCase { - - URI httpURI; - URI ftpURI; - URI svnURI; - public void setUp() throws Exception { - super.setUp(); - httpURI = new URI("http://www.fumm.off/"); - ftpURI = new URI("ftp://www.fumm.off/"); - svnURI = new URI("svn://www.fumm.off/"); - } - - public void testSimpleProxySelect() throws URISyntaxException { - - MyProxySelector selector = new MyProxySelector(); - - - final MyProxy proxy1 = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8080))); - final MyProxy proxy2 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("localhost", 8080))); - final MyProxy proxy3 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("localhost", 8081)), MyProxyType.FTP); - selector.add(proxy2); - selector.add(proxy1); - selector.add(proxy3); - assertEquals(1, selector.select(httpURI).size()); - assertEquals(1, selector.select(svnURI).size()); - assertEquals(1, selector.select(ftpURI).size()); - assertEquals(proxy1.getProxy(), selector.select(httpURI).get(0)); - assertEquals(proxy3.getProxy(), selector.select(ftpURI).get(0)); - assertEquals(proxy2.getProxy(), selector.select(svnURI).get(0)); - } - - public void testAddAndSelect() { - MyProxySelector selector = new MyProxySelector(); - assertNull(selector.getForType(MyProxyType.HTTP)); - assertNull(selector.getForType(MyProxyType.SOCKS)); - assertNull(selector.getForType(MyProxyType.FTP)); - assertEquals(Proxy.NO_PROXY, selector.select(httpURI).get(0)); - assertEquals(Proxy.NO_PROXY, selector.select(ftpURI).get(0)); - assertEquals(Proxy.NO_PROXY, selector.select(svnURI).get(0)); - final MyProxy http = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8080)), MyProxyType.HTTP); - final MyProxy ftp = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("hehe.kill.yourself", 8080)), MyProxyType.FTP); - final MyProxy socks = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("localhost", 8080)), MyProxyType.SOCKS); - selector.add(http); - selector.add(ftp); - selector.add(socks); - assertNotNull(selector.getForType(MyProxyType.HTTP)); - assertNotNull(selector.getForType(MyProxyType.SOCKS)); - assertNotNull(selector.getForType(MyProxyType.FTP)); - assertEquals(http.getProxy(), selector.select(httpURI).get(0)); - assertEquals(ftp.getProxy(), selector.select(ftpURI).get(0)); - assertEquals(socks.getProxy(), selector.select(svnURI).get(0)); - } - - public void testRemoveReplace() { - MyProxySelector selector = new MyProxySelector(); - final MyProxy http = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8080))); - final MyProxy ftp = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("hehe.kill.yourself", 8080)), MyProxyType.FTP); - final MyProxy socks = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("localhost", 8080))); - final MyProxy socks2 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("localhost", 8081))); - final MyProxy noProxy = new MyProxy(Proxy.NO_PROXY); - selector.add(http); - selector.add(socks); - selector.add(noProxy); - assertEquals(socks.getProxy(), selector.select(svnURI).get(0)); - selector.add(socks2); - assertEquals(socks2.getProxy(), selector.select(svnURI).get(0)); - selector.remove(MyProxyType.FTP); - assertNotNull(selector.getForType(MyProxyType.HTTP)); - assertNotNull(selector.getForType(MyProxyType.SOCKS)); - assertNotNull(selector.getForType(MyProxyType.DIRECT)); - assertNull(selector.getForType(MyProxyType.FTP)); - selector.remove(MyProxyType.HTTP); - selector.remove(MyProxyType.SOCKS); - assertNull(selector.getForType(MyProxyType.HTTP)); - assertNull(selector.getForType(MyProxyType.SOCKS)); - assertNotNull(selector.getForType(MyProxyType.DIRECT)); - assertNull(selector.getForType(MyProxyType.FTP)); - } - - public void testByPassAddGet() { - MyProxySelector selector = new MyProxySelector(); - assertTrue(selector.getByPass().length == 0); - final Set expected = new HashSet(); - expected.add("sun.com"); - selector.addByPassHost("sun.com"); - assertTrue(selector.getByPass().length == 1); - assertEquals("sun.com", selector.getByPass()[0]); - expected.add("www.my.ru"); - expected.add("w3c.go.go"); - expected.add("12.34.65.2"); - selector.addByPassHost("www.my.ru"); - selector.addByPassHost("w3c.go.go"); - selector.addByPassHost("12.34.65.2"); - final Set list = new HashSet(); - for(String str : selector.getByPass()) { - list.add(str); - } - assertEquals(expected, list); - } - - public void testClearAndAddNewByPass() { - MyProxySelector selector = new MyProxySelector(); - selector.addByPassHost("sun.com"); - assertTrue(selector.getByPass().length > 0); - selector.clearByPassList(); - assertTrue(selector.getByPass().length == 0); - selector.addByPassHost("mysun.com"); - assertEquals("mysun.com", selector.getByPass()[0]); - } - - public void testSelectWithByPass() { - MyProxySelector selector = new MyProxySelector(); - final MyProxy http = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8080)), MyProxyType.HTTP); - selector.add(http); - assertEquals(http.getProxy(), selector.select(httpURI).get(0)); - selector.addByPassHost(httpURI.getHost()); - assertEquals(Proxy.NO_PROXY, selector.select(httpURI).get(0)); - } -} diff --git a/nbi/engine/tests/org/connector/ProxyTest.java b/nbi/engine/tests/org/connector/ProxyTest.java deleted file mode 100644 index 73d5ddecd101..000000000000 --- a/nbi/engine/tests/org/connector/ProxyTest.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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.connector; - -import java.net.InetSocketAddress; -import java.net.Proxy; -import org.MyTestCase; -import org.netbeans.installer.downloader.connector.MyProxy; -import org.netbeans.installer.downloader.connector.MyProxyType; -import org.netbeans.installer.utils.exceptions.ParseException; -import org.netbeans.installer.utils.xml.DomUtil; -import org.netbeans.installer.utils.xml.visitors.DomVisitor; -import org.netbeans.installer.utils.xml.visitors.RecursiveDomVisitor; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * - * @author Danila_Dugurov - */ -public class ProxyTest extends MyTestCase { - - public void testProxyCreation() { - final Proxy real = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 4321)); - MyProxy proxy = new MyProxy(real); - assertEquals(real, proxy.getProxy()); - - proxy = new MyProxy(); - assertEquals(Proxy.NO_PROXY, proxy.getProxy()); - } - - public void testProxySerializing() { - final MyProxy proxy = new MyProxy( - new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 4321))); - final MyProxy desirealized = new MyProxy(); - try { - Document doc = DomUtil.parseXmlFile(""); - DomUtil.addChild(doc.getDocumentElement(), proxy); - - DomVisitor visitor = new RecursiveDomVisitor() { - public void visit(Element element) { - if ("proxy".equals(element.getNodeName())) { - desirealized.readXML(element); - } else super.visit(element); - } - }; - visitor.visit(doc); - } catch(ParseException ex) {} - assertEquals(proxy, desirealized); - } - - public void testProxyEquals() { - MyProxy proxy1 = new MyProxy(); - MyProxy proxy2 = new MyProxy(); - assertTrue(proxy1.equals(proxy2)); - assertEquals(proxy1.hashCode(), proxy2.hashCode()); - assertFalse(proxy1.equals(null)); - - proxy1 = new MyProxy(); - proxy2 = new MyProxy(Proxy.NO_PROXY); - assertTrue(proxy1.equals(proxy2)); - - proxy1 = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 4321))); - proxy2 = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 4321))); - assertTrue(proxy1.equals(proxy2)); - assertEquals(proxy1.hashCode(), proxy2.hashCode()); - - proxy1 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 4321))); - proxy2 = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 4321))); - assertFalse(proxy1.equals(proxy2)); - assertNotSame(proxy1.hashCode(), proxy2.hashCode()); - - proxy1 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 4321))); - proxy2 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 4322))); - assertFalse(proxy1.equals(proxy2)); - assertNotSame(proxy1.hashCode(), proxy2.hashCode()); - - //comments: long duration due to host resolving in constructor InetSocketAddress! - proxy1 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("125.0.0.1", 4321))); - proxy2 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 4321))); - assertFalse(proxy1.equals(proxy2)); - assertNotSame(proxy1.hashCode(), proxy2.hashCode()); - proxy1 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("www.fake.ru", 4321))); - proxy2 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 4321))); - assertFalse(proxy1.equals(proxy2)); - assertNotSame(proxy1.hashCode(), proxy2.hashCode()); - } - - public void testIncompatible() { - try { - MyProxy proxy1 = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 4321)), MyProxyType.SOCKS); - fail(); - } catch(IllegalArgumentException ex) { - } - try { - MyProxy proxy1 = new MyProxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 4321)), MyProxyType.HTTP); - fail(); - } catch(IllegalArgumentException ex) { - } - try { - MyProxy proxy1 = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 4321)), MyProxyType.DIRECT); - fail(); - } catch(IllegalArgumentException ex) { - } - try { - MyProxy proxy1 = new MyProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 4321)), MyProxyType.FTP); - fail(); - } catch(IllegalArgumentException ex) { - } - } -} diff --git a/nbi/engine/tests/org/dispatcher/DispatcherTest.java b/nbi/engine/tests/org/dispatcher/DispatcherTest.java deleted file mode 100644 index d04993973d64..000000000000 --- a/nbi/engine/tests/org/dispatcher/DispatcherTest.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * 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.dispatcher; - -import org.MyTestCase; -import org.netbeans.installer.downloader.dispatcher.Process; -import org.netbeans.installer.downloader.dispatcher.ProcessDispatcher; -import org.netbeans.installer.downloader.dispatcher.impl.RoundRobinDispatcher; - -/** - * - * @author Danila_Dugurov - */ - -/** - * be aware of that if time quantum or sleep time change - failes may occur. - * it's all ok becouse asynchronious dispatcher wroking. - */ -public class DispatcherTest extends MyTestCase { - - public void testRunStop() { - final ProcessDispatcher dispatcher = new RoundRobinDispatcher(500, 1); - assertFalse(dispatcher.isActive()); - dispatcher.start(); - assertTrue(dispatcher.isActive()); - dispatcher.stop(); - assertFalse(dispatcher.isActive()); - - assertFalse(dispatcher.isActive()); - dispatcher.start(); - assertTrue(dispatcher.isActive()); - dispatcher.stop(); - assertFalse(dispatcher.isActive()); - } - - public void testSingleProcessAddAndTerminate() { - final ProcessDispatcher dispatcher = new RoundRobinDispatcher(50, 1); - final DummyProcess dummy = new DummyProcess(); - dispatcher.schedule(dummy); - shortSleep(); - assertEquals(0, dispatcher.activeCount()); - assertEquals(1, dispatcher.waitingCount()); - assertFalse(dummy.isProcessed()); - dispatcher.start(); - shortSleep(); - assertTrue(dummy.isProcessed()); - assertEquals(1, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - dummy.terminate(); - shortSleep(); - assertFalse(dummy.isProcessed()); - assertEquals(0, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - dispatcher.stop(); - } - - public void testSingleProcessAddAndDispatcherTerminate() { - final ProcessDispatcher dispatcher = new RoundRobinDispatcher(50, 1); - final DummyProcess dummy = new DummyProcess(); - dispatcher.schedule(dummy); - dispatcher.start(); - shortSleep(); - assertTrue(dummy.isProcessed()); - assertEquals(1, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - dispatcher.stop(); - assertFalse(dummy.isProcessed()); - assertEquals(0, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - } - - public void testReuseThreadWorker() { - final ProcessDispatcher dispatcher = new RoundRobinDispatcher(50, 1); - final DummyProcess dummy = new DummyProcess(); - final DummyProcess dummy2 = new DummyProcess(); - dispatcher.schedule(dummy); - dispatcher.start(); - shortSleep(); - dummy.terminate(); - shortSleep(); - assertEquals(0, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - assertFalse(dummy.isProcessed()); - Thread worker = dummy.getWorker(); - assertTrue(worker.isAlive()); - assertTrue(dispatcher.isActive()); - assertTrue(dispatcher.schedule(dummy2)); - assertEquals(1, dispatcher.waitingCount() + dispatcher.activeCount()); - shortSleep(); - assertEquals(1, dispatcher.activeCount()); - assertTrue(dummy2.isProcessed()); - assertEquals(worker, dummy2.getWorker());//key line in this test - dispatcher.stop(); - assertFalse(dummy2.isProcessed()); - } - - public void testTwoProcessWhenPoolOnlyOne() { - final ProcessDispatcher dispatcher = new RoundRobinDispatcher(50, 1); - final DummyProcess dummy = new DummyProcess(); - final DummyProcess dummy2 = new DummyProcess(); - dispatcher.start(); - dispatcher.schedule(dummy); - dispatcher.schedule(dummy2); - shortSleep(); - assertTrue(dummy.isProcessed()); - assertFalse(dummy2.isProcessed()); - assertEquals(1, dispatcher.activeCount()); - assertEquals(1, dispatcher.waitingCount()); - final Thread worker = dummy.getWorker(); - dummy.terminate(); - shortSleep(); - assertFalse(dummy.isProcessed()); - assertTrue(dummy2.isProcessed()); - assertEquals(1, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - assertEquals(worker, dummy2.getWorker()); - dispatcher.stop(); - assertEquals(0, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - } - - public void testTwicetheSameProcess() { - final ProcessDispatcher dispatcher = new RoundRobinDispatcher(50, 1); - final DummyProcess dummy = new DummyProcess(); - dispatcher.schedule(dummy); - dispatcher.start(); - shortSleep(); - assertTrue(dummy.isProcessed()); - dummy.terminate(); - shortSleep(); - assertTrue(dispatcher.schedule(dummy)); - assertEquals(1, dispatcher.activeCount() + dispatcher.waitingCount()); - dispatcher.stop(); - assertEquals(0, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - assertTrue(dispatcher.schedule(dummy)); - } - - public void testTerminateByDispatcher() { - final ProcessDispatcher dispatcher = new RoundRobinDispatcher(50, 1); - final DummyProcess goodDummy = new DummyProcess(); - final DummyProcess badDummy = new DummyProcess() { - public void run() { - while(true) { - try { - Thread.sleep(1000); - } catch (InterruptedException ex) { - //no reaction - I'm very very bad dummy - } - } - } - public void terminate() { - } - }; - dispatcher.schedule(goodDummy); - dispatcher.start(); - shortSleep(); - assertTrue(goodDummy.isProcessed()); - final Thread worker = goodDummy.getWorker(); - dispatcher.terminate(goodDummy); - dispatcher.schedule(badDummy); - shortSleep(); - assertTrue(badDummy.isProcessed()); - assertEquals(worker, badDummy.getWorker()); - dispatcher.terminate(badDummy); - assertEquals(0, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - dispatcher.schedule(goodDummy); - assertEquals(1, dispatcher.activeCount() + dispatcher.waitingCount()); - shortSleep(); - assertEquals(1, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - assertTrue(goodDummy.isProcessed()); - assertNotSame(worker, goodDummy.getWorker()); - dispatcher.stop(); - } - - public void testWorkability() { - final ProcessDispatcher dispatcher = new RoundRobinDispatcher(50, 10); - final DummyProcess[] dummies = new DummyProcess[15]; - for (int i = 0; i < 15; i++) { - dummies[i] = new DummyProcess( i + 1); - } - for (int i = 0 ; i < 5; i++) { - dispatcher.schedule(dummies[i]); - } - assertEquals(5, dispatcher.waitingCount()); - dispatcher.start(); - shortSleep(); - assertEquals(5, dispatcher.activeCount()); - for (int i = 5 ; i < 10; i++) { - dispatcher.schedule(dummies[i]); - shortSleep(); - assertEquals(i + 1, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - } - longSleep(); - for (int i = 0 ; i < 10; i++) { - assertTrue(dummies[i].isProcessed()); - } - dispatcher.schedule(dummies[11]); - dispatcher.schedule(dummies[10]); - assertEquals(10, dispatcher.activeCount()); - assertEquals(2, dispatcher.waitingCount()); - dummies[5].terminate(); - //dispatcher.terminate(dummies[5]); - longSleep(); - longSleep(); - assertEquals(10, dispatcher.activeCount()); - assertEquals(1, dispatcher.waitingCount()); - dispatcher.schedule(dummies[12]); - dispatcher.schedule(dummies[13]); - dispatcher.schedule(dummies[14]); - - dispatcher.terminate(dummies[0]); - dispatcher.terminate(dummies[1]); - dispatcher.terminate(dummies[2]); - dispatcher.terminate(dummies[3]); - // dummies[0].terminate(); - // dummies[1].terminate(); - // dummies[2].terminate(); - // dummies[3].terminate(); - longSleep(); - assertEquals(10, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - for (int i = 6; i < 15; i++) { - assertTrue(dummies[i].isProcessed()); - } - dispatcher.stop(); - assertEquals(0, dispatcher.activeCount()); - assertEquals(0, dispatcher.waitingCount()); - for (int i = 0; i < 15; i++) { - assertFalse(dummies[i].isProcessed()); - } - dispatcher.stop(); - } - - private void longSleep() { - try { - Thread.sleep(500); - } catch (InterruptedException ex) {//skip - } - } - - private void shortSleep() { - try { - Thread.sleep(100); - } catch (InterruptedException ex) {//skip - } - } -} diff --git a/nbi/engine/tests/org/dispatcher/DummyProcess.java b/nbi/engine/tests/org/dispatcher/DummyProcess.java deleted file mode 100644 index 7dd39b0618c3..000000000000 --- a/nbi/engine/tests/org/dispatcher/DummyProcess.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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.dispatcher; - -import org.netbeans.installer.downloader.dispatcher.Process; - -/** - * - * @author Danila_Dugurov - */ -public class DummyProcess implements Process { - - public Thread worker = null; - - private boolean interrupted = false; - - private boolean isProcessed = false; - - private long workingStartTime = 0; - private long workingEndTime = 0; - - private int id; - - public DummyProcess() {} - - public DummyProcess(int id) { - this.id = id; - } - - public Thread getWorker() { - return worker; - } - - public boolean isProcessed() { - return isProcessed; - } - - public long workingStartTime() { - return workingStartTime; - } - - public long workingEndTime() { - return workingEndTime; - } - - public void init() { - workingStartTime = System.currentTimeMillis(); - isProcessed = true; - worker = Thread.currentThread(); - } - - public void run() { - while (!interrupted) { - int TwoPlusTwo = 0; - TwoPlusTwo = 2 + 2; - //bla bla bla some work.. - try { - Thread.sleep(1000); - } catch (InterruptedException exit) { - break; - } - } - isProcessed = false; - interrupted = false; - workingEndTime = System.currentTimeMillis(); - } - - public void terminate() { - interrupted = true; - workingEndTime = System.currentTimeMillis(); - if (worker != null) worker.interrupt(); - else System.out.println("worker: " + null); - } -} diff --git a/nbi/engine/tests/org/downloader/ActionsTracer.java b/nbi/engine/tests/org/downloader/ActionsTracer.java deleted file mode 100644 index 8827085b4f2d..000000000000 --- a/nbi/engine/tests/org/downloader/ActionsTracer.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.downloader; - -import java.util.LinkedList; -import java.util.List; -import org.netbeans.installer.downloader.DownloadListener; -import org.netbeans.installer.downloader.PumpingsQueue; -import org.netbeans.installer.utils.helper.Pair; - -/** - * - * @author Danila_Dugurov - */ -public class ActionsTracer implements DownloadListener { - - List> actions = new LinkedList>(); - - protected PumpingsQueue queue; - - protected ActionsTracer(PumpingsQueue queue) { - this.queue = queue; - queue.addListener(this); - } - - public void pumpingUpdate(String id) { - actions.add(Pair.create("update", id)); - } - - public void pumpingStateChange(String id) { - actions.add(Pair.create("stateChange", id)); - } - - public void pumpingAdd(String id) { - actions.add(Pair.create("add", id)); - } - - public void pumpingDelete(String id) { - actions.add(Pair.create("delete", id)); - } - - public void queueReset() { - actions.add(Pair.create("reset", "")); - } - - public void pumpsInvoke() { - actions.add(Pair.create("invoke", "")); - } - - public void pumpsTerminate() { - actions.add(Pair.create("terminate", "")); - } -} diff --git a/nbi/engine/tests/org/downloader/QueueAndListenerWithServerTest.java b/nbi/engine/tests/org/downloader/QueueAndListenerWithServerTest.java deleted file mode 100644 index cd9848f2ef70..000000000000 --- a/nbi/engine/tests/org/downloader/QueueAndListenerWithServerTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.downloader; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import org.MyTestCase; -import org.netbeans.installer.downloader.DownloadConfig; -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.queue.DispatchedQueue; -import org.netbeans.installer.downloader.services.EmptyQueueListener; -import org.server.WithServerTestCase; - -/** - * - * @author Danila_Dugurov - */ -public class QueueAndListenerWithServerTest extends WithServerTestCase { - - public void testFailedDwonload() throws MalformedURLException { - final DispatchedQueue queue = new DispatchedQueue(new File(MyTestCase.testWD, "queueState.xml")); - final VerboseTracer listener = new VerboseTracer(queue); - EmptyQueueListener notifier = new EmptyQueueListener() { - public void pumpingStateChange(String id) { - System.out.println(queue.getById(id).state()); - if (queue.getById(id).state() == Pumping.State.FAILED) { - synchronized (queue) { - queue.notifyAll(); - } - } - } - }; - queue.addListener(notifier); - queue.invoke(); - queue.add(new URL("http://www.oblom.com:8080/oblom.data")); - synchronized (queue) { - try { - queue.wait(); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - } - queue.terminate(); - assertEquals(2 + DownloadConfig.ATTEMPT_COUNT * 2 + 2, listener.verboseActions.size()); - assertEquals("invoke", listener.verboseActions.get(0).getFirst()); - assertEquals("add", listener.verboseActions.get(1).getFirst()); - for (int i = 2 ; i < 2 + DownloadConfig.ATTEMPT_COUNT * 2; i+=2) { - assertEquals("stateChange", listener.verboseActions.get(i).getFirst()); - assertEquals(Pumping.State.CONNECTING.toString(), listener.verboseActions.get(i).getSecond()[1]); - assertEquals("stateChange", listener.verboseActions.get(i + 1).getFirst()); - assertEquals(Pumping.State.WAITING.toString(), listener.verboseActions.get(i+1).getSecond()[1]); - } - assertEquals(Pumping.State.FAILED.toString(), listener.verboseActions.get(2 + DownloadConfig.ATTEMPT_COUNT * 2).getSecond()[1]); - assertEquals("terminate", listener.verboseActions.get(2 + DownloadConfig.ATTEMPT_COUNT * 2 + 1).getFirst()); - } -} diff --git a/nbi/engine/tests/org/downloader/QueueAndListenerWithoutServerTest.java b/nbi/engine/tests/org/downloader/QueueAndListenerWithoutServerTest.java deleted file mode 100644 index 27c6c431a7cb..000000000000 --- a/nbi/engine/tests/org/downloader/QueueAndListenerWithoutServerTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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.downloader; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.LinkedList; -import java.util.List; -import org.MyTestCase; -import org.netbeans.installer.downloader.DownloadListener; -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.PumpingsQueue; -import org.netbeans.installer.downloader.queue.DispatchedQueue; -import org.netbeans.installer.utils.helper.Pair; - -/** - * - * @author Danila_Dugurov - */ -public class QueueAndListenerWithoutServerTest extends MyTestCase { - - public void testInvokeTerminate() { - final DispatchedQueue queue = new DispatchedQueue(new File(MyTestCase.testWD, "queueState.xml")); - final ActionsTracer listener = new ActionsTracer(queue); - queue.invoke(); - assertEquals(1, listener.actions.size()); - assertEquals("invoke", listener.actions.get(0).getFirst()); - queue.terminate(); - assertEquals(2, listener.actions.size()); - assertEquals("terminate", listener.actions.get(1).getFirst()); - } - - public void testAddDelete() throws MalformedURLException { - final PumpingsQueue queue = new DispatchedQueue(new File(MyTestCase.testWD, "queueState.xml")); - final ActionsTracer listener = new ActionsTracer(queue); - final Pumping pumping = queue.add(new URL("http://127.0.0.1:8080/testurl.data")); - assertTrue(queue.toArray().length == 1); - assertEquals(1, listener.actions.size()); - assertEquals("add", listener.actions.get(0).getFirst()); - assertEquals(pumping.getId(), listener.actions.get(0).getSecond()); - queue.delete(pumping.getId()); - assertEquals(2, listener.actions.size()); - assertEquals("delete", listener.actions.get(1).getFirst()); - assertEquals(pumping.getId(), listener.actions.get(1).getSecond()); - assertTrue(queue.toArray().length == 0); - } - - public void testReset() throws MalformedURLException { - final PumpingsQueue queue = new DispatchedQueue(new File(MyTestCase.testWD, "queueState.xml")); - final ActionsTracer listener = new ActionsTracer(queue); - final Pumping pumping1 = queue.add(new URL("http://127.0.0.1:8080/testurl.data")); - final Pumping pumping2 = queue.add(new URL("http://127.0.0.1:8080/testurl.data")); - final Pumping pumping3 = queue.add(new URL("http://127.0.0.1:8080/testurl.data")); - assertEquals(3, listener.actions.size()); - assertEquals("add", listener.actions.get(0).getFirst()); - assertEquals(pumping1.getId(), listener.actions.get(0).getSecond()); - assertEquals("add", listener.actions.get(1).getFirst()); - assertEquals(pumping2.getId(), listener.actions.get(1).getSecond()); - assertEquals("add", listener.actions.get(2).getFirst()); - assertEquals(pumping3.getId(), listener.actions.get(2).getSecond()); - queue.reset(); - assertEquals(7, listener.actions.size()); - assertEquals("delete", listener.actions.get(3).getFirst()); - assertEquals(pumping3.getId(), listener.actions.get(3).getSecond()); - assertEquals("delete", listener.actions.get(4).getFirst()); - assertEquals(pumping1.getId(), listener.actions.get(4).getSecond()); - assertEquals("delete", listener.actions.get(5).getFirst()); - assertEquals(pumping2.getId(), listener.actions.get(5).getSecond()); - assertEquals("reset", listener.actions.get(6).getFirst()); - } - - public void testResetInAction() { - final DispatchedQueue queue = new DispatchedQueue(new File(MyTestCase.testWD, "queueState.xml")); - final ActionsTracer listener = new ActionsTracer(queue); - queue.invoke(); - queue.reset(); - queue.terminate(); - assertEquals(5, listener.actions.size()); - assertEquals("invoke", listener.actions.get(0).getFirst()); - assertEquals("terminate", listener.actions.get(1).getFirst()); - assertEquals("reset", listener.actions.get(2).getFirst()); - assertEquals("invoke", listener.actions.get(3).getFirst()); - assertEquals("terminate", listener.actions.get(4).getFirst()); - } -} diff --git a/nbi/engine/tests/org/downloader/RedirectTest.java b/nbi/engine/tests/org/downloader/RedirectTest.java deleted file mode 100644 index 951f72c27a4a..000000000000 --- a/nbi/engine/tests/org/downloader/RedirectTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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.downloader; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import org.MyTestCase; -import org.netbeans.installer.downloader.DownloadListener; -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.queue.DispatchedQueue; -import org.netbeans.installer.downloader.services.EmptyQueueListener; -import org.server.TestDataGenerator; -import org.server.WithServerTestCase; - -/** - * - * @author Danila_Dugurov - */ -public class RedirectTest extends WithServerTestCase { - - public void testWithRedirect() { - final DispatchedQueue queue = new DispatchedQueue(new File(MyTestCase.testWD, "queueState.xml")); - final DownloadListener listener = new EmptyQueueListener() { - public void pumpingStateChange(String id) { - final Pumping pumping = queue.getById(id); - System.out.println("pumping url: " + pumping.declaredURL()); - System.out.println("pumping real url: " + pumping.realURL()); - System.out.println("pumping file " + pumping.outputFile() + " " + pumping.state()); - if (pumping.state() == Pumping.State.FINISHED) { - assertEquals(pumping.length(), TestDataGenerator.testFileSizes[0]); - assertEquals(pumping.realURL(), TestDataGenerator.testUrls[0]); - synchronized (RedirectTest.this) { - RedirectTest.this.notify(); - } - } else if (pumping.state() == Pumping.State.FAILED) { - synchronized (RedirectTest.this) { - RedirectTest.this.notify(); - } - fail(); - } - } - }; - queue.addListener(listener); - URL redirURL = null; - try { - redirURL = new URL("http://localhost:" + WithServerTestCase.PORT + "/redirect/" + TestDataGenerator.testFiles[0]); - } catch (MalformedURLException ex) { - fail(); - } - // System.out.println(redirURL); - queue.invoke(); - synchronized (this) { - queue.add(redirURL, MyTestCase.testOutput); - try { - wait(); - } catch (InterruptedException ex) { - fail(); - } - } - queue.terminate(); - } -} diff --git a/nbi/engine/tests/org/downloader/VerboseTracer.java b/nbi/engine/tests/org/downloader/VerboseTracer.java deleted file mode 100644 index f31d1f2b9f93..000000000000 --- a/nbi/engine/tests/org/downloader/VerboseTracer.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.downloader; - -import java.util.LinkedList; -import java.util.List; -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.PumpingsQueue; -import org.netbeans.installer.utils.helper.Pair; - -/** - * - * @author Danila_Dugurov - */ -public class VerboseTracer extends ActionsTracer { - List> verboseActions = new LinkedList>(); - - public VerboseTracer(PumpingsQueue queue) { - super(queue); - } - - public void pumpingUpdate(String id) { - super.pumpingUpdate(id); - verboseActions.add(Pair.create("update", new String[] {id})); - } - - public void pumpingStateChange(String id) { - super.pumpingStateChange(id); - final Pumping pumping = queue.getById(id); - verboseActions.add(Pair.create("stateChange", new String[] {id, pumping.state().toString()})); - } - - public void pumpingAdd(String id) { - super.pumpingAdd(id); - verboseActions.add(Pair.create("add", new String[] {id})); - } - - public void pumpingDelete(String id) { - super.pumpingDelete(id); - verboseActions.add(Pair.create("delete", new String[] {id})); - } - - public void queueReset() { - super.queueReset(); - verboseActions.add(Pair.create("reset", new String[0])); - } - - public void pumpsInvoke() { - super.pumpsInvoke(); - verboseActions.add(Pair.create("invoke", new String[0])); - } - - public void pumpsTerminate() { - super.pumpsTerminate(); - verboseActions.add(Pair.create("terminate", new String[0])); - } -} diff --git a/nbi/engine/tests/org/downloader/WorkabilityTest.java b/nbi/engine/tests/org/downloader/WorkabilityTest.java deleted file mode 100644 index d36ae94fd4b3..000000000000 --- a/nbi/engine/tests/org/downloader/WorkabilityTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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.downloader; - -import java.io.File; -import org.MyTestCase; -import org.netbeans.installer.downloader.DownloadListener; -import org.netbeans.installer.downloader.Pumping; -import org.netbeans.installer.downloader.Pumping.Section; -import org.netbeans.installer.downloader.queue.DispatchedQueue; -import org.netbeans.installer.downloader.services.EmptyQueueListener; -import org.server.TestDataGenerator; -import org.server.WithServerTestCase; - -/** - * - * @author Danila_Dugurov - */ -public class WorkabilityTest extends WithServerTestCase { - - public void testStepByStepWorkability() { - final DispatchedQueue queue = new DispatchedQueue(new File(MyTestCase.testWD, "queueState.xml")); - final DownloadListener listener = new EmptyQueueListener() { - int i = 0; - public void pumpingStateChange(String id) { - final Pumping pumping = queue.getById(id); - System.out.println("pumping file " + pumping.outputFile() + " " + pumping.state()); - if (pumping.state() == Pumping.State.FINISHED) { - assertEquals(pumping.length(), TestDataGenerator.testFileSizes[i++]); - synchronized (WorkabilityTest.this) { - WorkabilityTest.this.notify(); - } - } else if (pumping.state() == Pumping.State.FAILED) {fail();} - } - public void pumpingUpdate(String id) { - // System.out.print("Update downloading file.." + queue.getById(id).outputFile().getName()); - // System.out.println(" Size = " + downperc(queue.getById(id))); - } - - private long downperc(Pumping pumping) { - long size = 0; - for (Section section : pumping.getSections()) { - size +=section.offset() - section.getRange().getFirst(); - } - return /*pumping.length() > 0 ? size * 100 / pumping.length():*/ size; - } - }; - queue.addListener(listener); - assertFalse(queue.isActive()); - queue.invoke(); - assertTrue(queue.isActive()); - int i = 0 ; - while (i < TestDataGenerator.testUrls.length) { - synchronized (this) { - queue.add(TestDataGenerator.testUrls[i], MyTestCase.testOutput); - try { - wait(); - } catch (InterruptedException ex) { - fail(); - } - } - i++; - } - queue.terminate(); - } - - public void testConcurrentlyWorkability() { - final DispatchedQueue queue = new DispatchedQueue(new File(MyTestCase.testWD, "queueState.xml")); - final DownloadListener listener = new EmptyQueueListener() { - int i = 0; - public void pumpingStateChange(String id) { - final Pumping pumping = queue.getById(id); - System.out.println("pumping file " + pumping.outputFile() + " " + pumping.state()); - if (pumping.state() == Pumping.State.FINISHED) { - i++; - if (i == TestDataGenerator.testUrls.length) { - synchronized (WorkabilityTest.this) { - WorkabilityTest.this.notify(); - } - } - } else if (pumping.state() == Pumping.State.FAILED) {fail();} - } - - public void pumpingUpdate(String id) { - // System.out.print("Update downloading file.." + queue.getById(id).outputFile().getName()); - // System.out.println(" Size = " + downperc(queue.getById(id))); - } - - private long downperc(Pumping pumping) { - long size = 0; - for (Section section : pumping.getSections()) { - size +=section.offset() - section.getRange().getFirst(); - } - return /*pumping.length() > 0 ? size * 100 / pumping.length():*/ size; - } - }; - queue.addListener(listener); - queue.invoke(); - int i = 0 ; - while (i < TestDataGenerator.testUrls.length) { - queue.add(TestDataGenerator.testUrls[i], MyTestCase.testOutput); - i++; - } - synchronized (this) { - try { - wait(); - } catch (InterruptedException ex) { - fail(); - } - } - queue.terminate(); - } -} diff --git a/nbi/infra/lib/registries-management/src/org/netbeans/installer/infra/lib/registries/impl/RegistriesManagerImpl.java b/nbi/infra/lib/registries-management/src/org/netbeans/installer/infra/lib/registries/impl/RegistriesManagerImpl.java index a00436b19da9..dfb68b59585a 100644 --- a/nbi/infra/lib/registries-management/src/org/netbeans/installer/infra/lib/registries/impl/RegistriesManagerImpl.java +++ b/nbi/infra/lib/registries-management/src/org/netbeans/installer/infra/lib/registries/impl/RegistriesManagerImpl.java @@ -33,7 +33,6 @@ import java.util.Queue; import java.util.concurrent.locks.ReentrantLock; import org.netbeans.installer.Installer; -import org.netbeans.installer.downloader.DownloadManager; import org.netbeans.installer.product.Registry; import org.netbeans.installer.product.RegistryNode; import org.netbeans.installer.product.components.Group; @@ -985,9 +984,6 @@ private void initializeRegistryNoLock( //Issue #183611 //Locale.setDefault(new Locale("en", "US")); - DownloadManager.getInstance().setLocalDirectory(temp); - DownloadManager.getInstance().setFinishHandler(DummyFinishHandler.INSTANCE); - System.setProperty( Installer.LOCAL_DIRECTORY_PATH_PROPERTY, temp.getAbsolutePath()); System.setProperty( diff --git a/php/hudson.php/manifest.mf b/php/hudson.php/manifest.mf index 11a4dfe73f1f..a2240cb3cca5 100644 --- a/php/hudson.php/manifest.mf +++ b/php/hudson.php/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.hudson.php OpenIDE-Module-Layer: org/netbeans/modules/hudson/php/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/hudson/php/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.43 +OpenIDE-Module-Specification-Version: 1.44 diff --git a/php/languages.neon/manifest.mf b/php/languages.neon/manifest.mf index 0491e08818f6..eafc3ec89ffd 100644 --- a/php/languages.neon/manifest.mf +++ b/php/languages.neon/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.languages.neon OpenIDE-Module-Layer: org/netbeans/modules/languages/neon/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/neon/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/php/libs.javacup/nbproject/project.properties b/php/libs.javacup/nbproject/project.properties index 4a24381dd608..cdf411de77fa 100644 --- a/php/libs.javacup/nbproject/project.properties +++ b/php/libs.javacup/nbproject/project.properties @@ -17,4 +17,4 @@ is.autoload=true release.external/java-cup-11a.jar=modules/ext/java-cup-11a.jar -spec.version.base=1.49.0 +spec.version.base=1.50.0 diff --git a/php/php.api.annotation/manifest.mf b/php/php.api.annotation/manifest.mf index 8fbd51f5c3cc..acc65cda4bc4 100644 --- a/php/php.api.annotation/manifest.mf +++ b/php/php.api.annotation/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.api.annotation/0 OpenIDE-Module-Layer: org/netbeans/modules/php/api/annotation/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/annotation/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.43 +OpenIDE-Module-Specification-Version: 0.44 diff --git a/php/php.api.documentation/manifest.mf b/php/php.api.documentation/manifest.mf index ae8f24c8ed11..cf1cd73b41d6 100644 --- a/php/php.api.documentation/manifest.mf +++ b/php/php.api.documentation/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.api.documentation/0 OpenIDE-Module-Layer: org/netbeans/modules/php/api/documentation/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/documentation/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.38 +OpenIDE-Module-Specification-Version: 0.39 diff --git a/php/php.api.editor/manifest.mf b/php/php.api.editor/manifest.mf index bc9b066c463e..4dc85a7bd15e 100644 --- a/php/php.api.editor/manifest.mf +++ b/php/php.api.editor/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.api.editor/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/editor/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.52 +OpenIDE-Module-Specification-Version: 0.53 diff --git a/php/php.api.executable/manifest.mf b/php/php.api.executable/manifest.mf index a09eb01ce24d..34089301d3c5 100644 --- a/php/php.api.executable/manifest.mf +++ b/php/php.api.executable/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.api.executable/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/executable/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.55 +OpenIDE-Module-Specification-Version: 0.56 diff --git a/php/php.api.framework/manifest.mf b/php/php.api.framework/manifest.mf index 37788b6d0214..ff768de8d870 100644 --- a/php/php.api.framework/manifest.mf +++ b/php/php.api.framework/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.api.framework/0 OpenIDE-Module-Layer: org/netbeans/modules/php/api/framework/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/framework/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.50 +OpenIDE-Module-Specification-Version: 0.51 diff --git a/php/php.api.phpmodule/manifest.mf b/php/php.api.phpmodule/manifest.mf index 082e62d50298..9ab923887fcd 100644 --- a/php/php.api.phpmodule/manifest.mf +++ b/php/php.api.phpmodule/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.api.phpmodule OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/phpmodule/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 2.97 +OpenIDE-Module-Specification-Version: 2.98 diff --git a/php/php.api.templates/manifest.mf b/php/php.api.templates/manifest.mf index 9c52c6772444..fe791e85ff4c 100644 --- a/php/php.api.templates/manifest.mf +++ b/php/php.api.templates/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.api.templates/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/templates/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.34 +OpenIDE-Module-Specification-Version: 0.35 diff --git a/php/php.api.testing/manifest.mf b/php/php.api.testing/manifest.mf index 072693724893..ccbcede931b3 100644 --- a/php/php.api.testing/manifest.mf +++ b/php/php.api.testing/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.api.testing/0 OpenIDE-Module-Layer: org/netbeans/modules/php/api/testing/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/testing/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.44 +OpenIDE-Module-Specification-Version: 0.45 diff --git a/php/php.apigen/manifest.mf b/php/php.apigen/manifest.mf index 9132d4241c2e..a103d9cf1b48 100644 --- a/php/php.apigen/manifest.mf +++ b/php/php.apigen/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.php.apigen OpenIDE-Module-Layer: org/netbeans/modules/php/apigen/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/apigen/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 diff --git a/php/php.atoum/manifest.mf b/php/php.atoum/manifest.mf index d87d8c9d4363..0e0b3d5aa5af 100644 --- a/php/php.atoum/manifest.mf +++ b/php/php.atoum/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.php.atoum OpenIDE-Module-Layer: org/netbeans/modules/php/atoum/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/atoum/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.41 +OpenIDE-Module-Specification-Version: 0.42 diff --git a/php/php.code.analysis/manifest.mf b/php/php.code.analysis/manifest.mf index 541d9293c957..43edaa1f6a75 100644 --- a/php/php.code.analysis/manifest.mf +++ b/php/php.code.analysis/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.code.analysis OpenIDE-Module-Layer: org/netbeans/modules/php/analysis/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/analysis/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.39 +OpenIDE-Module-Specification-Version: 0.40 diff --git a/php/php.codeception/manifest.mf b/php/php.codeception/manifest.mf index fecbbf16f327..2642a9059d70 100644 --- a/php/php.codeception/manifest.mf +++ b/php/php.codeception/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.php.codeception OpenIDE-Module-Layer: org/netbeans/modules/php/codeception/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/codeception/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.29 +OpenIDE-Module-Specification-Version: 0.30 diff --git a/php/php.composer/manifest.mf b/php/php.composer/manifest.mf index 45fd630b6669..4b744fe056c0 100644 --- a/php/php.composer/manifest.mf +++ b/php/php.composer/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.php.composer/0 OpenIDE-Module-Layer: org/netbeans/modules/php/composer/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/composer/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.55 +OpenIDE-Module-Specification-Version: 0.56 diff --git a/php/php.dbgp/manifest.mf b/php/php.dbgp/manifest.mf index 91aafd6ac6da..721a9227f6d0 100644 --- a/php/php.dbgp/manifest.mf +++ b/php/php.dbgp/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.php.dbgp OpenIDE-Module-Layer: org/netbeans/modules/php/dbgp/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/dbgp/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.67 +OpenIDE-Module-Specification-Version: 1.68 diff --git a/php/php.doctrine2/manifest.mf b/php/php.doctrine2/manifest.mf index 8a891d3aa09e..4a7e3f1a7086 100644 --- a/php/php.doctrine2/manifest.mf +++ b/php/php.doctrine2/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.doctrine2 OpenIDE-Module-Layer: org/netbeans/modules/php/doctrine2/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/doctrine2/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 diff --git a/php/php.editor/nbproject/project.properties b/php/php.editor/nbproject/project.properties index c5f700d77b53..c16172508a84 100644 --- a/php/php.editor/nbproject/project.properties +++ b/php/php.editor/nbproject/project.properties @@ -18,7 +18,7 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial nbjavac.ignore.missing.enclosing=**/CUP$ASTPHP5Parser$actions.class nbm.needs.restart=true -spec.version.base=2.39.0 +spec.version.base=2.41.0 release.external/predefined_vars-1.0.zip=docs/predefined_vars.zip sigtest.gen.fail.on.error=false diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/actions/ImportDataCreator.java b/php/php.editor/src/org/netbeans/modules/php/editor/actions/ImportDataCreator.java index f8f79da26cab..1d4b5459c484 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/actions/ImportDataCreator.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/actions/ImportDataCreator.java @@ -182,7 +182,28 @@ private Collection filterPlatformConstsAndFunctions(final private Collection filterExactUnqualifiedName(final Collection possibleFQElements, final String typeName) { Collection result = new HashSet<>(); for (FullyQualifiedElement fqElement : possibleFQElements) { - if (fqElement.getFullyQualifiedName().toString().endsWith(typeName)) { + // type name: e.g. Foo, Name\Space\Foo, \Name\Space\Foo + // GH-7546 if an element name has the same prefix and suffix(e.g. Foo2Foo), + // the following check is incorrect + // `fqElement.getFullyQualifiedName().toString().endsWith(typeName)` + // so, compare the segments, instead + QualifiedName qualifiedTypeName = QualifiedName.create(typeName); + List segments = qualifiedTypeName.getSegments(); + Collections.reverse(segments); + List elementSegments = fqElement.getFullyQualifiedName().getSegments(); + Collections.reverse(elementSegments); + boolean exactUnqualifiedName = true; + if (!segments.isEmpty() && segments.size() <= elementSegments.size()) { + for (int i = 0; i < segments.size(); i++) { + if (!segments.get(i).equals(elementSegments.get(i))) { + exactUnqualifiedName = false; + break; + } + } + } else { + exactUnqualifiedName = false; + } + if (exactUnqualifiedName) { result.add(fqElement); } } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java b/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java index 93696a8bc4d3..5723150fb008 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java @@ -273,6 +273,8 @@ private static enum UseType { private static final List INHERITANCE_KEYWORDS = Arrays.asList(new String[]{"extends", "implements"}); //NOI18N private static final String EXCEPTION_CLASS_NAME = "\\Exception"; // NOI18N + private static final String ERROR_CLASS_NAME = "\\Error"; // NOI18N + private static final String THROWABLE_INTERFACE_NAME = "\\Throwable"; // NOI18N private static final List VALID_UNION_TYPE_TOKENS = Arrays.asList( PHPTokenId.WHITESPACE, PHPTokenId.PHP_STRING, PHPTokenId.PHP_NS_SEPARATOR, PHPTokenId.PHP_TYPE_BOOL, PHPTokenId.PHP_TYPE_FLOAT, PHPTokenId.PHP_TYPE_INT, PHPTokenId.PHP_TYPE_STRING, PHPTokenId.PHP_TYPE_VOID, @@ -891,7 +893,8 @@ private void autoCompleteExceptions(final PHPCompletionResult completionResult, if (CancelSupport.getDefault().isCancelled()) { return; } - if (isExceptionClass(classElement)) { + if (isExceptionClass(classElement) + || isErrorClass(classElement)) { completionResult.add(new PHPCompletionItem.ClassItem(classElement, request, false, null)); if (withConstructors) { constructorClassNames.add(classElement.getFullyQualifiedName()); @@ -904,7 +907,8 @@ private void autoCompleteExceptions(final PHPCompletionResult completionResult, if (CancelSupport.getDefault().isCancelled()) { return; } - if (isExceptionClass(inheritedClass)) { + if (isExceptionClass(inheritedClass) + || isErrorClass(inheritedClass)) { completionResult.add(new PHPCompletionItem.ClassItem(classElement, request, false, null)); if (withConstructors) { constructorClassNames.add(classElement.getFullyQualifiedName()); @@ -914,6 +918,13 @@ private void autoCompleteExceptions(final PHPCompletionResult completionResult, } } } + final Set interfaces = request.index.getInterfaces(nameQuery); + for (InterfaceElement interfaceElement : interfaces) { + if (isThrowableInterface(interfaceElement)) { + completionResult.add(new PHPCompletionItem.InterfaceItem(interfaceElement, request, false)); + break; + } + } for (QualifiedName qualifiedName : constructorClassNames) { if (CancelSupport.getDefault().isCancelled()) { return; @@ -926,6 +937,14 @@ private boolean isExceptionClass(ClassElement classElement) { return classElement.getFullyQualifiedName().toString().equals(EXCEPTION_CLASS_NAME); } + private boolean isErrorClass(ClassElement classElement) { + return classElement.getFullyQualifiedName().toString().equals(ERROR_CLASS_NAME); + } + + private boolean isThrowableInterface(InterfaceElement interfaceElement) { + return interfaceElement.getFullyQualifiedName().toString().equals(THROWABLE_INTERFACE_NAME); + } + private void autoCompleteClassNames(final PHPCompletionResult completionResult, PHPCompletionItem.CompletionRequest request, boolean endWithDoubleColon) { autoCompleteClassNames(completionResult, request, endWithDoubleColon, null); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/Type.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/Type.java index 079454b4d6ee..3ac60d510cd5 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/Type.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/Type.java @@ -111,7 +111,7 @@ private Type() { public static boolean isPrimitive(String typeName) { boolean retval = false; if (BOOL.equals(typeName) || INT.equals(typeName) - || INTEGER.equals(typeName) || FLOAT.equals(typeName) || REAL.equals(typeName) + || INTEGER.equals(typeName) || FLOAT.equals(typeName) || ARRAY.equals(typeName) || OBJECT.equals(typeName) || MIXED.equals(typeName) || NUMBER.equals(typeName) || CALLBACK.equals(typeName) || RESOURCE.equals(typeName) || DOUBLE.equals(typeName) || STRING.equals(typeName) || NULL.equals(typeName) @@ -125,7 +125,7 @@ public static boolean isPrimitive(String typeName) { public static boolean isPrimitiveAlias(String typeName) { boolean retval = false; - if (BOOLEAN.equals(typeName)) { + if (BOOLEAN.equals(typeName) || REAL.equals(typeName)) { retval = true; } return retval; diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java index 82660b7a5a0c..ed1e4c928b14 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java @@ -19,7 +19,7 @@ //---------------------------------------------------- // The following code was generated by CUP v0.11a beta 20060608 -// Sat Dec 09 20:59:16 JST 2023 +// Tue May 14 21:41:03 NOVT 2024 //---------------------------------------------------- package org.netbeans.modules.php.editor.parser; @@ -30,7 +30,7 @@ import org.openide.util.Pair; /** CUP v0.11a beta 20060608 generated parser. - * @version Sat Dec 09 20:59:16 JST 2023 + * @version Tue May 14 21:41:03 NOVT 2024 */ @org.netbeans.api.annotations.common.SuppressWarnings({"EI_EXPOSE_REP", "MS_PKGPROTECT", "BC_BAD_CAST_TO_CONCRETE_COLLECTION"}) public class ASTPHP5Parser extends java_cup.runtime.lr_parser { @@ -11184,7 +11184,7 @@ public final java_cup.runtime.Symbol fakeMethod400to499( int exprright = ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()).right; Expression expr = (Expression)((java_cup.runtime.Symbol) CUP$ASTPHP5Parser$stack.peek()).value; - RESULT = new CastExpression(tokenleft, exprright, expr , CastExpression.Type.REAL); + RESULT = new CastExpression(tokenleft, exprright, expr , CastExpression.Type.FLOAT); CUP$ASTPHP5Parser$result = parser.getSymbolFactory().newSymbol("expr_without_variable_and_class_instance",53, ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.elementAt(CUP$ASTPHP5Parser$top-1)), ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()), RESULT); } @@ -12805,7 +12805,7 @@ public final java_cup.runtime.Symbol fakeMethod500to599( int scalarright = ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()).right; String scalar = (String)((java_cup.runtime.Symbol) CUP$ASTPHP5Parser$stack.peek()).value; - Scalar s = new Scalar(scalarleft, scalarright, scalar, Scalar.Type.REAL); + Scalar s = new Scalar(scalarleft, scalarright, scalar, Scalar.Type.FLOAT); RESULT = s; CUP$ASTPHP5Parser$result = parser.getSymbolFactory().newSymbol("common_scalar",58, ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()), RESULT); @@ -16735,7 +16735,7 @@ public final java_cup.runtime.Symbol fakeMethod700to799( int numright = ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()).right; String num = (String)((java_cup.runtime.Symbol) CUP$ASTPHP5Parser$stack.peek()).value; - Scalar scalar = new Scalar(numleft,numright, num, Scalar.Type.REAL); + Scalar scalar = new Scalar(numleft,numright, num, Scalar.Type.FLOAT); RESULT = scalar; CUP$ASTPHP5Parser$result = parser.getSymbolFactory().newSymbol("encaps_var_offset",100, ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()), RESULT); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Symbols.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Symbols.java index 73864e60237c..f14f2512ccf4 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Symbols.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Symbols.java @@ -19,7 +19,7 @@ //---------------------------------------------------- // The following code was generated by CUP v0.11a beta 20060608 -// Sat Dec 09 20:59:16 JST 2023 +// Tue May 14 21:41:03 NOVT 2024 //---------------------------------------------------- package org.netbeans.modules.php.editor.parser; diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Block.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Block.java index b0624a186f2a..5bcbe6cc14e6 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Block.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Block.java @@ -46,7 +46,7 @@ private Block(int start, int end, Statement[] statements, boolean isCurly) { } public Block(int start, int end, List statements, boolean isCurly) { - this(start, end, statements == null ? new Statement[0] : (Statement[]) statements.toArray(new Statement[0]), isCurly); + this(start, end, statements == null ? new Statement[0] : statements.toArray(new Statement[0]), isCurly); } public Block(int start, int end, List statements) { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/CastExpression.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/CastExpression.java index 808316bc4ad1..d698f28ab70c 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/CastExpression.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/CastExpression.java @@ -27,12 +27,17 @@ public class CastExpression extends Expression { public enum Type { INT, // 'int' + /** + * @deprecated will be removed in the future, to follow PHP type system, + * use {@link Type#FLOAT} instead + */ REAL, // 'real' STRING, // 'string' ARRAY, // 'array' OBJECT, // 'object' BOOL, // 'bool' - UNSET// 'unset' + UNSET,// 'unset' + FLOAT, // 'float' } private Expression expression; diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/FunctionDeclaration.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/FunctionDeclaration.java index 855958318733..bb5cec4a9b69 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/FunctionDeclaration.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/FunctionDeclaration.java @@ -61,7 +61,7 @@ private FunctionDeclaration(int start, int end, Identifier functionName, FormalP } private FunctionDeclaration(int start, int end, Identifier functionName, List formalParameters, Expression returnType, Block body, boolean isReference, List attributes) { - this(start, end, functionName, (FormalParameter[]) formalParameters.toArray(new FormalParameter[0]), returnType, body, isReference, attributes); + this(start, end, functionName, formalParameters.toArray(new FormalParameter[0]), returnType, body, isReference, attributes); } public FunctionDeclaration(int start, int end, Identifier functionName, List formalParameters, Expression returnType, Block body, boolean isReference) { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Scalar.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Scalar.java index 693733d20787..cd70b0cbdda2 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Scalar.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Scalar.java @@ -29,11 +29,15 @@ public class Scalar extends Expression { public enum Type { INT, // 'int' + /** + * @deprecated will be removed in the future, to follow PHP type system, + * use {@link Type#FLOAT} instead + */ REAL, // 'real' STRING, // 'string' UNKNOWN, // unknown scalar in quote expression - SYSTEM // system scalars (__CLASS__ / ...) - + SYSTEM, // system scalars (__CLASS__ / ...) + FLOAT // 'float' } // 'int' //public static final int TYPE_INT = 0; diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpCommentGenerator.java b/php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpCommentGenerator.java index 9ac7a4bcc2f5..f23dcae025c8 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpCommentGenerator.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpCommentGenerator.java @@ -542,6 +542,7 @@ public void scan(ASTNode node) { type = Type.INTEGER; break; case REAL: + case FLOAT: type = Type.FLOAT; break; case STRING: diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP54UnhandledError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP54UnhandledError.java index bd7a4b3df35c..34bdb65c0633 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP54UnhandledError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP54UnhandledError.java @@ -156,7 +156,7 @@ public void visit(Scalar node) { if (CancelSupport.getDefault().isCancelled()) { return; } - if (node.getScalarType().equals(Scalar.Type.REAL) && node.getStringValue().startsWith(BINARY_PREFIX)) { + if ((node.getScalarType().equals(Scalar.Type.FLOAT) || node.getScalarType().equals(Scalar.Type.REAL)) && node.getStringValue().startsWith(BINARY_PREFIX)) { createError(node); } if (node.getScalarType().equals(Scalar.Type.SYSTEM) && "__TRAIT__".equals(node.getStringValue())) { // NOI18N diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP74UnhandledError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP74UnhandledError.java index fdd2e7b9e580..fdf32e2cc379 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP74UnhandledError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP74UnhandledError.java @@ -149,6 +149,7 @@ private void checkUnpackableArrayElement(UnpackableArrayElement node) { private void checkNumericLiteralSeparator(Scalar node) { if (node.getScalarType() == Scalar.Type.INT + || node.getScalarType() == Scalar.Type.FLOAT || node.getScalarType() == Scalar.Type.REAL) { if (node.getStringValue().contains("_")) { // NOI18N createError(node); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP81UnhandledError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP81UnhandledError.java index 5c9eb9f5b54b..d502b4598280 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP81UnhandledError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP81UnhandledError.java @@ -252,6 +252,7 @@ private void checkExplicitOctalNotation(Scalar scalar) { private boolean isNumber(Scalar scalar) { return scalar.getScalarType() == Scalar.Type.INT + || scalar.getScalarType() == Scalar.Type.FLOAT || scalar.getScalarType() == Scalar.Type.REAL; } diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/TextSearchQuery.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/TextSearchQuery.pass index 9f0e6538aa37..222b5d0b7063 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/TextSearchQuery.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/TextSearchQuery.pass @@ -16986,7 +16986,7 @@ - + @@ -17102,7 +17102,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_01.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_01.pass index b902f7f77462..3da29bdc371d 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_01.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_01.pass @@ -28,7 +28,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_02.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_02.pass index e5e90dd5bd6a..4eb78bc823e0 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_02.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_02.pass @@ -28,7 +28,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_03.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_03.pass index a99d4b6f719d..e87f0faa6d7d 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_03.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/binaryNotation_03.pass @@ -28,7 +28,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/issueGH5933_01.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/issueGH5933_01.pass index 7c82547b524a..4b3129371aab 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/issueGH5933_01.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/issueGH5933_01.pass @@ -449,7 +449,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/netbeans1563_03.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/netbeans1563_03.pass index be326e27a81f..cde4b5058889 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/netbeans1563_03.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/netbeans1563_03.pass @@ -54,7 +54,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/numericLiteralSeparatorParseError_03.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/numericLiteralSeparatorParseError_03.pass index c2c270f6296a..a95258f4a6cb 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/numericLiteralSeparatorParseError_03.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/numericLiteralSeparatorParseError_03.pass @@ -25,7 +25,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/numericLiteralSeparator_01.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/numericLiteralSeparator_01.pass index 2b4174ead5d2..14d525c0f615 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/numericLiteralSeparator_01.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/numericLiteralSeparator_01.pass @@ -296,7 +296,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -312,7 +312,7 @@ - + @@ -332,34 +332,34 @@ - + - + - + - + - + - + - + - + - + - + @@ -371,22 +371,22 @@ - + - + - + - + - + - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/typedPropertiesClass.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/typedPropertiesClass.pass index db75ee66dd24..043975e3fe3b 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/typedPropertiesClass.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/typedPropertiesClass.pass @@ -689,7 +689,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/typedPropertiesTrait.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/typedPropertiesTrait.pass index d999bed42b31..1f5363c84c3d 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/typedPropertiesTrait.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php74/typedPropertiesTrait.pass @@ -685,7 +685,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php81/explicitOctalIntegerLiteralNotationParseError_03.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php81/explicitOctalIntegerLiteralNotationParseError_03.pass index 7624c3300fd1..e584f61480f4 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php81/explicitOctalIntegerLiteralNotationParseError_03.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php81/explicitOctalIntegerLiteralNotationParseError_03.pass @@ -25,7 +25,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php81/explicitOctalIntegerLiteralNotationParseError_05.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php81/explicitOctalIntegerLiteralNotationParseError_05.pass index ce8a9cd9909e..53fea71589de 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php81/explicitOctalIntegerLiteralNotationParseError_05.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php81/explicitOctalIntegerLiteralNotationParseError_05.pass @@ -21,7 +21,7 @@ - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php83/typedClassConstants_01.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php83/typedClassConstants_01.pass index 817aea5a99f2..7bd482ea53c0 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php83/typedClassConstants_01.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php83/typedClassConstants_01.pass @@ -1328,7 +1328,7 @@ - + diff --git a/nbi/engine/src/org/netbeans/installer/downloader/services/EmptyQueueListener.java b/php/php.editor/test/unit/data/testfiles/actions/testGH7546/testGH7546.php similarity index 52% rename from nbi/engine/src/org/netbeans/installer/downloader/services/EmptyQueueListener.java rename to php/php.editor/test/unit/data/testfiles/actions/testGH7546/testGH7546.php index 981841f42cf0..6982ca0ce2ff 100644 --- a/nbi/engine/src/org/netbeans/installer/downloader/services/EmptyQueueListener.java +++ b/php/php.editor/test/unit/data/testfiles/actions/testGH7546/testGH7546.php @@ -1,3 +1,4 @@ +<cannot be resolved> + \NS1\TestClass + \NS1\TestEnum + \NS1\TestInterface + \NS1\TestTrait + \NS1\Sub1\Sub2\Sub3\TestInterface + \NS1\Sub1\Sub2\Sub3\func + +Names: + CONSTANT + NS1\Sub1\TestClass + TestClass + TestEnum + TestInterface + TestTrait + \NS1\Sub1\Sub2\Sub3\TestInterface + func + +Variants: + \NS1\CONSTANT + \NS1\Sub1\Sub2\Sub3\CONSTANT + Don't import. + + <cannot be resolved> + + \NS1\Sub1\Sub2\Sub3\TestClass + \NS1\TestClass + Don't import. + + \NS1\Sub1\Sub2\Sub3\TestEnum + \NS1\TestEnum + Don't import. + + \NS1\Sub1\Sub2\Sub3\TestInterface + \NS1\TestInterface + Don't import. + + \NS1\Sub1\Sub2\Sub3\TestTrait + \NS1\TestTrait + Don't import. + + \NS1\Sub1\Sub2\Sub3\TestInterface + Don't import. + + \NS1\func + \NS1\Sub1\Sub2\Sub3\func + Don't import. + diff --git a/nbi/engine/src/org/netbeans/installer/downloader/DownloadMode.java b/php/php.editor/test/unit/data/testfiles/actions/useCase_11.php similarity index 85% rename from nbi/engine/src/org/netbeans/installer/downloader/DownloadMode.java rename to php/php.editor/test/unit/data/testfiles/actions/useCase_11.php index 01e1f5d81252..5d1c29623c67 100644 --- a/nbi/engine/src/org/netbeans/installer/downloader/DownloadMode.java +++ b/php/php.editor/test/unit/data/testfiles/actions/useCase_11.php @@ -1,3 +1,4 @@ + diff --git a/php/php.editor/test/unit/data/testfiles/actions/useCase_11.php.usedNames b/php/php.editor/test/unit/data/testfiles/actions/useCase_11.php.usedNames new file mode 100644 index 000000000000..9d5c3c730840 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/actions/useCase_11.php.usedNames @@ -0,0 +1,2 @@ +Name: real + real --> real:863 diff --git a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/LoadFactor.java b/php/php.editor/test/unit/data/testfiles/actions/useCase_12.php similarity index 84% rename from nbi/engine/src/org/netbeans/installer/downloader/dispatcher/LoadFactor.java rename to php/php.editor/test/unit/data/testfiles/actions/useCase_12.php index fb5832707bda..7888cbecea6c 100644 --- a/nbi/engine/src/org/netbeans/installer/downloader/dispatcher/LoadFactor.java +++ b/php/php.editor/test/unit/data/testfiles/actions/useCase_12.php @@ -1,3 +1,4 @@ + diff --git a/php/php.editor/test/unit/data/testfiles/actions/useCase_12.php.usedNames b/php/php.editor/test/unit/data/testfiles/actions/useCase_12.php.usedNames new file mode 100644 index 000000000000..7b8d40967354 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/actions/useCase_12.php.usedNames @@ -0,0 +1,2 @@ +Name: real + real --> real:860 diff --git a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/StringTemplates.java b/php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessingFloatType/testInstanceOverrideMethodWithGuessingFloatType.php similarity index 73% rename from java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/StringTemplates.java rename to php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessingFloatType/testInstanceOverrideMethodWithGuessingFloatType.php index d59ec8394e5a..67072b5f77bd 100644 --- a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/StringTemplates.java +++ b/php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessingFloatType/testInstanceOverrideMethodWithGuessingFloatType.php @@ -1,3 +1,4 @@ + +
Code completion result for source line:
+testFloatReturn|Type_01();
+(QueryType=DOCUMENTATION, prefixSearch=false, caseSensitive=true)
+METHOD     testFloatReturnType_01()        [PUBLIC]   functionGuessingFloatReturnType.php
+

Documentation:

testFloatReturnType_01


+

Returns:

+ +
Type:float
diff --git a/php/php.editor/test/unit/data/testfiles/completion/documentation/functionGuessingFloatReturnType.php.testFunctionGuessingFloatReturnType_02.html b/php/php.editor/test/unit/data/testfiles/completion/documentation/functionGuessingFloatReturnType.php.testFunctionGuessingFloatReturnType_02.html new file mode 100644 index 000000000000..fd6e2ebf8410 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/documentation/functionGuessingFloatReturnType.php.testFunctionGuessingFloatReturnType_02.html @@ -0,0 +1,9 @@ + +
Code completion result for source line:
+testFloatReturnTypeWithUnion|Type_01();
+(QueryType=DOCUMENTATION, prefixSearch=false, caseSensitive=true)
+METHOD     testFloatReturnTypeWithUnionTy  [PUBLIC]   functionGuessingFloatReturnType.php
+

Documentation:

testFloatReturnTypeWithUnionType_01


+

Returns:

+ +
Type:string | float
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/gh7594/gh7594.php b/php/php.editor/test/unit/data/testfiles/completion/lib/gh7594/gh7594.php new file mode 100644 index 000000000000..ca87dd1291b5 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/lib/gh7594/gh7594.php @@ -0,0 +1,55 @@ +\n"); } + public void testFunctionGuessingFloatReturnType() throws Exception { + insertBreak( "\n", + "\n"); + } + public void testFunctionGuessingNullReturnType() throws Exception { insertBreak( " --> - -

When present as a Java agent on the boot classpath, Javeleon is invoked reflectively to enhance module reloading.

-
+

+ XXX no answer for exec-reflection +

diff --git a/platform/core.startup/nbproject/project.properties b/platform/core.startup/nbproject/project.properties index ae5e3c997727..e1e39ec5f3c6 100644 --- a/platform/core.startup/nbproject/project.properties +++ b/platform/core.startup/nbproject/project.properties @@ -21,7 +21,7 @@ javac.source=1.8 javadoc.apichanges=${basedir}/apichanges.xml module.jar.dir=core module.jar.basename=core.jar -spec.version.base=1.88.0 +spec.version.base=1.89.0 # XXX using a data dir from another module means that these tests cannot be run from testdist test-unit-sys-prop.xtest.data=${nb_all}/platform/o.n.bootstrap/test/unit/data diff --git a/platform/core.startup/src/org/netbeans/core/startup/JaveleonModuleReloader.java b/platform/core.startup/src/org/netbeans/core/startup/JaveleonModuleReloader.java deleted file mode 100644 index cbdfbef31de7..000000000000 --- a/platform/core.startup/src/org/netbeans/core/startup/JaveleonModuleReloader.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * 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.core.startup; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.zip.CRC32; -import java.util.zip.CheckedInputStream; -import javax.swing.SwingUtilities; -import org.netbeans.Events; -import org.netbeans.InvalidException; -import org.netbeans.JaveleonModule; -import org.netbeans.Module; -import org.netbeans.ModuleManager; -import org.netbeans.Util; -import org.openide.modules.Dependency; -import org.openide.util.Exceptions; - -/** - * - * @author Allan Gregersen - */ -class JaveleonModuleReloader { - - private static JaveleonModuleReloader reloader = new JaveleonModuleReloader(); - - static JaveleonModuleReloader getDefault() { - return reloader; - } - - /** This map ensures that the layer handling done by - * NBInstaller.loadLayer()is consistent with the modules - * registered with the currently installed layers. - */ - private HashMap registeredModules = new HashMap(); - - // Use JaveleonModuleReloader.getDefault() to get the singleton instance - private JaveleonModuleReloader() { - } - - boolean reloadJaveleonModule(File jar, ModuleManager mgr, NbInstaller installer, Events ev) throws IOException { - if (!JaveleonModule.incrementGlobalId()) { - // oops, we shouldn't end up in here, since Javeleon was - // supposed to be present given the above test succeeeded! - // Oh well, just fall back to normal reload operation then - return false; - } - System.err.println("Start Javeleon module update..."); - - // the existing module if any - Module m = null; - // the new updated module - JaveleonModule tm = null; - // Anything that needs to have class loaders refreshed - List dependents; - // First see if this refers to an existing module. - for (Module module : mgr.getModules()) { - if (module.getJarFile() != null) { - if (jar.equals(module.getJarFile())) { - // Hah, found it. - m = module; - tm = createJaveleonModule(mgr, jar, new ModuleHistory(jar.getAbsolutePath())); - break; - } - } - } - if(m == null) { - return false; - } - - // now find dependent modules which need to be class loader migrated - dependents = mgr.simulateJaveleonReload(m); - - // setup the class loader for the new Javeleon module - // That's all we need to do to update the module with Javeleon! - setupClassLoaderForJaveleonModule(mgr, tm); - refreshLayer(m, tm, installer, mgr); - - // OK so far, then create new Javeleon modules for the - // dependent modules and create new classloaders for - // them as well - for (Module m3 : dependents) { - File moduleJar = m3.getJarFile(); - JaveleonModule toRefresh = createJaveleonModule(mgr, moduleJar, new ModuleHistory(moduleJar.getAbsolutePath())); - setupClassLoaderForJaveleonModule(mgr, toRefresh); - refreshLayer(m3, toRefresh, installer, mgr); - } - // done... - System.err.println("Javeleon finished module update..."); - MainLookup.systemClassLoaderChanged(mgr.getClassLoader()); - ev.log(Events.FINISH_DEPLOY_TEST_MODULE, jar); - return true; - } - - private JaveleonModule createJaveleonModule(ModuleManager mgr, File jar, Object history) throws IOException { - try { - return new JaveleonModule(mgr, jar.getAbsoluteFile(), history, mgr.getEvents()); - } catch (IOException ex) { - System.err.println("EXCEPTION IN MGR.createJav..."); - throw ex; - } - } - - private void setupClassLoaderForJaveleonModule(ModuleManager mgr, JaveleonModule javeleonModule) throws InvalidException { - try { - // Calculate the parents to initialize the classloader with. - Dependency[] dependencies = javeleonModule.getDependenciesArray(); - Set parents = new HashSet(dependencies.length * 4 / 3 + 1); - for (Dependency dep : dependencies) { - if (dep.getType() != Dependency.TYPE_MODULE) { - // Token providers do *not* go into the parent classloader - // list. The providing module must have been turned on first. - // But you cannot automatically access classes from it. - continue; - } - String name = (String) Util.parseCodeName(dep.getName())[0]; - Module parent = mgr.get(name); - // Should not happen: - if (parent == null) { - throw new IOException("Parent " + name + " not found!"); // NOI18N - } - parents.add(parent); - } - javeleonModule.classLoaderUp(parents); -// classLoader.append(new ClassLoader[]{javeleonModule.getClassLoader()}); - } catch (IOException ioe) { - InvalidException ie = new InvalidException(javeleonModule, ioe.toString()); - ie.initCause(ioe); - throw ie; - } - } - - private Set getOpenTopComponents(ClassLoader loader) { - try { - Class classWindowManager = loader.loadClass("org.openide.windows.WindowManager"); - Object manager = classWindowManager.getMethod("getDefault").invoke(null); - Object registry = classWindowManager.getMethod("getRegistry").invoke(manager); - Class classRegistry = loader.loadClass("org.openide.windows.TopComponent$Registry"); - return (Set) classRegistry.getMethod("getOpened").invoke(registry); - } catch (Exception ex) { - //Exceptions.printStackTrace(ex); - return Collections.emptySet(); - } - } - - private void restoreOpenTopComponents(final ClassLoader loader, final Set openTCs) { - if (openTCs == null || openTCs.isEmpty()) { - return; - } - - // TopComponent.open must be called from the AWT thread - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - try { - Class classTopComponent = loader.loadClass("org.openide.windows.TopComponent"); - for (Object topComponent : openTCs) { - classTopComponent.getMethod("open").invoke(topComponent); - } - } catch (Exception ex) { - Exceptions.printStackTrace(ex); - } - - } - }); - } - - private void refreshLayer(Module original, Module newModule, NbInstaller installer, ModuleManager mgr) { - try { - boolean changed = layersChanged(original, newModule); - Set openTCs = null; - // Always refresh the layer. Exsitng instances created from the - // layer will be retained and their identity preserved in the updated - // module. - - if (changed) { - openTCs = getOpenTopComponents(mgr.getClassLoader()); - Module registeredModule = getAndClearRegisteredModule(original); - installer.loadLayers(Collections.singletonList(registeredModule), false); - //installer.unload(Collections.singletonList(registeredModule)); - installer.dispose(registeredModule); - } - mgr.replaceJaveleonModule(original, newModule); - - if (changed) { - installer.prepare(newModule); - installer.loadLayers(Collections.singletonList(newModule), true); - //installer.load(Collections.singletonList(newModule)); - registerModule(newModule); - - restoreOpenTopComponents(mgr.getClassLoader(), openTCs); - } - if (!changed && !(original instanceof JaveleonModule)) { - // make sure to register the original module for later unloading - // of the original module that installed the layer. - registerModule(original); - } - } - catch (InvalidException ex) { - // shouldn't happen ever - } - catch (Throwable ex) { - ex.printStackTrace(System.err); - } - } - - private boolean layersChanged(Module m1, Module m2) { - return ((CRC32Layer(m1) != CRC32Layer(m2)) || (CRC32GeneratedLayer(m1) != CRC32GeneratedLayer(m2))); - } - - private long calculateChecksum(URL layer) { - if (layer == null) { - return -1; - } - try { - InputStream is = layer.openStream(); - try { - CheckedInputStream cis = new CheckedInputStream(is, new CRC32()); - // Compute the CRC32 checksum - byte[] buf = new byte[1024]; - while (cis.read(buf) >= 0) { - } - cis.close(); - return cis.getChecksum().getValue(); - } finally { - is.close(); - } - } catch (IOException e) { - return -1; - } - } - - private long CRC32Layer(Module m) { - String layerResource = m.getManifest().getMainAttributes().getValue("OpenIDE-Module-Layer"); // NOI18N - String osgi = m.getManifest().getMainAttributes().getValue("Bundle-SymbolicName"); // NOI18N - if (layerResource != null && osgi == null) { - URL layer = m.getClassLoader().getResource(layerResource); - return calculateChecksum(layer); - } - return -1; - } - - private long CRC32GeneratedLayer(Module m) { - String layerRessource = "META-INF/generated-layer.xml"; // NOI18N - URL layer = m.getClassLoader().getResource(layerRessource); - return calculateChecksum(layer); - } - - private Module getAndClearRegisteredModule(Module original) { - return (registeredModules.containsKey(original.getCodeNameBase())) ? - registeredModules.remove(original.getCodeNameBase()) : - original; - } - - private void registerModule(Module newModule) { - registeredModules.put(newModule.getCodeNameBase(), newModule); - } - -} diff --git a/platform/core.startup/src/org/netbeans/core/startup/ModuleSystem.java b/platform/core.startup/src/org/netbeans/core/startup/ModuleSystem.java index c9ff19f87710..7408107ffa43 100644 --- a/platform/core.startup/src/org/netbeans/core/startup/ModuleSystem.java +++ b/platform/core.startup/src/org/netbeans/core/startup/ModuleSystem.java @@ -41,7 +41,6 @@ import org.netbeans.DuplicateException; import org.netbeans.Events; import org.netbeans.JarClassLoader; -import org.netbeans.JaveleonModule; import org.netbeans.Module; import org.netbeans.ModuleManager; import org.netbeans.Stamps; @@ -360,12 +359,6 @@ public void run() { */ final void deployTestModule(File jar) throws IOException { if (! jar.isAbsolute()) throw new IOException("Absolute paths only please"); // NOI18N - - // Check to see if Javeleon is enabled. If so, - // let Javeleon handle the module reloading. - if (JaveleonModule.isJaveleonPresent && JaveleonModuleReloader.getDefault().reloadJaveleonModule(jar, mgr, installer, ev)) { - return; - } mgr.mutexPrivileged().enterWriteAccess(); ev.log(Events.START_DEPLOY_TEST_MODULE, jar); @@ -384,7 +377,7 @@ final void deployTestModule(File jar) throws IOException { if (m.getJarFile() != null) { if (jar.equals(m.getJarFile())) { if (m.isAutoload() || m.isEager()) { - System.err.println("Reloading autoload and eager modules is not supported, sorry! (Try Javeleon.)"); + System.err.println("Reloading autoload and eager modules is not supported, sorry!"); return; } // Hah, found it. diff --git a/platform/core.ui/manifest.mf b/platform/core.ui/manifest.mf index e5c67301b073..ac5d3edddb5a 100644 --- a/platform/core.ui/manifest.mf +++ b/platform/core.ui/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/core/ui/resources/Bundle.properti OpenIDE-Module-Layer: org/netbeans/core/ui/resources/layer.xml AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 1.70 +OpenIDE-Module-Specification-Version: 1.71 diff --git a/platform/core.windows/manifest.mf b/platform/core.windows/manifest.mf index 5d381b0b8761..7a1f7764c274 100644 --- a/platform/core.windows/manifest.mf +++ b/platform/core.windows/manifest.mf @@ -7,4 +7,4 @@ OpenIDE-Module-Recommends: org.netbeans.core.windows.nativeaccess.NativeWindowSy OpenIDE-Module-Needs: org.netbeans.swing.tabcontrol.customtabs.TabbedComponentFactory AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 2.110 +OpenIDE-Module-Specification-Version: 2.111 diff --git a/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java b/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java index 44cda9ce607a..c36eb283f24d 100644 --- a/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java +++ b/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java @@ -267,6 +267,12 @@ public void setTitleAt(int idx, String title) { } super.setTitleAt(idx, title); + // Force update of the special "CloseButton" UI. It was observed, that + // after a change to an empty title changing to a title with content + // only works when the surrounding component is resized, forcing a + // revalidation of the terminal + getTabComponentAt(idx).revalidate(); + getTabComponentAt(idx).repaint(); } private Component findTabAt(int index) { diff --git a/platform/editor.mimelookup.impl/manifest.mf b/platform/editor.mimelookup.impl/manifest.mf index 36b5e30b4250..e635b11770ca 100644 --- a/platform/editor.mimelookup.impl/manifest.mf +++ b/platform/editor.mimelookup.impl/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.mimelookup.impl/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/mimelookup/impl/Bundle.properties OpenIDE-Module-Provides: org.netbeans.spi.editor.mimelookup.MimeDataProvider -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 diff --git a/platform/editor.mimelookup/manifest.mf b/platform/editor.mimelookup/manifest.mf index 86cc725996e6..451253cd70ad 100644 --- a/platform/editor.mimelookup/manifest.mf +++ b/platform/editor.mimelookup/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.mimelookup/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/mimelookup/Bundle.properties -OpenIDE-Module-Specification-Version: 1.65 +OpenIDE-Module-Specification-Version: 1.66 OpenIDE-Module-Recommends: org.netbeans.spi.editor.mimelookup.MimeDataProvider AutoUpdate-Essential-Module: true diff --git a/platform/favorites/manifest.mf b/platform/favorites/manifest.mf index de04b38a70db..e826e4ce6c92 100644 --- a/platform/favorites/manifest.mf +++ b/platform/favorites/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.favorites/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/favorites/Bundle.properties -OpenIDE-Module-Specification-Version: 1.71 +OpenIDE-Module-Specification-Version: 1.72 OpenIDE-Module-Layer: org/netbeans/modules/favorites/resources/layer.xml AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true diff --git a/platform/htmlui/manifest.mf b/platform/htmlui/manifest.mf index 408be8888f1a..7b9ed530f1d3 100644 --- a/platform/htmlui/manifest.mf +++ b/platform/htmlui/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.htmlui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/htmlui/impl/Bundle.properties -OpenIDE-Module-Specification-Version: 1.10 +OpenIDE-Module-Specification-Version: 1.11 diff --git a/platform/janitor/manifest.mf b/platform/janitor/manifest.mf index 01747b213159..a025f3ec7f80 100644 --- a/platform/janitor/manifest.mf +++ b/platform/janitor/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.janitor OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/janitor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.18 +OpenIDE-Module-Specification-Version: 1.19 diff --git a/platform/javahelp/manifest.mf b/platform/javahelp/manifest.mf index 18cf93fe2a56..d747fcaade99 100644 --- a/platform/javahelp/manifest.mf +++ b/platform/javahelp/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javahelp/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javahelp/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 2.66 +OpenIDE-Module-Specification-Version: 2.67 OpenIDE-Module-Provides: org.netbeans.api.javahelp.Help OpenIDE-Module-Requires: org.openide.modules.InstalledFileLocator, org.openide.modules.ModuleFormat2 OpenIDE-Module-Layer: org/netbeans/modules/javahelp/resources/layer.xml diff --git a/platform/junitlib/external/binaries-list b/platform/junitlib/external/binaries-list index 5e11f55b2410..93937706bfba 100644 --- a/platform/junitlib/external/binaries-list +++ b/platform/junitlib/external/binaries-list @@ -16,9 +16,9 @@ # under the License. 33987872A811FE4D4001ED494B07854822257F42 junit:junit:4.13.2:sources F2F3F384DACD2ADE2DDF7AA7E0F4360DFEE38672 junit:junit:4.13.2:javadoc -B281DBB5921CE56B37B6E07A2502F663CA6C8DB6 org.junit.jupiter:junit-jupiter-api:5.10.2:sources -6B1A9F9714E17D9FE9D55BF74F05F802F3833C2B org.junit.jupiter:junit-jupiter-api:5.10.2:javadoc -1ADD8E4310A408675F46EAE8ACAFE6B2B72232E5 org.junit.jupiter:junit-jupiter-params:5.10.2:sources -1884958A4A9A9CB99F55D406072CF51348CA764C org.junit.jupiter:junit-jupiter-params:5.10.2:javadoc -624F71A8D76185F2AC8D234C686BBDAB0BD28AE0 org.junit.jupiter:junit-jupiter-engine:5.10.2:sources -10135E653002732D0D2F952190EE47DC008A42EE org.junit.jupiter:junit-jupiter-engine:5.10.2:javadoc \ No newline at end of file +64C385E8817F225ED6BBF6179856DF66DC338815 org.junit.jupiter:junit-jupiter-api:5.10.3:sources +D24094F7517EABAB7654600923381E3824FC9638 org.junit.jupiter:junit-jupiter-api:5.10.3:javadoc +1C01AC91F54B36643ABB411041ABDF27C3AAD8E7 org.junit.jupiter:junit-jupiter-params:5.10.3:sources +8FDCA2E86F8D6D496FA6E348F010AA121AAE2F37 org.junit.jupiter:junit-jupiter-params:5.10.3:javadoc +698D1CF97A3400805F030D8C1E546960641C078C org.junit.jupiter:junit-jupiter-engine:5.10.3:sources +2390CB89CE1511A27187B1351E283D9389B81EAD org.junit.jupiter:junit-jupiter-engine:5.10.3:javadoc \ No newline at end of file diff --git a/platform/junitlib/external/junit-jupiter-api-5.10.2-license.txt b/platform/junitlib/external/junit-jupiter-api-5.10.3-license.txt similarity index 99% rename from platform/junitlib/external/junit-jupiter-api-5.10.2-license.txt rename to platform/junitlib/external/junit-jupiter-api-5.10.3-license.txt index 4a4c52576e52..32a4e4e0c49d 100644 --- a/platform/junitlib/external/junit-jupiter-api-5.10.2-license.txt +++ b/platform/junitlib/external/junit-jupiter-api-5.10.3-license.txt @@ -1,9 +1,9 @@ Name: JUnit Jupiter API -Version: 5.10.2 +Version: 5.10.3 License: EPL-v20 Description: JUnit Jupiter API Origin: JUnit -Files: junit-jupiter-api-5.10.2-sources.jar junit-jupiter-api-5.10.2-javadoc.jar +Files: junit-jupiter-api-5.10.3-sources.jar junit-jupiter-api-5.10.3-javadoc.jar Eclipse Public License - v 2.0 diff --git a/platform/junitlib/external/junit-jupiter-engine-5.10.2-license.txt b/platform/junitlib/external/junit-jupiter-engine-5.10.3-license.txt similarity index 99% rename from platform/junitlib/external/junit-jupiter-engine-5.10.2-license.txt rename to platform/junitlib/external/junit-jupiter-engine-5.10.3-license.txt index aaebe89cc31d..0bae4d9a70e4 100644 --- a/platform/junitlib/external/junit-jupiter-engine-5.10.2-license.txt +++ b/platform/junitlib/external/junit-jupiter-engine-5.10.3-license.txt @@ -1,9 +1,9 @@ Name: JUnit Jupiter Engine -Version: 5.10.2 +Version: 5.10.3 License: EPL-v20 Description: JUnit Jupiter Engine Origin: JUnit -Files: junit-jupiter-engine-5.10.2-sources.jar junit-jupiter-engine-5.10.2-javadoc.jar +Files: junit-jupiter-engine-5.10.3-sources.jar junit-jupiter-engine-5.10.3-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. diff --git a/platform/junitlib/external/junit-jupiter-params-5.10.2-license.txt b/platform/junitlib/external/junit-jupiter-params-5.10.3-license.txt similarity index 99% rename from platform/junitlib/external/junit-jupiter-params-5.10.2-license.txt rename to platform/junitlib/external/junit-jupiter-params-5.10.3-license.txt index fd0907b17071..f5b7ef3580b7 100644 --- a/platform/junitlib/external/junit-jupiter-params-5.10.2-license.txt +++ b/platform/junitlib/external/junit-jupiter-params-5.10.3-license.txt @@ -1,9 +1,9 @@ Name: JUnit Jupiter Params -Version: 5.10.2 +Version: 5.10.3 License: EPL-v20 Description: JUnit Jupiter Params Origin: JUnit -Files: junit-jupiter-params-5.10.2-sources.jar junit-jupiter-params-5.10.2-javadoc.jar +Files: junit-jupiter-params-5.10.3-sources.jar junit-jupiter-params-5.10.3-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. diff --git a/platform/junitlib/manifest.mf b/platform/junitlib/manifest.mf index fd779f914f6e..c20f929978d3 100644 --- a/platform/junitlib/manifest.mf +++ b/platform/junitlib/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.junitlib OpenIDE-Module-Layer: org/netbeans/modules/junitlib/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/junitlib/Bundle.properties -OpenIDE-Module-Specification-Version: 1.30 +OpenIDE-Module-Specification-Version: 1.31 diff --git a/platform/junitlib/nbproject/project.properties b/platform/junitlib/nbproject/project.properties index b5f1a0aea9af..c8192f07c093 100644 --- a/platform/junitlib/nbproject/project.properties +++ b/platform/junitlib/nbproject/project.properties @@ -19,20 +19,20 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial release.external/junit-4.13.2-sources.jar=docs/junit-4.13.2-sources.jar release.external/junit-4.13.2-javadoc.jar=docs/junit-4.13.2-javadoc.jar -release.external/junit-jupiter-api-5.10.2-sources.jar=docs/junit-jupiter-api-5.10.2-sources.jar -release.external/junit-jupiter-api-5.10.2-javadoc.jar=docs/junit-jupiter-api-5.10.2-javadoc.jar -release.external/junit-jupiter-params-5.10.2-sources.jar=docs/junit-jupiter-params-5.10.2-sources.jar -release.external/junit-jupiter-params-5.10.2-javadoc.jar=docs/junit-jupiter-params-5.10.2-javadoc.jar -release.external/junit-jupiter-engine-5.10.2-sources.jar=docs/junit-jupiter-engine-5.10.2-sources.jar -release.external/junit-jupiter-engine-5.10.2-javadoc.jar=docs/junit-jupiter-engine-5.10.2-javadoc.jar +release.external/junit-jupiter-api-5.10.3-sources.jar=docs/junit-jupiter-api-5.10.3-sources.jar +release.external/junit-jupiter-api-5.10.3-javadoc.jar=docs/junit-jupiter-api-5.10.3-javadoc.jar +release.external/junit-jupiter-params-5.10.3-sources.jar=docs/junit-jupiter-params-5.10.3-sources.jar +release.external/junit-jupiter-params-5.10.3-javadoc.jar=docs/junit-jupiter-params-5.10.3-javadoc.jar +release.external/junit-jupiter-engine-5.10.3-sources.jar=docs/junit-jupiter-engine-5.10.3-sources.jar +release.external/junit-jupiter-engine-5.10.3-javadoc.jar=docs/junit-jupiter-engine-5.10.3-javadoc.jar nbm.target.cluster=java nbm.is.global=false jnlp.indirect.jars=\ docs/junit-4.13.2-sources.jar,\ docs/junit-4.13.2-javadoc.jar,\ - docs/junit-jupiter-api-5.10.2-sources.jar,\ - docs/junit-jupiter-api-5.10.2-javadoc.jar,\ - docs/junit-jupiter-params-5.10.2-sources.jar,\ - docs/junit-jupiter-params-5.10.2-javadoc.jar,\ - docs/junit-jupiter-engine-5.10.2-sources.jar,\ - docs/junit-jupiter-engine-5.10.2-javadoc.jar + docs/junit-jupiter-api-5.10.3-sources.jar,\ + docs/junit-jupiter-api-5.10.3-javadoc.jar,\ + docs/junit-jupiter-params-5.10.3-sources.jar,\ + docs/junit-jupiter-params-5.10.3-javadoc.jar,\ + docs/junit-jupiter-engine-5.10.3-sources.jar,\ + docs/junit-jupiter-engine-5.10.3-javadoc.jar diff --git a/platform/junitlib/src/org/netbeans/modules/junitlib/Bundle.properties b/platform/junitlib/src/org/netbeans/modules/junitlib/Bundle.properties index abc11404ef70..7daa7be848fa 100644 --- a/platform/junitlib/src/org/netbeans/modules/junitlib/Bundle.properties +++ b/platform/junitlib/src/org/netbeans/modules/junitlib/Bundle.properties @@ -20,5 +20,5 @@ OpenIDE-Module-Short-Description=Bundles the JUnit testing library. OpenIDE-Module-Long-Description=\ Includes the JUnit unit testing library and corresponding library definition. Versions 4.x/5.x are included. junit_4=JUnit 4.13.2 -junit_5=JUnit 5.10.2 +junit_5=JUnit 5.10.3 hamcrest=Hamcrest 1.3 diff --git a/platform/junitlib/src/org/netbeans/modules/junitlib/junit_5.xml b/platform/junitlib/src/org/netbeans/modules/junitlib/junit_5.xml index f28c25dfbf24..57853921529b 100644 --- a/platform/junitlib/src/org/netbeans/modules/junitlib/junit_5.xml +++ b/platform/junitlib/src/org/netbeans/modules/junitlib/junit_5.xml @@ -25,29 +25,29 @@ org.netbeans.modules.junitlib.Bundle classpath - jar:nbinst://org.netbeans.libs.junit5/modules/ext/junit-jupiter-api-5.10.2.jar!/ - jar:nbinst://org.netbeans.libs.junit5/modules/ext/junit-jupiter-params-5.10.2.jar!/ - jar:nbinst://org.netbeans.libs.junit5/modules/ext/junit-jupiter-engine-5.10.2.jar!/ + jar:nbinst://org.netbeans.libs.junit5/modules/ext/junit-jupiter-api-5.10.3.jar!/ + jar:nbinst://org.netbeans.libs.junit5/modules/ext/junit-jupiter-params-5.10.3.jar!/ + jar:nbinst://org.netbeans.libs.junit5/modules/ext/junit-jupiter-engine-5.10.3.jar!/ javadoc - jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-api-5.10.2-javadoc.jar!/ - jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-params-5.10.2-javadoc.jar!/ - jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-engine-5.10.2-javadoc.jar!/ + jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-api-5.10.3-javadoc.jar!/ + jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-params-5.10.3-javadoc.jar!/ + jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-engine-5.10.3-javadoc.jar!/ src - jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-api-5.10.2-sources.jar!/ - jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-params-5.10.2-sources.jar!/ - jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-engine-5.10.2-sources.jar!/ + jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-api-5.10.3-sources.jar!/ + jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-params-5.10.3-sources.jar!/ + jar:nbinst://org.netbeans.modules.junitlib/docs/junit-jupiter-engine-5.10.3-sources.jar!/ maven-dependencies - org.junit.jupiter:junit-jupiter-api:5.10.2:jar - org.junit.jupiter:junit-jupiter-params:5.10.2:jar - org.junit.jupiter:junit-jupiter-engine:5.10.2:jar + org.junit.jupiter:junit-jupiter-api:5.10.3:jar + org.junit.jupiter:junit-jupiter-params:5.10.3:jar + org.junit.jupiter:junit-jupiter-engine:5.10.3:jar diff --git a/platform/keyring.fallback/manifest.mf b/platform/keyring.fallback/manifest.mf index 407c8ac73922..3ea144e35105 100644 --- a/platform/keyring.fallback/manifest.mf +++ b/platform/keyring.fallback/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.keyring.fallback OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/keyring/fallback/Bundle.properties -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.34 diff --git a/platform/keyring.impl/manifest.mf b/platform/keyring.impl/manifest.mf index 25fc469f128d..b746bcba6675 100644 --- a/platform/keyring.impl/manifest.mf +++ b/platform/keyring.impl/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.keyring.impl OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/keyring/impl/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 OpenIDE-Module-Provides: org.netbeans.modules.keyring.impl diff --git a/platform/keyring/manifest.mf b/platform/keyring/manifest.mf index 9d2fee4ae181..0844da809b1a 100644 --- a/platform/keyring/manifest.mf +++ b/platform/keyring/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.keyring OpenIDE-Module-Layer: org/netbeans/modules/keyring/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/keyring/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 OpenIDE-Module-Recommends: org.netbeans.modules.keyring.impl diff --git a/platform/lib.uihandler/manifest.mf b/platform/lib.uihandler/manifest.mf index 7f19a05a208b..9c2867fa98b4 100644 --- a/platform/lib.uihandler/manifest.mf +++ b/platform/lib.uihandler/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.lib.uihandler _OpenIDE-Module-Layer: org/netbeans/lib/uihandler/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/uihandler/Bundle.properties -OpenIDE-Module-Specification-Version: 1.70 +OpenIDE-Module-Specification-Version: 1.71 diff --git a/platform/libs.asm/manifest.mf b/platform/libs.asm/manifest.mf index a23aec2aaa84..3b9beb178a0d 100644 --- a/platform/libs.asm/manifest.mf +++ b/platform/libs.asm/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.asm OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/asm/Bundle.properties -OpenIDE-Module-Specification-Version: 5.28 +OpenIDE-Module-Specification-Version: 5.29 diff --git a/platform/libs.batik.read/nbproject/project.properties b/platform/libs.batik.read/nbproject/project.properties index 3e968e12c30b..28ff7bc0f2d6 100644 --- a/platform/libs.batik.read/nbproject/project.properties +++ b/platform/libs.batik.read/nbproject/project.properties @@ -55,4 +55,4 @@ javac.source=1.8 nbm.homepage=https://xmlgraphics.apache.org/batik/ sigtest.gen.fail.on.error=false -spec.version.base=1.20.0 +spec.version.base=1.21.0 diff --git a/platform/libs.felix/manifest.mf b/platform/libs.felix/manifest.mf index c5f72be2d6ee..48b523ce3f9a 100644 --- a/platform/libs.felix/manifest.mf +++ b/platform/libs.felix/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.felix OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/felix/Bundle.properties -OpenIDE-Module-Specification-Version: 2.40 +OpenIDE-Module-Specification-Version: 2.41 OpenIDE-Module-Provides: org.osgi.framework.launch.FrameworkFactory AutoUpdate-Show-In-Client: false Covered-Packages: META-INF,/MANIFEST.MF,org.netbeans.libs.felix, diff --git a/platform/libs.flatlaf/external/binaries-list b/platform/libs.flatlaf/external/binaries-list index fd8f2fc5ef0b..e78a70689b45 100644 --- a/platform/libs.flatlaf/external/binaries-list +++ b/platform/libs.flatlaf/external/binaries-list @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -C816DFDF2AC7BD55512597E4605FFCCFF840040D com.formdev:flatlaf:3.3 +8E4295F9BA5756736FA60A3A567FD9CD8840594F com.formdev:flatlaf:3.5.1 diff --git a/platform/libs.flatlaf/external/flatlaf-3.3-license.txt b/platform/libs.flatlaf/external/flatlaf-3.5.1-license.txt similarity index 99% rename from platform/libs.flatlaf/external/flatlaf-3.3-license.txt rename to platform/libs.flatlaf/external/flatlaf-3.5.1-license.txt index 9c88ca3baa96..b9c53aa7332a 100644 --- a/platform/libs.flatlaf/external/flatlaf-3.3-license.txt +++ b/platform/libs.flatlaf/external/flatlaf-3.5.1-license.txt @@ -1,7 +1,7 @@ Name: FlatLaf Look and Feel Description: FlatLaf Look and Feel -Version: 3.3 -Files: flatlaf-3.3.jar +Version: 3.5.1 +Files: flatlaf-3.5.1.jar License: Apache-2.0 Origin: FormDev Software GmbH. URL: https://www.formdev.com/flatlaf/ diff --git a/platform/libs.flatlaf/manifest.mf b/platform/libs.flatlaf/manifest.mf index 36cb0d0090a7..fd007c571ab4 100644 --- a/platform/libs.flatlaf/manifest.mf +++ b/platform/libs.flatlaf/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/flatlaf/Bundle.properties OpenIDE-Module: org.netbeans.libs.flatlaf/1 OpenIDE-Module-Install: org/netbeans/libs/flatlaf/Installer.class -OpenIDE-Module-Specification-Version: 1.19 +OpenIDE-Module-Specification-Version: 1.20 AutoUpdate-Show-In-Client: false -OpenIDE-Module-Implementation-Version: 3.3 +OpenIDE-Module-Implementation-Version: 3.5.1 diff --git a/platform/libs.flatlaf/nbproject/project.properties b/platform/libs.flatlaf/nbproject/project.properties index 51b6d34bd92a..17136f04c6ea 100644 --- a/platform/libs.flatlaf/nbproject/project.properties +++ b/platform/libs.flatlaf/nbproject/project.properties @@ -17,7 +17,7 @@ is.autoload=true javac.compilerargs=-Xlint:unchecked -javac.source=1.8 +javac.release=8 nbm.target.cluster=platform spec.version.base.fatal.warning=false @@ -31,17 +31,17 @@ spec.version.base.fatal.warning=false # # So when FlatLaf is updated, the OpenIDE-Module-Implementation-Version entry # in manifest.mf needs to be updated to match the new FlatLaf version. -release.external/flatlaf-3.3.jar=modules/ext/flatlaf-3.3.jar +release.external/flatlaf-3.5.1.jar=modules/ext/flatlaf-3.5.1.jar # com.formdev.flatlaf.ui intentionally ommitted. # rest is equivalent to the "public" packages for friend dependencies as declared in project.xml sigtest.public.packages=com.formdev.flatlaf,com.formdev.flatlaf.themes,com.formdev.flatlaf.util -release.external/flatlaf-3.3.jar!/com/formdev/flatlaf/natives/flatlaf-windows-x86.dll=modules/lib/flatlaf-windows-x86.dll -release.external/flatlaf-3.3.jar!/com/formdev/flatlaf/natives/flatlaf-windows-x86_64.dll=modules/lib/flatlaf-windows-x86_64.dll -release.external/flatlaf-3.3.jar!/com/formdev/flatlaf/natives/flatlaf-windows-arm64.dll=modules/lib/flatlaf-windows-arm64.dll -release.external/flatlaf-3.3.jar!/com/formdev/flatlaf/natives/libflatlaf-macos-arm64.dylib=modules/lib/libflatlaf-macos-arm64.dylib -release.external/flatlaf-3.3.jar!/com/formdev/flatlaf/natives/libflatlaf-macos-x86_64.dylib=modules/lib/libflatlaf-macos-x86_64.dylib -release.external/flatlaf-3.3.jar!/com/formdev/flatlaf/natives/libflatlaf-linux-x86_64.so=modules/lib/libflatlaf-linux-x86_64.so +release.external/flatlaf-3.5.1.jar!/com/formdev/flatlaf/natives/flatlaf-windows-x86.dll=modules/lib/flatlaf-windows-x86.dll +release.external/flatlaf-3.5.1.jar!/com/formdev/flatlaf/natives/flatlaf-windows-x86_64.dll=modules/lib/flatlaf-windows-x86_64.dll +release.external/flatlaf-3.5.1.jar!/com/formdev/flatlaf/natives/flatlaf-windows-arm64.dll=modules/lib/flatlaf-windows-arm64.dll +release.external/flatlaf-3.5.1.jar!/com/formdev/flatlaf/natives/libflatlaf-macos-arm64.dylib=modules/lib/libflatlaf-macos-arm64.dylib +release.external/flatlaf-3.5.1.jar!/com/formdev/flatlaf/natives/libflatlaf-macos-x86_64.dylib=modules/lib/libflatlaf-macos-x86_64.dylib +release.external/flatlaf-3.5.1.jar!/com/formdev/flatlaf/natives/libflatlaf-linux-x86_64.so=modules/lib/libflatlaf-linux-x86_64.so jnlp.verify.excludes=\ modules/lib/flatlaf-windows-x86.dll,\ modules/lib/flatlaf-windows-x86_64.dll,\ diff --git a/platform/libs.flatlaf/nbproject/project.xml b/platform/libs.flatlaf/nbproject/project.xml index fa42c32f5d83..545d5ec04edb 100644 --- a/platform/libs.flatlaf/nbproject/project.xml +++ b/platform/libs.flatlaf/nbproject/project.xml @@ -49,8 +49,8 @@ com.formdev.flatlaf.util - ext/flatlaf-3.3.jar - external/flatlaf-3.3.jar + ext/flatlaf-3.5.1.jar + external/flatlaf-3.5.1.jar diff --git a/platform/libs.javafx/manifest.mf b/platform/libs.javafx/manifest.mf index 96690c52a515..7db63ccb0527 100644 --- a/platform/libs.javafx/manifest.mf +++ b/platform/libs.javafx/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.javafx OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/javafx/Bundle.properties -OpenIDE-Module-Specification-Version: 2.32 +OpenIDE-Module-Specification-Version: 2.33 OpenIDE-Module-Needs: org.openide.modules.jre.JavaFX OpenIDE-Module-Provides: javafx.animation, javafx.application, diff --git a/platform/libs.jna.platform/manifest.mf b/platform/libs.jna.platform/manifest.mf index 3577e100f2f4..421064ed36f6 100644 --- a/platform/libs.jna.platform/manifest.mf +++ b/platform/libs.jna.platform/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.jna.platform/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jna/platform/Bundle.properties -OpenIDE-Module-Specification-Version: 2.20 +OpenIDE-Module-Specification-Version: 2.21 diff --git a/platform/libs.jna/manifest.mf b/platform/libs.jna/manifest.mf index 732db87b5ba1..5fd32b911067 100644 --- a/platform/libs.jna/manifest.mf +++ b/platform/libs.jna/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module: org.netbeans.libs.jna/2 OpenIDE-Module-Install: org/netbeans/libs/jna/Installer.class OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jna/Bundle.properties AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 2.20 +OpenIDE-Module-Specification-Version: 2.21 diff --git a/platform/libs.jsr223/manifest.mf b/platform/libs.jsr223/manifest.mf index 7828c6108a8b..fe8f69efdeac 100644 --- a/platform/libs.jsr223/manifest.mf +++ b/platform/libs.jsr223/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.jsr223/1 -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.61 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jsr223/Bundle.properties OpenIDE-Module-Deprecated: true diff --git a/platform/libs.junit4/manifest.mf b/platform/libs.junit4/manifest.mf index 1629f6260aa8..8282be6d113f 100644 --- a/platform/libs.junit4/manifest.mf +++ b/platform/libs.junit4/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.junit4 -OpenIDE-Module-Specification-Version: 1.43 +OpenIDE-Module-Specification-Version: 1.44 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/junit4/Bundle.properties diff --git a/platform/libs.junit5/external/binaries-list b/platform/libs.junit5/external/binaries-list index 214aeb34cb48..e65c0f4984e7 100644 --- a/platform/libs.junit5/external/binaries-list +++ b/platform/libs.junit5/external/binaries-list @@ -14,6 +14,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -FB55D6E2BCE173F35FD28422E7975539621055EF org.junit.jupiter:junit-jupiter-api:5.10.2 -359132C82A9D3FA87A325DB6EDD33B5FDC67A3D8 org.junit.jupiter:junit-jupiter-params:5.10.2 -F1F8FE97BD58E85569205F071274D459C2C4F8CD org.junit.jupiter:junit-jupiter-engine:5.10.2 +A22AA91D1D6C69B2020A9AEB6D095EA81132BFA5 org.junit.jupiter:junit-jupiter-api:5.10.3 +4852F4E4AF9074D9214213B199751F99EFEAB8B9 org.junit.jupiter:junit-jupiter-params:5.10.3 +48C14E866BB1A87CA35D24FF068463BB202ADA24 org.junit.jupiter:junit-jupiter-engine:5.10.3 diff --git a/platform/libs.junit5/external/junit-jupiter-5.10.2-license.txt b/platform/libs.junit5/external/junit-jupiter-5.10.3-license.txt similarity index 99% rename from platform/libs.junit5/external/junit-jupiter-5.10.2-license.txt rename to platform/libs.junit5/external/junit-jupiter-5.10.3-license.txt index e2756b7b215b..d1c886534f2d 100644 --- a/platform/libs.junit5/external/junit-jupiter-5.10.2-license.txt +++ b/platform/libs.junit5/external/junit-jupiter-5.10.3-license.txt @@ -1,10 +1,10 @@ Name: JUnit Jupiter -Version: 5.10.2 -Files: junit-jupiter-api-5.10.2.jar junit-jupiter-params-5.10.2.jar junit-jupiter-engine-5.10.2.jar +Version: 5.10.3 +Files: junit-jupiter-api-5.10.3.jar junit-jupiter-params-5.10.3.jar junit-jupiter-engine-5.10.3.jar License: EPL-v20 Description: JUnit Jupiter Origin: JUnit -URL: https://search.maven.org/search?q=g:org.junit.jupiter%20AND%20v:5.10.2 +URL: https://search.maven.org/search?q=g:org.junit.jupiter%20AND%20v:5.10.3 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. diff --git a/platform/libs.junit5/manifest.mf b/platform/libs.junit5/manifest.mf index 7a3c47150840..db6650340cd3 100644 --- a/platform/libs.junit5/manifest.mf +++ b/platform/libs.junit5/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.junit5 -OpenIDE-Module-Specification-Version: 1.22 +OpenIDE-Module-Specification-Version: 1.23 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/junit5/Bundle.properties diff --git a/platform/libs.junit5/nbproject/project.properties b/platform/libs.junit5/nbproject/project.properties index 9625476820f7..550a40fdeac1 100644 --- a/platform/libs.junit5/nbproject/project.properties +++ b/platform/libs.junit5/nbproject/project.properties @@ -16,9 +16,9 @@ # under the License. is.autoload=true -release.external/junit-jupiter-api-5.10.2.jar=modules/ext/junit-jupiter-api-5.10.2.jar -release.external/junit-jupiter-params-5.10.2.jar=modules/ext/junit-jupiter-params-5.10.2.jar -release.external/junit-jupiter-engine-5.10.2.jar=modules/ext/junit-jupiter-engine-5.10.2.jar +release.external/junit-jupiter-api-5.10.3.jar=modules/ext/junit-jupiter-api-5.10.3.jar +release.external/junit-jupiter-params-5.10.3.jar=modules/ext/junit-jupiter-params-5.10.3.jar +release.external/junit-jupiter-engine-5.10.3.jar=modules/ext/junit-jupiter-engine-5.10.3.jar nbm.target.cluster=platform sigtest.skip.check=true sigtest.fail.on.error=false diff --git a/platform/libs.junit5/nbproject/project.xml b/platform/libs.junit5/nbproject/project.xml index 6da355a91d22..e8194d6d1e71 100644 --- a/platform/libs.junit5/nbproject/project.xml +++ b/platform/libs.junit5/nbproject/project.xml @@ -43,16 +43,16 @@ org.junit.jupiter.engine.script - ext/junit-jupiter-api-5.10.2.jar - external/junit-jupiter-api-5.10.2.jar + ext/junit-jupiter-api-5.10.3.jar + external/junit-jupiter-api-5.10.3.jar - ext/junit-jupiter-params-5.10.2.jar - external/junit-jupiter-params-5.10.2.jar + ext/junit-jupiter-params-5.10.3.jar + external/junit-jupiter-params-5.10.3.jar - ext/junit-jupiter-engine-5.10.2.jar - external/junit-jupiter-engine-5.10.2.jar + ext/junit-jupiter-engine-5.10.3.jar + external/junit-jupiter-engine-5.10.3.jar diff --git a/platform/libs.osgi/manifest.mf b/platform/libs.osgi/manifest.mf index 2fa63899751b..9339b5bc4e17 100644 --- a/platform/libs.osgi/manifest.mf +++ b/platform/libs.osgi/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.osgi OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/osgi/Bundle.properties -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 diff --git a/platform/libs.testng/manifest.mf b/platform/libs.testng/manifest.mf index 9e97d77ea993..0d279cfc3f05 100644 --- a/platform/libs.testng/manifest.mf +++ b/platform/libs.testng/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.libs.testng/1 -OpenIDE-Module-Specification-Version: 1.39 +OpenIDE-Module-Specification-Version: 1.40 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/testng/Bundle.properties diff --git a/platform/masterfs.linux/manifest.mf b/platform/masterfs.linux/manifest.mf index 3bf80bc99aa2..47bc06d2635f 100644 --- a/platform/masterfs.linux/manifest.mf +++ b/platform/masterfs.linux/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.masterfs.linux OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/masterfs/watcher/linux/Bundle.properties -OpenIDE-Module-Specification-Version: 1.38 +OpenIDE-Module-Specification-Version: 1.39 OpenIDE-Module-Requires: org.openide.modules.os.Linux OpenIDE-Module-Provides: org.netbeans.modules.masterfs.providers.Notifier diff --git a/platform/masterfs.macosx/manifest.mf b/platform/masterfs.macosx/manifest.mf index a14c1b4ddc24..6bd3f2f9f780 100644 --- a/platform/masterfs.macosx/manifest.mf +++ b/platform/masterfs.macosx/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.masterfs.macosx OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/masterfs/watcher/macosx/Bundle.properties -OpenIDE-Module-Specification-Version: 1.38 +OpenIDE-Module-Specification-Version: 1.39 OpenIDE-Module-Requires: org.openide.modules.os.MacOSX OpenIDE-Module-Provides: org.netbeans.modules.masterfs.providers.Notifier diff --git a/platform/masterfs.nio2/manifest.mf b/platform/masterfs.nio2/manifest.mf index b2bbd4f55384..3751515e8dfb 100644 --- a/platform/masterfs.nio2/manifest.mf +++ b/platform/masterfs.nio2/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.masterfs.nio2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/masterfs/watcher/nio2/Bundle.properties -OpenIDE-Module-Specification-Version: 1.40 +OpenIDE-Module-Specification-Version: 1.41 OpenIDE-Module-Provides: org.netbeans.modules.masterfs.providers.Notifier diff --git a/platform/masterfs.ui/nbproject/project.properties b/platform/masterfs.ui/nbproject/project.properties index 7d1870bac470..7f594c070a3b 100644 --- a/platform/masterfs.ui/nbproject/project.properties +++ b/platform/masterfs.ui/nbproject/project.properties @@ -17,4 +17,4 @@ is.eager=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=2.28.0 +spec.version.base=2.29.0 diff --git a/platform/masterfs.windows/manifest.mf b/platform/masterfs.windows/manifest.mf index cd8a04abb24a..5e9244ba8863 100644 --- a/platform/masterfs.windows/manifest.mf +++ b/platform/masterfs.windows/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.masterfs.windows OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/masterfs/watcher/windows/Bundle.properties OpenIDE-Module-Requires: org.openide.modules.os.Windows OpenIDE-Module-Provides: org.netbeans.modules.masterfs.providers.Notifier -OpenIDE-Module-Specification-Version: 1.41 +OpenIDE-Module-Specification-Version: 1.42 diff --git a/platform/masterfs/nbproject/project.properties b/platform/masterfs/nbproject/project.properties index 8ced37ce7844..6be6b850383f 100644 --- a/platform/masterfs/nbproject/project.properties +++ b/platform/masterfs/nbproject/project.properties @@ -35,4 +35,4 @@ test.config.stableBTD.excludes=\ **/SlowRefreshAndPriorityIOTest.class,\ **/SlowRefreshSuspendableTest.class,\ **/StatFilesTest.class -spec.version.base=2.80.0 +spec.version.base=2.81.0 diff --git a/platform/netbinox/manifest.mf b/platform/netbinox/manifest.mf index ab7d39ffb364..637c816ea893 100644 --- a/platform/netbinox/manifest.mf +++ b/platform/netbinox/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.netbinox OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/netbinox/Bundle.properties -OpenIDE-Module-Specification-Version: 1.66 +OpenIDE-Module-Specification-Version: 1.67 OpenIDE-Module-Provides: org.osgi.framework.launch.FrameworkFactory, org.netbeans.Netbinox OpenIDE-Module-Hide-Classpath-Packages: org.eclipse.core.runtime.**,org.eclipse.osgi.** Covered-Packages: META-INF,org.netbeans.modules.netbinox, diff --git a/platform/o.apache.commons.codec/build.xml b/platform/o.apache.commons.codec/build.xml index 80fab1b71079..9015d071cca8 100644 --- a/platform/o.apache.commons.codec/build.xml +++ b/platform/o.apache.commons.codec/build.xml @@ -22,13 +22,13 @@ - + - + - - + + diff --git a/platform/o.apache.commons.codec/external/binaries-list b/platform/o.apache.commons.codec/external/binaries-list index 8ea76c8c8bf4..f22d53f6ccf4 100644 --- a/platform/o.apache.commons.codec/external/binaries-list +++ b/platform/o.apache.commons.codec/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -47BD4D333FBA53406F6C6C51884DDBCA435C8862 commons-codec:commons-codec:1.16.1 +0DBE8EEF6E14460E73DA07F7B11BF994D6626355 commons-codec:commons-codec:1.17.0 diff --git a/platform/o.apache.commons.codec/external/commons-codec-1.16.1-license.txt b/platform/o.apache.commons.codec/external/commons-codec-1.17.0-license.txt similarity index 99% rename from platform/o.apache.commons.codec/external/commons-codec-1.16.1-license.txt rename to platform/o.apache.commons.codec/external/commons-codec-1.17.0-license.txt index a078057ab2fd..955633fa4d92 100644 --- a/platform/o.apache.commons.codec/external/commons-codec-1.16.1-license.txt +++ b/platform/o.apache.commons.codec/external/commons-codec-1.17.0-license.txt @@ -1,7 +1,7 @@ Name: Apache Commons Codec Description: General encoding/decoding algorithms (for example phonetic, base64, URL). Origin: https://commons.apache.org/proper/commons-codec/ -Version: 1.16.1 +Version: 1.17.0 License: Apache-2.0 Apache License diff --git a/platform/o.apache.commons.codec/external/commons-codec-1.16.1-notice.txt b/platform/o.apache.commons.codec/external/commons-codec-1.17.0-notice.txt similarity index 100% rename from platform/o.apache.commons.codec/external/commons-codec-1.16.1-notice.txt rename to platform/o.apache.commons.codec/external/commons-codec-1.17.0-notice.txt diff --git a/platform/o.apache.commons.codec/manifest.mf b/platform/o.apache.commons.codec/manifest.mf index 385eebec05ec..27a4170bed20 100644 --- a/platform/o.apache.commons.codec/manifest.mf +++ b/platform/o.apache.commons.codec/manifest.mf @@ -1,2 +1,2 @@ OpenIDE-Module: org.apache.commons.codec -OpenIDE-Module-Specification-Version: 1.32 +OpenIDE-Module-Specification-Version: 1.33 diff --git a/platform/o.apache.commons.codec/nbproject/project.xml b/platform/o.apache.commons.codec/nbproject/project.xml index 8458596d70e2..894b9e5b9450 100644 --- a/platform/o.apache.commons.codec/nbproject/project.xml +++ b/platform/o.apache.commons.codec/nbproject/project.xml @@ -28,7 +28,7 @@ org-apache-commons-codec.jar - external/commons-codec-1.16.1.jar + external/commons-codec-1.17.0.jar diff --git a/platform/o.apache.commons.commons_io/external/binaries-list b/platform/o.apache.commons.commons_io/external/binaries-list index d1f8238274d7..c97b1f7a66be 100644 --- a/platform/o.apache.commons.commons_io/external/binaries-list +++ b/platform/o.apache.commons.commons_io/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -27875A7935F1DDCC13267EB6FAE1F719E0409572 commons-io:commons-io:2.16.0 +377D592E740DC77124E0901291DBFAA6810A200E commons-io:commons-io:2.16.1 diff --git a/platform/o.apache.commons.commons_io/external/commons-io-2.16.0-license.txt b/platform/o.apache.commons.commons_io/external/commons-io-2.16.1-license.txt similarity index 99% rename from platform/o.apache.commons.commons_io/external/commons-io-2.16.0-license.txt rename to platform/o.apache.commons.commons_io/external/commons-io-2.16.1-license.txt index 2278c502f08d..92962a2eaae5 100644 --- a/platform/o.apache.commons.commons_io/external/commons-io-2.16.0-license.txt +++ b/platform/o.apache.commons.commons_io/external/commons-io-2.16.1-license.txt @@ -1,7 +1,7 @@ Name: Apache Commons IO Description: Assist with developing IO functionality Origin: Apache Software Foundation -Version: 2.16.0 +Version: 2.16.1 License: Apache-2.0 URL: https://commons.apache.org/proper/commons-io/ diff --git a/platform/o.apache.commons.commons_io/external/commons-io-2.16.0-notice.txt b/platform/o.apache.commons.commons_io/external/commons-io-2.16.1-notice.txt similarity index 100% rename from platform/o.apache.commons.commons_io/external/commons-io-2.16.0-notice.txt rename to platform/o.apache.commons.commons_io/external/commons-io-2.16.1-notice.txt diff --git a/platform/o.apache.commons.commons_io/manifest.mf b/platform/o.apache.commons.commons_io/manifest.mf index f307a27cda8b..1232dea6385d 100644 --- a/platform/o.apache.commons.commons_io/manifest.mf +++ b/platform/o.apache.commons.commons_io/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.apache.commons.commons_io OpenIDE-Module-Localizing-Bundle: org/apache/commons/commons_io/Bundle.properties -OpenIDE-Module-Specification-Version: 2.16 +OpenIDE-Module-Specification-Version: 2.17 diff --git a/platform/o.apache.commons.commons_io/nbproject/project.properties b/platform/o.apache.commons.commons_io/nbproject/project.properties index 919205842b22..c85dac5a27f2 100644 --- a/platform/o.apache.commons.commons_io/nbproject/project.properties +++ b/platform/o.apache.commons.commons_io/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.8 -release.external/commons-io-2.16.0.jar=modules/ext/commons-io-2.16.0.jar +release.external/commons-io-2.16.1.jar=modules/ext/commons-io-2.16.1.jar is.autoload=true nbm.module.author=Tomas Stupka #generics related sig validation failure diff --git a/platform/o.apache.commons.commons_io/nbproject/project.xml b/platform/o.apache.commons.commons_io/nbproject/project.xml index 034ecc161d68..00a248952f64 100644 --- a/platform/o.apache.commons.commons_io/nbproject/project.xml +++ b/platform/o.apache.commons.commons_io/nbproject/project.xml @@ -58,8 +58,8 @@ org.apache.commons.io.serialization - ext/commons-io-2.16.0.jar - external/commons-io-2.16.0.jar + ext/commons-io-2.16.1.jar + external/commons-io-2.16.1.jar diff --git a/platform/o.apache.commons.lang3/manifest.mf b/platform/o.apache.commons.lang3/manifest.mf index ae138d211504..26596611919c 100644 --- a/platform/o.apache.commons.lang3/manifest.mf +++ b/platform/o.apache.commons.lang3/manifest.mf @@ -1,2 +1,2 @@ OpenIDE-Module: org.apache.commons.lang3 -OpenIDE-Module-Specification-Version: 1.20 +OpenIDE-Module-Specification-Version: 1.21 diff --git a/platform/o.apache.commons.logging/build.xml b/platform/o.apache.commons.logging/build.xml index 0dd558349d1f..fcb4f3848be0 100644 --- a/platform/o.apache.commons.logging/build.xml +++ b/platform/o.apache.commons.logging/build.xml @@ -27,9 +27,9 @@ the original commons-logging. --> - + - + - + diff --git a/platform/o.apache.commons.logging/external/binaries-list b/platform/o.apache.commons.logging/external/binaries-list index f7e57836814d..4b53016932c6 100644 --- a/platform/o.apache.commons.logging/external/binaries-list +++ b/platform/o.apache.commons.logging/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -8CFF7DC1E492911F3DD7640EBFB60D6206A1DD40 commons-logging:commons-logging:1.3.1 +580AD1A4F34876C4F964C083361DE31B3D60BE68 commons-logging:commons-logging:1.3.3 diff --git a/ide/c.google.gson/external/gson-2.8.9-license.txt b/platform/o.apache.commons.logging/external/commons-logging-1.3.3-license.txt similarity index 98% rename from ide/c.google.gson/external/gson-2.8.9-license.txt rename to platform/o.apache.commons.logging/external/commons-logging-1.3.3-license.txt index 2619e5f7cc1f..f2dec05d88b4 100644 --- a/ide/c.google.gson/external/gson-2.8.9-license.txt +++ b/platform/o.apache.commons.logging/external/commons-logging-1.3.3-license.txt @@ -1,8 +1,9 @@ -Name: GSon -Description: JSon serialization/deserialization library -Origin: GitHub -Version: 2.8.9 +Name: Apache Jakarta Commons Logging +Origin: Apache Software Foundation +Version: 1.3.3 License: Apache-2.0 +Description: Logging component +URL: https://commons.apache.org/proper/commons-logging/ Apache License Version 2.0, January 2004 diff --git a/platform/o.apache.commons.logging/external/commons-logging-1.3.3-notice.txt b/platform/o.apache.commons.logging/external/commons-logging-1.3.3-notice.txt new file mode 100644 index 000000000000..db3351bca504 --- /dev/null +++ b/platform/o.apache.commons.logging/external/commons-logging-1.3.3-notice.txt @@ -0,0 +1,5 @@ +Apache Commons Logging +Copyright 2001-2024 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (https://www.apache.org/). \ No newline at end of file diff --git a/platform/o.apache.commons.logging/manifest.mf b/platform/o.apache.commons.logging/manifest.mf index b9361a18dd6f..05aba2514910 100644 --- a/platform/o.apache.commons.logging/manifest.mf +++ b/platform/o.apache.commons.logging/manifest.mf @@ -1,2 +1,2 @@ OpenIDE-Module: org.apache.commons.logging -OpenIDE-Module-Specification-Version: 1.20 +OpenIDE-Module-Specification-Version: 1.21 diff --git a/platform/o.apache.commons.logging/nbproject/project.xml b/platform/o.apache.commons.logging/nbproject/project.xml index 976fa01a9e9c..b7ffc5fa11f6 100644 --- a/platform/o.apache.commons.logging/nbproject/project.xml +++ b/platform/o.apache.commons.logging/nbproject/project.xml @@ -28,7 +28,7 @@ org-apache-commons-logging.jar - external/commons-logging-1.3.1.jar + external/commons-logging-1.3.3.jar diff --git a/platform/o.n.bootstrap/arch.xml b/platform/o.n.bootstrap/arch.xml index 886884c08bc9..30d3d6820a47 100644 --- a/platform/o.n.bootstrap/arch.xml +++ b/platform/o.n.bootstrap/arch.xml @@ -759,9 +759,6 @@ load from JARs is rather buggy when it comes to changing or removing the JAR during the JVM session.

- -

When present as a Java agent on the boot classpath, Javeleon is invoked reflectively to enhance module reloading.

-
diff --git a/platform/o.n.bootstrap/manifest.mf b/platform/o.n.bootstrap/manifest.mf index 155251e8ae4e..e3d81eaab3cf 100644 --- a/platform/o.n.bootstrap/manifest.mf +++ b/platform/o.n.bootstrap/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.bootstrap/1 -OpenIDE-Module-Specification-Version: 2.104 +OpenIDE-Module-Specification-Version: 2.105 OpenIDE-Module-Localizing-Bundle: org/netbeans/Bundle.properties OpenIDE-Module-Recommends: org.netbeans.NetigsoFramework diff --git a/platform/o.n.bootstrap/nbproject/org-netbeans-bootstrap.sig b/platform/o.n.bootstrap/nbproject/org-netbeans-bootstrap.sig index d9d79d5876eb..11db9deb19cf 100644 --- a/platform/o.n.bootstrap/nbproject/org-netbeans-bootstrap.sig +++ b/platform/o.n.bootstrap/nbproject/org-netbeans-bootstrap.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 2.103 +#Version 2.104 CLSS public java.awt.datatransfer.Clipboard cons public init(java.lang.String) @@ -290,28 +290,6 @@ supr org.netbeans.ProxyClassLoader hfds BASE_VERSION,LOGGER,META_INF,MULTI_RELEASE,RUNTIME_VERSION,archive,cache,module,patchingBytecode,sources hcls DirSource,JarSource,JarURLStreamHandler,NbJarURLConnection,Source -CLSS public final org.netbeans.JaveleonModule -cons public init(org.netbeans.ModuleManager,java.io.File,java.lang.Object,org.netbeans.Events) throws java.io.IOException -fld public final static boolean isJaveleonPresent -meth protected java.lang.ClassLoader createNewClassLoader(java.util.List,java.util.List) -meth protected java.lang.ClassLoader getParentLoader(org.netbeans.Module) -meth protected void classLoaderDown() -meth protected void cleanup() -meth public boolean isFixed() -meth public final void reload() throws java.io.IOException -meth public java.io.File getJarFile() -meth public java.lang.Object getLocalizedAttribute(java.lang.String) -meth public java.lang.String toString() -meth public java.util.List getAllJars() -meth public java.util.jar.Manifest getManifest() -meth public static boolean incrementGlobalId() -meth public void classLoaderUp(java.util.Set) throws java.io.IOException -meth public void destroy() -meth public void releaseManifest() -meth public void setReloadable(boolean) -supr org.netbeans.Module -hfds LOG,currentClassLoaders,incrementGlobalId,registerClassLoader - CLSS public final org.netbeans.Main meth public static void finishInitialization() meth public static void main(java.lang.String[]) throws java.lang.Exception @@ -435,7 +413,6 @@ meth public java.lang.ClassLoader refineClassLoader(org.netbeans.Module,java.uti meth public java.util.Collection getAttachedFragments(org.netbeans.Module) meth public java.util.List simulateDisable(java.util.Set) meth public java.util.List simulateEnable(java.util.Set) -meth public java.util.List simulateJaveleonReload(org.netbeans.Module) meth public java.util.Set getModuleInterdependencies(org.netbeans.Module,boolean,boolean) anno 0 java.lang.Deprecated() meth public java.util.Set getModuleInterdependencies(org.netbeans.Module,boolean,boolean,boolean) @@ -455,7 +432,6 @@ meth public void disable(java.util.Set) meth public void enable(java.util.Set) throws org.netbeans.InvalidException meth public void releaseModuleManifests() meth public void reload(org.netbeans.Module) throws java.io.IOException -meth public void replaceJaveleonModule(org.netbeans.Module,org.netbeans.Module) supr org.openide.modules.Modules hfds DEPLOG,EMPTY_COLLECTION,MODULE_PROBLEMS_LOCK,MUTEX,MUTEX_PRIVILEGED,PRINT_TOPOLOGICAL_EXCEPTION_STACK_TRACES,PROBING_IN_PROCESS,addedBecauseOfDependent,bootstrapModules,changeSupport,classLoader,classLoaderLock,classLoaderPatches,completeLookup,eagerActivation,enableContext,environmentTokens,ev,firer,fragmentModules,installer,lookup,mdc,moduleFactory,moduleProblemsWithNeeds,moduleProblemsWithoutNeeds,modules,modulesByName,netigso,providersOf,readOnly,reported,reportedProblems hcls CodeNameBaseComparator,EnableContext,ModuleDataCache,ProvidersOf,SystemClassLoader diff --git a/platform/o.n.bootstrap/src/org/netbeans/JaveleonModule.java b/platform/o.n.bootstrap/src/org/netbeans/JaveleonModule.java deleted file mode 100644 index 9ae7941fb68b..000000000000 --- a/platform/o.n.bootstrap/src/org/netbeans/JaveleonModule.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author Allan Gregersen - */ -public final class JaveleonModule extends StandardModule { - - private static final Logger LOG = Logger.getLogger(JaveleonModule.class.getName()); - - public static final boolean isJaveleonPresent; - private static final Method incrementGlobalId; - private static final Method registerClassLoader; - static { - Method _incrementGlobalId = null; - Method _registerClassLoader = null; - try { - _incrementGlobalId = Class.forName("org.javeleon.reload.ReloadModule").getDeclaredMethod("incrementGlobalId"); - _registerClassLoader = Class.forName("org.javeleon.reload.ReloadFacade").getDeclaredMethod("registerClassLoader", ClassLoader.class, String.class); - } catch (ClassNotFoundException x) { - // Javeleon was not present... nothing to do then! - } catch (Exception x) { - LOG.log(Level.INFO, "Could not load Javeleon integration", x); - } - isJaveleonPresent = _incrementGlobalId != null && _registerClassLoader != null; - incrementGlobalId = _incrementGlobalId; - registerClassLoader = _registerClassLoader; - } - - public static boolean incrementGlobalId() { - assert isJaveleonPresent; - try { - incrementGlobalId.invoke(null); - return true; - } catch (Exception x) { - LOG.log(Level.INFO, "Could not reload", x); - return false; - } - } - - - /** - * Registers a module class loader according to module CNB. - * No-op if {@link #isJaveleonPresent} is false (no need to guard). - */ - static void registerClassLoader(ClassLoader loader, String codeNameBase) { - if (isJaveleonPresent) { - try { - registerClassLoader.invoke(null, loader, codeNameBase); - } catch (Exception x) { - LOG.log(Level.INFO, "Could not register " + codeNameBase, x); - } - } - } - - private static HashMap currentClassLoaders = new HashMap(); - - - public JaveleonModule(ModuleManager mgr, File jar, Object history, Events ev) throws IOException { - super(mgr, ev, jar, history, true, false, false); - setEnabled(true); - } - - @Override - protected ClassLoader createNewClassLoader(List classp, List parents) { - ClassLoader cl = super.createNewClassLoader(classp, parents); - currentClassLoaders.put(getCodeNameBase(), cl); - return cl; - } - - /** public for use from JaveleonModuleReloader */ - public @Override void classLoaderUp(Set parents) throws IOException { - super.classLoaderUp(parents); - } - - @Override - protected ClassLoader getParentLoader(Module parent) { - if(currentClassLoaders.containsKey(parent.getCodeNameBase())) - return currentClassLoaders.get(parent.getCodeNameBase()); - else - return parent.getClassLoader(); - } - - @Override - public String toString() { - return "Javeleon module " + getJarFile().toString(); - } - - @Override - protected void classLoaderDown() { - // do not touch the class loader... Javeleon system will handle it - } - - @Override - public final void reload() throws IOException { - // Javeleon will do this - } - - @Override - protected void cleanup() { - // do nothing - } - - @Override - public void destroy() { - // do nothing - } -} diff --git a/platform/o.n.bootstrap/src/org/netbeans/ModuleManager.java b/platform/o.n.bootstrap/src/org/netbeans/ModuleManager.java index 91fd7c6553ff..76eac2962833 100644 --- a/platform/o.n.bootstrap/src/org/netbeans/ModuleManager.java +++ b/platform/o.n.bootstrap/src/org/netbeans/ModuleManager.java @@ -500,16 +500,6 @@ private static void updateContextClassLoaders(ClassLoader l, boolean force) { } } - /** Only for use with Javeleon modules. */ - public void replaceJaveleonModule(Module module, Module newModule) { - assert newModule instanceof JaveleonModule; - modules.remove(module); - modulesByName.remove(module.getCodeNameBase()); - modules.add(newModule); - modulesByName.put(newModule.getCodeNameBase(), newModule); - invalidateClassLoader(); - } - private static void checkMissingModules( Set requested, List reallyEnabled ) throws InvalidException { @@ -1976,44 +1966,6 @@ private boolean couldBeEnabledWithEagers(Module m, Set willEnable, Set simulateJaveleonReload(Module moduleToReload) throws IllegalArgumentException { - Set transitiveDependents = new HashSet(20); - addToJaveleonDisableList(transitiveDependents, moduleToReload); - Map> deps = Util.moduleDependencies(transitiveDependents, modulesByName, getProvidersOf()); - try { - LinkedList orderedForEnabling = new LinkedList(); - for (Module m : Utilities.topologicalSort(transitiveDependents, deps)) { - if (m != moduleToReload) { - orderedForEnabling.addFirst(m); - } - } - return orderedForEnabling; - } catch (TopologicalSortException ex) { - return new ArrayList(transitiveDependents); - } - } - private void addToJaveleonDisableList(Set willDisable, Module m) { - if (willDisable.contains(m)) { - return; - } - willDisable.add(m); - for (Module other : modules) { - if (! other.isEnabled() || willDisable.contains(other)) { - continue; - } - Dependency[] depenencies = other.getDependenciesArray(); - for (int i = 0; i < depenencies.length; i++) { - Dependency dep = depenencies[i]; - if (dep.getType() == Dependency.TYPE_MODULE) { - if (Util.parseCodeName(dep.getName())[0].equals(m.getCodeNameBase())) { - addToJaveleonDisableList(willDisable, other); - break; - } - } - } - } - } /** Simulate what would happen if a set of modules were to be disabled. * None of the listed modules may be autoload modules, nor eager, nor currently disabled, nor fixed. diff --git a/platform/o.n.bootstrap/src/org/netbeans/StandardModule.java b/platform/o.n.bootstrap/src/org/netbeans/StandardModule.java index 9e7a4efcb65b..5d770d8460be 100644 --- a/platform/o.n.bootstrap/src/org/netbeans/StandardModule.java +++ b/platform/o.n.bootstrap/src/org/netbeans/StandardModule.java @@ -87,7 +87,7 @@ class StandardModule extends Module { /** Use ModuleManager.create as a factory. */ public StandardModule(ModuleManager mgr, Events ev, File jar, Object history, boolean reloadable, boolean autoload, boolean eager) throws IOException { - super(mgr, ev, history, JaveleonModule.isJaveleonPresent || reloadable, autoload, eager); + super(mgr, ev, history, reloadable, autoload, eager); this.jar = jar; moduleJARs.add(jar); } @@ -607,7 +607,6 @@ class OneModuleClassLoader extends JarClassLoader implements Util.ModuleProvider */ public OneModuleClassLoader(List classp, ClassLoader[] parents) throws IllegalArgumentException { super(classp, parents, false, StandardModule.this); - JaveleonModule.registerClassLoader(this, getCodeNameBase()); } public Module getModule() { diff --git a/platform/o.n.core/manifest.mf b/platform/o.n.core/manifest.mf index 65c1419fc759..3847d16b3adc 100644 --- a/platform/o.n.core/manifest.mf +++ b/platform/o.n.core/manifest.mf @@ -5,5 +5,5 @@ OpenIDE-Module-Layer: org/netbeans/core/resources/mf-layer.xml AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true OpenIDE-Module-Recommends: org.netbeans.core.ProxySettings.Reloader -OpenIDE-Module-Specification-Version: 3.76 +OpenIDE-Module-Specification-Version: 3.77 diff --git a/platform/o.n.swing.laf.dark/nbproject/project.properties b/platform/o.n.swing.laf.dark/nbproject/project.properties index 593fd9fa88aa..a87d80e53b5a 100644 --- a/platform/o.n.swing.laf.dark/nbproject/project.properties +++ b/platform/o.n.swing.laf.dark/nbproject/project.properties @@ -18,4 +18,4 @@ is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=2.20.0 +spec.version.base=2.21.0 diff --git a/platform/o.n.swing.laf.flatlaf/manifest.mf b/platform/o.n.swing.laf.flatlaf/manifest.mf index 455070cf6a91..0fad5436431a 100644 --- a/platform/o.n.swing.laf.flatlaf/manifest.mf +++ b/platform/o.n.swing.laf.flatlaf/manifest.mf @@ -3,6 +3,6 @@ OpenIDE-Module-Install: org/netbeans/swing/laf/flatlaf/Installer.class OpenIDE-Module-Layer: org/netbeans/swing/laf/flatlaf/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/laf/flatlaf/Bundle.properties OpenIDE-Module: org.netbeans.swing.laf.flatlaf -OpenIDE-Module-Specification-Version: 1.18 +OpenIDE-Module-Specification-Version: 1.19 AutoUpdate-Show-In-Client: false diff --git a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/Bundle.properties b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/Bundle.properties index fbdc275f6366..cee0a67709ef 100644 --- a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/Bundle.properties +++ b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/Bundle.properties @@ -34,7 +34,7 @@ FlatLafOptionsPanel.unifiedTitleBarCheckBox.text=&Unified window title bar FlatLafOptionsPanel.menuBarEmbeddedCheckBox.text=&Embedded menu bar FlatLafOptionsPanel.underlineMenuSelectionCheckBox.text=Use underline menu &selection FlatLafOptionsPanel.alwaysShowMnemonicsCheckBox.text=Always show &mnemonics -FlatLafOptionsPanel.showFileChooserFavoritesCheckBox.text=Show favorites in file chooser (experimental) +FlatLafOptionsPanel.showFileChooserFavoritesCheckBox.text=Show favorites in file chooser LookAndFeel.Config.displayName=Look and Feel FlatLafOptionsPanel.Advanced.title=Advanced diff --git a/platform/o.n.swing.outline/manifest.mf b/platform/o.n.swing.outline/manifest.mf index 141ec89c80fb..bfc3078c3546 100644 --- a/platform/o.n.swing.outline/manifest.mf +++ b/platform/o.n.swing.outline/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.swing.outline OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/outline/Bundle.properties -OpenIDE-Module-Specification-Version: 1.59 +OpenIDE-Module-Specification-Version: 1.60 diff --git a/platform/o.n.swing.outline/src/org/netbeans/swing/outline/Outline.java b/platform/o.n.swing.outline/src/org/netbeans/swing/outline/Outline.java index 2311076f1c52..cccc008962e0 100644 --- a/platform/o.n.swing.outline/src/org/netbeans/swing/outline/Outline.java +++ b/platform/o.n.swing.outline/src/org/netbeans/swing/outline/Outline.java @@ -801,7 +801,11 @@ public boolean editCellAt (int row, int column, EventObject e) { } boolean res = false; - if (!isTreeColumn || e instanceof MouseEvent && row >= 0 && isEditEvent(row, column, (MouseEvent) e)) { + if (!isTreeColumn || + e instanceof MouseEvent && row >= 0 && isEditEvent(row, column, (MouseEvent) e) || + // Allow F2 to be used to invoke Rename. + e instanceof ActionEvent && row >= 0) + { res = super.editCellAt(row, column, e); } if( res && isTreeColumn && row >= 0 && null != getEditorComponent() ) { diff --git a/platform/o.n.swing.plaf/manifest.mf b/platform/o.n.swing.plaf/manifest.mf index a7048a09bb19..ba06028ea98c 100644 --- a/platform/o.n.swing.plaf/manifest.mf +++ b/platform/o.n.swing.plaf/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/plaf/Bundle.properties OpenIDE-Module: org.netbeans.swing.plaf -OpenIDE-Module-Specification-Version: 1.67 +OpenIDE-Module-Specification-Version: 1.68 AutoUpdate-Show-In-Client: false diff --git a/platform/o.n.swing.tabcontrol/manifest.mf b/platform/o.n.swing.tabcontrol/manifest.mf index 88f0929cce18..836cb54ae3be 100644 --- a/platform/o.n.swing.tabcontrol/manifest.mf +++ b/platform/o.n.swing.tabcontrol/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/tabcontrol/Bundle.properties OpenIDE-Module: org.netbeans.swing.tabcontrol -OpenIDE-Module-Specification-Version: 1.82 +OpenIDE-Module-Specification-Version: 1.83 AutoUpdate-Essential-Module: true diff --git a/platform/openide.actions/manifest.mf b/platform/openide.actions/manifest.mf index 19448b01f11c..e97e1e633077 100644 --- a/platform/openide.actions/manifest.mf +++ b/platform/openide.actions/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.openide.actions OpenIDE-Module-Localizing-Bundle: org/openide/actions/Bundle.properties AutoUpdate-Essential-Module: true OpenIDE-Module-Recommends: org.openide.util.spi.SVGLoader -OpenIDE-Module-Specification-Version: 6.64 +OpenIDE-Module-Specification-Version: 6.65 diff --git a/platform/openide.awt/manifest.mf b/platform/openide.awt/manifest.mf index 78b308f71ed9..be6a84726ac4 100644 --- a/platform/openide.awt/manifest.mf +++ b/platform/openide.awt/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.awt OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 7.93 +OpenIDE-Module-Specification-Version: 7.94 diff --git a/platform/openide.awt/src/org/openide/awt/Actions.java b/platform/openide.awt/src/org/openide/awt/Actions.java index 53bc0af688aa..d5ea2db39c18 100644 --- a/platform/openide.awt/src/org/openide/awt/Actions.java +++ b/platform/openide.awt/src/org/openide/awt/Actions.java @@ -1557,7 +1557,10 @@ protected void updateButtonIcon() { return; } - if (!popup) { + /* I believe the empty icon was originally set to make the text of items with and + without icons align. But a JCheckBoxMenuItem without an icon will include its own + checkmark icon, which we want to preserve. */ + if (!popup && !(button instanceof JCheckBoxMenuItem)) { button.setIcon(ImageUtilities.loadImageIcon("org/openide/resources/actions/empty.gif", true)); // NOI18N } } diff --git a/platform/openide.awt/src/org/openide/awt/ContextAction.java b/platform/openide.awt/src/org/openide/awt/ContextAction.java index ff32d4404e52..bcdf1a6c1d6b 100644 --- a/platform/openide.awt/src/org/openide/awt/ContextAction.java +++ b/platform/openide.awt/src/org/openide/awt/ContextAction.java @@ -35,28 +35,28 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Action; -import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.openide.util.ContextAwareAction; import org.openide.util.Lookup; import org.openide.util.Mutex; -import org.openide.util.WeakListeners; /** A delegate action that is usually associated with a specific lookup and * listens on certain classes to appear and disappear there. */ -class ContextAction extends Object +class ContextAction extends Object implements Action, ContextAwareAction, ChangeListener, Runnable { //, Presenter.Menu, Presenter.Popup, Presenter.Toolbar, PropertyChangeListener { static final Logger LOG = Logger.getLogger(ContextAction.class.getName()); - + /** type to check */ final Class type; /** selection mode */ final ContextSelection selectMode; /** performer to call */ - final ContextAction.Performer performer; + final ContextAction.Performer performer; + /** performer factory to create copies of this action */ + final Supplier> performerSupplier; /** global lookup to work with */ final ContextManager global; @@ -66,7 +66,7 @@ class ContextAction extends Object /** was this action enabled or not*/ private boolean previousEnabled; - + protected final StatefulMonitor enableMonitor; /** Constructs new action that is bound to given context and @@ -74,18 +74,19 @@ class ContextAction extends Object * to right action. */ public ContextAction( - ContextAction.Performer performer, + Supplier> performerSupplier, ContextSelection selectMode, - Lookup actionContext, + Lookup actionContext, Class type, boolean surviveFocusChange, StatefulMonitor enableMonitor ) { - if (performer == null) { - throw new NullPointerException("Has to provide a key!"); // NOI18N + if (performerSupplier == null) { + throw new NullPointerException("Has to performerSupplier a key!"); // NOI18N } this.type = type; this.selectMode = selectMode; - this.performer = performer; + this.performerSupplier = performerSupplier; + this.performer = performerSupplier.get(); this.global = ContextManager.findManager(actionContext, surviveFocusChange); this.enableMonitor = enableMonitor; if (enableMonitor != null) { @@ -93,7 +94,7 @@ public ContextAction( this, enableMonitor} ); } } - + /** Overrides superclass method, adds delegate description. */ @Override public String toString() { @@ -102,10 +103,12 @@ public String toString() { /** Invoked when an action occurs. */ + @Override public void actionPerformed(final java.awt.event.ActionEvent e) { global.actionPerformed(e, performer, type, selectMode); } + @Override public boolean isEnabled() { assert EventQueue.isDispatchThread(); boolean r; @@ -117,17 +120,17 @@ public boolean isEnabled() { previousEnabled = r; return r; } - + private boolean fetchEnabledValue() { return global.runEnabled(type, selectMode, (all, everything) -> { - Supplier af = () -> (Action)performer.delegate0(everything, all, true); + Supplier af = () -> (Action)performer.delegate(everything, all); if (enableMonitor.getType() == Action.class) { // special case for monitoring the action itself Action dele = (Action)performer.delegate(everything, all); // delegate to the action return enableMonitor.enabled(Collections.singletonList(dele), () -> dele); } else if (enableMonitor.getType() != type) { - return global.runEnabled(enableMonitor.getType(), selectMode, + return global.runEnabled(enableMonitor.getType(), selectMode, (all2, everything2) -> { // run enable monitor for the other type and the original action return enableMonitor.enabled(all2, af); @@ -173,27 +176,27 @@ public synchronized void removePropertyChangeListener(PropertyChangeListener lis } } } - + protected void startListeners() { - performer.startListeners(); global.registerListener(type, this); if (enableMonitor != null) { fetchEnabledValue(); enableMonitor.addChangeListener(this); } } - + protected void stopListeners() { global.unregisterListener(type, this); - performer.stopListeners(); if (enableMonitor != null) { enableMonitor.removeChangeListener(this); } } + @Override public void putValue(String key, Object o) { } + @Override public Object getValue(String key) { if ("enabler".equals(key)) { // NOI18N // special API to support re-enablement @@ -211,9 +214,10 @@ public Object getValue(String key) { return null; } + @Override public void setEnabled(boolean b) { } - + void clearState() { performer.clear(); if (enableMonitor != null) { @@ -232,7 +236,7 @@ void updateState() { } updateStateProperties(); } - + void updateStateProperties() { boolean prev = previousEnabled; boolean now = isEnabled(); @@ -240,17 +244,17 @@ void updateStateProperties() { updateEnabledState(now); } } - + boolean wasEnabled() { return previousEnabled; } - + protected boolean isListening() { synchronized (this) { return support != null; } } - + protected void firePropertyChange(String property, Boolean old, Boolean current) { PropertyChangeSupport s; synchronized (this) { @@ -261,7 +265,7 @@ protected void firePropertyChange(String property, Boolean old, Boolean current) } s.firePropertyChange(property, old, current); } - + protected void updateEnabledState(boolean enabled) { this.previousEnabled = enabled; firePropertyChange("enabled", !enabled, enabled); // NOI18N @@ -269,8 +273,9 @@ protected void updateEnabledState(boolean enabled) { /** Clones itself with given context. */ + @Override public Action createContextAwareInstance(Lookup actionContext) { - return new ContextAction(performer, selectMode, actionContext, type, global.isSurvive(), + return new ContextAction<>(performerSupplier, selectMode, actionContext, type, global.isSurvive(), enableMonitor == null ? null : enableMonitor.createContextMonitor(actionContext)); } @@ -284,10 +289,10 @@ public boolean equals(Object obj) { if (obj == this) { return true; } - + if (obj instanceof ContextAction) { ContextAction c = (ContextAction)obj; - + return type.equals(c.type) && selectMode.equals(c.selectMode) && performer.equals(c.performer) && @@ -295,17 +300,11 @@ public boolean equals(Object obj) { } return false; } - - private static final Reference NONE = new WeakReference<>(null); - - static class Performer implements ChangeListener { + + static class Performer { final Map delegate; - Reference owner; - Reference instDelegate = null; - StatefulMonitor enabler = null; - ChangeListener weakEnableListener; - PropertyChangeListener weakActionListener; - + Reference instDelegate = null; + public Performer(Map delegate) { this.delegate = delegate; } @@ -314,14 +313,13 @@ public Performer( ContextActionPerformer p, ContextActionEnabler e ) { - Map map = new HashMap(); + Map map = new HashMap<>(); map.put("delegate", p); // NOI18N map.put("enabler", e); // NOI18N this.delegate = map; } - + void clear() { - stopListeners(); Reference r = instDelegate; instDelegate = null; if (r != null) { @@ -331,21 +329,17 @@ void clear() { } } } - - void attach(ContextAction a) { - this.owner = new WeakReference<>(a); - } - + /** - * Creates a delegate. + * Creates a delegate. * @param everything * @param data - * @return + * @return */ Object delegate(Lookup.Provider everything, List data) { return delegate0(everything, data, true); } - + private Object delegate0(Lookup.Provider everything, List data, boolean getAction) { Object d = instDelegate != null ? instDelegate.get() : null; if (d != null) { @@ -357,6 +351,9 @@ private Object delegate0(Lookup.Provider everything, List data, boolean getAc d = createDelegate(everything, data); if (d != null) { if (getAction && (d instanceof Performer)) { + // WHY?????????? + // If I'm not mistaken this is a strange way to make a + // WeakReference a hard reference. final Object fd = d; instDelegate = new WeakReference(d) { private Object hardRef = fd; }; return ((Performer)d).delegate0(everything, data, getAction); @@ -366,36 +363,10 @@ private Object delegate0(Lookup.Provider everything, List data, boolean getAc } instDelegate = new WeakReference<>(d); } else { - instDelegate = NONE; + instDelegate = null; } return d; } - - void stopListeners() { - if (enabler != null) { - enabler.removeChangeListener(weakEnableListener); - weakEnableListener = null; - } - } - - void startListeners() { - if (enabler != null) { - weakEnableListener = WeakListeners.change(this, enabler); - enabler.addChangeListener(weakEnableListener); - } - } - - /** - * Called when the manager decides that the action should not be enabled at all. - * The Performer should detach from the delegate and enabler. - */ - void detach() { - stopListeners(); - Object inst = instDelegate != null ? instDelegate.get() : null; - if (inst instanceof Action) { - ((Action)inst).removePropertyChangeListener(weakActionListener); - } - } @SuppressWarnings("unchecked") public boolean enabled(List data, Lookup.Provider everything) { @@ -409,10 +380,10 @@ public boolean enabled(List data, Lookup.Provider everything) return en.enabled(data); } - GeneralAction.LOG.warning("Wrong enabler for " + delegate + ":" + o); + GeneralAction.LOG.log(Level.WARNING, "Wrong enabler for {0}:{1}", new Object[]{delegate, o}); return false; } - + protected Object createDelegate(Lookup.Provider everything, List data) { Object obj = delegate.get("delegate"); // NOI18N if (obj instanceof ContextActionPerformer) { @@ -422,7 +393,7 @@ protected Object createDelegate(Lookup.Provider everything, List data) { return obj; } if (!(obj instanceof ActionListener)) { - GeneralAction.LOG.warning("Wrong delegate for " + delegate + ":" + obj); + GeneralAction.LOG.log(Level.WARNING, "Wrong delegate for {0}:{1}", new Object[]{delegate, obj}); } return obj; } @@ -446,7 +417,7 @@ public void actionPerformed( ((ActionListener)obj).actionPerformed(ev); } } - + @Override public int hashCode() { return delegate.hashCode() + 117; @@ -464,14 +435,6 @@ public boolean equals(Object obj) { return false; } - @Override - public void stateChanged(ChangeEvent e) { - ContextAction a = owner.get(); - if (a != null) { - a.updateState(); - } - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -489,13 +452,13 @@ public String toString() { /** * Interface between Performer and value monitors. - * @param + * @param */ static interface StatefulMonitor { public void clear(); public void addChangeListener(ChangeListener l); public void removeChangeListener(ChangeListener l); - + /** * Factory interface allows first to evaluate guard conditions, then * query action; delays action creation. @@ -504,6 +467,6 @@ static interface StatefulMonitor { public Class getType(); public StatefulMonitor createContextMonitor(Lookup context); } - + } diff --git a/platform/openide.awt/src/org/openide/awt/ContextManager.java b/platform/openide.awt/src/org/openide/awt/ContextManager.java index 6ec2a8d40721..8fb8e7805513 100644 --- a/platform/openide.awt/src/org/openide/awt/ContextManager.java +++ b/platform/openide.awt/src/org/openide/awt/ContextManager.java @@ -143,8 +143,6 @@ public boolean isEnabled(Class type, ContextSelection selectMode, Context if (e) { List all = listFromResult(result); e = enabler.enabled(all, new LkpAE(all, type)); - } else if (enabler != null) { - enabler.detach(); } } diff --git a/platform/openide.awt/src/org/openide/awt/GeneralAction.java b/platform/openide.awt/src/org/openide/awt/GeneralAction.java index c91f774772b2..3af7c62f901b 100644 --- a/platform/openide.awt/src/org/openide/awt/GeneralAction.java +++ b/platform/openide.awt/src/org/openide/awt/GeneralAction.java @@ -26,6 +26,7 @@ import java.beans.PropertyChangeSupport; import java.util.HashMap; import java.util.Map; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Action; @@ -75,7 +76,7 @@ public static ContextAwareAction callback(Map map) { } public static ContextAwareAction context( - ContextAction.Performer perf, + Supplier> perf, ContextSelection selectionType, Lookup context, Class dataType @@ -105,7 +106,6 @@ public static Action bindContext(Map map, Lookup context) { private static ContextAwareAction _context(Map map, Class dataType, Lookup context, boolean instanceReady) { ContextSelection sel = readSelection(map.get("selectionType")); // NOI18N - Performer perf = new Performer(map); boolean survive = Boolean.TRUE.equals(map.get("surviveFocusChange")); // NOI18N StatefulMonitor enableMonitor = null; StatefulMonitor checkMonitor = null; @@ -141,10 +141,10 @@ private static ContextAwareAction _context(Map map, Class dataType, Looku if (checkMonitor == null) { a = new ContextAction( - perf, sel, context, dataType, survive, enableMonitor + () -> new Performer(map), sel, context, dataType, survive, enableMonitor ); } else { - a = new StatefulAction<>(perf, sel, context, dataType, survive, enableMonitor, checkMonitor); + a = new StatefulAction<>(() -> new Performer(map), sel, context, dataType, survive, enableMonitor, checkMonitor); LOG.log(Level.FINE, "Created stateful delegate for {0}, instance {1}, value monitor {2}", new Object[] { map, a, checkMonitor }); } diff --git a/platform/openide.awt/src/org/openide/awt/StatefulAction.java b/platform/openide.awt/src/org/openide/awt/StatefulAction.java index a1bfa6932b97..184375819c08 100644 --- a/platform/openide.awt/src/org/openide/awt/StatefulAction.java +++ b/platform/openide.awt/src/org/openide/awt/StatefulAction.java @@ -20,6 +20,7 @@ import java.util.Collections; import java.util.Objects; +import java.util.function.Supplier; import java.util.logging.Level; import javax.swing.Action; import org.openide.util.Lookup; @@ -44,9 +45,9 @@ final class StatefulAction extends ContextAction { */ private boolean first = true; - public StatefulAction(Performer performer, ContextSelection selectMode, Lookup actionContext, Class type, boolean surviveFocusChange, + public StatefulAction(Supplier> performerSupplier, ContextSelection selectMode, Lookup actionContext, Class type, boolean surviveFocusChange, StatefulMonitor enableMonitor, StatefulMonitor valueMonitor) { - super(performer, selectMode, actionContext, type, surviveFocusChange, enableMonitor); + super(performerSupplier, selectMode, actionContext, type, surviveFocusChange, enableMonitor); this.checkValueMonitor = valueMonitor; } @@ -124,7 +125,8 @@ public Object getValue(String key) { public Action createContextAwareInstance(Lookup actionContext) { StatefulMonitor checkMon = checkValueMonitor.createContextMonitor(actionContext); StatefulMonitor enableMon = enableMonitor == null ? null : enableMonitor.createContextMonitor(actionContext); - Action a = new StatefulAction<>(performer, + Action a = new StatefulAction( + performerSupplier, selectMode, actionContext, type, diff --git a/platform/openide.awt/src/org/openide/awt/ToolbarWithOverflow.java b/platform/openide.awt/src/org/openide/awt/ToolbarWithOverflow.java index 1951e7741a67..f0f3552fbb76 100644 --- a/platform/openide.awt/src/org/openide/awt/ToolbarWithOverflow.java +++ b/platform/openide.awt/src/org/openide/awt/ToolbarWithOverflow.java @@ -28,8 +28,6 @@ import java.awt.Toolkit; import java.awt.event.AWTEventListener; import java.awt.event.ComponentAdapter; -import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.geom.Path2D; @@ -57,9 +55,10 @@ public class ToolbarWithOverflow extends JToolBar { private JPopupMenu popup; private JToolBar overflowToolbar; private boolean displayOverflowOnHover = true; - private final String PROP_PREF_ICON_SIZE = "PreferredIconSize"; //NOI18N - private final String PROP_DRAGGER = "_toolbar_dragger_"; //NOI18N - private final String PROP_JDEV_DISABLE_OVERFLOW = "nb.toolbar.overflow.disable"; //NOI18N + private boolean updateOverflow = false; + private static final String PROP_PREF_ICON_SIZE = "PreferredIconSize"; //NOI18N + private static final String PROP_DRAGGER = "_toolbar_dragger_"; //NOI18N + private static final String PROP_JDEV_DISABLE_OVERFLOW = "nb.toolbar.overflow.disable"; //NOI18N private AWTEventListener awtEventListener; private ComponentAdapter componentAdapter; // keep track of the overflow popup that is showing, possibly from another overflow button, in order to hide it if necessary @@ -122,18 +121,6 @@ public ToolbarWithOverflow(String name, int orientation) { overflowToolbar.setBorder(BorderFactory.createLineBorder(UIManager.getColor("controlShadow"), 1)); } - private ComponentListener getComponentListener() { - if (componentAdapter == null) { - componentAdapter = new ComponentAdapter() { - @Override - public void componentResized(ComponentEvent e) { - maybeAddOverflow(); - } - }; - } - return componentAdapter; - } - private AWTEventListener getAWTEventListener() { if (awtEventListener == null) { awtEventListener = new AWTEventListener() { @@ -180,7 +167,6 @@ public void eventDispatched(AWTEvent event) { public void addNotify() { super.addNotify(); if (!Boolean.TRUE.equals(getClientProperty(PROP_JDEV_DISABLE_OVERFLOW))) { - addComponentListener(getComponentListener()); Toolkit.getDefaultToolkit().addAWTEventListener(getAWTEventListener(), AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK); } } @@ -198,12 +184,7 @@ public void removeNotify() { @Override public void updateUI() { - Mutex.EVENT.readAccess(new Runnable() { - @Override - public void run() { - superUpdateUI(); - } - }); + Mutex.EVENT.readAccess(this::superUpdateUI); } final void superUpdateUI() { @@ -266,32 +247,35 @@ public void removeAll() { super.removeAll(); overflowToolbar.removeAll(); } - + @Override - public void validate() { - if (!Boolean.TRUE.equals(getClientProperty(PROP_JDEV_DISABLE_OVERFLOW))) { - int visibleButtons = computeVisibleButtons(); - if (visibleButtons == -1) { - handleOverflowRemoval(); - } else { - handleOverflowAddittion(visibleButtons); + public void doLayout() { + if (updateOverflow) { + updateOverflow = false; + if (!Boolean.TRUE.equals(getClientProperty(PROP_JDEV_DISABLE_OVERFLOW))) { + int visibleButtons = computeVisibleButtons(); + if (visibleButtons == -1) { + handleOverflowRemoval(); + } else { + handleOverflowAddition(visibleButtons); + } } } - super.validate(); + super.doLayout(); } - + + @Override + public void invalidate() { + updateOverflow = true; + super.invalidate(); + } + private void setupOverflowButton() { overflowButton = new JButton(getOrientation() == HORIZONTAL - ? ToolbarArrowIcon.INSTANCE_VERTICAL : ToolbarArrowIcon.INSTANCE_HORIZONTAL) - { + ? ToolbarArrowIcon.INSTANCE_VERTICAL : ToolbarArrowIcon.INSTANCE_HORIZONTAL) { @Override public void updateUI() { - Mutex.EVENT.readAccess(new Runnable() { - @Override - public void run() { - superUpdateUI(); - } - }); + Mutex.EVENT.readAccess(this::superUpdateUI); } private void superUpdateUI() { @@ -333,14 +317,6 @@ private void displayOverflow() { popup.setVisible(true); } - /** - * Determines if an overflow button should be added to or removed from the toolbar. - */ - private void maybeAddOverflow() { - validate(); - repaint(); - } - private int computeVisibleButtons() { if (isShowing()) { int w = getOrientation() == HORIZONTAL ? overflowButton.getIcon().getIconWidth() + 4 : getWidth() - getInsets().left - getInsets().right; @@ -378,9 +354,7 @@ private int computeVisibleButtons() { // overflow button needed but would not have enough space, remove one more button visibleButtons--; } - if (visibleButtons == 0 && comps.length > 0 - && comps[0] instanceof JComponent - && Boolean.TRUE.equals(((JComponent) comps[0]).getClientProperty(PROP_DRAGGER))) { + if (visibleButtons == 0 && comps.length > 0 && isDragger(comps[0])) { visibleButtons = 1; // always include the dragger if present } if (visibleButtons == showingButtons) { @@ -388,8 +362,15 @@ private int computeVisibleButtons() { } return visibleButtons; } + + private static boolean isDragger(Component c) { + return c instanceof JComponent && Boolean.TRUE.equals(((JComponent) c).getClientProperty(PROP_DRAGGER)); + } - private void handleOverflowAddittion(int visibleButtons) { + private void handleOverflowAddition(int visibleButtons) { + if (overflowToolbar.getComponentCount() > 0 && visibleButtons == getComponentCount() - 1) { + return; + } Component[] comps = getAllComponents(); removeAll(); overflowToolbar.setOrientation(getOrientation() == HORIZONTAL ? VERTICAL : HORIZONTAL); @@ -410,15 +391,16 @@ private void handleOverflowAddittion(int visibleButtons) { } private void handleOverflowRemoval() { - if (overflowToolbar.getComponents().length > 0) { - remove(overflowButton); - handleIconResize(); - for (Component comp : overflowToolbar.getComponents()) { - add(comp); - } - overflowToolbar.removeAll(); - popup.removeAll(); + if (overflowToolbar.getComponentCount() == 0) { + return; } + remove(overflowButton); + handleIconResize(); + for (Component comp : overflowToolbar.getComponents()) { + add(comp); + } + overflowToolbar.removeAll(); + popup.removeAll(); } private void handleIconResize() { @@ -427,28 +409,28 @@ private void handleIconResize() { if (smallToolbarIcons) { ((JComponent) comp).putClientProperty(PROP_PREF_ICON_SIZE, null); } else { - ((JComponent) comp).putClientProperty(PROP_PREF_ICON_SIZE, Integer.valueOf(24)); + ((JComponent) comp).putClientProperty(PROP_PREF_ICON_SIZE, 24); } } } private Component[] getAllComponents() { - Component[] toolbarComps; - Component[] overflowComps = overflowToolbar.getComponents(); - if (overflowComps.length == 0) { - toolbarComps = getComponents(); + if (overflowToolbar.getComponentCount() == 0) { + return getComponents(); } else { + Component[] toolbarComps; if (getComponentCount() > 0) { - toolbarComps = new Component[getComponents().length - 1]; + toolbarComps = new Component[getComponentCount() - 1]; System.arraycopy(getComponents(), 0, toolbarComps, 0, toolbarComps.length); } else { toolbarComps = new Component[0]; } + Component[] overflowComps = overflowToolbar.getComponents(); + Component[] comps = new Component[toolbarComps.length + overflowComps.length]; + System.arraycopy(toolbarComps, 0, comps, 0, toolbarComps.length); + System.arraycopy(overflowComps, 0, comps, toolbarComps.length, overflowComps.length); + return comps; } - Component[] comps = new Component[toolbarComps.length + overflowComps.length]; - System.arraycopy(toolbarComps, 0, comps, 0, toolbarComps.length); - System.arraycopy(overflowComps, 0, comps, toolbarComps.length, overflowComps.length); - return comps; } private static class SafeToolBar extends JToolBar { @@ -459,12 +441,7 @@ public SafeToolBar( String name, int orientation ) { @Override public void updateUI() { - Mutex.EVENT.readAccess(new Runnable() { - @Override - public void run() { - superUpdateUI(); - } - }); + Mutex.EVENT.readAccess(this::superUpdateUI); } final void superUpdateUI() { @@ -475,12 +452,7 @@ final void superUpdateUI() { private static class SafePopupMenu extends JPopupMenu { @Override public void updateUI() { - Mutex.EVENT.readAccess(new Runnable() { - @Override - public void run() { - superUpdateUI(); - } - }); + Mutex.EVENT.readAccess(this::superUpdateUI); } final void superUpdateUI() { diff --git a/platform/openide.awt/test/unit/src/org/netbeans/modules/openide/openide/awt/StatefulActionProcessorTest.java b/platform/openide.awt/test/unit/src/org/netbeans/modules/openide/awt/StatefulActionProcessorTest.java similarity index 100% rename from platform/openide.awt/test/unit/src/org/netbeans/modules/openide/openide/awt/StatefulActionProcessorTest.java rename to platform/openide.awt/test/unit/src/org/netbeans/modules/openide/awt/StatefulActionProcessorTest.java diff --git a/platform/openide.awt/test/unit/src/org/openide/awt/ContextActionTest.java b/platform/openide.awt/test/unit/src/org/openide/awt/ContextActionTest.java index 19aa4664fc28..3d144f810579 100644 --- a/platform/openide.awt/test/unit/src/org/openide/awt/ContextActionTest.java +++ b/platform/openide.awt/test/unit/src/org/openide/awt/ContextActionTest.java @@ -21,6 +21,7 @@ import java.awt.EventQueue; import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; @@ -42,6 +43,7 @@ import org.openide.util.ContextAwareAction; import org.openide.util.ContextGlobalProvider; import org.openide.util.Lookup; +import org.openide.util.NbBundle.Messages; import org.openide.util.Utilities; import org.openide.util.lookup.AbstractLookup; import org.openide.util.lookup.InstanceContent; @@ -678,8 +680,7 @@ static ContextActionEnabler getEnabler() { private static ContextAwareAction context( ContextActionPerformer a, ContextActionEnabler e, ContextSelection s, Lookup lookupProxy, Class c ) { - ContextAction.Performer perf = new ContextAction.Performer(a, e); - return GeneralAction.context(perf, s, lookupProxy, c); + return GeneralAction.context(() -> new ContextAction.Performer(a, e), s, lookupProxy, c); } public static interface Openable { @@ -924,4 +925,103 @@ public void propertyChange(PropertyChangeEvent evt) { assertTrue(listenerB.propChanges.contains(Action.SELECTED_KEY)); } + + + @ActionID(category = "test", id = "OutputTestAction") + @ActionRegistration(displayName = "Dummy", lazy = true) + public static class OutputTestAction extends AbstractAction implements ContextAwareAction { + + // Record the result string from the last action invocation + public static String actionResult; + + private Lookup ctx; + + public OutputTestAction(String text) { + this.ctx = Lookups.fixed(text); + } + + private OutputTestAction(Lookup ctx) { + this.ctx = ctx; + } + + @Override + public void actionPerformed(ActionEvent ae) { + System.out.println(this.ctx.lookup(String.class)); + actionResult = this.ctx.lookup(String.class); + } + + @Override + public Action createContextAwareInstance(Lookup actionContext) { + return new OutputTestAction(ctx); + } + + } + + public void testContextAwareInstanceInvokesWithCorrectContext() throws InterruptedException, InvocationTargetException { + OutputTestAction.actionResult = null; + + ContextAwareAction baseCAA = (ContextAwareAction) Actions.forID("test", "OutputTestAction"); + + Lookup l1 = Lookups.fixed("Lookup 1"); + Lookup l2 = Lookups.fixed("Lookup 2"); + + Action cai1 = baseCAA.createContextAwareInstance(l1); + Action cai2 = baseCAA.createContextAwareInstance(l2); + + assertNull(OutputTestAction.actionResult); + runOnEdt(() -> cai1.actionPerformed(new ActionEvent(new Object(), 1, "blah"))); + assertEquals("Lookup 1", OutputTestAction.actionResult); + runOnEdt(() -> cai2.actionPerformed(new ActionEvent(new Object(), 2, "blah"))); + assertEquals("Lookup 2", OutputTestAction.actionResult); + runOnEdt(() -> cai1.actionPerformed(new ActionEvent(new Object(), 3, "blah"))); + assertEquals("Lookup 1", OutputTestAction.actionResult); + } + + @ActionID(category = "test", id = "OutputTestAction2") + @ActionRegistration(displayName = "Dummy2") + public static class OutputTestAction2 implements ActionListener { + + // Record the result string from the last action invocation + public static String actionResult; + + private final String text; + + public OutputTestAction2(String text) { + this.text = text; + } + + @Override + public void actionPerformed(ActionEvent e) { + System.out.println(text); + actionResult = text; + } + } + + public void testActionListenerInvokesWithCorrectContext() throws InterruptedException, InvocationTargetException { + OutputTestAction2.actionResult = null; + + ContextAwareAction baseCAA = (ContextAwareAction) Actions.forID("test", "OutputTestAction2"); + + Lookup l1 = Lookups.fixed("Lookup 1"); + Lookup l2 = Lookups.fixed("Lookup 2"); + + Action cai1 = baseCAA.createContextAwareInstance(l1); + Action cai2 = baseCAA.createContextAwareInstance(l2); + + assertNull(OutputTestAction2.actionResult); + runOnEdt(() -> cai1.actionPerformed(new ActionEvent(new Object(), 1, "blah"))); + assertEquals("Lookup 1", OutputTestAction2.actionResult); + runOnEdt(() -> cai2.actionPerformed(new ActionEvent(new Object(), 2, "blah"))); + assertEquals("Lookup 2", OutputTestAction2.actionResult); + runOnEdt(() -> cai1.actionPerformed(new ActionEvent(new Object(), 3, "blah"))); + assertEquals("Lookup 1", OutputTestAction2.actionResult); + } + + private void runOnEdt(Runnable runnable) throws InterruptedException, InvocationTargetException { + if(EventQueue.isDispatchThread()) { + runnable.run(); + } else { + EventQueue.invokeAndWait(runnable); + } + } } diff --git a/platform/openide.compat/manifest.mf b/platform/openide.compat/manifest.mf index 2ee64bbeac00..bab9dbd4de3f 100644 --- a/platform/openide.compat/manifest.mf +++ b/platform/openide.compat/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.compat -OpenIDE-Module-Specification-Version: 6.65 +OpenIDE-Module-Specification-Version: 6.66 OpenIDE-Module-Deprecated: true OpenIDE-Module-Localizing-Bundle: org/openide/compat/Bundle.properties AutoUpdate-Essential-Module: true diff --git a/platform/openide.dialogs/manifest.mf b/platform/openide.dialogs/manifest.mf index 7b586a1a2a13..64e9f343872c 100644 --- a/platform/openide.dialogs/manifest.mf +++ b/platform/openide.dialogs/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.dialogs -OpenIDE-Module-Specification-Version: 7.72 +OpenIDE-Module-Specification-Version: 7.73 OpenIDE-Module-Localizing-Bundle: org/openide/Bundle.properties AutoUpdate-Essential-Module: true diff --git a/platform/openide.dialogs/src/org/openide/NotifyDescriptor.java b/platform/openide.dialogs/src/org/openide/NotifyDescriptor.java index 7628df3d8ad9..718ceaec4f50 100644 --- a/platform/openide.dialogs/src/org/openide/NotifyDescriptor.java +++ b/platform/openide.dialogs/src/org/openide/NotifyDescriptor.java @@ -1038,7 +1038,7 @@ public static class InputLine extends NotifyDescriptor { /** * Property whose value is the input text, an event is fired * when the input text's value changes, - * if enabled using {@link #setInputTextEventsEnabled(boolean) }. + * if enabled using {@link #setInputTextEventEnabled(boolean) }. * * @since 7.70 */ diff --git a/platform/openide.execution.compat8/manifest.mf b/platform/openide.execution.compat8/manifest.mf index ac4c1cbe7fc8..2a3bcd44e572 100644 --- a/platform/openide.execution.compat8/manifest.mf +++ b/platform/openide.execution.compat8/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.execution.compat8 OpenIDE-Module-Localizing-Bundle: org/openide/execution/compat8/Bundle.properties -OpenIDE-Module-Specification-Version: 9.27 +OpenIDE-Module-Specification-Version: 9.28 OpenIDE-Module-Fragment-Host: org.openide.execution diff --git a/platform/openide.execution/manifest.mf b/platform/openide.execution/manifest.mf index a827d8520662..b3ae404f55ff 100644 --- a/platform/openide.execution/manifest.mf +++ b/platform/openide.execution/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.execution -OpenIDE-Module-Specification-Version: 9.28 +OpenIDE-Module-Specification-Version: 9.29 OpenIDE-Module-Localizing-Bundle: org/openide/execution/Bundle.properties OpenIDE-Module-Recommends: org.openide.execution.ExecutionEngine AutoUpdate-Essential-Module: true diff --git a/platform/openide.explorer/manifest.mf b/platform/openide.explorer/manifest.mf index 14a24a08c53f..580d0d6a00ff 100644 --- a/platform/openide.explorer/manifest.mf +++ b/platform/openide.explorer/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.explorer OpenIDE-Module-Localizing-Bundle: org/openide/explorer/Bundle.properties AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 6.87 +OpenIDE-Module-Specification-Version: 6.88 diff --git a/platform/openide.filesystems.compat8/manifest.mf b/platform/openide.filesystems.compat8/manifest.mf index 25eef4d0bc71..7fbc926bb2e4 100644 --- a/platform/openide.filesystems.compat8/manifest.mf +++ b/platform/openide.filesystems.compat8/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.filesystems.compat8 OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/compat8/Bundle.properties -OpenIDE-Module-Specification-Version: 9.34 +OpenIDE-Module-Specification-Version: 9.35 OpenIDE-Module-Fragment-Host: org.openide.filesystems diff --git a/platform/openide.filesystems.nb/manifest.mf b/platform/openide.filesystems.nb/manifest.mf index 8be7d9f9cde2..2b040f4a368d 100644 --- a/platform/openide.filesystems.nb/manifest.mf +++ b/platform/openide.filesystems.nb/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.filesystems.nb OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/nb/Bundle.properties -OpenIDE-Module-Specification-Version: 9.35 +OpenIDE-Module-Specification-Version: 9.36 diff --git a/platform/openide.filesystems/manifest.mf b/platform/openide.filesystems/manifest.mf index b20d2168da52..ab42ef4159f5 100644 --- a/platform/openide.filesystems/manifest.mf +++ b/platform/openide.filesystems/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.filesystems OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml -OpenIDE-Module-Specification-Version: 9.38 +OpenIDE-Module-Specification-Version: 9.39 diff --git a/platform/openide.io/manifest.mf b/platform/openide.io/manifest.mf index 7692beb65a1e..62408d6d34ec 100644 --- a/platform/openide.io/manifest.mf +++ b/platform/openide.io/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.io -OpenIDE-Module-Specification-Version: 1.74 +OpenIDE-Module-Specification-Version: 1.75 OpenIDE-Module-Localizing-Bundle: org/openide/io/Bundle.properties OpenIDE-Module-Recommends: org.openide.windows.IOProvider, org.openide.windows.IOContainer$Provider AutoUpdate-Essential-Module: true diff --git a/platform/openide.loaders/manifest.mf b/platform/openide.loaders/manifest.mf index d4fcd9f53f33..48b53ef9890a 100644 --- a/platform/openide.loaders/manifest.mf +++ b/platform/openide.loaders/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.loaders -OpenIDE-Module-Specification-Version: 7.95 +OpenIDE-Module-Specification-Version: 7.96 OpenIDE-Module-Localizing-Bundle: org/openide/loaders/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.templates.v1_0 OpenIDE-Module-Layer: org/netbeans/modules/openide/loaders/layer.xml diff --git a/platform/openide.modules/manifest.mf b/platform/openide.modules/manifest.mf index 74d2facf5a29..cb27d8552e37 100644 --- a/platform/openide.modules/manifest.mf +++ b/platform/openide.modules/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.modules OpenIDE-Module-Localizing-Bundle: org/openide/modules/Bundle.properties -OpenIDE-Module-Specification-Version: 7.73 +OpenIDE-Module-Specification-Version: 7.74 diff --git a/platform/openide.nodes/manifest.mf b/platform/openide.nodes/manifest.mf index 8a0eb3897219..24464b4fb26c 100644 --- a/platform/openide.nodes/manifest.mf +++ b/platform/openide.nodes/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.nodes OpenIDE-Module-Localizing-Bundle: org/openide/nodes/Bundle.properties AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 7.70 +OpenIDE-Module-Specification-Version: 7.71 diff --git a/platform/openide.options/manifest.mf b/platform/openide.options/manifest.mf index cfa00161266a..daf62b7b6b84 100644 --- a/platform/openide.options/manifest.mf +++ b/platform/openide.options/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.options -OpenIDE-Module-Specification-Version: 6.62 +OpenIDE-Module-Specification-Version: 6.63 OpenIDE-Module-Localizing-Bundle: org/openide/options/Bundle.properties OpenIDE-Module-Deprecated: true AutoUpdate-Essential-Module: true diff --git a/platform/openide.text/manifest.mf b/platform/openide.text/manifest.mf index 5fde904277fe..30185d7e13a2 100644 --- a/platform/openide.text/manifest.mf +++ b/platform/openide.text/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.text OpenIDE-Module-Localizing-Bundle: org/openide/text/Bundle.properties AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 6.93 +OpenIDE-Module-Specification-Version: 6.94 diff --git a/platform/openide.util.lookup/manifest.mf b/platform/openide.util.lookup/manifest.mf index 05222b57780c..0591e5d5b7a8 100644 --- a/platform/openide.util.lookup/manifest.mf +++ b/platform/openide.util.lookup/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.util.lookup OpenIDE-Module-Localizing-Bundle: org/openide/util/lookup/Bundle.properties -OpenIDE-Module-Specification-Version: 8.59 +OpenIDE-Module-Specification-Version: 8.60 diff --git a/platform/openide.util.lookup/test/unit/src/org/openide/util/test/AnnotationProcessorTestUtils.java b/platform/openide.util.lookup/test/unit/src/org/openide/util/test/AnnotationProcessorTestUtils.java index d7bcabdfd45d..397ce4d2936c 100644 --- a/platform/openide.util.lookup/test/unit/src/org/openide/util/test/AnnotationProcessorTestUtils.java +++ b/platform/openide.util.lookup/test/unit/src/org/openide/util/test/AnnotationProcessorTestUtils.java @@ -94,7 +94,6 @@ public static boolean runJavac(File src, String srcIncludes, File dest, File[] c */ public static boolean runJavac(File src, String srcIncludes, File dest, File[] cp, OutputStream stderr, String source) { List args = new ArrayList(); - args.add("-classpath"); StringBuilder b = new StringBuilder(dest.getAbsolutePath()); if (cp != null) { for (File entry : cp) { @@ -104,7 +103,11 @@ public static boolean runJavac(File src, String srcIncludes, File dest, File[] c } else { b.append(File.pathSeparatorChar).append(System.getProperty("java.class.path")); } - args.add(b.toString()); + String classpath = b.toString(); + args.add("-classpath"); + args.add(classpath); + args.add("-processorpath"); + args.add(classpath); args.add("-d"); args.add(dest.getAbsolutePath()); args.add("-sourcepath"); @@ -118,6 +121,7 @@ public static boolean runJavac(File src, String srcIncludes, File dest, File[] c } else { args.add(source); } + args.add("-proc:full"); // https://inside.java/2024/06/18/quality-heads-up/ args.add("-Xlint:-options"); dest.mkdirs(); destG.mkdirs(); diff --git a/platform/openide.util.ui.svg/manifest.mf b/platform/openide.util.ui.svg/manifest.mf index a0af15c00f9d..84d24b644798 100644 --- a/platform/openide.util.ui.svg/manifest.mf +++ b/platform/openide.util.ui.svg/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.openide.util.ui.svg OpenIDE-Module-Localizing-Bundle: org/openide/util/svg/Bundle.properties -OpenIDE-Module-Specification-Version: 1.19 +OpenIDE-Module-Specification-Version: 1.20 OpenIDE-Module-Provides: org.openide.util.spi.SVGLoader diff --git a/platform/openide.util.ui/manifest.mf b/platform/openide.util.ui/manifest.mf index 1d8866d38e0a..e9f4a3e8a481 100644 --- a/platform/openide.util.ui/manifest.mf +++ b/platform/openide.util.ui/manifest.mf @@ -1,5 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.util.ui OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties -OpenIDE-Module-Specification-Version: 9.34 - +OpenIDE-Module-Specification-Version: 9.35 diff --git a/platform/openide.util.ui/nbproject/project.properties b/platform/openide.util.ui/nbproject/project.properties index 5ba993f13de2..d56fbb7147a2 100644 --- a/platform/openide.util.ui/nbproject/project.properties +++ b/platform/openide.util.ui/nbproject/project.properties @@ -16,8 +16,7 @@ # under the License. javac.compilerargs=-Xlint -Xlint:-serial -Xlint:-processing -javac.source=1.8 -javac.target=1.8 +javac.release=11 module.jar.dir=lib diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java index d66dd82b6334..526f659594a8 100644 --- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java +++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java @@ -34,6 +34,7 @@ import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.ImageObserver; +import java.awt.image.MultiResolutionImage; import java.awt.image.RGBImageFilter; import java.awt.image.WritableRaster; import java.io.IOException; @@ -46,6 +47,7 @@ import java.util.HashSet; import java.util.Hashtable; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; @@ -322,10 +324,9 @@ public static final Image mergeImages(Image image1, Image image2, int x, int y) * @return icon corresponding icon */ public static final Icon image2Icon(Image image) { - /* Make sure to always return a ToolTipImage, to take advantage of its rendering tweaks for - HiDPI screens. */ - return (image instanceof ToolTipImage) + ToolTipImage ret = (image instanceof ToolTipImage) ? (ToolTipImage) image : assignToolTipToImageInternal(image, ""); + return ret.asImageIconIfRequiredForRetina(); } /** @@ -376,8 +377,9 @@ methods in this class may be called from any thread, while JLabel's methods and // so let's try second most used one type, it satisfies AbstractButton, JCheckbox. Not all cases are // covered, however. icon.paintIcon(dummyIconComponentButton, g, 0, 0); + } finally { + g.dispose(); } - g.dispose(); return image; } @@ -1049,17 +1051,12 @@ private static final class IconImageIcon extends ImageIcon { it volatile instead, to be completely sure that the class is still thread-safe. */ private volatile Icon delegate; - private IconImageIcon(Icon delegate) { - super(icon2Image(delegate)); + IconImageIcon(ToolTipImage delegate) { + super(delegate); Parameters.notNull("delegate", delegate); this.delegate = delegate; } - private static ImageIcon create(Icon delegate) { - return (delegate instanceof ImageIcon) - ? (ImageIcon) delegate : new IconImageIcon(delegate); - } - @Override public synchronized void paintIcon(Component c, Graphics g, int x, int y) { delegate.paintIcon(c, g, x, y); @@ -1089,9 +1086,15 @@ private void readObjectNoData() throws ObjectStreamException { } /** - * Image with tool tip text (for icons with badges) + * Image with tool tip text (for icons with badges). + * + *

On MacOS, HiDPI (Retina) support in JMenuItem.setIcon(Icon) requires the Icon argument to + * be an instance of ImageIcon wrapping a MultiResolutionImage (see + * com.apple.laf.ScreenMenuIcon.setIcon, com.apple.laf.AquaIcon.getImageForIcon, and + * sun.lwawt.macosx.CImage.Creator.createFromImage). Thus we have this class implement + * MultiResolutionImage, and use asImageIcon when needed via asImageIconIfRequiredForRetina. */ - private static class ToolTipImage extends BufferedImage implements Icon { + private static class ToolTipImage extends BufferedImage implements Icon, MultiResolutionImage { final String toolTipText; // May be null. final Icon delegateIcon; @@ -1099,6 +1102,8 @@ private static class ToolTipImage extends BufferedImage implements Icon { final URL url; // May be null. ImageIcon imageIconVersion; + // May be null. + volatile BufferedImage doubleSizeVariant; public static ToolTipImage createNew(String toolTipText, Image image, URL url) { ImageUtilities.ensureLoaded(image); @@ -1137,9 +1142,16 @@ public ToolTipImage( } public synchronized ImageIcon asImageIcon() { - if (imageIconVersion == null) - imageIconVersion = IconImageIcon.create(this); - return imageIconVersion; + if (imageIconVersion == null) { + imageIconVersion = new IconImageIcon(this); + } + return imageIconVersion; + } + + public Icon asImageIconIfRequiredForRetina() { + /* We could choose to do this only on MacOS, but doing it on all platforms will lower + the chance of undetected platform-specific bugs. */ + return delegateIcon != null ? asImageIcon() : this; } /** @@ -1237,6 +1249,49 @@ Image.UndefinedProperty rather than null (see Javadoc spec for this method), but } return super.getProperty(name, observer); } + + private Image getDoubleSizeVariant() { + if (delegateIcon == null) { + return null; + } + BufferedImage ret = doubleSizeVariant; + if (ret == null) { + int SCALE = 2; + ColorModel model = getColorModel(); + int w = delegateIcon.getIconWidth() * SCALE; + int h = delegateIcon.getIconHeight() * SCALE; + ret = new BufferedImage( + model, + model.createCompatibleWritableRaster(w, h), + model.isAlphaPremultiplied(), null); + Graphics g = ret.createGraphics(); + try { + ((Graphics2D) g).transform(AffineTransform.getScaleInstance(SCALE, SCALE)); + delegateIcon.paintIcon(dummyIconComponentLabel, g, 0, 0); + } finally { + g.dispose(); + } + doubleSizeVariant = ret; + } + return ret; + } + + @Override + public Image getResolutionVariant(double destImageWidth, double destImageHeight) { + if (destImageWidth <= getWidth(null) && destImageHeight <= getHeight(null)) { + /* Returning "this" should be safe here, as the same is done in + sun.awt.image.MultiResolutionToolkitImage. */ + return this; + } + Image ds = getDoubleSizeVariant(); + return ds != null ? ds : this; + } + + @Override + public List getResolutionVariants() { + Image ds = getDoubleSizeVariant(); + return ds == null ? List.of(this) : List.of(this, ds); + } } private static final class DisabledButtonFilter extends RGBImageFilter { diff --git a/platform/openide.util.ui/test/unit/src/org/openide/util/UtilitiesTest.java b/platform/openide.util.ui/test/unit/src/org/openide/util/UtilitiesTest.java index 421d39d1fe16..840a5e7b94cf 100644 --- a/platform/openide.util.ui/test/unit/src/org/openide/util/UtilitiesTest.java +++ b/platform/openide.util.ui/test/unit/src/org/openide/util/UtilitiesTest.java @@ -55,7 +55,7 @@ import java.awt.datatransfer.Clipboard; import java.awt.dnd.DragGestureEvent; import java.awt.dnd.InvalidDnDOperationException; -import java.awt.dnd.peer.DragSourceContextPeer; +//import java.awt.dnd.peer.DragSourceContextPeer; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; @@ -64,6 +64,7 @@ import java.awt.image.ColorModel; import java.awt.image.ImageObserver; import java.awt.image.ImageProducer; +/* import java.awt.peer.ButtonPeer; import java.awt.peer.CanvasPeer; import java.awt.peer.CheckboxMenuItemPeer; @@ -86,6 +87,7 @@ import java.awt.peer.TextAreaPeer; import java.awt.peer.TextFieldPeer; import java.awt.peer.WindowPeer; +*/ import java.beans.PropertyChangeListener; import java.net.URL; import java.util.ArrayList; @@ -320,28 +322,12 @@ public Toolkit getToolkit() { return customToolkit; } } - + private static class NoCustomCursorToolkit extends Toolkit { public FontMetrics getFontMetrics(Font font) { return Toolkit.getDefaultToolkit().getFontMetrics( font ); } - protected TextFieldPeer createTextField(TextField target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected ListPeer createList(java.awt.List target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected MenuBarPeer createMenuBar(MenuBar target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException { - throw new IllegalStateException("Method not implemented"); - } - public boolean prepareImage(Image image, int width, int height, ImageObserver observer) { return Toolkit.getDefaultToolkit().prepareImage( image, width, height, observer ); } @@ -350,30 +336,14 @@ public int checkImage(Image image, int width, int height, ImageObserver observer return Toolkit.getDefaultToolkit().checkImage( image, width, height, observer ); } - protected PopupMenuPeer createPopupMenu(PopupMenu target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - public PrintJob getPrintJob(Frame frame, String jobtitle, Properties props) { return Toolkit.getDefaultToolkit().getPrintJob( frame, jobtitle, props ); } - protected ButtonPeer createButton(Button target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - public Image createImage(ImageProducer producer) { return Toolkit.getDefaultToolkit().createImage( producer ); } - protected CanvasPeer createCanvas(Canvas target) { - throw new IllegalStateException("Method not implemented"); - } - - protected ScrollbarPeer createScrollbar(Scrollbar target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - public Image getImage(String filename) { return Toolkit.getDefaultToolkit().getImage( filename ); } @@ -382,14 +352,6 @@ public Image createImage(String filename) { return Toolkit.getDefaultToolkit().createImage( filename ); } - protected MenuPeer createMenu(Menu target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected MenuItemPeer createMenuItem(MenuItem target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - public Map mapInputMethodHighlight(InputMethodHighlight highlight) throws HeadlessException { return Toolkit.getDefaultToolkit().mapInputMethodHighlight( highlight ); } @@ -402,58 +364,10 @@ public Image getImage(URL url) { return Toolkit.getDefaultToolkit().getImage( url ); } - protected CheckboxPeer createCheckbox(Checkbox target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - public Image createImage(URL url) { return Toolkit.getDefaultToolkit().createImage( url ); } - protected TextAreaPeer createTextArea(TextArea target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected FileDialogPeer createFileDialog(FileDialog target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected ScrollPanePeer createScrollPane(ScrollPane target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected DialogPeer createDialog(Dialog target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected PanelPeer createPanel(Panel target) { - throw new IllegalStateException("Method not implemented"); - } - - protected ChoicePeer createChoice(Choice target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected FramePeer createFrame(Frame target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected LabelPeer createLabel(Label target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected FontPeer getFontPeer(String name, int style) { - throw new IllegalStateException("Method not implemented"); - } - - protected CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - - protected WindowPeer createWindow(Window target) throws HeadlessException { - throw new IllegalStateException("Method not implemented"); - } - public void sync() { Toolkit.getDefaultToolkit().sync(); } @@ -503,10 +417,6 @@ public Dimension getBestCursorSize(int preferredWidth, int preferredHeight) thro return new Dimension(0,0); } - protected DesktopPeer createDesktopPeer(Desktop target) throws HeadlessException { - throw new UnsupportedOperationException("Not supported yet."); - } - @Override public boolean isModalityTypeSupported(ModalityType modalityType) { throw new UnsupportedOperationException("Not supported yet."); diff --git a/platform/openide.util/manifest.mf b/platform/openide.util/manifest.mf index 115bf664b092..82cfb9db46a5 100644 --- a/platform/openide.util/manifest.mf +++ b/platform/openide.util/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.util OpenIDE-Module-Localizing-Bundle: org/openide/util/base/Bundle.properties -OpenIDE-Module-Specification-Version: 9.33 +OpenIDE-Module-Specification-Version: 9.34 diff --git a/platform/openide.windows/manifest.mf b/platform/openide.windows/manifest.mf index e2449d89abc6..e59c87526a37 100644 --- a/platform/openide.windows/manifest.mf +++ b/platform/openide.windows/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.windows -OpenIDE-Module-Specification-Version: 6.102 +OpenIDE-Module-Specification-Version: 6.103 OpenIDE-Module-Localizing-Bundle: org/openide/windows/Bundle.properties AutoUpdate-Essential-Module: true diff --git a/platform/options.api/manifest.mf b/platform/options.api/manifest.mf index 2cc60f79ae53..8c66b6d8252e 100644 --- a/platform/options.api/manifest.mf +++ b/platform/options.api/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.options.api/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/options/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.70 +OpenIDE-Module-Specification-Version: 1.71 AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true diff --git a/platform/options.keymap/manifest.mf b/platform/options.keymap/manifest.mf index 449cb71fc0ff..842e0ddd92cc 100644 --- a/platform/options.keymap/manifest.mf +++ b/platform/options.keymap/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.options.keymap OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/keymap/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/options/keymap/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.62 +OpenIDE-Module-Specification-Version: 1.63 AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true diff --git a/platform/print/manifest.mf b/platform/print/manifest.mf index b3fb6456cd62..c9faaaaff418 100644 --- a/platform/print/manifest.mf +++ b/platform/print/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 7.51 +OpenIDE-Module-Specification-Version: 7.52 OpenIDE-Module: org.netbeans.modules.print OpenIDE-Module-Layer: org/netbeans/modules/print/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/print/resources/Bundle.properties diff --git a/platform/progress.ui/manifest.mf b/platform/progress.ui/manifest.mf index ea17c0ff444a..573cb73da172 100644 --- a/platform/progress.ui/manifest.mf +++ b/platform/progress.ui/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.progress.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/progress/ui/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.progress.spi.ProgressUIWorkerProvider, org.netbeans.modules.progress.spi.RunOffEDTProvider AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 diff --git a/platform/queries/manifest.mf b/platform/queries/manifest.mf index 85604587b95a..a2126e201689 100644 --- a/platform/queries/manifest.mf +++ b/platform/queries/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.queries/1 -OpenIDE-Module-Specification-Version: 1.68 +OpenIDE-Module-Specification-Version: 1.69 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/queries/Bundle.properties diff --git a/platform/sampler/manifest.mf b/platform/sampler/manifest.mf index 2b3532f2cd43..7ef9db324a2d 100644 --- a/platform/sampler/manifest.mf +++ b/platform/sampler/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.sampler OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/sampler/Bundle.properties -OpenIDE-Module-Specification-Version: 1.39 +OpenIDE-Module-Specification-Version: 1.40 Main-Class: org.netbeans.modules.sampler.CLISampler diff --git a/platform/sendopts/manifest.mf b/platform/sendopts/manifest.mf index 06f642b5f4bf..7c53c83decf1 100644 --- a/platform/sendopts/manifest.mf +++ b/platform/sendopts/manifest.mf @@ -1,5 +1,5 @@ OpenIDE-Module: org.netbeans.modules.sendopts/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/sendopts/Bundle.properties -OpenIDE-Module-Specification-Version: 2.61 +OpenIDE-Module-Specification-Version: 2.62 AutoUpdate-Essential-Module: true diff --git a/platform/settings/manifest.mf b/platform/settings/manifest.mf index 3b14b4f88208..3c20dd80c407 100644 --- a/platform/settings/manifest.mf +++ b/platform/settings/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.settings/1 OpenIDE-Module-Layer: org/netbeans/modules/settings/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/settings/resources/Bundle.properties AutoUpdate-Essential-Module: true -OpenIDE-Module-Specification-Version: 1.74 +OpenIDE-Module-Specification-Version: 1.75 diff --git a/platform/spi.actions/manifest.mf b/platform/spi.actions/manifest.mf index 345d22690369..12ad4799b5de 100644 --- a/platform/spi.actions/manifest.mf +++ b/platform/spi.actions/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.spi.actions/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/spi/actions/Bundle.properties -OpenIDE-Module-Specification-Version: 1.53 +OpenIDE-Module-Specification-Version: 1.54 diff --git a/platform/spi.quicksearch/manifest.mf b/platform/spi.quicksearch/manifest.mf index f5cc21679737..1d1cb40e4556 100644 --- a/platform/spi.quicksearch/manifest.mf +++ b/platform/spi.quicksearch/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.spi.quicksearch OpenIDE-Module-Layer: org/netbeans/modules/quicksearch/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/spi/quicksearch/Bundle.properties -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 diff --git a/platform/templates/manifest.mf b/platform/templates/manifest.mf index ebac59f27ea4..eaca71e00820 100644 --- a/platform/templates/manifest.mf +++ b/platform/templates/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.templates/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/templates/Bundle.properties -OpenIDE-Module-Specification-Version: 1.32 +OpenIDE-Module-Specification-Version: 1.33 OpenIDE-Module-Layer: org/netbeans/modules/templates/resources/layer.xml AutoUpdate-Show-In-Client: false AutoUpdate-Essential-Module: true diff --git a/platform/templatesui/manifest.mf b/platform/templatesui/manifest.mf index b38123c38a5b..e80618963a3e 100644 --- a/platform/templatesui/manifest.mf +++ b/platform/templatesui/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.templatesui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/templatesui/Bundle.properties OpenIDE-Module-Provides: org.netbeans.api.templates.wizard -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/platform/uihandler/manifest.mf b/platform/uihandler/manifest.mf index 3911b9d9f24e..d9ccf90122e9 100644 --- a/platform/uihandler/manifest.mf +++ b/platform/uihandler/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.uihandler OpenIDE-Module-Install: org/netbeans/modules/uihandler/Installer.class OpenIDE-Module-Layer: org/netbeans/modules/uihandler/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/uihandler/Bundle.properties -OpenIDE-Module-Specification-Version: 2.60 +OpenIDE-Module-Specification-Version: 2.61 diff --git a/profiler/debugger.jpda.heapwalk/manifest.mf b/profiler/debugger.jpda.heapwalk/manifest.mf index c8c5256abc75..abfdda0fa832 100644 --- a/profiler/debugger.jpda.heapwalk/manifest.mf +++ b/profiler/debugger.jpda.heapwalk/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.debugger.jpda.heapwalk/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/heapwalk/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/heapwalk/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 OpenIDE-Module-Requires: org.netbeans.api.debugger.jpda.JPDADebuggerEngineImpl, org.netbeans.spi.debugger.ui OpenIDE-Module-Provides: org.netbeans.modules.debugger.jpda.heapwalk diff --git a/profiler/lib.profiler.charts/manifest.mf b/profiler/lib.profiler.charts/manifest.mf index d7c015cddf77..77be3bd4ed39 100644 --- a/profiler/lib.profiler.charts/manifest.mf +++ b/profiler/lib.profiler.charts/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.lib.profiler.charts/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/profiler/charts/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 diff --git a/profiler/lib.profiler.common/manifest.mf b/profiler/lib.profiler.common/manifest.mf index 67064d914810..7084d8d3cbee 100644 --- a/profiler/lib.profiler.common/manifest.mf +++ b/profiler/lib.profiler.common/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.lib.profiler.common/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/profiler/common/Bundle.properties -OpenIDE-Module-Specification-Version: 1.72 +OpenIDE-Module-Specification-Version: 1.73 OpenIDE-Module-Needs: org.netbeans.lib.profiler.common.Profiler diff --git a/profiler/lib.profiler.ui/manifest.mf b/profiler/lib.profiler.ui/manifest.mf index 16daafad37ac..82a0eb17f7b5 100644 --- a/profiler/lib.profiler.ui/manifest.mf +++ b/profiler/lib.profiler.ui/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.lib.profiler.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/profiler/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.171 +OpenIDE-Module-Specification-Version: 1.172 diff --git a/profiler/lib.profiler/manifest.mf b/profiler/lib.profiler/manifest.mf index 9654d387ab9d..730b98ed12cd 100644 --- a/profiler/lib.profiler/manifest.mf +++ b/profiler/lib.profiler/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.lib.profiler/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/profiler/Bundle.properties -OpenIDE-Module-Specification-Version: 1.134 +OpenIDE-Module-Specification-Version: 1.135 diff --git a/profiler/maven.profiler/manifest.mf b/profiler/maven.profiler/manifest.mf index 4c22a2ceb36a..369e43096b96 100644 --- a/profiler/maven.profiler/manifest.mf +++ b/profiler/maven.profiler/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.profiler/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/profiler/Bundle.properties -OpenIDE-Module-Specification-Version: 1.57 +OpenIDE-Module-Specification-Version: 1.58 AutoUpdate-Show-In-Client: false diff --git a/profiler/profiler.api/manifest.mf b/profiler/profiler.api/manifest.mf index f91ba7b54e48..2eab6ae228e2 100644 --- a/profiler/profiler.api/manifest.mf +++ b/profiler/profiler.api/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.api/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.75 +OpenIDE-Module-Specification-Version: 1.76 Netigso-Export-Package: org.netbeans.modules.profiler.spi diff --git a/profiler/profiler.attach/manifest.mf b/profiler/profiler.attach/manifest.mf index cd298c5c6044..50ac22c2fdbf 100644 --- a/profiler/profiler.attach/manifest.mf +++ b/profiler/profiler.attach/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.attach/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/attach/Bundle.properties -OpenIDE-Module-Specification-Version: 2.46 +OpenIDE-Module-Specification-Version: 2.47 diff --git a/profiler/profiler.freeform/manifest.mf b/profiler/profiler.freeform/manifest.mf index 3eca40b84578..8d806540364e 100644 --- a/profiler/profiler.freeform/manifest.mf +++ b/profiler/profiler.freeform/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.freeform/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/freeform/Bundle.properties -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.61 diff --git a/profiler/profiler.heapwalker/manifest.mf b/profiler/profiler.heapwalker/manifest.mf index e5843b39983a..ad0213a570f2 100644 --- a/profiler/profiler.heapwalker/manifest.mf +++ b/profiler/profiler.heapwalker/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.profiler.heapwalker OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/heapwalker/Bundle.properties -OpenIDE-Module-Specification-Version: 1.137 +OpenIDE-Module-Specification-Version: 1.138 diff --git a/profiler/profiler.j2se/manifest.mf b/profiler/profiler.j2se/manifest.mf index 126cf7f3ad73..8a22771a837f 100644 --- a/profiler/profiler.j2se/manifest.mf +++ b/profiler/profiler.j2se/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.j2se/1 OpenIDE-Module-Layer: org/netbeans/modules/profiler/j2se/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/j2se/Bundle.properties -OpenIDE-Module-Specification-Version: 1.61 +OpenIDE-Module-Specification-Version: 1.62 diff --git a/profiler/profiler.kit/manifest.mf b/profiler/profiler.kit/manifest.mf index 4515e74558af..3a72a56af4b8 100644 --- a/profiler/profiler.kit/manifest.mf +++ b/profiler/profiler.kit/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.44 +OpenIDE-Module-Specification-Version: 1.45 OpenIDE-Module-Provides: org.netbeans.modules.profiler diff --git a/profiler/profiler.nbimpl/manifest.mf b/profiler/profiler.nbimpl/manifest.mf index baadcc44efd7..53013db336b0 100644 --- a/profiler/profiler.nbimpl/manifest.mf +++ b/profiler/profiler.nbimpl/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module: org.netbeans.modules.profiler.nbimpl/1 OpenIDE-Module-Layer: org/netbeans/modules/profiler/nbimpl/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/nbimpl/Bundle.properties OpenIDE-Module-Provides: org.netbeans.lib.profiler.common.Profiler -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 diff --git a/profiler/profiler.nbmodule/manifest.mf b/profiler/profiler.nbmodule/manifest.mf index e4680a777249..2e9778550002 100644 --- a/profiler/profiler.nbmodule/manifest.mf +++ b/profiler/profiler.nbmodule/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.nbmodule/1 OpenIDE-Module-Layer: org/netbeans/modules/profiler/nbmodule/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/nbmodule/Bundle.properties -OpenIDE-Module-Specification-Version: 1.60 +OpenIDE-Module-Specification-Version: 1.61 diff --git a/profiler/profiler.options/manifest.mf b/profiler/profiler.options/manifest.mf index f94bfab3efea..e4a2752ce4ad 100644 --- a/profiler/profiler.options/manifest.mf +++ b/profiler/profiler.options/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.profiler.options OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/options/Bundle.properties OpenIDE-Module-Recommends: org.netbeans.modules.options.java -OpenIDE-Module-Specification-Version: 1.44 +OpenIDE-Module-Specification-Version: 1.45 diff --git a/profiler/profiler.oql.language/manifest.mf b/profiler/profiler.oql.language/manifest.mf index 62951683e587..2891180329a8 100644 --- a/profiler/profiler.oql.language/manifest.mf +++ b/profiler/profiler.oql.language/manifest.mf @@ -4,5 +4,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.profiler.oql.language/0 OpenIDE-Module-Layer: org/netbeans/modules/profiler/oql/language/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/oql/language/Bundle.properties -OpenIDE-Module-Specification-Version: 0.53 +OpenIDE-Module-Specification-Version: 0.54 diff --git a/profiler/profiler.oql/manifest.mf b/profiler/profiler.oql/manifest.mf index 51f67d9da3be..392511e3757a 100644 --- a/profiler/profiler.oql/manifest.mf +++ b/profiler/profiler.oql/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.profiler.oql/2 OpenIDE-Module-Layer: org/netbeans/modules/profiler/oql/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/oql/Bundle.properties -OpenIDE-Module-Specification-Version: 2.43 +OpenIDE-Module-Specification-Version: 2.44 diff --git a/profiler/profiler.ppoints/manifest.mf b/profiler/profiler.ppoints/manifest.mf index 333f93fc4010..08df8d90f27f 100644 --- a/profiler/profiler.ppoints/manifest.mf +++ b/profiler/profiler.ppoints/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.ppoints OpenIDE-Module-Layer: org/netbeans/modules/profiler/ppoints/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/ppoints/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 diff --git a/profiler/profiler.projectsupport/manifest.mf b/profiler/profiler.projectsupport/manifest.mf index 0cee4bfd0a7f..484622f1daa5 100644 --- a/profiler/profiler.projectsupport/manifest.mf +++ b/profiler/profiler.projectsupport/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.projectsupport OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/projectsupport/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 diff --git a/profiler/profiler.snaptracer/manifest.mf b/profiler/profiler.snaptracer/manifest.mf index 389fab5fac98..3821682200dd 100644 --- a/profiler/profiler.snaptracer/manifest.mf +++ b/profiler/profiler.snaptracer/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.profiler.snaptracer/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/snaptracer/Bundle.properties -OpenIDE-Module-Specification-Version: 1.49 +OpenIDE-Module-Specification-Version: 1.50 diff --git a/profiler/profiler.utilities/manifest.mf b/profiler/profiler.utilities/manifest.mf index 1d5e904f16eb..23a2a020caf3 100644 --- a/profiler/profiler.utilities/manifest.mf +++ b/profiler/profiler.utilities/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.utilities/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/utilities/Bundle.properties -OpenIDE-Module-Specification-Version: 1.62 +OpenIDE-Module-Specification-Version: 1.63 diff --git a/profiler/profiler/manifest.mf b/profiler/profiler/manifest.mf index b0f725ab9b64..874c43a3d2a0 100644 --- a/profiler/profiler/manifest.mf +++ b/profiler/profiler/manifest.mf @@ -5,5 +5,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/Bundle.propertie OpenIDE-Module-Install: org/netbeans/modules/profiler/ProfilerModule.class OpenIDE-Module-Requires: org.openide.windows.WindowManager OpenIDE-Module-Package-Dependencies: com.sun.tools.attach[VirtualMachine] -OpenIDE-Module-Specification-Version: 3.54 +OpenIDE-Module-Specification-Version: 3.55 diff --git a/webcommon/api.knockout/manifest.mf b/webcommon/api.knockout/manifest.mf index 6a24136ae1fe..85be7aee7498 100644 --- a/webcommon/api.knockout/manifest.mf +++ b/webcommon/api.knockout/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.knockout OpenIDE-Module-Localizing-Bundle: org/netbeans/spi/knockout/Bundle.properties -OpenIDE-Module-Specification-Version: 1.26 +OpenIDE-Module-Specification-Version: 1.27 AutoUpdate-Show-In-Client: false diff --git a/webcommon/cordova.platforms.android/manifest.mf b/webcommon/cordova.platforms.android/manifest.mf index 9ec540f0b38f..0399331dbe39 100644 --- a/webcommon/cordova.platforms.android/manifest.mf +++ b/webcommon/cordova.platforms.android/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.cordova.platforms.android OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cordova/platforms/android/Bundle.properties -OpenIDE-Module-Specification-Version: 1.51 +OpenIDE-Module-Specification-Version: 1.52 diff --git a/webcommon/cordova.platforms/manifest.mf b/webcommon/cordova.platforms/manifest.mf index 50b258937eae..548b349e748b 100644 --- a/webcommon/cordova.platforms/manifest.mf +++ b/webcommon/cordova.platforms/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.cordova.platforms OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cordova/platforms/Bundle.properties -OpenIDE-Module-Specification-Version: 1.61 +OpenIDE-Module-Specification-Version: 1.62 diff --git a/webcommon/cordova/manifest.mf b/webcommon/cordova/manifest.mf index ba19da2ef99c..208558693e0f 100644 --- a/webcommon/cordova/manifest.mf +++ b/webcommon/cordova/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.cordova OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cordova/Bundle.properties -OpenIDE-Module-Specification-Version: 1.58 +OpenIDE-Module-Specification-Version: 1.59 OpenIDE-Module-Layer: org/netbeans/modules/cordova/resources/layer.xml OpenIDE-Module-Recommends: cnb.org.netbeans.modules.cordova.platforms.ios diff --git a/webcommon/extbrowser.chrome/manifest.mf b/webcommon/extbrowser.chrome/manifest.mf index 8338350679b4..127d16190cd0 100644 --- a/webcommon/extbrowser.chrome/manifest.mf +++ b/webcommon/extbrowser.chrome/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.extbrowser.chrome OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/extbrowser/chrome/Bundle.properties -OpenIDE-Module-Specification-Version: 1.35 +OpenIDE-Module-Specification-Version: 1.36 AutoUpdate-Show-In-Client: false diff --git a/webcommon/html.angular/manifest.mf b/webcommon/html.angular/manifest.mf index 48ac68b2a995..6225d84f953f 100644 --- a/webcommon/html.angular/manifest.mf +++ b/webcommon/html.angular/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.html.angular OpenIDE-Module-Layer: org/netbeans/modules/html/angular/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/angular/Bundle.properties -OpenIDE-Module-Specification-Version: 1.37 +OpenIDE-Module-Specification-Version: 1.38 diff --git a/webcommon/html.knockout/manifest.mf b/webcommon/html.knockout/manifest.mf index bf6550b9c952..fcd1963bbde7 100644 --- a/webcommon/html.knockout/manifest.mf +++ b/webcommon/html.knockout/manifest.mf @@ -2,6 +2,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.html.knockout OpenIDE-Module-Layer: org/netbeans/modules/html/knockout/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/knockout/Bundle.properties -OpenIDE-Module-Specification-Version: 1.35 +OpenIDE-Module-Specification-Version: 1.36 OpenIDE-Module-Provides: org.netbeans.modules.ko4j.editing diff --git a/webcommon/javascript.bower/manifest.mf b/webcommon/javascript.bower/manifest.mf index c838b0e6007a..d745ca2c1fc7 100644 --- a/webcommon/javascript.bower/manifest.mf +++ b/webcommon/javascript.bower/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.bower OpenIDE-Module-Layer: org/netbeans/modules/javascript/bower/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/bower/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.30 +OpenIDE-Module-Specification-Version: 0.31 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript.cdnjs/manifest.mf b/webcommon/javascript.cdnjs/manifest.mf index 74cf80f4c9d4..c8ab02130061 100644 --- a/webcommon/javascript.cdnjs/manifest.mf +++ b/webcommon/javascript.cdnjs/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.cdnjs/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/cdnjs/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.32 +OpenIDE-Module-Specification-Version: 0.33 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript.cdtdebug.ui/nbproject/project.properties b/webcommon/javascript.cdtdebug.ui/nbproject/project.properties index 91cc720ca57f..2e14723a6dcf 100644 --- a/webcommon/javascript.cdtdebug.ui/nbproject/project.properties +++ b/webcommon/javascript.cdtdebug.ui/nbproject/project.properties @@ -19,4 +19,4 @@ javac.release=11 javadoc.arch=${basedir}/arch.xml is.eager=true -spec.version.base=1.1.0 +spec.version.base=1.2.0 diff --git a/webcommon/javascript.cdtdebug/nbproject/project.properties b/webcommon/javascript.cdtdebug/nbproject/project.properties index 89d99a9b3ae6..5b778417dba0 100644 --- a/webcommon/javascript.cdtdebug/nbproject/project.properties +++ b/webcommon/javascript.cdtdebug/nbproject/project.properties @@ -19,4 +19,4 @@ javac.release=11 javadoc.arch=${basedir}/arch.xml is.autoload=true -spec.version.base=1.1.0 +spec.version.base=1.2.0 diff --git a/webcommon/javascript.grunt/manifest.mf b/webcommon/javascript.grunt/manifest.mf index eb27c31ec9d0..57eede889159 100644 --- a/webcommon/javascript.grunt/manifest.mf +++ b/webcommon/javascript.grunt/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.grunt OpenIDE-Module-Layer: org/netbeans/modules/javascript/grunt/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/grunt/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.39 +OpenIDE-Module-Specification-Version: 0.40 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript.gulp/manifest.mf b/webcommon/javascript.gulp/manifest.mf index 8d13f4a5653f..a7525af5f6e6 100644 --- a/webcommon/javascript.gulp/manifest.mf +++ b/webcommon/javascript.gulp/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.gulp OpenIDE-Module-Layer: org/netbeans/modules/javascript/gulp/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/gulp/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.38 +OpenIDE-Module-Specification-Version: 0.39 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript.jstestdriver/manifest.mf b/webcommon/javascript.jstestdriver/manifest.mf index 505a6c4b7a21..a2a1822d368f 100644 --- a/webcommon/javascript.jstestdriver/manifest.mf +++ b/webcommon/javascript.jstestdriver/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.jstestdriver OpenIDE-Module-Layer: org/netbeans/modules/javascript/jstestdriver/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/jstestdriver/Bundle.properties -OpenIDE-Module-Specification-Version: 0.37 +OpenIDE-Module-Specification-Version: 0.38 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript.karma/manifest.mf b/webcommon/javascript.karma/manifest.mf index 5df8f1ff083a..01a211d90b1f 100644 --- a/webcommon/javascript.karma/manifest.mf +++ b/webcommon/javascript.karma/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.karma/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/karma/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.41 +OpenIDE-Module-Specification-Version: 0.42 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript.nodejs/manifest.mf b/webcommon/javascript.nodejs/manifest.mf index 8c730b426db6..058a24defb14 100644 --- a/webcommon/javascript.nodejs/manifest.mf +++ b/webcommon/javascript.nodejs/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.nodejs/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/nodejs/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.54 +OpenIDE-Module-Specification-Version: 0.55 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript.v8debug.ui/nbproject/project.properties b/webcommon/javascript.v8debug.ui/nbproject/project.properties index c95ad1355c83..bd2358851fa9 100644 --- a/webcommon/javascript.v8debug.ui/nbproject/project.properties +++ b/webcommon/javascript.v8debug.ui/nbproject/project.properties @@ -19,4 +19,4 @@ javac.source=1.8 javadoc.arch=${basedir}/arch.xml is.eager=true -spec.version.base=1.24.0 +spec.version.base=1.25.0 diff --git a/webcommon/javascript.v8debug/nbproject/project.properties b/webcommon/javascript.v8debug/nbproject/project.properties index f91766ae8ede..bc5f3befeeea 100644 --- a/webcommon/javascript.v8debug/nbproject/project.properties +++ b/webcommon/javascript.v8debug/nbproject/project.properties @@ -19,4 +19,4 @@ javac.source=1.8 javadoc.arch=${basedir}/arch.xml is.autoload=true -spec.version.base=1.35.0 +spec.version.base=1.36.0 diff --git a/webcommon/javascript2.doc/manifest.mf b/webcommon/javascript2.doc/manifest.mf index bf693c0e6dbb..3f5b15dd8f58 100644 --- a/webcommon/javascript2.doc/manifest.mf +++ b/webcommon/javascript2.doc/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javascript2.doc/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/doc/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/webcommon/javascript2.editor/manifest.mf b/webcommon/javascript2.editor/manifest.mf index ffa24c1eaa69..74de4b136c27 100644 --- a/webcommon/javascript2.editor/manifest.mf +++ b/webcommon/javascript2.editor/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.javascript2.editor/1 OpenIDE-Module-Install: org/netbeans/modules/javascript2/editor/ModuleInstaller.class OpenIDE-Module-Layer: org/netbeans/modules/javascript2/editor/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 0.100 +OpenIDE-Module-Specification-Version: 0.101 OpenIDE-Module-Recommends: cnb.org.netbeans.modules.html.editor diff --git a/webcommon/javascript2.extdoc/manifest.mf b/webcommon/javascript2.extdoc/manifest.mf index 13f76cd9e33a..77c9daf478c4 100644 --- a/webcommon/javascript2.extdoc/manifest.mf +++ b/webcommon/javascript2.extdoc/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javascript2.extdoc OpenIDE-Module-Layer: org/netbeans/modules/javascript2/extdoc/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/extdoc/Bundle.properties -OpenIDE-Module-Specification-Version: 1.23 +OpenIDE-Module-Specification-Version: 1.24 diff --git a/webcommon/javascript2.extjs/manifest.mf b/webcommon/javascript2.extjs/manifest.mf index 897b340a897e..7b892f9d48e9 100644 --- a/webcommon/javascript2.extjs/manifest.mf +++ b/webcommon/javascript2.extjs/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript2.extjs OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/extjs/Bundle.properties -OpenIDE-Module-Specification-Version: 1.34 +OpenIDE-Module-Specification-Version: 1.35 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript2.html/manifest.mf b/webcommon/javascript2.html/manifest.mf index 865d59bbda79..ec27678fc4ad 100644 --- a/webcommon/javascript2.html/manifest.mf +++ b/webcommon/javascript2.html/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javascript2.html OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/html/Bundle.properties -OpenIDE-Module-Specification-Version: 1.15 +OpenIDE-Module-Specification-Version: 1.16 diff --git a/webcommon/javascript2.jade/manifest.mf b/webcommon/javascript2.jade/manifest.mf index e40546f7445b..38952ddfa832 100644 --- a/webcommon/javascript2.jade/manifest.mf +++ b/webcommon/javascript2.jade/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.javascript2.jade/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/jade/Bundle.properties -OpenIDE-Module-Specification-Version: 0.31 +OpenIDE-Module-Specification-Version: 0.32 OpenIDE-Module-Layer: org/netbeans/modules/javascript2/jade/layer.xml diff --git a/webcommon/javascript2.jquery/manifest.mf b/webcommon/javascript2.jquery/manifest.mf index cb02eb82657c..a2255618dd1e 100644 --- a/webcommon/javascript2.jquery/manifest.mf +++ b/webcommon/javascript2.jquery/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.javascript2.jquery OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/jquery/Bundle.properties -OpenIDE-Module-Specification-Version: 1.34 +OpenIDE-Module-Specification-Version: 1.35 diff --git a/webcommon/javascript2.jsdoc/manifest.mf b/webcommon/javascript2.jsdoc/manifest.mf index 62c46cf6cc42..c5d631f4cb8e 100644 --- a/webcommon/javascript2.jsdoc/manifest.mf +++ b/webcommon/javascript2.jsdoc/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javascript2.jsdoc OpenIDE-Module-Layer: org/netbeans/modules/javascript2/jsdoc/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/jsdoc/Bundle.properties -OpenIDE-Module-Specification-Version: 1.23 +OpenIDE-Module-Specification-Version: 1.24 diff --git a/webcommon/javascript2.json/manifest.mf b/webcommon/javascript2.json/manifest.mf index 6764777329d3..fe6b68ebca8e 100644 --- a/webcommon/javascript2.json/manifest.mf +++ b/webcommon/javascript2.json/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.javascript2.json OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/json/Bundle.properties -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/webcommon/javascript2.kit/manifest.mf b/webcommon/javascript2.kit/manifest.mf index 9c13dabe780f..9f2b75bd2b71 100644 --- a/webcommon/javascript2.kit/manifest.mf +++ b/webcommon/javascript2.kit/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript2.kit/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 0.38 +OpenIDE-Module-Specification-Version: 0.39 AutoUpdate-Show-In-Client: true diff --git a/webcommon/javascript2.knockout/manifest.mf b/webcommon/javascript2.knockout/manifest.mf index 235a1cd4656e..17596c66ce2f 100644 --- a/webcommon/javascript2.knockout/manifest.mf +++ b/webcommon/javascript2.knockout/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript2.knockout OpenIDE-Module-Layer: org/netbeans/modules/javascript2/knockout/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/knockout/Bundle.properties -OpenIDE-Module-Specification-Version: 1.35 +OpenIDE-Module-Specification-Version: 1.36 AutoUpdate-Show-In-Client: true diff --git a/webcommon/javascript2.lexer/manifest.mf b/webcommon/javascript2.lexer/manifest.mf index c17473adee57..94f817cd1aa7 100644 --- a/webcommon/javascript2.lexer/manifest.mf +++ b/webcommon/javascript2.lexer/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javascript2.lexer/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/lexer/Bundle.properties -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 diff --git a/webcommon/javascript2.model/manifest.mf b/webcommon/javascript2.model/manifest.mf index 66d6bbb87db0..2bfdf8a495a9 100644 --- a/webcommon/javascript2.model/manifest.mf +++ b/webcommon/javascript2.model/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javascript2.model/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/model/Bundle.properties -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 diff --git a/webcommon/javascript2.nodejs/manifest.mf b/webcommon/javascript2.nodejs/manifest.mf index 83e346a03de6..267b72faa96e 100644 --- a/webcommon/javascript2.nodejs/manifest.mf +++ b/webcommon/javascript2.nodejs/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript2.nodejs/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/nodejs/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/javascript2/nodejs/resources/layer.xml -OpenIDE-Module-Specification-Version: 0.37 +OpenIDE-Module-Specification-Version: 0.38 AutoUpdate-Show-In-Client: true diff --git a/webcommon/javascript2.prototypejs/manifest.mf b/webcommon/javascript2.prototypejs/manifest.mf index 0db63d96ba85..aa2acb066d2b 100644 --- a/webcommon/javascript2.prototypejs/manifest.mf +++ b/webcommon/javascript2.prototypejs/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.javascript2.prototypejs OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/prototypejs/Bundle.properties -OpenIDE-Module-Specification-Version: 0.30 +OpenIDE-Module-Specification-Version: 0.31 diff --git a/webcommon/javascript2.react/manifest.mf b/webcommon/javascript2.react/manifest.mf index 8f571674a562..3a06887a416e 100644 --- a/webcommon/javascript2.react/manifest.mf +++ b/webcommon/javascript2.react/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript2.react OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/react/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/javascript2/react/resources/layer.xml -OpenIDE-Module-Specification-Version: 0.24 +OpenIDE-Module-Specification-Version: 0.25 AutoUpdate-Show-In-Client: true diff --git a/webcommon/javascript2.requirejs/manifest.mf b/webcommon/javascript2.requirejs/manifest.mf index 638f8ff74260..ffcdd1c2fbcc 100644 --- a/webcommon/javascript2.requirejs/manifest.mf +++ b/webcommon/javascript2.requirejs/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.javascript2.requirejs OpenIDE-Module-Layer: org/netbeans/modules/javascript2/requirejs/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/requirejs/Bundle.properties -OpenIDE-Module-Specification-Version: 0.32 +OpenIDE-Module-Specification-Version: 0.33 diff --git a/webcommon/javascript2.sdoc/manifest.mf b/webcommon/javascript2.sdoc/manifest.mf index ac6cfebe0964..95f7de08ed6e 100644 --- a/webcommon/javascript2.sdoc/manifest.mf +++ b/webcommon/javascript2.sdoc/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javascript2.sdoc OpenIDE-Module-Layer: org/netbeans/modules/javascript2/sdoc/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/sdoc/Bundle.properties -OpenIDE-Module-Specification-Version: 1.23 +OpenIDE-Module-Specification-Version: 1.24 diff --git a/webcommon/javascript2.source.query/manifest.mf b/webcommon/javascript2.source.query/manifest.mf index d5d0035fd8dc..7ecd16a5e9d2 100644 --- a/webcommon/javascript2.source.query/manifest.mf +++ b/webcommon/javascript2.source.query/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript2.source.query/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/source/query/Bundle.properties -OpenIDE-Module-Specification-Version: 0.24 +OpenIDE-Module-Specification-Version: 0.25 OpenIDE-Module-Provides: org.netbeans.modules.javascript2.debug.spi.SourceElementsQuery AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript2.types/manifest.mf b/webcommon/javascript2.types/manifest.mf index ea5e790c645a..36eb5e06a2e6 100644 --- a/webcommon/javascript2.types/manifest.mf +++ b/webcommon/javascript2.types/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.javascript2.types/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript2/types/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 diff --git a/webcommon/languages.apacheconf/manifest.mf b/webcommon/languages.apacheconf/manifest.mf index 89cb31ad4544..cc45919bb4dc 100644 --- a/webcommon/languages.apacheconf/manifest.mf +++ b/webcommon/languages.apacheconf/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.languages.apacheconf OpenIDE-Module-Layer: org/netbeans/modules/languages/apacheconf/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/apacheconf/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.41 +OpenIDE-Module-Specification-Version: 1.42 diff --git a/webcommon/languages.ini/manifest.mf b/webcommon/languages.ini/manifest.mf index c91c2d84aca5..2a0ee93df58b 100644 --- a/webcommon/languages.ini/manifest.mf +++ b/webcommon/languages.ini/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.languages.ini OpenIDE-Module-Layer: org/netbeans/modules/languages/ini/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/ini/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.50 +OpenIDE-Module-Specification-Version: 1.51 diff --git a/webcommon/lib.chrome_devtools_protocol/manifest.mf b/webcommon/lib.chrome_devtools_protocol/manifest.mf index 12dd9c9de685..ec77d2f17782 100644 --- a/webcommon/lib.chrome_devtools_protocol/manifest.mf +++ b/webcommon/lib.chrome_devtools_protocol/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.lib.chrome_devtools_protocol/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/chrome_devtools_protocol/Bundle.properties -OpenIDE-Module-Specification-Version: 1.1 +OpenIDE-Module-Specification-Version: 1.2 diff --git a/webcommon/lib.v8debug/manifest.mf b/webcommon/lib.v8debug/manifest.mf index 90b2747c4aad..46c020e1efae 100644 --- a/webcommon/lib.v8debug/manifest.mf +++ b/webcommon/lib.v8debug/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.lib.v8debug/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/v8debug/Bundle.properties -OpenIDE-Module-Specification-Version: 1.41 +OpenIDE-Module-Specification-Version: 1.42 Main-Class: org.netbeans.lib.v8debug.client.cmdline.V8Debug diff --git a/webcommon/libs.graaljs/manifest.mf b/webcommon/libs.graaljs/manifest.mf index b208ee8afe3d..2742f968ff21 100644 --- a/webcommon/libs.graaljs/manifest.mf +++ b/webcommon/libs.graaljs/manifest.mf @@ -3,7 +3,7 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.libs.graaljs/2 OpenIDE-Module-Layer: org/netbeans/libs/graaljs/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/graaljs/Bundle.properties -OpenIDE-Module-Specification-Version: 1.26 +OpenIDE-Module-Specification-Version: 1.27 OpenIDE-Module-Provides: javax.script.ScriptEngine.js,org.netbeans.libs.graaljs OpenIDE-Module-Hide-Classpath-Packages: com.oracle.truffle.js.scriptengine.**, com.oracle.js.parser.**, com.oracle.truffle.js.** diff --git a/webcommon/libs.jstestdriver/manifest.mf b/webcommon/libs.jstestdriver/manifest.mf index 26d8dc94722a..e1cad19e3dd5 100644 --- a/webcommon/libs.jstestdriver/manifest.mf +++ b/webcommon/libs.jstestdriver/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.jstestdriver OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jstestdriver/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.35 +OpenIDE-Module-Specification-Version: 1.36 diff --git a/webcommon/libs.nashorn/manifest.mf b/webcommon/libs.nashorn/manifest.mf index 686a5909a36e..032963fb1d06 100644 --- a/webcommon/libs.nashorn/manifest.mf +++ b/webcommon/libs.nashorn/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.libs.nashorn/3 OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/nashorn/Bundle.properties -OpenIDE-Module-Specification-Version: 3.6 +OpenIDE-Module-Specification-Version: 3.7 diff --git a/webcommon/libs.plist/manifest.mf b/webcommon/libs.plist/manifest.mf index b9538a658ee8..54f28993d5c0 100644 --- a/webcommon/libs.plist/manifest.mf +++ b/webcommon/libs.plist/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.libs.plist OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/plist/Bundle.properties -OpenIDE-Module-Specification-Version: 1.32 +OpenIDE-Module-Specification-Version: 1.33 diff --git a/webcommon/netserver/manifest.mf b/webcommon/netserver/manifest.mf index c6a1dcbe2262..292842242da4 100644 --- a/webcommon/netserver/manifest.mf +++ b/webcommon/netserver/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.netserver OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/netserver/Bundle.properties -OpenIDE-Module-Specification-Version: 1.38 +OpenIDE-Module-Specification-Version: 1.39 diff --git a/webcommon/selenium2.webclient.mocha/manifest.mf b/webcommon/selenium2.webclient.mocha/manifest.mf index 670709236f0e..e97b22422904 100644 --- a/webcommon/selenium2.webclient.mocha/manifest.mf +++ b/webcommon/selenium2.webclient.mocha/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.selenium2.webclient.mocha OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/selenium2/webclient/mocha/Bundle.properties -OpenIDE-Module-Specification-Version: 1.31 +OpenIDE-Module-Specification-Version: 1.32 diff --git a/webcommon/selenium2.webclient.protractor/manifest.mf b/webcommon/selenium2.webclient.protractor/manifest.mf index 6111d61b78f3..6c83517f3825 100644 --- a/webcommon/selenium2.webclient.protractor/manifest.mf +++ b/webcommon/selenium2.webclient.protractor/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.selenium2.webclient.protractor OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/selenium2/webclient/protractor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.28 +OpenIDE-Module-Specification-Version: 1.29 diff --git a/webcommon/selenium2.webclient/manifest.mf b/webcommon/selenium2.webclient/manifest.mf index fbe261b73d0f..2127fb840adb 100644 --- a/webcommon/selenium2.webclient/manifest.mf +++ b/webcommon/selenium2.webclient/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.selenium2.webclient OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/selenium2/webclient/Bundle.properties -OpenIDE-Module-Specification-Version: 1.32 +OpenIDE-Module-Specification-Version: 1.33 diff --git a/webcommon/typescript.editor/manifest.mf b/webcommon/typescript.editor/manifest.mf index 0b24b6cdffd5..bc467d9de809 100644 --- a/webcommon/typescript.editor/manifest.mf +++ b/webcommon/typescript.editor/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.netbeans.modules.typescript.editor OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/typescript/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.18 +OpenIDE-Module-Specification-Version: 1.19 diff --git a/webcommon/web.client.kit/manifest.mf b/webcommon/web.client.kit/manifest.mf index 5da75f33740f..b9ead732e601 100644 --- a/webcommon/web.client.kit/manifest.mf +++ b/webcommon/web.client.kit/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.client.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/client/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.41 +OpenIDE-Module-Specification-Version: 1.42 diff --git a/webcommon/web.client.samples/manifest.mf b/webcommon/web.client.samples/manifest.mf index 7de58674ae80..076c67587b26 100644 --- a/webcommon/web.client.samples/manifest.mf +++ b/webcommon/web.client.samples/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.web.client.samples OpenIDE-Module-Layer: org/netbeans/modules/web/client/samples/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/client/samples/Bundle.properties -OpenIDE-Module-Specification-Version: 1.39 +OpenIDE-Module-Specification-Version: 1.40 diff --git a/webcommon/web.clientproject.api/manifest.mf b/webcommon/web.clientproject.api/manifest.mf index 33ddc07c5348..36f2004a5a25 100644 --- a/webcommon/web.clientproject.api/manifest.mf +++ b/webcommon/web.clientproject.api/manifest.mf @@ -2,5 +2,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.clientproject.api OpenIDE-Module-Layer: org/netbeans/modules/web/clientproject/api/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/clientproject/api/Bundle.properties -OpenIDE-Module-Specification-Version: 1.129 +OpenIDE-Module-Specification-Version: 1.130 diff --git a/webcommon/web.clientproject/manifest.mf b/webcommon/web.clientproject/manifest.mf index a7b0889f882e..a907e658cc2b 100644 --- a/webcommon/web.clientproject/manifest.mf +++ b/webcommon/web.clientproject/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.web.clientproject OpenIDE-Module-Layer: org/netbeans/modules/web/clientproject/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/clientproject/Bundle.properties -OpenIDE-Module-Specification-Version: 1.112 +OpenIDE-Module-Specification-Version: 1.113 OpenIDE-Module-Provides: org.netbeans.modules.web.clientproject diff --git a/webcommon/web.inspect/manifest.mf b/webcommon/web.inspect/manifest.mf index 0a75e79b0595..b960960e0b63 100644 --- a/webcommon/web.inspect/manifest.mf +++ b/webcommon/web.inspect/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.web.inspect OpenIDE-Module-Layer: org/netbeans/modules/web/inspect/resources/layer.xml OpenIDE-Module-Requires: org.openide.windows.WindowManager -OpenIDE-Module-Specification-Version: 0.55 +OpenIDE-Module-Specification-Version: 0.56 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/inspect/Bundle.properties AutoUpdate-Show-In-Client: false OpenIDE-Module-Provides: org.netbeans.modules.web.browser.api.PageInspector diff --git a/webcommon/web.javascript.debugger/manifest.mf b/webcommon/web.javascript.debugger/manifest.mf index 7b871d52bc39..74ea194a1fa2 100644 --- a/webcommon/web.javascript.debugger/manifest.mf +++ b/webcommon/web.javascript.debugger/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.web.javascript.debugger OpenIDE-Module-Layer: org/netbeans/modules/web/javascript/debugger/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/javascript/debugger/Bundle.properties -OpenIDE-Module-Specification-Version: 1.40 +OpenIDE-Module-Specification-Version: 1.41 diff --git a/webcommon/web.webkit.tooling/manifest.mf b/webcommon/web.webkit.tooling/manifest.mf index c4d3c50186a9..0463698cf0db 100644 --- a/webcommon/web.webkit.tooling/manifest.mf +++ b/webcommon/web.webkit.tooling/manifest.mf @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.web.webkit.tooling OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/webkit/tooling/Bundle.properties OpenIDE-Module-Requires: org.openide.windows.WindowManager -OpenIDE-Module-Specification-Version: 1.35 +OpenIDE-Module-Specification-Version: 1.36 diff --git a/websvccommon/websvc.jaxwsmodelapi/manifest.mf b/websvccommon/websvc.jaxwsmodelapi/manifest.mf index 3a7600b179cd..baa1f66a72a7 100644 --- a/websvccommon/websvc.jaxwsmodelapi/manifest.mf +++ b/websvccommon/websvc.jaxwsmodelapi/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.jaxwsmodelapi/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/jaxwsmodelapi/Bundle.properties -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 AutoUpdate-Show-In-Client: false diff --git a/websvccommon/websvc.saas.api/manifest.mf b/websvccommon/websvc.saas.api/manifest.mf index e64aece8558a..52d88ff95b50 100644 --- a/websvccommon/websvc.saas.api/manifest.mf +++ b/websvccommon/websvc.saas.api/manifest.mf @@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.websvc.saas.api OpenIDE-Module-Layer: org/netbeans/modules/websvc/saas/model/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/spi/Bundle.properties -OpenIDE-Module-Specification-Version: 1.56 +OpenIDE-Module-Specification-Version: 1.57 diff --git a/websvccommon/websvc.saas.codegen/manifest.mf b/websvccommon/websvc.saas.codegen/manifest.mf index f7868bfe564b..2e47309c7ca9 100644 --- a/websvccommon/websvc.saas.codegen/manifest.mf +++ b/websvccommon/websvc.saas.codegen/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.saas.codegen OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/codegen/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 +OpenIDE-Module-Specification-Version: 1.56 AutoUpdate-Show-In-Client: false diff --git a/websvccommon/websvc.saas.kit/manifest.mf b/websvccommon/websvc.saas.kit/manifest.mf index 895efbaff5df..f913d74379b3 100644 --- a/websvccommon/websvc.saas.kit/manifest.mf +++ b/websvccommon/websvc.saas.kit/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.saas.kit OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/kit/Bundle.properties -OpenIDE-Module-Specification-Version: 1.52 +OpenIDE-Module-Specification-Version: 1.53 AutoUpdate-Show-In-Client: true OpenIDE-Module-Provides: org.netbeans.modules.websvc.saas.kit diff --git a/websvccommon/websvc.saas.ui/manifest.mf b/websvccommon/websvc.saas.ui/manifest.mf index c8f3bccf2bf0..2e05b9a9475c 100644 --- a/websvccommon/websvc.saas.ui/manifest.mf +++ b/websvccommon/websvc.saas.ui/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.saas.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/ui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.53 +OpenIDE-Module-Specification-Version: 1.54 AutoUpdate-Show-In-Client: false