You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "mbien (via GitHub)" <gi...@apache.org> on 2025/02/20 23:55:32 UTC

[PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

mbien opened a new pull request, #8265:
URL: https://github.com/apache/netbeans/pull/8265

    - remove maven 2 specific output parsing
    - fix reactor summary parsing
    - disabled `JavadocOutputProcessor` since it doesn't do anything atm
    - code cleanup
    
    reactor summary link on failure is working again (useful with `--fail-at-end`):
    
   ![reactor-failure-link](https://github.com/user-attachments/assets/bec13500-1a6e-4ac8-96dc-d95eb6fbe6d5)
   


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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1994271963


##########
platform/openide.io/src/org/openide/windows/OutputListener.java:
##########
@@ -28,15 +28,15 @@ public interface OutputListener extends java.util.EventListener {
     /** Called when a line is selected.
     * @param ev the event describing the line
     */
-    public void outputLineSelected (OutputEvent ev);
+    public default void outputLineSelected(OutputEvent ev) {}

Review Comment:
   cleaned up all `OutputListener` usages



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1992273840


##########
java/maven/src/org/netbeans/modules/maven/output/DefaultOutputProcessorFactory.java:
##########
@@ -32,24 +31,28 @@
 @ServiceProvider(service=OutputProcessorFactory.class)
 public class DefaultOutputProcessorFactory implements ContextOutputProcessorFactory {
     
-    @Override public Set<OutputProcessor> createProcessorsSet(Project project) {
-        Set<OutputProcessor> toReturn = new HashSet<>();
+    @Override
+    public Set<OutputProcessor> createProcessorsSet(Project project) {
         if (project != null) {
-            toReturn.add(new JavadocOutputProcessor());
-            toReturn.add(new TestOutputListenerProvider());
-            toReturn.add(new SiteOutputProcessor(project));
             NbMavenProjectImpl nbprj = project.getLookup().lookup(NbMavenProjectImpl.class);
-            toReturn.add(new JavaStacktraceOutputProcessor(nbprj));
-            toReturn.add(new DependencyAnalyzeOutputProcessor(nbprj));
+            return Set.of(
+//                new JavadocOutputProcessor(),  // TODO update processor

Review Comment:
   Intentionally? Then why or what will be broken after this?



##########
java/maven/src/org/netbeans/modules/maven/execute/AbstractOutputHandler.java:
##########
@@ -106,17 +102,15 @@ private boolean isProtectedWait(Project proj, RunConfig config) {
         if(action == null || proj == null || !RunUtils.isCompileOnSaveEnabled(proj)) {
             return false;
         }
-        switch(action) {
-            case ActionProvider.COMMAND_RUN: 
-            case ActionProvider.COMMAND_RUN_SINGLE:
-            case ActionProvider.COMMAND_DEBUG:
-            case ActionProvider.COMMAND_DEBUG_SINGLE:
-            case ActionProviderImpl.COMMAND_DEBUG_MAIN:
-            case ActionProviderImpl.COMMAND_RUN_MAIN:
-                return true;
-            default:
-                return false;
-        }
+        return switch (action) {

Review Comment:
   Personal opinion and not a request for revert: for the the original code was more readable.



##########
platform/openide.io/src/org/openide/windows/OutputListener.java:
##########
@@ -28,15 +28,15 @@ public interface OutputListener extends java.util.EventListener {
     /** Called when a line is selected.
     * @param ev the event describing the line
     */
-    public void outputLineSelected (OutputEvent ev);
+    public default void outputLineSelected(OutputEvent ev) {}

Review Comment:
   This is my understanding: With a non-generic signature, this will always be a binary compatible change as there can be no situations where implementation and interface signature does not match and there must always be an implementation, so diamond inheritance is not a problem. However this might cause source incompatibilities, as this might happen:
   
   Starting point:
   
   ```java
   public class Dummy {
   
       public interface I1 {
           public void dummy();
       }
   
       public interface I2 {
           public void dummy();
       }
   
       public interface I12 extends I1, I2 {}
   
   }
   ```
   
   Kaputt:
   
   ```java
   public class Dummy {
   
       public interface I1 {
           public default void dummy() {
           }
       }
   
       public interface I2 {
           public default void dummy() {
           }
       }
   
       // Does not compile as javac can't decide which is the "right" implementation
       public interface I12 extends I1, I2 {}
   
   }
   ```
   
   I'm good with this, but wanted to confirm.



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1992473293


##########
platform/openide.io/src/org/openide/windows/OutputListener.java:
##########
@@ -28,15 +28,15 @@ public interface OutputListener extends java.util.EventListener {
     /** Called when a line is selected.
     * @param ev the event describing the line
     */
-    public void outputLineSelected (OutputEvent ev);
+    public default void outputLineSelected(OutputEvent ev) {}

Review Comment:
   this could indeed happen. I believe the endorsed way to resolve the conflict would be to implement the method again and explicitly select one of the two implementations.
   
   e.g:
   
   ```java
   public class Dummy {
       
       public interface I1 {
           public default void dummy() {
               System.out.println("1");
           }
       }
   
       public interface I2 {
           public default void dummy() {
               System.out.println("2");
           }
       }
   
       public interface I12 extends I1, I2 {
           @Override
           public default void dummy() {
               I1.super.dummy();
           }
       }
   
   }
   ```
   This should compile and If something implements `Dummy.I12` and calls `dummy()` it should print `1`.



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien merged PR #8265:
URL: https://github.com/apache/netbeans/pull/8265


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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1992319805


##########
java/maven/src/org/netbeans/modules/maven/execute/AbstractOutputHandler.java:
##########
@@ -106,17 +102,15 @@ private boolean isProtectedWait(Project proj, RunConfig config) {
         if(action == null || proj == null || !RunUtils.isCompileOnSaveEnabled(proj)) {
             return false;
         }
-        switch(action) {
-            case ActionProvider.COMMAND_RUN: 
-            case ActionProvider.COMMAND_RUN_SINGLE:
-            case ActionProvider.COMMAND_DEBUG:
-            case ActionProvider.COMMAND_DEBUG_SINGLE:
-            case ActionProviderImpl.COMMAND_DEBUG_MAIN:
-            case ActionProviderImpl.COMMAND_RUN_MAIN:
-                return true;
-            default:
-                return false;
-        }
+        return switch (action) {

Review Comment:
   I somewhat agree that it doesn't look better in this particular case. Its still a bit less noisy so I thought I convert it.
   
   The main value is that switch expressions must be exhaustive, but this was easy enough to see in the original version too.



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1964533095


##########
java/maven/src/org/netbeans/modules/maven/execute/CommandLineOutputHandler.java:
##########
@@ -294,13 +294,6 @@ private String readLine() throws IOException {
                         nextLine = line.substring(execEventIdx);
                         line = line.substring(0, execEventIdx);
                     }                   
-                    if (line.startsWith("[INFO] Final Memory:")) { //NOI18N

Review Comment:
   @cstamas pretty sure this is a m2 relict. I do remember the line but since it isn't [anywhere](https://github.com/apache/maven/blob/69980eeafcb1c0371e48df89953390b6d939d61a/its/core-it-support/maven-it-sample-archetype/src/main/resources/archetype-resources/out.txt#L743) i suppose it was from m2 times?



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1992295691


##########
java/maven/src/org/netbeans/modules/maven/output/DefaultOutputProcessorFactory.java:
##########
@@ -32,24 +31,28 @@
 @ServiceProvider(service=OutputProcessorFactory.class)
 public class DefaultOutputProcessorFactory implements ContextOutputProcessorFactory {
     
-    @Override public Set<OutputProcessor> createProcessorsSet(Project project) {
-        Set<OutputProcessor> toReturn = new HashSet<>();
+    @Override
+    public Set<OutputProcessor> createProcessorsSet(Project project) {
         if (project != null) {
-            toReturn.add(new JavadocOutputProcessor());
-            toReturn.add(new TestOutputListenerProvider());
-            toReturn.add(new SiteOutputProcessor(project));
             NbMavenProjectImpl nbprj = project.getLookup().lookup(NbMavenProjectImpl.class);
-            toReturn.add(new JavaStacktraceOutputProcessor(nbprj));
-            toReturn.add(new DependencyAnalyzeOutputProcessor(nbprj));
+            return Set.of(
+//                new JavadocOutputProcessor(),  // TODO update processor

Review Comment:
   the old maven javadoc plugin must have printed the path to the javadoc index file at some point. This did make a hyperlink out of it. Since this doesn't happen anymore, the processor serves no purpose atm as far as I can tell.
   
   So I thought I turn it off and mark it in case someone has an idea how to add that functionality again.



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1964533095


##########
java/maven/src/org/netbeans/modules/maven/execute/CommandLineOutputHandler.java:
##########
@@ -294,13 +294,6 @@ private String readLine() throws IOException {
                         nextLine = line.substring(execEventIdx);
                         line = line.substring(0, execEventIdx);
                     }                   
-                    if (line.startsWith("[INFO] Final Memory:")) { //NOI18N

Review Comment:
   @cstamas pretty sure this is a m2 relict. I do remember the line but since it isn't anywhere except [here](https://github.com/apache/maven/blob/69980eeafcb1c0371e48df89953390b6d939d61a/its/core-it-support/maven-it-sample-archetype/src/main/resources/archetype-resources/out.txt#L743) i suppose it was from m2 times?



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1965037218


##########
java/maven/src/org/netbeans/modules/maven/execute/CommandLineOutputHandler.java:
##########
@@ -294,13 +294,6 @@ private String readLine() throws IOException {
                         nextLine = line.substring(execEventIdx);
                         line = line.substring(0, execEventIdx);
                     }                   
-                    if (line.startsWith("[INFO] Final Memory:")) { //NOI18N

Review Comment:
   Yes, this is not logged anymore 



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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


Re: [PR] Remove maven 2 output parsing, cleanup and some parsing fixes [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on code in PR #8265:
URL: https://github.com/apache/netbeans/pull/8265#discussion_r1992310263


##########
java/maven/src/org/netbeans/modules/maven/output/DefaultOutputProcessorFactory.java:
##########
@@ -32,24 +31,28 @@
 @ServiceProvider(service=OutputProcessorFactory.class)
 public class DefaultOutputProcessorFactory implements ContextOutputProcessorFactory {
     
-    @Override public Set<OutputProcessor> createProcessorsSet(Project project) {
-        Set<OutputProcessor> toReturn = new HashSet<>();
+    @Override
+    public Set<OutputProcessor> createProcessorsSet(Project project) {
         if (project != null) {
-            toReturn.add(new JavadocOutputProcessor());
-            toReturn.add(new TestOutputListenerProvider());
-            toReturn.add(new SiteOutputProcessor(project));
             NbMavenProjectImpl nbprj = project.getLookup().lookup(NbMavenProjectImpl.class);
-            toReturn.add(new JavaStacktraceOutputProcessor(nbprj));
-            toReturn.add(new DependencyAnalyzeOutputProcessor(nbprj));
+            return Set.of(
+//                new JavadocOutputProcessor(),  // TODO update processor

Review Comment:
   Thanks, makes sense.



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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