Skip to content

Commit

Permalink
Drop Invokable interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pzygielo committed May 7, 2022
1 parent 5360a1c commit 886f3e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 42 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/codehaus/mojo/exec/ExecMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import java.util.function.Consumer;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
Expand Down Expand Up @@ -434,7 +435,7 @@ else if (useMavenLogger)
getLog().debug("Will redirect program output to Maven logger");
final String parentThreadName = Thread.currentThread().getName();
final String logSuffix = "[" + parentThreadName + "] ";
Invokable<String> mavenOutRedirect = new Invokable<String>()
Consumer<String> mavenOutRedirect = new Consumer<String>()
{

@Override
Expand All @@ -450,7 +451,7 @@ public void accept(String logMessage)
}
}
};
Invokable<String> mavenErrRedirect = new Invokable<String>()
Consumer<String> mavenErrRedirect = new Consumer<String>()
{

@Override
Expand Down
37 changes: 0 additions & 37 deletions src/main/java/org/codehaus/mojo/exec/Invokable.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
*/

import java.io.OutputStream;
import java.util.function.Consumer;

/**
* An output stream that captures one line of output at a time, and then
* redirects that line to some {@link Invokable} to act upon as it pleases. This
* redirects that line to some {@link Consumer} to act upon as it pleases. This
* class is not thread safe and expects to have only one active writer consuming
* it at any given time.
*
Expand All @@ -32,9 +33,9 @@
class LineRedirectOutputStream extends OutputStream {

private StringBuilder currentLine = new StringBuilder();
private final Invokable<String> linePrinter;
private final Consumer<String> linePrinter;

public LineRedirectOutputStream(Invokable<String> linePrinter) {
public LineRedirectOutputStream(Consumer<String> linePrinter) {
this.linePrinter = linePrinter;
}

Expand Down

0 comments on commit 886f3e3

Please sign in to comment.