From 433908f34f0f6554efbd6d615c7c65b84d5322b2 Mon Sep 17 00:00:00 2001 From: Dave Waltermire Date: Tue, 11 Jun 2024 22:49:36 -0400 Subject: [PATCH] code cleanup and fixes to PMD warnings --- .../function/library/HasOscalNamespace.java | 3 +- .../lib/model/control/AbstractParameter.java | 2 +- .../oscal/lib/model/control/AbstractPart.java | 2 +- .../control/catalog/AbstractCatalog.java | 3 +- .../control/catalog/AbstractCatalogGroup.java | 3 +- .../catalog/AbstractCatalogVisitor.java | 16 ++--- .../control/catalog/AbstractControl.java | 3 +- .../lib/profile/resolver/ProfileResolver.java | 18 +++--- .../profile/resolver/alter/AddVisitor.java | 59 +++++++++---------- .../DefaultControlSelectionFilter.java | 4 +- .../selection/IControlSelectionFilter.java | 16 +---- .../profile/resolver/selection/Import.java | 11 ++-- .../secauto/oscal/java/ReadWriteTest.java | 7 ++- 13 files changed, 72 insertions(+), 75 deletions(-) diff --git a/src/main/java/gov/nist/secauto/oscal/lib/metapath/function/library/HasOscalNamespace.java b/src/main/java/gov/nist/secauto/oscal/lib/metapath/function/library/HasOscalNamespace.java index 5621dcfc..e5e0b76f 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/metapath/function/library/HasOscalNamespace.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/metapath/function/library/HasOscalNamespace.java @@ -193,8 +193,7 @@ public static ISequence executeTwoArg( @NonNull public static IBooleanItem hasNamespace( @NonNull IAssemblyNodeItem propOrPart, - @NonNull ISequence namespaces) - throws MetapathException { + @NonNull ISequence namespaces) { Object propOrPartObject = propOrPart.getValue(); if (propOrPartObject == null) { throw new InvalidTypeFunctionException(InvalidTypeFunctionException.NODE_HAS_NO_TYPED_VALUE, propOrPart); diff --git a/src/main/java/gov/nist/secauto/oscal/lib/model/control/AbstractParameter.java b/src/main/java/gov/nist/secauto/oscal/lib/model/control/AbstractParameter.java index 244789d0..c08e4f26 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/model/control/AbstractParameter.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/model/control/AbstractParameter.java @@ -57,7 +57,7 @@ public Stream getParameterReferences() { Stream aggregatesIds = CollectionUtil.listOrEmpty(getProps()).stream() .filter(Objects::nonNull) .filter(prop -> prop.isNamespaceEqual(IProperty.OSCAL_NAMESPACE) && "aggregates".equals(prop.getName())) - .map(prop -> prop.getValue()); + .map(Property::getValue); // handle select/choice/insert ParameterSelection selection = getSelect(); diff --git a/src/main/java/gov/nist/secauto/oscal/lib/model/control/AbstractPart.java b/src/main/java/gov/nist/secauto/oscal/lib/model/control/AbstractPart.java index b07a9cf3..9d391f8b 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/model/control/AbstractPart.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/model/control/AbstractPart.java @@ -65,7 +65,7 @@ public Stream getPartsRecursively() { return Stream.concat( Stream.of(this), CollectionUtil.listOrEmpty(getParts()).stream() - .flatMap(part -> part.getPartsRecursively())); + .flatMap(AbstractPart::getPartsRecursively)); } @NonNull diff --git a/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalog.java b/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalog.java index acd761af..ccbcd640 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalog.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalog.java @@ -29,6 +29,7 @@ import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import gov.nist.secauto.oscal.lib.model.AbstractOscalInstance; +import gov.nist.secauto.oscal.lib.model.control.AbstractParameter; import java.util.stream.Stream; @@ -45,7 +46,7 @@ public Stream getReferencedParameterIds() { return ObjectUtils.notNull( CollectionUtil.listOrEmpty(getParams()).stream() .flatMap(ObjectUtils::filterNull) - .flatMap(param -> param.getParameterReferences()) + .flatMap(AbstractParameter::getParameterReferences) .distinct()); } } diff --git a/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalogGroup.java b/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalogGroup.java index e2819f84..36daa7b1 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalogGroup.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalogGroup.java @@ -35,6 +35,7 @@ import gov.nist.secauto.oscal.lib.model.Link; import gov.nist.secauto.oscal.lib.model.Parameter; import gov.nist.secauto.oscal.lib.model.Property; +import gov.nist.secauto.oscal.lib.model.control.AbstractParameter; import java.util.LinkedList; import java.util.List; @@ -63,7 +64,7 @@ public Stream getReferencedParameterIds() { // get parameters referenced by the control's parameters Stream parameterIds = CollectionUtil.listOrEmpty(getParams()).stream() .flatMap(ObjectUtils::filterNull) - .flatMap(param -> param.getParameterReferences()); + .flatMap(AbstractParameter::getParameterReferences); return ObjectUtils.notNull( Stream.concat(insertIds, parameterIds).distinct()); diff --git a/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalogVisitor.java b/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalogVisitor.java index 1e4ce4e8..949c7875 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalogVisitor.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractCatalogVisitor.java @@ -64,15 +64,15 @@ public RESULT visitCatalog(Catalog catalog, CONTEXT context) { RESULT result = CollectionUtil.listOrEmpty(catalog.getGroups()).stream() .filter(Objects::nonNull) .map(childGroup -> visitGroup(ObjectUtils.notNull(childGroup), context)) - .reduce(defaultResult(), (previous, current) -> aggregateResult(previous, current)); + .reduce(defaultResult(), this::aggregateResult); result = CollectionUtil.listOrEmpty(catalog.getControls()).stream() .filter(Objects::nonNull) .map(childControl -> visitControl(ObjectUtils.notNull(childControl), context)) - .reduce(result, (previous, current) -> aggregateResult(previous, current)); + .reduce(result, this::aggregateResult); return CollectionUtil.listOrEmpty(catalog.getParams()).stream() .filter(Objects::nonNull) .map(childParameter -> visitParameter(ObjectUtils.notNull(childParameter), context)) - .reduce(result, (previous, current) -> aggregateResult(previous, current)); + .reduce(result, this::aggregateResult); } @Override @@ -80,15 +80,15 @@ public RESULT visitGroup(@NonNull CatalogGroup group, CONTEXT context) { RESULT result = CollectionUtil.listOrEmpty(group.getGroups()).stream() .filter(Objects::nonNull) .map(childGroup -> visitGroup(ObjectUtils.notNull(childGroup), context)) - .reduce(defaultResult(), (previous, current) -> aggregateResult(previous, current)); + .reduce(defaultResult(), this::aggregateResult); result = CollectionUtil.listOrEmpty(group.getControls()).stream() .filter(Objects::nonNull) .map(childControl -> visitControl(ObjectUtils.notNull(childControl), context)) - .reduce(result, (previous, current) -> aggregateResult(previous, current)); + .reduce(result, this::aggregateResult); return CollectionUtil.listOrEmpty(group.getParams()).stream() .filter(Objects::nonNull) .map(childParameter -> visitParameter(ObjectUtils.notNull(childParameter), context)) - .reduce(result, (previous, current) -> aggregateResult(previous, current)); + .reduce(result, this::aggregateResult); } @Override @@ -96,11 +96,11 @@ public RESULT visitControl(Control control, CONTEXT context) { RESULT result = CollectionUtil.listOrEmpty(control.getControls()).stream() .filter(Objects::nonNull) .map(childControl -> visitControl(ObjectUtils.notNull(childControl), context)) - .reduce(defaultResult(), (previous, current) -> aggregateResult(previous, current)); + .reduce(defaultResult(), this::aggregateResult); return CollectionUtil.listOrEmpty(control.getParams()).stream() .filter(Objects::nonNull) .map(childParameter -> visitParameter(ObjectUtils.notNull(childParameter), context)) - .reduce(result, (previous, current) -> aggregateResult(previous, current)); + .reduce(result, this::aggregateResult); } @Override diff --git a/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractControl.java b/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractControl.java index 23a3df33..71c09c82 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractControl.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/model/control/catalog/AbstractControl.java @@ -35,6 +35,7 @@ import gov.nist.secauto.oscal.lib.model.Link; import gov.nist.secauto.oscal.lib.model.Parameter; import gov.nist.secauto.oscal.lib.model.Property; +import gov.nist.secauto.oscal.lib.model.control.AbstractParameter; import java.util.LinkedList; import java.util.List; @@ -86,7 +87,7 @@ public Stream getReferencedParameterIds() { // get parameters referenced by the control's parameters Stream parameterIds = CollectionUtil.listOrEmpty(getParams()).stream() .flatMap(ObjectUtils::filterNull) - .flatMap(param -> param.getParameterReferences()); + .flatMap(AbstractParameter::getParameterReferences); return ObjectUtils.notNull( Stream.concat(insertIds, parameterIds).distinct()); diff --git a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/ProfileResolver.java b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/ProfileResolver.java index c74a619a..36a0eaaa 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/ProfileResolver.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/ProfileResolver.java @@ -45,6 +45,7 @@ import gov.nist.secauto.metaschema.databind.io.DeserializationFeature; import gov.nist.secauto.metaschema.databind.io.IBoundLoader; import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelAssembly; +import gov.nist.secauto.metaschema.databind.model.IBoundObject; import gov.nist.secauto.oscal.lib.OscalBindingContext; import gov.nist.secauto.oscal.lib.OscalModelConstants; import gov.nist.secauto.oscal.lib.OscalUtils; @@ -56,6 +57,9 @@ import gov.nist.secauto.oscal.lib.model.Control; import gov.nist.secauto.oscal.lib.model.Merge; import gov.nist.secauto.oscal.lib.model.Metadata; +import gov.nist.secauto.oscal.lib.model.Metadata.Location; +import gov.nist.secauto.oscal.lib.model.Metadata.Party; +import gov.nist.secauto.oscal.lib.model.Metadata.Role; import gov.nist.secauto.oscal.lib.model.Modify; import gov.nist.secauto.oscal.lib.model.Modify.ProfileSetParameter; import gov.nist.secauto.oscal.lib.model.Parameter; @@ -395,9 +399,8 @@ protected IIndexer resolveImport( // changes to the data. try { IRootAssemblyNodeItem importedCatalogRoot = ObjectUtils.requireNonNull(getRoot(importedCatalog, CATALOG)); - Catalog catalogCopy - = (Catalog) OscalBindingContext.instance().deepCopy( - ObjectUtils.requireNonNull(importedCatalogRoot.getValue()), null); + Catalog catalogCopy = (Catalog) OscalBindingContext.instance().deepCopy( + (IBoundObject) ObjectUtils.requireNonNull(importedCatalogRoot).getValue(), null); importedCatalog = INodeItemFactory.instance().newDocumentNodeItem( importedCatalogRoot.getDefinition(), @@ -637,6 +640,7 @@ protected void handleSetParameter(IAssemblyNodeItem item, IIndexer indexer) { param.setSelect(setParameter.getSelect()); } + @SuppressWarnings("PMD.ExceptionAsFlowControl") protected void handleAlter(IAssemblyNodeItem item, IIndexer indexer) { Modify.Alter alter = ObjectUtils.requireNonNull((Modify.Alter) item.getValue()); String controlId = ObjectUtils.requireNonNull(alter.getControlId()); @@ -721,19 +725,19 @@ private static void handleReferences(@NonNull Catalog resolvedCatalog, @NonNull IIndexer.filterDistinct( ObjectUtils.notNull(CollectionUtil.listOrEmpty(resolvedMetadata.getRoles()).stream()), profileIndex.getEntitiesByItemType(IEntityItem.ItemType.ROLE), - item -> item.getId()) + Role::getId) .collect(Collectors.toCollection(LinkedList::new))); resolvedMetadata.setParties( IIndexer.filterDistinct( ObjectUtils.notNull(CollectionUtil.listOrEmpty(resolvedMetadata.getParties()).stream()), profileIndex.getEntitiesByItemType(IEntityItem.ItemType.PARTY), - item -> item.getUuid()) + Party::getUuid) .collect(Collectors.toCollection(LinkedList::new))); resolvedMetadata.setLocations( IIndexer.filterDistinct( ObjectUtils.notNull(CollectionUtil.listOrEmpty(resolvedMetadata.getLocations()).stream()), profileIndex.getEntitiesByItemType(IEntityItem.ItemType.LOCATION), - item -> item.getUuid()) + Location::getUuid) .collect(Collectors.toCollection(LinkedList::new))); // copy resources @@ -744,7 +748,7 @@ private static void handleReferences(@NonNull Catalog resolvedCatalog, @NonNull List resources = IIndexer.filterDistinct( ObjectUtils.notNull(resolvedResources.stream()), profileIndex.getEntitiesByItemType(IEntityItem.ItemType.RESOURCE), - item -> item.getUuid()) + Resource::getUuid) .collect(Collectors.toCollection(LinkedList::new)); if (!resources.isEmpty()) { diff --git a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/alter/AddVisitor.java b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/alter/AddVisitor.java index 75870f57..bcf56420 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/alter/AddVisitor.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/alter/AddVisitor.java @@ -372,14 +372,14 @@ private static boolean handleChild( // if id match, inject the new items into the collection switch (context.getPosition()) { case AFTER: { - newItemsSupplier.get().forEach(add -> iter.add(add)); + newItemsSupplier.get().forEach(iter::add); retval = true; break; } case BEFORE: { iter.previous(); List adds = newItemsSupplier.get(); - adds.forEach(add -> iter.add(add)); + adds.forEach(iter::add); item = iter.next(); retval = true; break; @@ -437,26 +437,26 @@ public Boolean visitControl(Control control, Context context) { boolean retval = handleCurrent( control, - title -> control.setTitle(title), - () -> control.getParams(), - () -> control.getProps(), - () -> control.getLinks(), - () -> control.getParts(), + control::setTitle, + control::getParams, + control::getProps, + control::getLinks, + control::getParts, context); // visit params retval = retval || handleChild( TargetType.PARAM, - () -> control.getParams(), - () -> context.getParams(), + control::getParams, + context::getParams, child -> visitParameter(ObjectUtils.notNull(child), context), context); // visit parts retval = retval || handleChild( TargetType.PART, - () -> control.getParts(), - () -> context.getParts(), + control::getParts, + context::getParts, child -> visitPart(child, context), context); @@ -485,8 +485,8 @@ public Boolean visitParameter(Parameter parameter, Context context) { parameter, null, null, - () -> parameter.getProps(), - () -> parameter.getLinks(), + parameter::getProps, + parameter::getLinks, null, context); } @@ -518,19 +518,17 @@ public boolean visitPart(ControlPart part, Context context) { part, null, null, - () -> part.getProps(), - () -> part.getLinks(), - () -> part.getParts(), + part::getProps, + part::getLinks, + part::getParts, context); - // visit parts - retval = retval || handleChild( + return retval || handleChild( TargetType.PART, - () -> part.getParts(), - () -> context.getParts(), + part::getParts, + context::getParts, child -> visitPart(child, context), context); - return retval; } static class Context { @@ -613,20 +611,19 @@ public Context( } if (Position.BEFORE.equals(position) || Position.AFTER.equals(position)) { - if (sequenceTarget) { - if (sequenceTarget && !params.isEmpty() && parts.isEmpty()) { - targetItemTypes.retainAll(Set.of(TargetType.PARAM)); - } else if (sequenceTarget && !parts.isEmpty() && params.isEmpty()) { - targetItemTypes.retainAll(Set.of(TargetType.PART)); - } else { - throw new ProfileResolutionEvaluationException( - "When using position before or after, only one collection of parameters or parts can be specified."); - } - } else { + if (!sequenceTarget) { throw new ProfileResolutionEvaluationException( "When using position before or after, one collection of parameters or parts can be specified." + " Other additions must not be used."); } + if (sequenceTarget && !params.isEmpty() && parts.isEmpty()) { + targetItemTypes.retainAll(Set.of(TargetType.PARAM)); + } else if (sequenceTarget && !parts.isEmpty() && params.isEmpty()) { + targetItemTypes.retainAll(Set.of(TargetType.PART)); + } else { + throw new ProfileResolutionEvaluationException( + "When using position before or after, only one collection of parameters or parts can be specified."); + } } if (targetItemTypes.isEmpty()) { diff --git a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/DefaultControlSelectionFilter.java b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/DefaultControlSelectionFilter.java index 6e11a422..be4df839 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/DefaultControlSelectionFilter.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/DefaultControlSelectionFilter.java @@ -64,7 +64,7 @@ public DefaultControlSelectionFilter(@NonNull List new Selection(selection)) + .map(Selection::new) .collect(Collectors.toUnmodifiableList()); } @@ -94,7 +94,7 @@ protected Pair match(String id) { return selections.parallelStream() .map(selection -> selection.match(id)) // filter out non-matches - .filter(pair -> pair.getLeft()) + .filter(Pair::getLeft) // aggregate matches .reduce((first, second) -> { Pair result; diff --git a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/IControlSelectionFilter.java b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/IControlSelectionFilter.java index 6dbabe11..00ffc079 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/IControlSelectionFilter.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/IControlSelectionFilter.java @@ -46,25 +46,15 @@ public interface IControlSelectionFilter extends Function MATCH = ObjectUtils.notNull(Pair.of(true, true)); @NonNull - IControlSelectionFilter ALL_MATCH = new IControlSelectionFilter() { - @Override - public Pair apply(IControl control) { - return MATCH; - } - }; + IControlSelectionFilter ALL_MATCH = control -> IControlSelectionFilter.MATCH; @NonNull - IControlSelectionFilter NONE_MATCH = new IControlSelectionFilter() { - @Override - public Pair apply(IControl control) { - return NON_MATCH; - } - }; + IControlSelectionFilter NONE_MATCH = control -> IControlSelectionFilter.NON_MATCH; @NonNull static IControlSelectionFilter matchIds(@NonNull String... identifiers) { return new IControlSelectionFilter() { - private Set keys = Arrays.stream(identifiers).collect(Collectors.toUnmodifiableSet()); + private final Set keys = Arrays.stream(identifiers).collect(Collectors.toUnmodifiableSet()); @Override public @NonNull Pair apply(IControl control) { diff --git a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/Import.java b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/Import.java index b8906497..a86f2490 100644 --- a/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/Import.java +++ b/src/main/java/gov/nist/secauto/oscal/lib/profile/resolver/selection/Import.java @@ -41,6 +41,9 @@ import gov.nist.secauto.oscal.lib.model.CatalogGroup; import gov.nist.secauto.oscal.lib.model.Control; import gov.nist.secauto.oscal.lib.model.Metadata; +import gov.nist.secauto.oscal.lib.model.Metadata.Location; +import gov.nist.secauto.oscal.lib.model.Metadata.Party; +import gov.nist.secauto.oscal.lib.model.Metadata.Role; import gov.nist.secauto.oscal.lib.model.Parameter; import gov.nist.secauto.oscal.lib.model.ProfileImport; import gov.nist.secauto.oscal.lib.profile.resolver.ProfileResolutionEvaluationException; @@ -185,19 +188,19 @@ private static void resolveMetadata( IIndexer.filterDistinct( ObjectUtils.notNull(CollectionUtil.listOrEmpty(resolved.getRoles()).stream()), indexer.getEntitiesByItemType(IEntityItem.ItemType.ROLE), - item -> item.getId()) + Role::getId) .collect(Collectors.toCollection(LinkedList::new))); resolved.setParties( IIndexer.filterDistinct( ObjectUtils.notNull(CollectionUtil.listOrEmpty(resolved.getParties()).stream()), indexer.getEntitiesByItemType(IEntityItem.ItemType.PARTY), - item -> item.getUuid()) + Party::getUuid) .collect(Collectors.toCollection(LinkedList::new))); resolved.setLocations( IIndexer.filterDistinct( ObjectUtils.notNull(CollectionUtil.listOrEmpty(resolved.getLocations()).stream()), indexer.getEntitiesByItemType(IEntityItem.ItemType.LOCATION), - item -> item.getUuid()) + Location::getUuid) .collect(Collectors.toCollection(LinkedList::new))); } @@ -217,7 +220,7 @@ private static void generateBackMatter( List resources = IIndexer.filterDistinct( ObjectUtils.notNull(resolvedResources.stream()), indexer.getEntitiesByItemType(IEntityItem.ItemType.RESOURCE), - item -> item.getUuid()) + Resource::getUuid) .collect(Collectors.toCollection(LinkedList::new)); if (!resources.isEmpty()) { diff --git a/src/test/java/gov/nist/secauto/oscal/java/ReadWriteTest.java b/src/test/java/gov/nist/secauto/oscal/java/ReadWriteTest.java index 5d247dc1..8ea94656 100644 --- a/src/test/java/gov/nist/secauto/oscal/java/ReadWriteTest.java +++ b/src/test/java/gov/nist/secauto/oscal/java/ReadWriteTest.java @@ -35,6 +35,7 @@ import gov.nist.secauto.metaschema.databind.io.Format; import gov.nist.secauto.metaschema.databind.io.IDeserializer; import gov.nist.secauto.metaschema.databind.io.ISerializer; +import gov.nist.secauto.metaschema.databind.model.IBoundObject; import gov.nist.secauto.oscal.lib.model.Catalog; import org.apache.logging.log4j.LogManager; @@ -56,7 +57,7 @@ class ReadWriteTest { // private static final int ITERATIONS = 1; @NonNull - private static CLASS measureDeserializer( + private static CLASS measureDeserializer( @NonNull String format, @NonNull Path file, @NonNull IDeserializer deserializer, @@ -96,7 +97,7 @@ private static CLASS measureDeserializer( return retval; } - private static void measureSerializer( + private static void measureSerializer( @NonNull CLASS root, @NonNull String format, @NonNull Path file, @@ -127,7 +128,7 @@ private static void measureSerializer( } } - private static void chainReadWrite( + private static void chainReadWrite( @NonNull Path xmlSource, @NonNull Class clazz, @NonNull Path tempDir,