From c6a4b46ef68dc23fe36f1bb9c9f6eae96bc6a6cf Mon Sep 17 00:00:00 2001 From: Craig Ringer Date: Thu, 8 Nov 2018 10:57:28 +0800 Subject: [PATCH 1/5] [JENKINS-54532] Document how to get parameters from a Run --- core/src/main/java/hudson/model/Run.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 6b9c3fbbd97d..a42ca53e147e 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -143,8 +143,17 @@ * a custom {@link Job} type, so there's no separate registration * mechanism for custom {@link Run} types. * + * Many details of a run are contained in {@link Action} instances + * accessible via {@link Action#getAllActions} and {@link + * #getAction(Class)}. For example, build access to + * build parameters is obtained with + * run.getAction(hudson.model.ParametersAction.class) to + * get the build's {@link ParametersAction} object. + * * @author Kohsuke Kawaguchi * @see RunListener + * @see Job + * @see Action */ @ExportedBean public abstract class Run ,RunT extends Run> @@ -1441,7 +1450,9 @@ public Collection getBuildFingerprints() { /** * Returns an input stream that reads from the log file. - * It will use a gzip-compressed log file (log.gz) if that exists. + * + * It will use a gzip-compressed log file (log.gz) if that exists, decompressing + * it on the fly to return the uncompressed data. * * @throws IOException * @return An input stream from the log file. @@ -1469,6 +1480,14 @@ public Collection getBuildFingerprints() { return new ByteArrayInputStream(charset != null ? message.getBytes(charset) : message.getBytes()); } + /** + * Returns a Reader that reads from the log file. + * + * This is the simplest way to access the job's console log. + * + * @throws IOException + * @return Character-oriented log file stream as a Reader + */ public @Nonnull Reader getLogReader() throws IOException { if (charset==null) return new InputStreamReader(getLogInputStream()); else return new InputStreamReader(getLogInputStream(),charset); From 075f46255fbfe93fba0fb93007d1969ec606fcd1 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Fri, 16 Nov 2018 21:43:53 +0100 Subject: [PATCH 2/5] [JENKINS-54532] - Fix formatting of Javadoc --- core/src/main/java/hudson/model/Run.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index a42ca53e147e..1ee68d26d098 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -144,9 +144,8 @@ * mechanism for custom {@link Run} types. * * Many details of a run are contained in {@link Action} instances - * accessible via {@link Action#getAllActions} and {@link - * #getAction(Class)}. For example, build access to - * build parameters is obtained with + * accessible via {@link Action#getAllActions} and {@link#getAction(Class)}. + * For example, build access to build parameters is obtained with * run.getAction(hudson.model.ParametersAction.class) to * get the build's {@link ParametersAction} object. * From 4c6fdd616beb83a640f41f615bf3f61c70370a94 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Fri, 16 Nov 2018 21:44:35 +0100 Subject: [PATCH 3/5] [JENKINS-54532] - More fixes --- core/src/main/java/hudson/model/Run.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 1ee68d26d098..c2cc9c217114 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -144,7 +144,7 @@ * mechanism for custom {@link Run} types. * * Many details of a run are contained in {@link Action} instances - * accessible via {@link Action#getAllActions} and {@link#getAction(Class)}. + * accessible via {@link Action#getAllActions} and {@link #getAction(Class)}. * For example, build access to build parameters is obtained with * run.getAction(hudson.model.ParametersAction.class) to * get the build's {@link ParametersAction} object. From ae778a1fa863736a2f9af39dba6333f008c051d5 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Tue, 29 Jan 2019 18:03:49 +0100 Subject: [PATCH 4/5] Update Run.java --- core/src/main/java/hudson/model/Run.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index c2cc9c217114..0cfe2c0d7e4d 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -1484,7 +1484,7 @@ public Collection getBuildFingerprints() { * * This is the simplest way to access the job's console log. * - * @throws IOException + * @throws IOException Log access error * @return Character-oriented log file stream as a Reader */ public @Nonnull Reader getLogReader() throws IOException { From cdcb613031b2557fc85428173a0948dae012ec7e Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Tue, 9 Apr 2019 22:59:29 +0200 Subject: [PATCH 5/5] Fix Javadoc --- core/src/main/java/hudson/model/Run.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 0cfe2c0d7e4d..170b89dae3e0 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -144,7 +144,7 @@ * mechanism for custom {@link Run} types. * * Many details of a run are contained in {@link Action} instances - * accessible via {@link Action#getAllActions} and {@link #getAction(Class)}. + * accessible via {@link Actionable#getAllActions} and {@link #getAction(Class)}. * For example, build access to build parameters is obtained with * run.getAction(hudson.model.ParametersAction.class) to * get the build's {@link ParametersAction} object.