use of jetbrains.buildServer.server.rest.model.problem.ProblemOccurrences in project teamcity-rest by JetBrains.
the class Build method getProblemOccurrences.
@XmlElement(name = "problemOccurrences")
public ProblemOccurrences getProblemOccurrences() {
return ValueWithDefault.decideDefault(myFields.isIncluded("problemOccurrences", false), () -> {
final List<BuildProblem> problemOccurrences = ProblemOccurrenceFinder.getProblemOccurrences(myBuildPromotion);
if (problemOccurrences.size() == 0)
return null;
int newProblemsCount = 0;
int mutedProblemsCount = 0;
for (BuildProblem problem : problemOccurrences) {
if (problem.isMutedInBuild())
mutedProblemsCount++;
final Boolean isNew = ((BuildProblemImpl) problem).isNew();
if (isNew != null && isNew)
newProblemsCount++;
}
final Fields problemOccurrencesFields = myFields.getNestedField("problemOccurrences");
final List<BuildProblem> problems = ValueWithDefault.decideDefault(problemOccurrencesFields.isIncluded("problemOccurrence", false), problemOccurrences);
return new ProblemOccurrences(problems, problemOccurrences.size(), null, null, newProblemsCount, null, mutedProblemsCount, ProblemOccurrenceRequest.getHref(myBuildPromotion), null, problemOccurrencesFields, myBeanContext);
});
}
Aggregations