[netbeans] branch master updated: fix enterprise cluster build on JDK 17 + add upstream-JDK build job.

2022-03-12 Thread mbien
This is an automated email from the ASF dual-hosted git repository.

mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 01fe94f  fix enterprise cluster build on JDK 17 + add upstream-JDK 
build job.
 new 50fb68f  Merge pull request #3764 from mbien/build-on-jdk17
01fe94f is described below

commit 01fe94faf11d94cc4bf6f545bb97be54ddb087e3
Author: Michael Bien 
AuthorDate: Fri Mar 11 15:53:57 2022 +0100

fix enterprise cluster build on JDK 17 + add upstream-JDK build job.
---
 .github/workflows/linux-upstream-jdk.yml   | 56 ++
 .../modules/schema2beansdev/gen/JavaUtil.java  | 18 +--
 2 files changed, 69 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/linux-upstream-jdk.yml 
b/.github/workflows/linux-upstream-jdk.yml
new file mode 100644
index 000..142c884
--- /dev/null
+++ b/.github/workflows/linux-upstream-jdk.yml
@@ -0,0 +1,56 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Apache Netbeans
+
+on:
+  push:
+  pull_request:
+
+# job is intended for early detection of build failures on new JDKs
+jobs:
+  linux:
+name: Check Build on Linux/JDK17
+runs-on: ubuntu-latest
+env:
+  ANT_OPTS: 
-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
+
+steps:
+
+  - name: Set up JDK 17
+uses: actions/setup-java@v2
+with:
+distribution: 'zulu'
+java-version: 17
+
+  - name: Checkout
+uses: actions/checkout@v2
+
+  - name: Caching dependencies
+uses: actions/cache@v2
+with:
+  path: ~/.hgexternalcache
+  key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', 
'*/*/external/binaries-list') }}
+  restore-keys: ${{ runner.os }}-
+
+  - name: Clean
+run: ant -Dcluster.config=full clean
+
+  - name: Build (cluster.config=full)
+run: ant -Dcluster.config=full build
+
+# todo: figure out if anything is testable post JDK 15
diff --git 
a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java 
b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java
index 6b176c4..6934834 100644
--- 
a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java
+++ 
b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java
@@ -835,6 +835,7 @@ public class JavaUtil {
 return cls.getName();
 }
 
+@Deprecated
 public static int getOptimialHashMapSize(Object[] keys) {
 return getOptimialHashMapSize(keys, keys.length * 8);
 }
