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 <[email protected]>
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
@@ -43,6 +43,7 @@ public interface EjbJar extends
org.netbeans.modules.j2ee.dd.api.common.RootInte
* @since 1.29
*/
public static final String VERSION_3_2 = "3.2"; //NOI18N
+ public static final String VERSION_4_0 = "4.0"; //NOI18N
public static final int STATE_VALID=0;
public static final int STATE_INVALID_PARSABLE=1;
public static final int STATE_INVALID_UNPARSABLE=2;
@@ -52,7 +53,7 @@ public interface EjbJar extends
org.netbeans.modules.j2ee.dd.api.common.RootInte
public static final String RELATIONSHIPS = "Relationships"; //
NOI18N
public static final String ASSEMBLY_DESCRIPTOR = "AssemblyDescriptor";
// NOI18N
public static final String EJB_CLIENT_JAR = "EjbClientJar"; //
NOI18N
-
+
/** Setter for version property.
* Warning : Only the upgrade from lower to higher version is supported.
* @param version ejb-jar version value
diff --git
a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java
b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java
index c3d6b82..d8079bb 100644
--- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java
+++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java
@@ -52,6 +52,7 @@ public interface WebApp extends
org.netbeans.modules.j2ee.dd.api.common.RootInte
*/
static final String VERSION_3_1 = "3.1"; //NOI18N
static final String VERSION_4_0 = "4.0"; //NOI18N
+ static final String VERSION_5_0 = "5.0"; //NOI18N
static final int STATE_VALID = 0;
static final int STATE_INVALID_PARSABLE = 1;
static final int STATE_INVALID_UNPARSABLE = 2;
diff --git
a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/Util.java
b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/Util.java
index be23141..9dfae65 100644
---
a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/Util.java
+++
b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/Util.java
@@ -26,11 +26,11 @@ import javax.swing.JLabel;
import java.awt.Container;
import java.io.IOException;
import java.util.ArrayList;
+import static java.util.Arrays.asList;
import javax.swing.JComponent;
import java.util.Vector;
import java.util.Iterator;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -178,11 +178,11 @@ public class Util {
return false;
}
if (JPAModuleInfo.ModuleType.EJB == moduleInfo.getType()
- && ("3.1".equals(moduleInfo.getVersion()) ||
"3.0".equals(moduleInfo.getVersion()) ||
"3.2".equals(moduleInfo.getVersion()))) {
+ && asList("3.0", "3.1", "3.2", "3.2.6",
"4.0").contains(moduleInfo.getVersion())) {
return true;
}
if (JPAModuleInfo.ModuleType.WEB == moduleInfo.getType()
- && ("3.1".equals(moduleInfo.getVersion()) ||
"3.0".equals(moduleInfo.getVersion()) ||
"2.5".equals(moduleInfo.getVersion()))) {
+ && asList("2.5", "3.1", "3.0", "4.0",
"5.0").contains(moduleInfo.getVersion())) {
return true;
}
return false;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists