Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Invokable interface #291

Merged
merged 1 commit into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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