Skip to content

Commit

Permalink
Merge pull request #27 from vjuranek/JENKINS-44024
Browse files Browse the repository at this point in the history
JENKINS-44024 Skip empty list of indications
  • Loading branch information
Greybird committed Nov 8, 2017
2 parents 56c54d3 + a9a93f6 commit 6c0e403
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 6c0e403

Please sign in to comment.