Skip to content

Commit

Permalink
[JENKINS-48116] - Restrore AbstractTaskListener binary compatibility …
Browse files Browse the repository at this point in the history
…in the core.

Since we have the confirmed regression due to the binary compatibility change, I think we need to restore the compatibility.
OTOH, I restricted the class, so all users will be forced to stop using it when they updgrade the core.
  • Loading branch information
oleg-nenashev committed Nov 21, 2017
1 parent d4419b5 commit 60085a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/hudson/util/AbstractTaskListener.java
@@ -1,11 +1,16 @@
package hudson.util;

import hudson.RestrictedSince;
import hudson.model.TaskListener;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;


/**
* @deprecated implement {@link TaskListener} directly
*/
@Deprecated
@Restricted(NoExternalUse.class)
@RestrictedSince("2.91")
public abstract class AbstractTaskListener implements TaskListener {
}
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/util/LogTaskListener.java
Expand Up @@ -35,10 +35,13 @@
import java.util.logging.LogRecord;
import java.util.logging.Logger;

// TODO: AbstractTaskListener is empty now, but there are dependencies on that e.g. Ruby Runtime - JENKINS-48116)
// The change needs API deprecation policy or external usages cleanup.

/**
* {@link TaskListener} which sends messages to a {@link Logger}.
*/
public class LogTaskListener implements TaskListener, Closeable {
public class LogTaskListener extends AbstractTaskListener implements TaskListener, Closeable {

// would be simpler to delegate to the LogOutputStream but this would incompatibly change the serial form
private final TaskListener delegate;
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/util/StreamTaskListener.java
Expand Up @@ -44,6 +44,9 @@
import java.util.logging.Logger;
import org.kohsuke.stapler.framework.io.WriterOutputStream;

// TODO: AbstractTaskListener is empty now, but there are dependencies on that e.g. Ruby Runtime - JENKINS-48116)
// The change needs API deprecation policy or external usages cleanup.

/**
* {@link TaskListener} that generates output into a single stream.
*
Expand All @@ -52,7 +55,7 @@
*
* @author Kohsuke Kawaguchi
*/
public class StreamTaskListener implements TaskListener, Closeable {
public class StreamTaskListener extends AbstractTaskListener implements TaskListener, Closeable {
private PrintStream out;
private Charset charset;

Expand Down

0 comments on commit 60085a0

Please sign in to comment.