diff --git a/core/src/main/java/org/verapdf/pdfa/validation/validators/BaseValidator.java b/core/src/main/java/org/verapdf/pdfa/validation/validators/BaseValidator.java index 7fcf07a21..6aa439fea 100644 --- a/core/src/main/java/org/verapdf/pdfa/validation/validators/BaseValidator.java +++ b/core/src/main/java/org/verapdf/pdfa/validation/validators/BaseValidator.java @@ -298,11 +298,7 @@ private boolean checkAllRules(Object checkObject, String checkContext) { private boolean firstProcessObjectWithRule(Object checkObject, String checkContext, Rule rule) { Boolean deferred = rule.getDeferred(); if (deferred != null && deferred.booleanValue()) { - List list = this.deferredRules.get(rule); - if (list == null) { - list = new ArrayList<>(); - this.deferredRules.put(rule, list); - } + List list = this.deferredRules.computeIfAbsent(rule, k -> new ArrayList<>()); list.add(new ObjectWithContext(checkObject, checkContext)); return true; } diff --git a/core/src/main/java/org/verapdf/processor/reports/RuleSummary.java b/core/src/main/java/org/verapdf/processor/reports/RuleSummary.java index b43a4c6a1..a49858016 100644 --- a/core/src/main/java/org/verapdf/processor/reports/RuleSummary.java +++ b/core/src/main/java/org/verapdf/processor/reports/RuleSummary.java @@ -45,7 +45,7 @@ public interface RuleSummary { public int getTestNumber(); public String getStatus(); public Status getRuleStatus(); - public int getPassedChecks(); + public Integer getPassedChecks(); public int getFailedChecks(); public Set getTags(); public String getDescription(); diff --git a/core/src/main/java/org/verapdf/processor/reports/RuleSummaryImpl.java b/core/src/main/java/org/verapdf/processor/reports/RuleSummaryImpl.java index 2c62c73f6..9c7e15fe4 100644 --- a/core/src/main/java/org/verapdf/processor/reports/RuleSummaryImpl.java +++ b/core/src/main/java/org/verapdf/processor/reports/RuleSummaryImpl.java @@ -50,7 +50,7 @@ final class RuleSummaryImpl implements RuleSummary { @XmlAttribute private final String status; @XmlAttribute - private final int passedChecks; + private final Integer passedChecks; @XmlAttribute private final int failedChecks; @XmlAttribute @@ -64,7 +64,7 @@ final class RuleSummaryImpl implements RuleSummary { @XmlElement(name = "check") private final List checks; - private RuleSummaryImpl(final RuleId ruleId, final Status status, final int passedChecks, final int failedChecks, + private RuleSummaryImpl(final RuleId ruleId, final Status status, final Integer passedChecks, final int failedChecks, final String tags, final String description, final String object, final String test, final List checks) { PDFAFlavour.Specification specification = ruleId.getSpecification(); this.specification = specification == null ? null : specification.getId(); @@ -135,7 +135,7 @@ public int getTestNumber() { * @return the passedChecks */ @Override - public int getPassedChecks() { + public Integer getPassedChecks() { return this.passedChecks; } @@ -149,7 +149,7 @@ public int getFailedChecks() { @Override public Set getTags() { - return tags != null ? new HashSet<>(Arrays.asList(tags.split(","))) : Collections.emptySet(); + return tags != null ? new HashSet<>(Arrays.asList(tags.split(","))) : null; } /** @@ -213,15 +213,13 @@ static final RuleSummary fromValues(final RuleId id, final String description, f for (TestAssertion assertion : assertions) { if (assertion.getStatus() == Status.PASSED) { passedChecks++; - if (logPassedChecks) { - checks.add(CheckImpl.fromValue(assertion)); - } + checks.add(CheckImpl.fromValue(assertion)); } else { status = assertion.getStatus(); checks.add(CheckImpl.fromValue(assertion)); } } - return new RuleSummaryImpl(id, status, passedChecks, failedChecks != null ? failedChecks : 0, tags, description, object, test, checks); + return new RuleSummaryImpl(id, status, logPassedChecks ? passedChecks : null, failedChecks != null ? failedChecks : 0, tags, description, object, test, checks); } static final RuleSummary uncheckedInstance(final RuleId id, final String description, final String object, diff --git a/xmp-core/src/main/java/org/verapdf/xmp/impl/VeraPDFMeta.java b/xmp-core/src/main/java/org/verapdf/xmp/impl/VeraPDFMeta.java index 104ee03b9..6dc137c45 100644 --- a/xmp-core/src/main/java/org/verapdf/xmp/impl/VeraPDFMeta.java +++ b/xmp-core/src/main/java/org/verapdf/xmp/impl/VeraPDFMeta.java @@ -15,6 +15,7 @@ public class VeraPDFMeta { public static final String PDFAID_PREFIX = "pdfaid"; + public static final String PDFUAID_PREFIX = "pdfuaid"; public static final String CONFORMANCE = "conformance"; public static final String PART = "part"; public static final String REVISION_YEAR = "rev";