From 8fe700b9102769cb0f1df70592c3c17865c8b1ef Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 9 Jun 2010 23:53:15 +0000 Subject: [PATCH] added a convenience method. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31888 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Run.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 3880fe0eca..b367a369a4 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -395,6 +395,18 @@ public abstract class Run ,RunT extends Run T getCause(Class type) { + for (Cause c : getCauses()) + if (type.isInstance(c)) + return type.cast(c); + return null; + } + /** * Returns true if this log file should be kept and not deleted. *