@@ -847,12 +848,13 @@ public class JavaUtil {
  *
  * @param maxSize the point at which to give up (the maximum size to try)
  */
+@Deprecated
 public static int getOptimialHashMapSize(Object[] keys, int maxSize) {
 int keyLength = keys.length;
-int defaultAnswer = keyLength + 1;
+int defaultAnswer = keyLength * 3 / 2;
 try {
 java.lang.reflect.Field tableField = 
HashMap.class.getDeclaredField("table");
-tableField.setAccessible(true);
+tableField.setAccessible(true); // requires --add-opens for util 
package
 for (int tableSize = keyLength + 1; tableSize <= maxSize;
  tableSize <<= 1) {
 //System.out.println("tableSize="+tableSize);
@@ -874,10 +876,16 @@ public class JavaUtil {
 }
 return table.length;
 }
-} catch (java.lang.IllegalAccessException e) {
-return defaultAnswer;
-} catch (java.lang.NoSuchFieldException e) {
+} catch (IllegalAccessException | NoSuchFieldException e) {
 return defaultAnswer;
+} catch (RuntimeException ex) {
+// todo: remove this workaround post JDK 9+ migration (or entire 
method)
+// modules on modern JDKs should prefere immutable collections 
anyway, e.g Map.of();
+if 
(ex.getClass().getName().equals("java.lang.reflect.InaccessibleObjectException"))
 {
+return 

[netbeans] branch master updated: Remove old & deprecated openide.util.enumerations module (#3679)

2022-03-12 Thread bwalker
This is an automated email from the ASF dual-hosted git repository.

bwalker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new b53effe  Remove old & deprecated openide.util.enumerations module 
(#3679)
b53effe is described below

commit b53effe3681904de30ce079b79fc556c7160e345
Author: Brad Walker 
AuthorDate: Sat Mar 12 15:27:04 2022 -0700

Remove old & deprecated openide.util.enumerations module (#3679)

The Enumerations module is really old, no longer used as it was replaced by 
an Enum keyword in JDK 1.5, and is not
used anywhere in the code.

Time to clean up the code base by removing this old module. That's what 
this code change does.
---
 .travis.yml|1 -
 .../project/jnlp/GenerateJNLPApplicationTest.java  |3 -
 .../project/suite/BuildZipDistributionTest.java|1 -
 .../project/universe/ModuleListTest.java   |4 -
 .../src/generators/NetBeansPlatform.groovy |3 +-
 .../netbeans/junit/NbModuleSuiteHideExtraTest.java |1 -
 .../src/org/netbeans/junit/NbModuleSuiteTest.java  |   64 --
 .../testjunit/AskForOrgOpenideUtilEnumClass.java   |   50 -
 .../xsl/grammar/XSLGrammarQueryProvider.java   |7 +-
 .../nbcode/nbproject/platform.properties   |1 -
 nbbuild/build.properties   |3 +-
 nbbuild/cluster.properties |1 -
 nbbuild/hudson/core-main   |1 -
 nbbuild/javadoctools/links.xml |1 -
 nbbuild/javadoctools/properties.xml|1 -
 nbbuild/javadoctools/replaces.xml  |1 -
 nbbuild/templates/common.xml   |1 -
 .../org/netbeans/nbbuild/FixDependenciesTest.java  |1 -
 .../src/org/openide/util/enum/ArrayEnumTest.java   |4 -
 .../org/openide/util/enum/Sequence2EnumTest.java   |   50 -
 .../org/openide/util/enum/SequenceEnumTest.java|   44 -
 platform/openide.modules/module-auto-deps.xml  |1 -
 platform/openide.util.enumerations/apichanges.xml  |   90 --
 platform/openide.util.enumerations/arch.xml| 1062 
 platform/openide.util.enumerations/build.xml   |   44 -
 platform/openide.util.enumerations/manifest.mf |7 -
 .../nbproject/org-openide-util-enumerations.sig|   90 --
 .../nbproject/project.properties   |   26 -
 .../nbproject/project.xml  |   62 --
 .../org/openide/util/enum/AlterEnumeration.java|   64 --
 .../org/openide/util/enum/ArrayEnumeration.java|   63 --
 .../src/org/openide/util/enum/Bundle.properties|   25 -
 .../org/openide/util/enum/EmptyEnumeration.java|   42 -
 .../org/openide/util/enum/FilterEnumeration.java   |  102 --
 .../org/openide/util/enum/QueueEnumeration.java|  110 --
 .../util/enum/RemoveDuplicatesEnumeration.java |   51 -
 .../org/openide/util/enum/SequenceEnumeration.java |  105 --
 .../openide/util/enum/SingletonEnumeration.java|   63 --
 .../src/org/openide/util/enum/package.html |   31 -
 .../org/openide/util/enum/OldEnumerationsTest.java |  180 
 40 files changed, 3 insertions(+), 2458 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index f529bd9..1e53249 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -181,7 +181,6 @@ matrix:
 - hide-logs.sh ant $OPTS -f platform/openide.options test
 - travis_retry hide-logs.sh ant $OPTS -f platform/openide.text test
 - hide-logs.sh ant $OPTS -f platform/openide.util test
-- hide-logs.sh ant $OPTS -f platform/openide.util.enumerations test
 - hide-logs.sh ant $OPTS -f platform/openide.util.lookup test
 - hide-logs.sh ant $OPTS -f platform/openide.util.ui test
 - hide-logs.sh ant $OPTS -f platform/openide.windows test
diff --git 
a/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/jnlp/GenerateJNLPApplicationTest.java
 
b/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/jnlp/GenerateJNLPApplicationTest.java
index f5b4384..27bb66d 100644
--- 
a/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/jnlp/GenerateJNLPApplicationTest.java
+++ 
b/apisupport/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/jnlp/GenerateJNLPApplicationTest.java
@@ -129,7 +129,6 @@ public class GenerateJNLPApplicationTest extends TestBase {
 //"org.openide.options," +
 //"org.openide.text," +
 //"org.openide.windows," +
-//"org.openide.util.enumerations" +
 //"");
 //ep.setProperty("jnlp.servlet.jar", someJar.toString());
 //
suite.getHelper().putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, ep);
@@ -246,7 +245,6 @@ public class 

[jira] [Updated] (NETBEANSINFRA-264) nbm file creation - Library jars with scope runtime missing

2022-03-12 Thread Axel Hauschulte (Jira)


 [ 
https://issues.apache.org/jira/browse/NETBEANSINFRA-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Axel Hauschulte updated NETBEANSINFRA-264:
--
Affects Version/s: NBM Maven Plugin 4.6

> nbm file creation - Library jars with scope runtime missing
> ---
>
> Key: NETBEANSINFRA-264
> URL: https://issues.apache.org/jira/browse/NETBEANSINFRA-264
> Project: Apache NetBeans Infra
>  Issue Type: Bug
>  Components: MU - Apache NetBeans NBM maven plugin
>Affects Versions: NBM Maven Plugin 4.6
>Reporter: Axel Hauschulte
>Priority: Major
>
> I noticed that not all the library jars required by a module I'm developing 
> are attached to the nbm file when I build the module using the nbm Maven 
> plugin. In fact, the library jars with Maven scope "runtime" are missing 
> while the ones with scope "compile" are correctly included in the nbm file.
> Shouldn’t both types of dependencies (scope compile and scope runtime) be 
> attached to the module’s nbm file?
> Just want to check that I'm not missing something fundamental. I'd be happy 
> to provide a PR.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[jira] [Created] (NETBEANSINFRA-264) nbm file creation - Library jars with scope runtime missing

2022-03-12 Thread Axel Hauschulte (Jira)
Axel Hauschulte created NETBEANSINFRA-264:
-

 Summary: nbm file creation - Library jars with scope runtime 
missing
 Key: NETBEANSINFRA-264
 URL: https://issues.apache.org/jira/browse/NETBEANSINFRA-264
 Project: Apache NetBeans Infra
  Issue Type: Bug
  Components: MU - Apache NetBeans NBM maven plugin
Reporter: Axel Hauschulte


I noticed that not all the library jars required by a module I'm developing are 
attached to the nbm file when I build the module using the nbm Maven plugin. In 
fact, the library jars with Maven scope "runtime" are missing while the ones 
with scope "compile" are correctly included in the nbm file.

Shouldn’t both types of dependencies (scope compile and scope runtime) be 
attached to the module’s nbm file?

Just want to check that I'm not missing something fundamental. I'd be happy to 
provide a PR.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[jira] [Commented] (NETBEANS-5216) Jakarta EE 9 Project Support

2022-03-12 Thread Claudia Pastor Ramirez (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17505298#comment-17505298
 ] 

Claudia Pastor Ramirez commented on NETBEANS-5216:
--

Thank you a lot Josh!

I did open a couple of issues on the GitHub after noticing that you have 
migrated there the issuing traking. They are the 3756 and 3757, if you want to 
review them. Kind regards,

 

> Jakarta EE 9 Project Support
> 
>
> Key: NETBEANS-5216
> URL: https://issues.apache.org/jira/browse/NETBEANS-5216
> Project: NetBeans
>  Issue Type: New Feature
>  Components: javaee - Web Project
>Reporter: Josh Juneau
>Assignee: Josh Juneau
>Priority: Major
>  Labels: pull-request-available
> Fix For: 12.4
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[jira] [Commented] (NETBEANS-5216) Jakarta EE 9 Project Support

2022-03-12 Thread Josh Juneau (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17505294#comment-17505294
 ] 

Josh Juneau commented on NETBEANS-5216:
---

I will open an issue in the GitHub tracker for these items.  Thanks for the 
feedback.

> Jakarta EE 9 Project Support
> 
>
> Key: NETBEANS-5216
> URL: https://issues.apache.org/jira/browse/NETBEANS-5216
> Project: NetBeans
>  Issue Type: New Feature
>  Components: javaee - Web Project
>Reporter: Josh Juneau
>Assignee: Josh Juneau
>Priority: Major
>  Labels: pull-request-available
> Fix For: 12.4
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists