You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/10/26 01:09:37 UTC

[GitHub] [netbeans] pepness opened a new pull request #2491: [NETBEANS-4946] - Improve JAVA EE with Ant based projects

pepness opened a new pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491


   Notes:
   - Fix version mismatching when creating deployment descriptors with JEE 8
     and JAKARTA EE 8
   - Fix CDI config file version mismatching with JEE 8 and JAKARTA EE 8, 
     IDE creates JEE 7
   - IDE do not create deployment descriptor for EJB Modules from JEE 5 to JEE 7
     and creates it with wrong version in JEE 8
   - Add methods that detect support for CDI 1.0 and CDI 2.0
   - Add missing resource, license file and deployment descriptor for JEE 8
   - Remove unnecessary validation that checks if running JDK 7 then change to JDK 6
   - Remove use of deprecated method "getJ2eePlatform" in one class
   - Remove use of deprecated method "getServerID" in one class
   - Update javac.source and compilerargs properties in some Java EE modules
   - Use try-with-resources and close
   - Fix statement that compares Integers with "=="
   - Fix some typos
   - Remove some unnecessary unboxing/boxing of variables
   - Add some missing @Override tags
   - Add loggers and fix some uses of it
   
   Testing:
   - Full build done
   - Create EAR, EJB, WEB and Application Client with JEE 5, 6, 6 w/CDI , 7 , 8 and
     JAKARTA EE 8
   - Verify the correct creation of deployment descriptors and CDI files for every
     profile in the projects mention above
   - Verify that every project can clean and build successfully 
   
   Issues:
   - Could not make work web-fragment version 4.0, it was not working from the beggining. Left the code commented.
   
   Doubts:
   - Don't know where to obtain or to create correct mdd files that will work correctly with NetBeans, I modify the `mdd` files that generate the models for JEE 8 Application and Application-client classes. I tried to do the same with web-fragment 4.0 but it failed to compile.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r562265439



##########
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.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r546428542



##########
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:
       This looks strange - EE6 -> source level 1.6 and EE5 -> source level 1.7?

##########
File path: enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/api/EjbJarProjectGenerator.java
##########
@@ -489,9 +503,7 @@ private static AntProjectHelper setupProject(FileObject dirFO, String name,
         SpecificationVersion v = defaultPlatform.getSpecification().getVersion();
         String sourceLevel = v.toString();
         // #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:
       See comments about this above.

##########
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:
       I read this as the target source level. If NetBeans runs on 8, it gets even worse. The description implies, that a build project should be compatible with Java 1.6, when generated for a JavaEE 6 client profile, this is ensures by the original code, you move all projects to 8.
   
   In the area where JavaEE is at home (large companies) I can imaginge setups where indeed Java 1.6 ist the latest installed version.

##########
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:
       Should this really be logged on INFO level?

##########
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:
       I would move the PrintWriter also into the resource block of the try-with-resource construct. I don't see a reason to special case it here.

##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java
##########
@@ -111,8 +109,7 @@ private EarProjectGenerator(File prjDir, FileObject prjDirFO, String name, Profi
         this.j2eeProfile = j2eeProfile;
         this.serverInstanceID = serverInstanceID;
         // #181215: JDK 6 should be the default source/binary format for Java EE 6 projects
-        if (sourceLevel != null && (sourceLevel.equals("1.7")))
-            sourceLevel = "1.6";

Review comment:
       And source level again.

##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java
##########
@@ -600,16 +599,17 @@ public static void setPlatformSourceLevel(final AntProjectHelper helper, final S
         }
         try {
             projectDir.getFileSystem().runAtomicAction(new AtomicAction() {
+                @Override
                 public void run() throws IOException {
                     ProjectManager.mutex().writeAccess(new Runnable() {
+                        @Override
                         public void run() {
                             try {
                                 EditableProperties ep = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
                                 // #89131: these levels are not actually distinct from 1.5.
                                 String srcLevel = sourceLevel;
                                 // #181215: JDK 6 should be the default source/binary format for Java EE 6 projects
-                                if (sourceLevel.equals("1.7"))
-                                    srcLevel = "1.6";
+                                // #181215: Not neccessary anymore because NetBeans should run on minimum JDK 8

Review comment:
       See my other comments about this.

##########
File path: enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java
##########
@@ -747,13 +770,10 @@ public void run() {
                                 if (finalPlatformName == null) {
                                     finalPlatformName = PreferredProjectPlatform.getPreferredPlatform(JavaPlatform.getDefault().getSpecification().getName()).getDisplayName();
                                 }
-
                                 // #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
+                                // #181215: Not neccessary anymore because NetBeans should run on minimum JDK 8
                                 String srcLevel = sourceLevel;
-                                if (sourceLevel.equals("1.7")) {
-                                    srcLevel = "1.6";
-                                }

Review comment:
       See comment above - probably same situation.

##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java
##########
@@ -885,7 +924,7 @@ public void artifactsUpdated(Iterable<Artifact> artifacts) {
                     try {
                         FileUtil.createData(destFile);
                     } catch (IOException ex) {
-                        LOGGER.log(Level.INFO, "Could not prepare data file", ex);
+                        LOGGER.log(Level.INFO, "Could not prepare data file {0}", ex);

Review comment:
       The parameter is not necessary. If an exception is present, it will be logged with message, no need to for the placeholder.

##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java
##########
@@ -543,8 +543,7 @@ private AntProjectHelper setupProject() throws IOException {
             srcLevel = 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 (srcLevel.equals("1.7"))
-                srcLevel = "1.6";

Review comment:
       This is several places - I saw a source level defined in one of the classes touched by this PR, why is that not used?

##########
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:
       Please add curly braces. In this case it costs one additional line and makes it IMHO clearer what goes on.

##########
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:
       I think this should have been a delete - the word "bean" and the word "root" in the first position of the documentation are superfluous. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r562300114



##########
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing merged pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
matthiasblaesing merged pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491


   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-803023426


   @pepness thank you for the update. Would you mind removing the commits:
   
   - 7b7b525
   - e25f480
   - 3957b83
   - 0666f31
   
   I assume, that the last three commits revert changes introduced in 7b7b525. Squash all four should result in an empty commit then. If you feel uncomfortable with that, please say so and I'll take a look.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-757095122


   @matthiasblaesing @lkishalmi I have separated the commits for better reviewing, and updated the description.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r562264842



##########
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.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-803463464


   Thank you for your work and patience - lets get this in.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-748664582


   The testing reads good. Reviewing is difficult, because there are to many commits to review per commit and to many changes in general to review by file. I suggest to do the cleanup you suggested and squash the changes. If possible split cleanup (@Override, loggers) and actually function changes into separate commits. After that it should be easier to review.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] neilcsmith-net commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-766101777


   Thanks for comments @matthiasblaesing - guess no option but to bump forward to 12.4 now.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r562270293



##########
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.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-803038496


   @matthiasblaesing I did the rebase, remove all added logging, squash the commits and re-test everything, I did not see your previous comment.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-798529208


   @pepness I suggest to rebase this one current master, do the final cleanup and get this in. We are early in the 12.4 and given the big size it would be good if this could land early.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r562270171



##########
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




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-757095122


   @matthiasblaesing @lkishalmi I have separated the commits for better reviewing, and updated the description.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] lkishalmi commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-748568602


   Is there anything against not to merge this one?


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
pepness commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r562772066



##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java
##########
@@ -885,7 +924,7 @@ public void artifactsUpdated(Iterable<Artifact> artifacts) {
                     try {
                         FileUtil.createData(destFile);
                     } catch (IOException ex) {
-                        LOGGER.log(Level.INFO, "Could not prepare data file", ex);
+                        LOGGER.log(Level.INFO, "Could not prepare data file {0}", ex);

Review comment:
       Fixed it. Thanks.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#issuecomment-765586254


   Looks sane to me - I admit, that I did not check every change, but overall it looks like a good cleanup. A final cleanup is necessary though as indicated.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pepness commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
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.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #2491: [NETBEANS-4946] - Improve JAVA/JAKARTA EE with Ant based projects

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on a change in pull request #2491:
URL: https://github.com/apache/netbeans/pull/2491#discussion_r546428542



##########
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:
       This looks strange - EE6 -> source level 1.6 and EE5 -> source level 1.7?

##########
File path: enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/api/EjbJarProjectGenerator.java
##########
@@ -489,9 +503,7 @@ private static AntProjectHelper setupProject(FileObject dirFO, String name,
         SpecificationVersion v = defaultPlatform.getSpecification().getVersion();
         String sourceLevel = v.toString();
         // #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:
       See comments about this above.

##########
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:
       I read this as the target source level. If NetBeans runs on 8, it gets even worse. The description implies, that a build project should be compatible with Java 1.6, when generated for a JavaEE 6 client profile, this is ensures by the original code, you move all projects to 8.
   
   In the area where JavaEE is at home (large companies) I can imaginge setups where indeed Java 1.6 ist the latest installed version.

##########
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:
       Should this really be logged on INFO level?

##########
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:
       I would move the PrintWriter also into the resource block of the try-with-resource construct. I don't see a reason to special case it here.

##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java
##########
@@ -111,8 +109,7 @@ private EarProjectGenerator(File prjDir, FileObject prjDirFO, String name, Profi
         this.j2eeProfile = j2eeProfile;
         this.serverInstanceID = serverInstanceID;
         // #181215: JDK 6 should be the default source/binary format for Java EE 6 projects
-        if (sourceLevel != null && (sourceLevel.equals("1.7")))
-            sourceLevel = "1.6";

Review comment:
       And source level again.

##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java
##########
@@ -600,16 +599,17 @@ public static void setPlatformSourceLevel(final AntProjectHelper helper, final S
         }
         try {
             projectDir.getFileSystem().runAtomicAction(new AtomicAction() {
+                @Override
                 public void run() throws IOException {
                     ProjectManager.mutex().writeAccess(new Runnable() {
+                        @Override
                         public void run() {
                             try {
                                 EditableProperties ep = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
                                 // #89131: these levels are not actually distinct from 1.5.
                                 String srcLevel = sourceLevel;
                                 // #181215: JDK 6 should be the default source/binary format for Java EE 6 projects
-                                if (sourceLevel.equals("1.7"))
-                                    srcLevel = "1.6";
+                                // #181215: Not neccessary anymore because NetBeans should run on minimum JDK 8

Review comment:
       See my other comments about this.

##########
File path: enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java
##########
@@ -747,13 +770,10 @@ public void run() {
                                 if (finalPlatformName == null) {
                                     finalPlatformName = PreferredProjectPlatform.getPreferredPlatform(JavaPlatform.getDefault().getSpecification().getName()).getDisplayName();
                                 }
-
                                 // #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
+                                // #181215: Not neccessary anymore because NetBeans should run on minimum JDK 8
                                 String srcLevel = sourceLevel;
-                                if (sourceLevel.equals("1.7")) {
-                                    srcLevel = "1.6";
-                                }

Review comment:
       See comment above - probably same situation.

##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java
##########
@@ -885,7 +924,7 @@ public void artifactsUpdated(Iterable<Artifact> artifacts) {
                     try {
                         FileUtil.createData(destFile);
                     } catch (IOException ex) {
-                        LOGGER.log(Level.INFO, "Could not prepare data file", ex);
+                        LOGGER.log(Level.INFO, "Could not prepare data file {0}", ex);

Review comment:
       The parameter is not necessary. If an exception is present, it will be logged with message, no need to for the placeholder.

##########
File path: enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java
##########
@@ -543,8 +543,7 @@ private AntProjectHelper setupProject() throws IOException {
             srcLevel = 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 (srcLevel.equals("1.7"))
-                srcLevel = "1.6";

Review comment:
       This is several places - I saw a source level defined in one of the classes touched by this PR, why is that not used?

##########
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:
       Please add curly braces. In this case it costs one additional line and makes it IMHO clearer what goes on.

##########
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:
       I think this should have been a delete - the word "bean" and the word "root" in the first position of the documentation are superfluous. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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