Skip to content

Commit

Permalink
Restrict helper classes in ScriptListener for internal use (#8588)
Browse files Browse the repository at this point in the history
Restrict helper classes for internal use

While they might be useful for anyone needing to call #fire...
methods, that alone is fairly unlikely to be necessary.

Co-authored-by: Daniel Beck <[email protected]>
  • Loading branch information
daniel-beck and daniel-beck authored Oct 11, 2023
1 parent 8ab2aca commit 0ace9ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/jenkins/util/ScriptListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import java.io.OutputStream;
import java.io.Writer;
import java.nio.charset.Charset;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.StaplerRequest;

/**
Expand Down Expand Up @@ -130,6 +132,7 @@ static void fireScriptOutput(@CheckForNull String output, @NonNull Object featur
* {@link java.io.Writer} that calls {@link #fireScriptOutput(String, Object, Object, String, hudson.model.User)} with the
* output it writes to the wrapped {@link java.io.Writer}, and otherwise just forwards {@link #flush()} and {@link #close()}.
*/
@Restricted(NoExternalUse.class)
class ListenerWriter extends Writer {

private final Writer writer;
Expand Down Expand Up @@ -169,6 +172,7 @@ public void close() throws IOException {
* the output it writes to the wrapped {@link java.io.OutputStream}, and otherwise just forwards {@link #flush()}
* and {@link #close()}.
*/
@Restricted(NoExternalUse.class)
class ListenerOutputStream extends OutputStream {

private final OutputStream os;
Expand Down

0 comments on commit 0ace9ad

Please sign in to comment.