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

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

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