mbien commented on code in PR #9043:
URL: https://github.com/apache/netbeans/pull/9043#discussion_r2574086002


##########
ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/NativeProcessExecutionService.java:
##########
@@ -34,6 +34,7 @@
  * This is a very light-weigth version of ExecutionService from 
org.netbeans.api.extexecution
  * @author ak119685
  */
+@SuppressWarnings("deprecation") // 
org.netbeans.api.extexecution.input.LineProcessor is API
 public final class NativeProcessExecutionService {

Review Comment:
   the deprecation note was likely overlooked while implementing the split 
https://github.com/emilianbold/netbeans-releases/commit/989e691f377b0d151f98931a6cff146a541806c6#diff-995af13546863b00d18871524135eb30d93cbf6063e573f1aac795638012e292
 since the parameters are deprecated.
   
   Before I noticed that it wasn't used I added a second method and deprecated 
the first. This way API users are not _forced_ to use deprecated classes.
   
   ```diff
   diff --git 
a/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/NativeProcessExecutionService.java
 
b/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/NativeProcessExecutionService.java
   index de62c90..31194f9 100644
   --- 
a/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/NativeProcessExecutionService.java
   +++ 
b/ide/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/NativeProcessExecutionService.java
   @@ -26,7 +26,7 @@
    import java.util.concurrent.Future;
    import java.util.logging.Level;
    import java.util.logging.Logger;
   -import org.netbeans.api.extexecution.input.LineProcessor;
   +import org.netbeans.api.extexecution.base.input.LineProcessor;
    import org.netbeans.modules.nativeexecution.api.util.ProcessUtils;
    import 
org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService;
    
   @@ -34,7 +34,6 @@
     * This is a very light-weigth version of ExecutionService from 
org.netbeans.api.extexecution
     * @author ak119685
     */
   -@SuppressWarnings("deprecation") // 
org.netbeans.api.extexecution.input.LineProcessor is API
    public final class NativeProcessExecutionService {
    
        private final ExecutionTask task;
   @@ -45,6 +44,14 @@
            this.descr = descr;
        }
    
   +    /**
   +     * @deprecated Use {@link #newService(NativeProcessBuilder, 
LineProcessor, LineProcessor, String)} instead.
   +     */
   +    @Deprecated
   +    public static NativeProcessExecutionService 
newService(NativeProcessBuilder npb, 
org.netbeans.api.extexecution.input.LineProcessor outProcessor, 
org.netbeans.api.extexecution.input.LineProcessor errProcessor, String descr) {
   +        return newService(npb, new LPWrapper(outProcessor), new 
LPWrapper(errProcessor), descr);
   +    }
   +
        public static NativeProcessExecutionService 
newService(NativeProcessBuilder npb, LineProcessor outProcessor, LineProcessor 
errProcessor, String descr) {
            ExecutionTask task = new ExecutionTask(npb, outProcessor, 
errProcessor, descr);
            return new NativeProcessExecutionService(task, descr);
   @@ -155,4 +162,30 @@
                return result;
            }
        }
   +    
   +    @SuppressWarnings("deprecation")
   +    private final static class LPWrapper implements LineProcessor {
   +
   +        private final org.netbeans.api.extexecution.input.LineProcessor 
delegate;
   +        
   +        private LPWrapper(org.netbeans.api.extexecution.input.LineProcessor 
delegate) {
   +            this.delegate = delegate;
   +        }
   +
   +        @Override
   +        public void processLine(String line) {
   +            delegate.processLine(line);
   +        }
   +
   +        @Override
   +        public void reset() {
   +            delegate.reset();
   +        }
   +
   +        @Override
   +        public void close() {
   +            delegate.close();
   +        }
   +    }
   +    
    }
   
   
   
   ```
   
   



-- 
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: [email protected]

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

Reply via email to