Skip to content
Permalink
Browse files

Merge pull request #27 from vjuranek/JENKINS-44024

JENKINS-44024 Skip empty list of indications
  • Loading branch information...
Greybird committed Nov 8, 2017
2 parents 56c54d3 + a9a93f6 commit 6c0e403222fc2b838651919fda16551853f72603
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/hudson/plugins/claim/ClaimBuildFailureAnalyzer.java
@@ -20,7 +20,7 @@
public class ClaimBuildFailureAnalyzer {

public static String ERROR = "Default";
private static final String matchingFile = "Claim";
private static final String MATCHING_FILE = "Claim";

public ClaimBuildFailureAnalyzer(String error) throws Exception {
ERROR=error;
@@ -55,7 +55,7 @@ public void createFailAction(Run run) throws Exception {
List<FoundIndication> indications = new LinkedList<>();
for(FailureCause cause : getFailureCauses()){
if(cause.getName().equals(ERROR)) {
indications.add(new ClaimIndication( run,"Null",matchingFile,"Null"));
indications.add(new ClaimIndication(run, "Null", MATCHING_FILE, "Null"));
newClaimedFailureCause = new FoundFailureCause(cause, indications);
break;
}
@@ -75,7 +75,7 @@ public void createFailAction(Run run) throws Exception {
if(cause.getName().equals(newClaimedFailureCause.getName()) && cause.getIndications().get(0).getMatchingFile().equals("log")){
hasFailureCauseFromBFA = true;
}
if (cause.getIndications().get(0).getMatchingFile()==matchingFile) {
if (cause.getIndications().get(0).getMatchingFile()==MATCHING_FILE) {
existingClaimedFoundFailureCause = cause;
break;
}
@@ -101,7 +101,7 @@ public void removeFailAction(Run run){
List<FoundFailureCause> foundFailureCauses = bfaAction.getFoundFailureCauses();
List<FoundFailureCause> toRemove = Lists.newArrayList();
for (FoundFailureCause cause : foundFailureCauses) {
if (cause.getIndications().get(0).getMatchingFile() == "Claim") {
if (cause.getIndications().size() > 0 && cause.getIndications().get(0).getMatchingFile() == MATCHING_FILE) {
toRemove.add(cause);
}
}

0 comments on commit 6c0e403

Please sign in to comment.
You can’t perform that action at this time.