[netbeans] branch master updated: FISH-7082 Use Payara Micro Maven Archetype 1.x/2.x release binary for respective Payara Micro 5.x/6.x (#5573)

2023-03-06 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 842a1c794f FISH-7082 Use Payara Micro Maven Archetype 1.x/2.x release 
binary for respective Payara Micro 5.x/6.x (#5573)
842a1c794f is described below

commit 842a1c794faad30dd7a4498dc8232d18c70f85c2
Author: Gaurav Gupta 
AuthorDate: Tue Mar 7 12:38:24 2023 +0530

FISH-7082 Use Payara Micro Maven Archetype 1.x/2.x release binary for 
respective Payara Micro 5.x/6.x (#5573)
---
 .../payara/micro/project/ui/MicroProjectWizardIterator.java   | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/MicroProjectWizardIterator.java
 
b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/MicroProjectWizardIterator.java
index ed97c264ff..c1b0ffbbc8 100644
--- 
a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/MicroProjectWizardIterator.java
+++ 
b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/ui/MicroProjectWizardIterator.java
@@ -79,7 +79,7 @@ public final class MicroProjectWizardIterator extends 
BaseWizardIterator {
 String payaraMicroVersion = (String) 
descriptor.getProperty(PROP_PAYARA_MICRO_VERSION);
 String autoBindHttp = (String) 
descriptor.getProperty(PROP_AUTO_BIND_HTTP);
 String contextRoot = (String) 
descriptor.getProperty(PROP_CONTEXT_ROOT);
-Archetype archetype = createMojoArchetype();
+Archetype archetype = createMojoArchetype(payaraMicroVersion);
 
 Map properties = new HashMap<>();
 if (payaraMicroVersion != null) {
@@ -106,11 +106,16 @@ public final class MicroProjectWizardIterator extends 
BaseWizardIterator {
 return projects;
 }
 
-private Archetype createMojoArchetype() {
+private Archetype createMojoArchetype(String payaraMicroVersion) {
 Archetype archetype = new Archetype();
 archetype.setGroupId(ARCHETYPE_GROUP_ID);
 archetype.setArtifactId(ARCHETYPE_ARTIFACT_ID);
-// latest version of archetype automatically fetched from remote 
catalog
+String[] versionToken = payaraMicroVersion.split("\\.");
+if (versionToken.length > 1 && Integer.parseInt(versionToken[0]) < 6) {
+archetype.setVersion("1.4.0");
+} else {
+// latest version of archetype automatically fetched from remote 
catalog
+}
 return archetype;
 }
 


-
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



[netbeans] branch master updated: Limit ValidateClassFilesTest to scan only JARs referenced from modules (#4775)

2022-10-13 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 3cbe596ea5 Limit ValidateClassFilesTest to scan only JARs referenced 
from modules (#4775)
3cbe596ea5 is described below

commit 3cbe596ea56c05de76f23474a2857aa28f6dc065
Author: Matthias Bläsing 
AuthorDate: Fri Oct 14 08:09:45 2022 +0200

Limit ValidateClassFilesTest to scan only JARs referenced from modules 
(#4775)

With the addition of jakarta ee 10 API jars it was found, that there is
an implicit assumption, that all JARs not referenced by modules have
to be JDK 8 compatible. In the case of jakarta ee 10 this is an
invalid assumption as it explicitly does not support JDK 8. The module
that introduces the binaries correctly declares a JDK 11 dependeny, but
at runtime the module <-> binary association is lost.

To prevent false positives, the test must be limited to JARs, that are
directly referenced from modules.
---
 ide/extexecution.process.jdk9/manifest.mf | 2 +-
 .../src/org/netbeans/core/validation/ValidateClassFilesTest.java  | 8 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ide/extexecution.process.jdk9/manifest.mf 
b/ide/extexecution.process.jdk9/manifest.mf
index c658b40501..c03a01512d 100644
--- a/ide/extexecution.process.jdk9/manifest.mf
+++ b/ide/extexecution.process.jdk9/manifest.mf
@@ -3,5 +3,5 @@ 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.18
-OpenIDE-Module-Java-Dependencies: Java > 1.9.0
+OpenIDE-Module-Java-Dependencies: Java > 9
 OpenIDE-Module-Provides: 
org.netbeans.spi.extexecution.base.ProcessesImplementation
diff --git 
a/platform/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateClassFilesTest.java
 
b/platform/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateClassFilesTest.java
index a2b00bbe44..6ac824a7d5 100644
--- 
a/platform/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateClassFilesTest.java
+++ 
b/platform/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateClassFilesTest.java
@@ -78,7 +78,11 @@ public class ValidateClassFilesTest extends NbTestCase {
 final File file = path.toFile();
 if (file.getName().endsWith(".jar")) {
 
-int classFileVersion = 
classFileVersions.getOrDefault(file.getName(), 52);
+if(! classFileVersions.containsKey(file.getName())) {
+return FileVisitResult.CONTINUE;
+}
+
+int classFileVersion = 
classFileVersions.get(file.getName());
 
 JarFile jf = new JarFile(file);
 Enumeration en = jf.entries();
@@ -129,7 +133,7 @@ public class ValidateClassFilesTest extends NbTestCase {
 if (dep.getType() == Dependency.TYPE_JAVA) {
 String javaVersion = dep.getVersion();
 if (javaVersion.startsWith("1.")) {
-break;
+javaVersion = javaVersion.substring(2);
 }
 int classFileVersion = Integer.parseInt(javaVersion) + 44;
 for (File jar : module.getAllJars()) {


-
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



[netbeans] branch master updated (2c27f5a31b -> 3a91f19f04)

2022-10-09 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

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


from 2c27f5a31b Merge pull request #4603 from 
errael/KeyboardFocusCanActivateTopComponent
 add 3a91f19f04 Unable to register Payara 6.x in Apache NetBeans 15 (#4695)

No new revisions were added by this update.

Summary of changes:
 .../payara/eecommon/api/config/J2EEVersion.java| 21 ++-
 .../payara/jakartaee/Hk2JavaEEPlatformImpl.java|  8 +
 .../org-netbeans-modules-payara-tooling.sig|  8 -
 .../server/config/ConfigBuilderProvider.java   |  9 +++--
 .../tooling/server/config/JavaEEProfile.java   | 23 +---
 .../server/config/{PayaraV5.xml => PayaraV6.xml}   | 42 ++
 6 files changed, 79 insertions(+), 32 deletions(-)
 copy 
enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/{PayaraV5.xml
 => PayaraV6.xml} (72%)


-
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



[netbeans] branch master updated: Application deployment support to locally running Payara Server docker container (#3330)

2022-02-01 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 8774f8d  Application deployment support to locally running Payara 
Server docker container (#3330)
8774f8d is described below

commit 8774f8d75a938de684f44d20133951e75323f245
Author: Gaurav Gupta 
AuthorDate: Wed Feb 2 12:19:15 2022 +0530

Application deployment support to locally running Payara Server docker 
container (#3330)

* FISH-511 Web Application deployment support to locally running Payara 
Server docker container

* FISH-511 Javadoc format fix
---
 .../modules/payara/common/CommonServerSupport.java |  13 +-
 .../modules/payara/common/PayaraInstance.java  |  83 -
 .../modules/payara/common/ui/Bundle.properties |   8 +-
 .../modules/payara/common/ui/InstancePanel.form|  87 ++
 .../modules/payara/common/ui/InstancePanel.java| 103 
 .../common/wizards/AddDomainLocationPanel.java |   3 +
 .../wizards/AddDomainLocationVisualPanel.form  |  97 ---
 .../wizards/AddDomainLocationVisualPanel.java  | 132 +++--
 .../payara/common/wizards/Bundle.properties|   5 +
 .../common/wizards/ServerWizardIterator.java   |  36 +-
 .../netbeans/modules/payara/spi/PayaraModule.java  |   3 +
 .../payara/jakartaee/Hk2DeploymentManager.java |  16 ++-
 .../payara/jakartaee/Hk2OptionalFactory.java   |   2 +-
 .../org-netbeans-modules-payara-tooling.sig|   6 +
 .../payara/tooling/admin/RunnerHttpDeploy.java |  17 ++-
 .../modules/payara/tooling/data/PayaraServer.java  |  22 
 .../payara/tooling/data/PayaraServerEntity.java|  39 ++
 17 files changed, 568 insertions(+), 104 deletions(-)

diff --git 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/CommonServerSupport.java
 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/CommonServerSupport.java
index ef917a0..cc4746e 100644
--- 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/CommonServerSupport.java
+++ 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/CommonServerSupport.java
@@ -36,6 +36,8 @@ import java.io.File;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.Socket;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.*;
 import java.util.Map.Entry;
 import java.util.concurrent.*;
@@ -1147,7 +1149,16 @@ public class CommonServerSupport
 }
 if (path.startsWith("file:")) {  // NOI18N
 path = path.substring(5);
-path = (new File(path)).getAbsolutePath();
+if (getInstance().isDocker()
+&& getInstance().getHostPath() != null
+&& !getInstance().getHostPath().isEmpty()
+&& getInstance().getContainerPath() != null
+&& !getInstance().getContainerPath().isEmpty()) {
+Path relativePath = 
Paths.get(getInstance().getContainerPath()).relativize(Paths.get(path));
+path = Paths.get(getInstance().getHostPath(), 
relativePath.toString()).toString();
+} else {
+path = (new File(path)).getAbsolutePath();
+}
 }
 
 String enabledKey = "servers.server.server.application-ref."
diff --git 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
index 8f73e3d..84f45ac 100644
--- 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
+++ 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
@@ -354,11 +354,25 @@ public class PayaraInstance implements 
ServerInstanceImplementation,
 }
 }
 
+@Deprecated
+public static PayaraInstance create(String displayName,
+String installRoot, String payaraRoot, String domainsDir,
+String domainName, int httpPort, int adminPort,
+String userName, String password, String target, String url,
+PayaraInstanceProvider pip) {
+return create(displayName,
+installRoot, payaraRoot, domainsDir,
+domainName, httpPort, adminPort,
+userName, password,
+false, null, null,
+target, url,
+pip);
+}
+ 
 /** 
- * Creates a PayaraInstance object for a server installation.  This
+ * Creates a PayaraInstance object for a server installation.This
  * instance should be added to the t

[netbeans] branch master updated: JDK 17 support to Payara Platform tools in Apache NetBeans IDE (#3508)

2022-01-28 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 8283367  JDK 17 support to Payara Platform tools in Apache NetBeans 
IDE (#3508)
8283367 is described below

commit 828336731ab1484ec17eab6de26a29fc63ee10d1
Author: Gaurav Gupta 
AuthorDate: Fri Jan 28 14:35:22 2022 +0530

JDK 17 support to Payara Platform tools in Apache NetBeans IDE (#3508)
---
 .../modules/payara/tooling/server/config/JavaSEPlatform.java  | 8 +++-
 .../netbeans/modules/payara/tooling/server/config/PayaraV5.xml| 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java
 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java
index 9d37405..1dbdd74 100644
--- 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java
+++ 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaSEPlatform.java
@@ -49,7 +49,9 @@ public enum JavaSEPlatform {
 /** JavaSE 1.8. */
 v1_8,
 /** JavaSE 11. */
-v11;
+v11,
+/** JavaSE 17. */
+v17;
 
 

 // Class attributes   
//
@@ -88,6 +90,9 @@ public enum JavaSEPlatform {
 /**  A String representation of v11 value. */
 static final String V11_STR = "11";
 
+/**  A String representation of v17 value. */
+static final String V17_STR = "17";
+
 /** 
  * Stored String values for backward String
  * conversion.
@@ -148,6 +153,7 @@ public enum JavaSEPlatform {
 case v1_7: return V1_7_STR;
 case v1_8: return V1_8_STR;
 case v11: return V11_STR;
+case v17: return V17_STR;
 // This is unrecheable. Being here means this class does not handle
 // all possible values correctly.
 default:   throw new ServerConfigException(
diff --git 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV5.xml
 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV5.xml
index 16ef582..7118760 100644
--- 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV5.xml
+++ 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV5.xml
@@ -26,6 +26,7 @@ under the License.
 
 
 
+
 
 
 
@@ -85,7 +86,6 @@ under the License.
 
 
 
-
 
 
 

-
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



[netbeans] branch master updated: Payara Micro Hot Deploy support in Apache NetBeans (#3248)

2022-01-26 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 47f0466  Payara Micro Hot Deploy support in Apache NetBeans (#3248)
47f0466 is described below

commit 47f0466f202eb2b0025520e9104f958d967146c2
Author: Gaurav Gupta 
AuthorDate: Wed Jan 26 23:25:55 2022 +0530

Payara Micro Hot Deploy support in Apache NetBeans (#3248)

* Payara Micro Hot Deploy support in Apache NetBeans

* Fixes selectedPayaraVersion NPE
---
 .../fish/payara/micro/plugin/Constants.java|  1 +
 .../fish/payara/micro/project/Bundle.properties|  2 +
 .../payara/micro/project/DeployOnSaveManager.java  | 52 +-
 .../payara/micro/project/MicroActionsProvider.java | 20 ++
 .../micro/project/MicroExecutionChecker.java   |  3 +-
 .../payara/micro/project/MicroPropertiesPanel.form | 36 --
 .../payara/micro/project/MicroPropertiesPanel.java | 41 ---
 .../fish/payara/micro/project/ReloadAction.java| 83 +-
 8 files changed, 172 insertions(+), 66 deletions(-)

diff --git 
a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Constants.java
 
b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Constants.java
index c8d6642..7f8b78b 100644
--- 
a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Constants.java
+++ 
b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/plugin/Constants.java
@@ -43,6 +43,7 @@ public interface Constants {
 String PROP_CONTEXT_ROOT = "contextRoot";
 
 String VERSION = "version";
+String HOT_DEPLOY = "hotDeploy";
 
 String WAR_PACKAGING = "war";
 
diff --git 
a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/Bundle.properties
 
b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/Bundle.properties
index 8f2e73f..aee40ac 100644
--- 
a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/Bundle.properties
+++ 
b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/Bundle.properties
@@ -23,3 +23,5 @@ MSG_IncrementalDeployFailed=Error during incremental deploy\: 
{0}
 TXT_Reload=Reload ({0})
 ERR_Compile_On_Save_Not_Enabled=Reload Error ({0} : Compile on save not 
enabled)
 ERR_Payara_Micro_Plugin_Not_Found=Reload Error ({0} : Payara Micro plugin not 
found)
+MicroPropertiesPanel.hotDeployLabel.text=Hot Deploy:
+MicroPropertiesPanel.hotDeployCheckBox.text=
diff --git 
a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java
 
b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java
index 53044d2..0bd7796 100644
--- 
a/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java
+++ 
b/enterprise/payara.micro/src/org/netbeans/modules/fish/payara/micro/project/DeployOnSaveManager.java
@@ -97,10 +97,9 @@ public final class DeployOnSaveManager {
 return t;
 });
 
-//private final ExecutorService EXECUTOR = Executors.newFixedThreadPool(1);
 /** GuardedBy("this")
  */
-private Map> toDeploy = new HashMap<>();
+private Map toDeploy = new HashMap<>();
 
 /** GuardedBy("this")
  */
@@ -230,19 +229,16 @@ public final class DeployOnSaveManager {
 }
 }
 
-public void submitChangedArtifacts(J2eeModuleProvider provider, 
Iterable artifacts) {
+public void submitChangedArtifacts(Project project, J2eeModuleProvider 
provider, Iterable artifacts) {
 assert provider != null;
 assert artifacts != null;
 
 synchronized (this) {
-Set preparedArtifacts = toDeploy.get(provider);
+DeployArtifact preparedArtifacts = toDeploy.get(provider);
 if (preparedArtifacts == null) {
-preparedArtifacts = new HashSet<>();
+preparedArtifacts = new DeployArtifact(project, artifacts);
 toDeploy.put(provider, preparedArtifacts);
 }
-for (Artifact artifact : artifacts) {
-preparedArtifacts.add(artifact);
-}
 
 boolean delayed = true;
 if (current != null && !current.isDone()) {
@@ -308,7 +304,7 @@ public final class DeployOnSaveManager {
 LOGGER.log(Level.FINE, "Delivered compile artifact: {0}", 
artifact);
 }
 }
-
DeployOnSaveManager.getDefault().submitChangedArtifacts(realProvider, 
realArtifacts);
+
DeployOnSaveManager.getDefault().submitChangedArtifacts(realProject, 
realProvider, realArtifacts);
 
 try {
 current.

[netbeans] branch master updated: NETBEANS-3270 Webapp not correctly recognized as Java EE (#3231)

2022-01-13 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 09555f4  NETBEANS-3270 Webapp not correctly recognized as Java EE 
(#3231)
09555f4 is described below

commit 09555f479cf01dc92a5ac33e28d531c1e01f5292
Author: Gaurav Gupta 
AuthorDate: Thu Jan 13 19:26:06 2022 +0530

NETBEANS-3270 Webapp not correctly recognized as Java EE (#3231)
---
 .../eecommon/api/config/EjbJarVersion.java | 67 --
 .../netbeans/modules/j2ee/dd/api/ejb/EjbJar.java   |  3 +-
 .../netbeans/modules/j2ee/dd/api/web/WebApp.java   |  1 +
 .../modules/j2ee/persistence/wizard/Util.java  |  6 +-
 4 files changed, 57 insertions(+), 20 deletions(-)

diff --git 
a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java
 
b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java
index f3cb9b8..0f279f1 100644
--- 
a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java
+++ 
b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java
@@ -26,33 +26,61 @@ package org.netbeans.modules.glassfish.eecommon.api.config;
  */
 public final class EjbJarVersion extends J2EEBaseVersion {
 
-/** Represents ejbjar version 2.0
+/**
+ * Represents ejbjar version 2.0
  */
 public static final EjbJarVersion EJBJAR_2_0 = new EjbJarVersion(
-"2.0", 2000,   // NOI18N
-"1.3", 1300// NOI18N
-);
+"2.0", 2000, // NOI18N
+"1.3", 1300 // NOI18N
+);
 
-/** Represents ejbjar version 2.1
+/**
+ * Represents ejbjar version 2.1
  */
 public static final EjbJarVersion EJBJAR_2_1 = new EjbJarVersion(
-"2.1", 2101,   // NOI18N
-"1.4", 1400// NOI18N
-);
+"2.1", 2101, // NOI18N
+"1.4", 1400 // NOI18N
+);
 
-/** Represents ejbjar version 3.0
+/**
+ * Represents ejbjar version 3.0
  */
 public static final EjbJarVersion EJBJAR_3_0 = new EjbJarVersion(
-"3.0", 3000,   // NOI18N
-"5.0", 5000// NOI18N
-);
+"3.0", 3000, // NOI18N
+"5.0", 5000 // NOI18N
+);
 
-/** Represents ejbjar version 3.0
+/**
+ * Represents ejbjar version 3.1
  */
 public static final EjbJarVersion EJBJAR_3_1 = new EjbJarVersion(
-"3.1", 3100,   // NOI18N
-"6.0", 6000// NOI18N
-);
+"3.1", 3100, // NOI18N
+"6.0", 6000 // NOI18N
+);
+
+/**
+ * Represents ejbjar version 3.2
+ */
+public static final EjbJarVersion EJBJAR_3_2 = new EjbJarVersion(
+"3.2", 3200, // NOI18N
+"7.0", 7000 // NOI18N
+);
+
+/**
+ * Represents ejbjar version 3.2.6
+ */
+public static final EjbJarVersion EJBJAR_3_2_6 = new EjbJarVersion(
+"3.2.6", 3260, // NOI18N
+"8.0", 8000 // NOI18N
+);
+
+/**
+ * Represents ejbjar version 4.0
+ */
+public static final EjbJarVersion EJBJAR_4_0 = new EjbJarVersion(
+"4.0", 4000, // NOI18N
+"9.0", 9000 // NOI18N
+);
 /** ---
  *  Implementation
  */
@@ -70,6 +98,7 @@ public final class EjbJarVersion extends J2EEBaseVersion {
  * than the version passed in as an argument.
  *  @throws ClassCastException if obj is not a EjbJarVersion object.
  */
+@Override
 public int compareTo(Object obj) {
 EjbJarVersion target = (EjbJarVersion) obj;
 return numericCompare(target);
@@ -86,6 +115,12 @@ public final class EjbJarVersion extends J2EEBaseVersion {
 result = EJBJAR_3_0;
 } else if(EJBJAR_3_1.toString().equals(version)) {
 result = EJBJAR_3_1;
+} else if(EJBJAR_3_2.toString().equals(version)) {
+result = EJBJAR_3_2;
+} else if(EJBJAR_3_2_6.toString().equals(version)) {
+result = EJBJAR_3_2_6;
+} else if(EJBJAR_4_0.toString().equals(version)) {
+result = EJBJAR_4_0;
 }
 
 return result;
diff --git 
a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/EjbJar.java 
b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/EjbJar.java
index f1dfa05..891750f 100644
--- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/EjbJar.java
+++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/EjbJar.java
@@

[netbeans] branch master updated: Fixes creation of a Glassfish deployment descriptor (#3219)

2022-01-13 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 de94f12  Fixes creation of a Glassfish deployment descriptor (#3219)
de94f12 is described below

commit de94f12e898a66153123bf535a397b3202e7fcd3
Author: Gaurav Gupta 
AuthorDate: Thu Jan 13 19:23:43 2022 +0530

Fixes creation of a Glassfish deployment descriptor (#3219)
---
 .../modules/glassfish/eecommon/api/Utils.java  | 26 --
 .../configbean/templates/SunDDVisualPanel.java |  9 
 2 files changed, 9 insertions(+), 26 deletions(-)

diff --git 
a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/Utils.java
 
b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/Utils.java
index 89cf116..6b4953e 100644
--- 
a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/Utils.java
+++ 
b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/Utils.java
@@ -30,6 +30,8 @@ import org.netbeans.api.project.ProjectUtils;
 import org.netbeans.modules.glassfish.eecommon.api.config.J2eeModuleHelper;
 import org.netbeans.modules.j2ee.dd.api.common.RootInterface;
 import org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException;
+import org.netbeans.modules.j2ee.dd.api.ejb.EjbJar;
+import org.netbeans.modules.j2ee.dd.api.web.WebApp;
 import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
 import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
 import org.openide.filesystems.FileObject;
@@ -177,30 +179,10 @@ public final class Utils {
 }
 
 public static FileObject getSunDDFromProjectsModuleVersion(J2eeModule mod, 
String sunDDFileName) {
-FileObject retVal = null;
-String suffix = "-java_ee_5/";
-if (null != mod) {
-String modVer = mod.getModuleVersion();
-J2eeModule.Type t = mod.getType();
-// ejb 2.0, 2.1, 3.0, 3.1
-// web 2.3, 2.4, 2.5, 3.0
-// appcli 1.3, 1.4, 5.0, 6.0
-// ear 1.3, 1.4, 5, 6
-if (modVer.equals("6") || modVer.equals("6.0") || 
modVer.endsWith("1.6") || modVer.equals("3.1")) {
-suffix = "-java_ee/";
-} else if (modVer.equals("3.0")) {
-if (J2eeModule.Type.WAR.equals(t)) {
-suffix = "-java_ee/";
-}
-} else if (modVer.equals("1.4") || modVer.equals("2.4") || 
modVer.equals("2.1")) {
-suffix = "-j2ee_1_4/";
-} else if (modVer.equals("2.0") || modVer.equals("2.3") || 
modVer.equals("1.3")) {
-suffix = "-j2ee_1_3/";
-}
-}
+FileObject retVal;
+String suffix = "-java_ee/";
 String resource = 
"org-netbeans-modules-glassfish-eecommon-ddtemplates" + suffix + sunDDFileName; 
// NOI18N
 retVal = FileUtil.getConfigFile(resource);
-
 return retVal;
 }
 
diff --git 
a/enterprise/j2ee.sun.ddui/src/org/netbeans/modules/j2ee/sun/share/configbean/templates/SunDDVisualPanel.java
 
b/enterprise/j2ee.sun.ddui/src/org/netbeans/modules/j2ee/sun/share/configbean/templates/SunDDVisualPanel.java
index f034494..590f247 100644
--- 
a/enterprise/j2ee.sun.ddui/src/org/netbeans/modules/j2ee/sun/share/configbean/templates/SunDDVisualPanel.java
+++ 
b/enterprise/j2ee.sun.ddui/src/org/netbeans/modules/j2ee/sun/share/configbean/templates/SunDDVisualPanel.java
@@ -41,6 +41,7 @@ public final class SunDDVisualPanel extends JPanel {
 private String sunDDFileName;
 private File sunDDFile;
 private File sunDDLocation;
+private static final String STANDARD_DD_NAME = "web.xml";
 
 public SunDDVisualPanel() {
 initComponents();
@@ -58,10 +59,10 @@ public final class SunDDVisualPanel extends JPanel {
 J2eeModule j2eeModule = provider.getJ2eeModule();
 sunDDFileName = 
getConfigFileName(j2eeModule,provider.getServerInstanceID());
 
-// Calculate location:
-sunDDFile = (sunDDFileName != null) ? 
j2eeModule.getDeploymentConfigurationFile(sunDDFileName) : null;
-sunDDLocation = (sunDDFile != null) ? sunDDFile.getParentFile() : null;
-
+// Calculate location:
+sunDDLocation = 
j2eeModule.getDeploymentConfigurationFile(STANDARD_DD_NAME).getParentFile();
+sunDDFile = (sunDDFileName != null) ? new File(sunDDLocation, 
sunDDFileName) : null;
+
 // initialize visual components
 textFileName.setText(sunDDFileName); // NOI18N
 
textProjectName.setText(ProjectUtils.getInformation

[netbeans] branch master updated: Fixes fetching the Payara Server list in private network (#3018)

2021-07-22 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 13d5f70  Fixes fetching the Payara Server list in private network 
(#3018)
13d5f70 is described below

commit 13d5f709df527af9d05a496be9ceccdb5469ddb3
Author: Gaurav Gupta 
AuthorDate: Fri Jul 23 00:24:09 2021 +0530

Fixes fetching the Payara Server list in private network (#3018)

* Fixes fetching the Payara Server list in private network

* Retrying fetching the Payara Server version from listed repositories

* Skip empty archetypeVersion property to run the latest archetype

* Fixes typo

* Log UnknownHost Exception

* Payara Server registration panel UI improvement

* Validate local metadata root location
---
 .../common/wizards/AddServerLocationPanel.java |  11 +-
 .../wizards/AddServerLocationVisualPanel.form  |   2 +
 .../wizards/AddServerLocationVisualPanel.java  |  20 +++-
 .../payara/common/wizards/Bundle.properties|   3 +-
 .../modules/payara/common/wizards/Retriever.java   |   2 +-
 .../fish/payara/micro/project/ui/Bundle.properties |   1 +
 .../project/ui/MicroProjectWizardIterator.java |   4 +-
 .../payara/micro/project/ui/PayaraMicroPanel.form  |  39 ---
 .../payara/micro/project/ui/PayaraMicroPanel.java  |  39 +--
 enterprise/payara.tooling/nbproject/project.xml|  25 +++--
 .../payara/tooling/data/PayaraPlatformVersion.java | 119 -
 java/maven.indexer/nbproject/project.xml   |   1 +
 .../maven/newproject/ArchetypeWizardUtils.java |   5 +-
 13 files changed, 202 insertions(+), 69 deletions(-)

diff --git 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationPanel.java
 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationPanel.java
index 00b3bd0..851876d 100644
--- 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationPanel.java
+++ 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationPanel.java
@@ -138,6 +138,14 @@ public class AddServerLocationPanel implements 
WizardDescriptor.FinishablePanel,
 File installDir = new File(locationStr).getAbsoluteFile();
 File payaraDir = getPayaraRoot(installDir);
 File domainDir = getDefaultDomain(payaraDir);
+StringBuilder message = new StringBuilder();
+if (wizardIterator.downloadableValues.isEmpty()) {
+message.append(NbBundle.getMessage(
+AddServerLocationPanel.class,
+"LBL_UnableToConnectPayaraMavenRepo"))
+.append(" "); // NOI18N
+panel.updateMessageText(message.toString());
+}
 if (!installDir.exists()) {
 if (!isLegalFolder(installDir)) {
 wizard.putProperty(PROP_ERROR_MESSAGE, 
NbBundle.getMessage(
@@ -145,8 +153,9 @@ public class AddServerLocationPanel implements 
WizardDescriptor.FinishablePanel,
 return false;
 } else if (canCreate(installDir)) {
 if (downloadState == 
AddServerLocationVisualPanel.DownloadState.AVAILABLE) {
-
panel.updateMessageText(NbBundle.getMessage(AddServerLocationPanel.class,
+
message.append(NbBundle.getMessage(AddServerLocationPanel.class,
 "LBL_NewInstallDirCanBeUsed", 
getSanitizedPath(installDir)));  // NOI18N
+panel.updateMessageText(message.toString());
 wizard.putProperty(PROP_ERROR_MESSAGE, 
panel.getStatusText());
 return false;
 } else {
diff --git 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationVisualPanel.form
 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationVisualPanel.form
index 9248c69..e814bef 100644
--- 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationVisualPanel.form
+++ 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationVisualPanel.form
@@ -256,6 +256,8 @@
   
   
 
+
+
 
   
 
diff --git 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationVisualPanel.java
 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddServerLocationVisualPanel.java
index 7ee0bf4..e6dd15c 100644
--- 
a/enterprise/payara.common/src/org/netbeans

[netbeans] branch master updated: NETBEANS-3584 Payara Platform 5.194/5.201 support in Apache NetBeans IDE

2019-12-16 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 c5f509b  NETBEANS-3584 Payara Platform 5.194/5.201 support in Apache 
NetBeans IDE
 new f4b48e1  Merge pull request #1772 from jGauravGupta/NETBEANS-3584
c5f509b is described below

commit c5f509b72acd1d314383736248e91f7ac21158f3
Author: Gaurav Gupta 
AuthorDate: Thu Dec 12 14:22:17 2019 +0530

NETBEANS-3584 Payara Platform 5.194/5.201 support in Apache NetBeans IDE

Signed-off-by: Gaurav Gupta 
---
 .../org-netbeans-modules-payara-common.sig |  2 ++
 .../modules/payara/common/Bundle.properties|  2 ++
 .../modules/payara/common/ServerDetails.java   | 31 --
 .../payara/micro/project/VersionRepository.java|  1 +
 .../org-netbeans-modules-payara-tooling.sig|  4 ++-
 .../modules/payara/tooling/admin/AdminFactory.java |  2 ++
 .../modules/payara/tooling/data/PayaraVersion.java | 16 ++-
 7 files changed, 54 insertions(+), 4 deletions(-)

diff --git 
a/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig 
b/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig
index 758b0ab..e0057fb 100644
--- a/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig
+++ b/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig
@@ -1520,6 +1520,8 @@ fld public final static 
org.netbeans.modules.payara.common.ServerDetails PAYARA_
 fld public final static org.netbeans.modules.payara.common.ServerDetails 
PAYARA_SERVER_5_191
 fld public final static org.netbeans.modules.payara.common.ServerDetails 
PAYARA_SERVER_5_192
 fld public final static org.netbeans.modules.payara.common.ServerDetails 
PAYARA_SERVER_5_193
+fld public final static org.netbeans.modules.payara.common.ServerDetails 
PAYARA_SERVER_5_194
+fld public final static org.netbeans.modules.payara.common.ServerDetails 
PAYARA_SERVER_5_201
 meth public boolean isInstalledInDirectory(java.io.File)
 meth public int getVersion()
 meth public java.lang.String getDirectUrl()
diff --git 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/Bundle.properties
 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/Bundle.properties
index a48096e..5195229 100644
--- 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/Bundle.properties
+++ 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/Bundle.properties
@@ -158,6 +158,8 @@ STR_5184_SERVER_NAME=Payara Server 5.184
 STR_5191_SERVER_NAME=Payara Server 5.191
 STR_5192_SERVER_NAME=Payara Server 5.192
 STR_5193_SERVER_NAME=Payara Server 5.193
+STR_5194_SERVER_NAME=Payara Server 5.194
+STR_5201_SERVER_NAME=Payara Server 5.201
 
 # CommonServerSupport.java
 MSG_FLAKEY_NETWORK=Network communication problemCould not establish 
\
diff --git 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java
 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java
index 04086e3..870ace8 100644
--- 
a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java
+++ 
b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java
@@ -244,7 +244,27 @@ public enum ServerDetails {
 PAYARA_SERVER_5_193(NbBundle.getMessage(ServerDetails.class, 
"STR_5193_SERVER_NAME", new Object[]{}), // NOI18N
 "deployer:pfv5ee8", // NOI18N
 5193,
-
"https://oss.sonatype.org/service/local/repositories/releases/content/fish/payara/distributions/payara/5.193/payara-5.193.zip";,
 // NOI18N
+
"https://oss.sonatype.org/service/local/repositories/releases/content/fish/payara/distributions/payara/5.193.1/payara-5.193.1.zip";,
 // NOI18N
+null,
+
"https://raw.githubusercontent.com/payara/Payara/master/LICENSE.txt";
+),
+/**
+ * details for an instance of Payara Server 5.194
+ */
+PAYARA_SERVER_5_194(NbBundle.getMessage(ServerDetails.class, 
"STR_5194_SERVER_NAME", new Object[]{}), // NOI18N
+"deployer:pfv5ee8", // NOI18N
+5194,
+
"https://oss.sonatype.org/service/local/repositories/releases/content/fish/payara/distributions/payara/5.194/payara-5.194.zip";,
 // NOI18N
+null,
+
"https://raw.githubusercontent.com/payara/Payara/master/LICENSE.txt";
+),
+/**
+ * details for an instance of Payara Server 5.201
+ */
+PAYARA_SERVER_5_201(NbBundle.getMessage(ServerDetails.class, 
"STR_5201_SERVER_NAME", new Object[]{}), // NOI18N
+"deployer:pfv5ee8", // NOI18N
+5201,
+"", // NOI18N
 null,
   

[netbeans] branch master updated: NETBEANS-3573 Unable to start the Payara server due to JDK version NumberFormatException

2019-12-16 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 1a143c8  NETBEANS-3573 Unable to start the Payara server due to JDK 
version NumberFormatException
 new 8863b18  Merge pull request #1770 from jGauravGupta/NETBEANS-3573
1a143c8 is described below

commit 1a143c81228c901f21b9934f97696b3b29d50aef
Author: Gaurav Gupta 
AuthorDate: Wed Dec 11 10:52:14 2019 +0530

NETBEANS-3573 Unable to start the Payara server due to JDK version 
NumberFormatException

Signed-off-by: Gaurav Gupta 
---
 .../org-netbeans-modules-payara-tooling.sig|   3 +-
 .../modules/payara/tooling/data/JDKVersion.java| 166 ++---
 .../payara/tooling/data/StartupArgsEntity.java |  31 ++--
 .../modules/payara/tooling/server/ServerTasks.java |   3 +-
 .../tooling/server/parser/JvmConfigReader.java |  10 +-
 .../payara/tooling/data/JDKVersionTest.java|  66 
 6 files changed, 174 insertions(+), 105 deletions(-)

diff --git 
a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig 
b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
index 99fca79..fce0555 100644
--- 
a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
+++ 
b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
@@ -1227,7 +1227,6 @@ cons public init()
 supr java.lang.Object
 
 CLSS public final org.netbeans.modules.payara.tooling.data.JDKVersion
-fld public static org.netbeans.modules.payara.tooling.data.JDKVersion 
IDE_JDK_VERSION
 meth public boolean equals(java.lang.Object)
 meth public boolean ge(org.netbeans.modules.payara.tooling.data.JDKVersion)
 meth public boolean gt(org.netbeans.modules.payara.tooling.data.JDKVersion)
@@ -1240,7 +1239,7 @@ meth public java.util.Optional 
getSubMinor()
 meth public java.util.Optional getUpdate()
 meth public short getMajor()
 meth public static boolean 
isCorrectJDK(java.util.Optional,java.util.Optional)
-meth public static boolean 
isCorrectJDK(org.netbeans.modules.payara.tooling.data.JDKVersion,java.util.Optional,java.util.Optional)
+meth public static boolean 
isCorrectJDK(org.netbeans.modules.payara.tooling.data.JDKVersion,java.util.Optional,java.util.Optional,java.util.Optional)
 meth public static org.netbeans.modules.payara.tooling.data.JDKVersion 
getDefaultPlatformVersion()
 meth public static org.netbeans.modules.payara.tooling.data.JDKVersion 
toValue(java.lang.String)
 supr java.lang.Object
diff --git 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/JDKVersion.java
 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/JDKVersion.java
index 873cbcd..24c2c15 100644
--- 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/JDKVersion.java
+++ 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/JDKVersion.java
@@ -41,45 +41,38 @@ public final class JDKVersion {
  * Update version number.
  */
 private final Optional update;
-
+
 /**
  * JDK vendor
  */
 private final Optional vendor;
 
-public static JDKVersion IDE_JDK_VERSION;
+private final static int MAJOR_INDEX = 0;
+private final static int MINOR_INDEX = 1;
+private final static int SUBMINOR_INDEX = 2;
+private final static int UPDATE_INDEX = 3;
 
-private static final String VERSION_MATCHER = "([0-9]+[\\._u\\-]+)*[0-9]+";
+private static JDKVersion IDE_JDK_VERSION;
 
-// split java version into it's constituent parts, i.e.
-// 1.2.3.4 -> [ 1, 2, 3, 4]
-// 1.2.3u4 -> [ 1, 2, 3, 4]
-// 1.2.3_4 -> [ 1, 2, 3, 4]
-private static final String VERSION_SPLITTER = "[\\._u\\-]+";
+private static final String VERSION_MATCHER = 
"(\\d+(\\.\\d+)*)([_u\\-]+[\\S]+)*";
 
 private static final Short DEFAULT_VALUE = 0;
 
-private JDKVersion(String version) {
-if (version.contains("-")) { // NOI18N
-String[] versionSplit = version.split("-"); // NOI18N
-vendor = versionSplit.length > 0 ? Optional.of(versionSplit[0]) : 
Optional.empty();
-version = versionSplit.length > 1 ? versionSplit[1] : ""; // NOI18N
-} else {
-vendor = Optional.empty();
-}
-String[] split = version.split(VERSION_SPLITTER);
-major = split.length > 0 ? Short.parseShort(split[0]) : 0;
-minor = split.length > 1 ? Optional.of(Short.parseShort(split[1])) : 
Optional.empty();
-subminor = split.length > 2 ? Optional.of(Short.parseShort(split[2])) 
: Optional.empty();
-update = split.length > 3 ? Optional.of(Short.parseShort(split[3])) : 
Optional.empty();
+private J

[netbeans] branch master updated: NETBEANS-3547 Support vendor specific JVM options in Payara Server

2019-12-09 Thread jgauravgupta
This is an automated email from the ASF dual-hosted git repository.

jgauravgupta 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 08fdb47  NETBEANS-3547 Support vendor specific JVM options in Payara 
Server
 new d441f95  Merge pull request #1691 from MeroRai/PAYARA-4228
08fdb47 is described below

commit 08fdb473ce3bc92b8c51f9dac9ee781e9cfbb582
Author: Mero Rai 
AuthorDate: Thu Nov 28 21:00:25 2019 +0530

NETBEANS-3547 Support vendor specific JVM options in Payara Server

Signed-off-by: Gaurav Gupta 
---
 .../modules/payara/tooling/data/JDKVersion.java| 53 --
 .../modules/payara/tooling/server/ServerTasks.java |  4 +-
 .../tooling/server/parser/JvmConfigReader.java | 12 -
 3 files changed, 53 insertions(+), 16 deletions(-)

diff --git 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/JDKVersion.java
 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/JDKVersion.java
index ad0ed7a..873cbcd 100644
--- 
a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/JDKVersion.java
+++ 
b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/JDKVersion.java
@@ -41,6 +41,11 @@ public final class JDKVersion {
  * Update version number.
  */
 private final Optional update;
+
+/**
+ * JDK vendor
+ */
+private final Optional vendor;
 
 public static JDKVersion IDE_JDK_VERSION;
 
@@ -54,19 +59,27 @@ public final class JDKVersion {
 
 private static final Short DEFAULT_VALUE = 0;
 
-private JDKVersion(String string) {
-String[] split = string.split(VERSION_SPLITTER);
+private JDKVersion(String version) {
+if (version.contains("-")) { // NOI18N
+String[] versionSplit = version.split("-"); // NOI18N
+vendor = versionSplit.length > 0 ? Optional.of(versionSplit[0]) : 
Optional.empty();
+version = versionSplit.length > 1 ? versionSplit[1] : ""; // NOI18N
+} else {
+vendor = Optional.empty();
+}
+String[] split = version.split(VERSION_SPLITTER);
 major = split.length > 0 ? Short.parseShort(split[0]) : 0;
 minor = split.length > 1 ? Optional.of(Short.parseShort(split[1])) : 
Optional.empty();
 subminor = split.length > 2 ? Optional.of(Short.parseShort(split[2])) 
: Optional.empty();
 update = split.length > 3 ? Optional.of(Short.parseShort(split[3])) : 
Optional.empty();
 }
 
-private JDKVersion(Short major, Short minor, Short subminor, Short update) 
{
+private JDKVersion(Short major, Short minor, Short subminor, Short update, 
String vendor) {
 this.major = major;
 this.minor = Optional.of(minor);
 this.subminor = Optional.of(subminor);
 this.update = Optional.of(update);
+this.vendor = Optional.of(vendor);
 }
 
 /**
@@ -104,6 +117,15 @@ public final class JDKVersion {
 public Optional getUpdate() {
 return update;
 }
+
+ /**
+ * Get JDK Vendor.
+ *
+ * @return JDK vendor.
+ */
+public Optional getVendor() {
+return vendor;
+}
 
 public boolean gt(JDKVersion version) {
 if (major > version.getMajor()) {
@@ -235,11 +257,15 @@ public final class JDKVersion {
 return IDE_JDK_VERSION;
 }
 
-public static boolean isCorrectJDK(JDKVersion jdkVersion, 
Optional minVersion, Optional maxVersion) {
+public static boolean isCorrectJDK(JDKVersion jdkVersion, Optional 
vendor, Optional minVersion, Optional maxVersion) {
 boolean correctJDK = true;
-if (minVersion.isPresent()) {
-correctJDK = jdkVersion.ge(minVersion.get());
+
+if (vendor.isPresent()) { 
+correctJDK = jdkVersion.vendor.get().contains(vendor.get());
 }
+if (correctJDK && minVersion.isPresent()) {
+correctJDK = jdkVersion.ge(minVersion.get());
+}   
 if (correctJDK && maxVersion.isPresent()) {
 correctJDK = jdkVersion.le(maxVersion.get());
 }
@@ -247,7 +273,7 @@ public final class JDKVersion {
 }
 
 public static boolean isCorrectJDK(Optional minVersion, 
Optional maxVersion) {
-return isCorrectJDK(IDE_JDK_VERSION, minVersion, maxVersion);
+return isCorrectJDK(IDE_JDK_VERSION, Optional.empty(), minVersion, 
maxVersion);
 }
 
 static {
@@ -259,6 +285,7 @@ public final class JDKVersion {
 short minor = 0;
 short subminor = 0;
 short update = 0;
+String vendor = System.getProperty("java.vendor"); // NOI18N
 try {
 /*
 In JEP 223 java.specification.version will be a single number 
versioning , n