pepness commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r562264709
##########
File path:
enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/EjbJarProjectProperties.java
##########
@@ -323,11 +323,16 @@ private void init() {
PLATFORM_LIST_RENDERER =
PlatformUiSupport.createPlatformListCellRenderer();
SpecificationVersion minimalSourceLevel = null;
Profile profile =
Profile.fromPropertiesString(evaluator.getProperty(J2EE_PLATFORM));
- if (Profile.JAVA_EE_6_FULL.equals(profile)) {
+ LOGGER.log(Level.INFO, "init(326) profile: {0}", profile);
+ if (Profile.JAKARTA_EE_8_FULL.equals(profile)) {
+ minimalSourceLevel = new SpecificationVersion("1.8");
+ } else if (Profile.JAVA_EE_8_FULL.equals(profile)) {
+ minimalSourceLevel = new SpecificationVersion("1.8");
+ } else if (Profile.JAVA_EE_7_FULL.equals(profile)) {
+ minimalSourceLevel = new SpecificationVersion("1.7");
+ } else if (Profile.JAVA_EE_6_FULL.equals(profile)) {
minimalSourceLevel = new SpecificationVersion("1.6");
} else if (Profile.JAVA_EE_5.equals(profile)) {
- minimalSourceLevel = new SpecificationVersion("1.5");
- } else if (Profile.JAVA_EE_7_FULL.equals(profile)) {
minimalSourceLevel = new SpecificationVersion("1.7");
Review comment:
Fixed, thank you.
##########
File path:
enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java
##########
@@ -780,15 +800,15 @@ private static void createManifest(FileObject dir, String
path) throws IOExcepti
FileObject manifest = FileUtil.createData(dir, path);
FileLock lock = manifest.lock();
try {
- OutputStream os = manifest.getOutputStream(lock);
- try {
- PrintWriter pw = new PrintWriter(os);
+ PrintWriter pw = null;
+ try (OutputStream os = manifest.getOutputStream(lock)) {
Review comment:
Fixed, thank you.
##########
File path:
enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java
##########
@@ -81,10 +83,9 @@ public static FileObject createWebXml(Profile j2eeProfile,
boolean webXmlRequire
} else if (Profile.J2EE_13 == j2eeProfile) {
template = "web-2.3.xml"; //NOI18N
}
-
if (template == null)
return null;
-
+ Logger.getLogger(DDHelper.class.getName()).log(Level.INFO, "template:
{0}", template);
Review comment:
I will remove all added logging, this is just for testing purposes.
##########
File path:
enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/api/EjbJarProjectGenerator.java
##########
@@ -174,16 +176,26 @@ public Void run() throws Exception {
Exceptions.printStackTrace(ex.getException());
}
- // create ejb-jar.xml
+ // Create ejb-jar.xml just for J2EE (1.3 and 1.4)
Profile profile = createData.getJavaEEProfile();
- if (!Profile.JAVA_EE_5.equals(profile) &&
!Profile.JAVA_EE_6_FULL.equals(profile) &&
!Profile.JAVA_EE_6_WEB.equals(profile) &&
- !Profile.JAVA_EE_7_FULL.equals(profile) &&
!Profile.JAVA_EE_7_WEB.equals(profile)) {
- String resource =
"org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-2.1.xml";
+ boolean isJ2EE = false;
+
+ if(profile.equals(Profile.J2EE_14) || profile.equals(Profile.J2EE_13))
{
+ isJ2EE = true;
+ }
+ if(isJ2EE) {
+ String resource;
+ if(profile.equals(Profile.J2EE_14))
+ resource =
"org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-2.1.xml";
+ else
+ resource =
"org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-2.0.xml";
Review comment:
Done
##########
File path:
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/common/RootInterface.java
##########
@@ -69,7 +70,7 @@
* MERGE_UNION is G1 U G2 <=> G1 + E2
* MERGE_INTERSECT is G1 n G2 <=> (G1 U G2) - E1 - E2
*</pre>
- * @param bean root of the bean graph that is merged with actual bean graph
+ * @param root root of the bean graph that is merged with actual bean graph
Review comment:
Done.
##########
File path:
enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java
##########
@@ -544,9 +563,7 @@ private static AntProjectHelper setupProject(FileObject
dirFO, String name,
String sourceLevel = v.toString();
// #89131: these levels are not actually distinct from 1.5.
// #181215: JDK 6 should be the default source/binary format for Java
EE 6 projects
- if (sourceLevel.equals("1.7")) {
- sourceLevel = "1.6";
- }
+ // #181215: Not neccessary anymore because NetBeans should run on
minimum JDK 8
Review comment:
After a more detailed testing to these validations, the methods were
these validations reside are called every time independently of the selected
profile. The `sourceLevel` variable is equal to the Java version that NetBeans
is running.
> JavaPlatform defaultPlatform =
JavaPlatformManager.getDefault().getDefaultPlatform();
> SpecificationVersion v = defaultPlatform.getSpecification().getVersion();
> String sourceLevel = v.toString();
In a new commit I added some missing validation that sets the correct target
source level.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
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