Skip to content

Commit

Permalink
Merge pull request #21 from wolfs/class-cast
Browse files Browse the repository at this point in the history
[FIXED JENKINS-33715] Fix Class Cast Exception when claiming Test
  • Loading branch information
ki82 committed Apr 19, 2016
2 parents 482db29 + 9dcba7c commit a8f95f1
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/main/java/hudson/plugins/claim/AbstractClaimBuildAction.java
Expand Up @@ -83,17 +83,21 @@ public void doClaim(StaplerRequest req, StaplerResponse resp)
if(ClaimBuildFailureAnalyzer.isBFAEnabled()) {
String error = req.getSubmittedForm().getString("errors");
BFAClaimer = new ClaimBuildFailureAnalyzer(error);
if(!ClaimBuildFailureAnalyzer.ERROR.equals("Default")){
try{
BFAClaimer.createFailAction((Run) owner);
} catch (IndexOutOfBoundsException e){
LOGGER.log(Level.WARNING, "No FailureCauseBuildAction detected for this build");
resp.forwardToPreviousPage(req);
return;
if (this.owner instanceof Run)
{
Run run = (Run) owner;
if(!ClaimBuildFailureAnalyzer.ERROR.equals("Default")){
try{
BFAClaimer.createFailAction(run);
} catch (IndexOutOfBoundsException e){
LOGGER.log(Level.WARNING, "No FailureCauseBuildAction detected for this build");
resp.forwardToPreviousPage(req);
return;
}
}
else{
BFAClaimer.removeFailAction(run);
}
}
else{
BFAClaimer.removeFailAction((Run) owner);
}
}

Expand Down

0 comments on commit a8f95f1

Please sign in to comment.