Implement default methods in TaskListener and BuildListener #3122
Conversation
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
@@ -82,12 +70,13 @@ public void close() { | |||
private final StackTraceElement caller; | |||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
|
|||
public LogOutputStream(Logger logger, Level level, StackTraceElement caller) { | |||
LogOutputStream(Logger logger, Level level, StackTraceElement caller) { |
svanoort
Nov 1, 2017
Member
🐛 - Potential breaker for code depending on this constructor.
jglick
Nov 2, 2017
Author
Member
Not true; the class was private
already, so the public
modifier on its constructor was just misleading.
Not true; the class was private
already, so the public
modifier on its constructor was just misleading.
@@ -58,7 +52,7 @@ | |||
* | |||
* @author Kohsuke Kawaguchi | |||
*/ | |||
public class StreamTaskListener extends AbstractTaskListener implements Serializable, Closeable { | |||
public class StreamTaskListener implements TaskListener, Closeable { |
svanoort
Nov 1, 2017
Member
🐛 You can no longer cast to AbstractTaskListener or check for instanceof AbstractTaskListener.
jglick
Nov 2, 2017
Author
Member
That is true, but AbstractTaskListener
was only ever a convenience base class, so there was never a legitimate reason to do so to begin with.
That is true, but AbstractTaskListener
was only ever a convenience base class, so there was never a legitimate reason to do so to begin with.
oleg-nenashev
Nov 3, 2017
Member
I was unable to find the implementation, which may be affected. But I agree that keeping the inheritance from a deprecated class would be the safest option for now. This old class is not doing anything wrong anyway
I was unable to find the implementation, which may be affected. But I agree that keeping the inheritance from a deprecated class would be the safest option for now. This old class is not doing anything wrong anyway
jglick
Nov 6, 2017
Author
Member
As in #2879 I would prefer to eliminate all usages of the deprecated type to reduce confusion, since there is no plausible risk from the technical API change here.
As in #2879 I would prefer to eliminate all usages of the deprecated type to reduce confusion, since there is no plausible risk from the technical API change here.
A couple small compatibility issues but otherwise looks reasonable AFAICT. |
Not issues I think. |
@@ -82,12 +70,13 @@ public void close() { | |||
private final StackTraceElement caller; | |||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
|
|||
public LogOutputStream(Logger logger, Level level, StackTraceElement caller) { | |||
LogOutputStream(Logger logger, Level level, StackTraceElement caller) { |
jglick
Nov 2, 2017
Author
Member
Not true; the class was private
already, so the public
modifier on its constructor was just misleading.
Not true; the class was private
already, so the public
modifier on its constructor was just misleading.
@@ -58,7 +52,7 @@ | |||
* | |||
* @author Kohsuke Kawaguchi | |||
*/ | |||
public class StreamTaskListener extends AbstractTaskListener implements Serializable, Closeable { | |||
public class StreamTaskListener implements TaskListener, Closeable { |
jglick
Nov 2, 2017
Author
Member
That is true, but AbstractTaskListener
was only ever a convenience base class, so there was never a legitimate reason to do so to begin with.
That is true, but AbstractTaskListener
was only ever a convenience base class, so there was never a legitimate reason to do so to begin with.
No strong opinion since I do not see any usages which will be affected by the change. |
And I would be happy to break any such usage if there were one, because it would be ridiculous. |
Weak |
formally it's ready to go. YOLO. |
5b9ad64
into
jenkinsci:master
noting that this caused a breakage as the class |
@jtnord Normally that would be irrelevant since master → agent connections will use identical bytecode. Would only matter for other uses of Remoting involving diachronic serialization. Probably fixable by adding a |
@jtnord Do you have an issue reference for that? |
Would avoid the need for
LessAbstractTaskListener
in jenkinsci/workflow-support-plugin#15, for example.@reviewbybees