Skip to content

Commit

Permalink
Adjusting code formatting.
Browse files Browse the repository at this point in the history
Suppressing false PMD errors.
  • Loading branch information
david-waltermire committed Oct 27, 2022
1 parent d7a71e6 commit faa2006
Show file tree
Hide file tree
Showing 31 changed files with 127 additions and 126 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<dependency.metaschema-framework.version>0.9.0</dependency.metaschema-framework.version>
<dependency.metaschema-framework.version>0.10.0</dependency.metaschema-framework.version>

<dependency.auto-service.version>1.0.1</dependency.auto-service.version>
<dependency.commons-lang3.version>3.12.0</dependency.commons-lang3.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public PlanOfActionAndMilestones loadPlanOfActionAndMilestones(@NonNull File fil

private static class Matcher implements IBindingMatcher {
@Override
public Class<?> getBoundClassForXmlQName(QName startElementQName) {
public Class<?> getBoundClassForXmlQName(QName startElementQName) {
Class<?> clazz = null;
if ("http://csrc.nist.gov/ns/oscal/1.0".equals(startElementQName.getNamespaceURI())) {
switch (startElementQName.getLocalPart()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gov/nist/secauto/oscal/lib/OscalUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private OscalUtils() {

public static boolean isInternalReference(@NonNull URI uri) {
if (uri.isAbsolute()) {
return false;
return false;
}

String schemeSpecificPart = uri.getSchemeSpecificPart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ public static ISequence<?> executeOneArg(
INodeItem focus) {
INodeItem node = focus;
if (node == null) {
return ISequence.empty();
return ISequence.empty();
}

ISequence<? extends IStringItem> namespaceArgs = FunctionUtils.asType(arguments.get(0));
if (namespaceArgs.isEmpty()) {
return ISequence.empty();
return ISequence.empty();
}

return ISequence.of(hasNamespace(FunctionUtils.asType(node), namespaceArgs));
Expand All @@ -123,19 +123,19 @@ public static ISequence<?> executeTwoArg(

IItem node = FunctionUtils.getFirstItem(nodeSequence, true);
if (node == null) {
return ISequence.empty();
return ISequence.empty();
}

ISequence<? extends IStringItem> namespaceArgs = FunctionUtils.asType(arguments.get(1));
if (namespaceArgs.isEmpty()) {
return ISequence.empty();
return ISequence.empty();
}

return ISequence.of(hasNamespace(FunctionUtils.asType(node), namespaceArgs));
}

@NonNull
public static IBooleanItem hasNamespace(
public static IBooleanItem hasNamespace(
@NonNull IDefinitionNodeItem propOrPart,
@NonNull ISequence<? extends IStringItem> namespaces)
throws MetapathException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static ISequence<?> executeNoArg(

INodeItem item = focus;
if (item == null) {
return ISequence.empty();
return ISequence.empty();
}
return ISequence.of(resolveProfile(FunctionUtils.asType(item), dynamicContext));
}
Expand All @@ -103,7 +103,7 @@ public static ISequence<?> executeOneArg(

IItem item = FunctionUtils.getFirstItem(arg, true);
if (item == null) {
return ISequence.empty();
return ISequence.empty();
}

return ISequence.of(resolveProfile(FunctionUtils.asType(item), dynamicContext));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ public static class Builder {
@NonNull
private final String id;

private String clazz;
private String clazz;
private final List<Property> props = new LinkedList<>();
private final List<Link> links = new LinkedList<>();
private MarkupLine label;
private MarkupMultiline usage;
private MarkupLine label;
private MarkupMultiline usage;
private final List<ParameterConstraint> constraints = new LinkedList<>();
private final List<ParameterGuideline> guidelines = new LinkedList<>();
private List<String> values = new LinkedList<>();
private List<String> values = new LinkedList<>();
private ParameterSelection selection;
private MarkupMultiline remarks;
private MarkupMultiline remarks;

public Builder(@NonNull String id) {
this.id = ObjectUtils.requireNonNull(id);
Expand Down Expand Up @@ -179,7 +179,7 @@ public Builder remarks(@NonNull MarkupMultiline value) {
}

@NonNull
public Parameter build() {
public Parameter build() {
Parameter retval = new Parameter();
retval.setId(id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ public static Builder builder(@NonNull String name) {
}

public static class Builder {
private String id;
private String id;
@NonNull
private final String name;
private URI namespace;
private String clazz;
private MarkupMultiline prose;
private MarkupLine title;
private URI namespace;
private String clazz;
private MarkupMultiline prose;
private MarkupLine title;
private final List<Property> props = new LinkedList<>();
private final List<Link> links = new LinkedList<>();
private final List<ControlPart> parts = new LinkedList<>();
Expand All @@ -90,7 +90,7 @@ public Builder(@NonNull String name) {
}

@NonNull
public Builder id(@NonNull String value) {
public Builder id(@NonNull String value) {
this.id = Objects.requireNonNull(value);
return this;
}
Expand Down Expand Up @@ -148,7 +148,7 @@ public Builder part(@NonNull ControlPart value) {
}

@NonNull
public ControlPart build() {
public ControlPart build() {
ControlPart retval = new ControlPart();

retval.setName(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void setParentControl(Control parent) {
}

@Override
public void beforeDeserialize(Object parent) {
public void beforeDeserialize(Object parent) { // NOPMD noop default
// do nothing
}

Expand Down Expand Up @@ -101,8 +101,8 @@ public static class Builder {
@NonNull
private final String id;

private String clazz;
private MarkupLine title;
private String clazz;
private MarkupLine title;
private final List<Parameter> params = new LinkedList<>();
private final List<Property> props = new LinkedList<>();
private final List<Link> links = new LinkedList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public static class Builder {
@NonNull
private final String name;

private UUID uuid;
private URI namespace;
private String value;
private String clazz;
private UUID uuid;
private URI namespace;
private String value;
private String clazz;

public Builder(@NonNull String name) {
this.name = Objects.requireNonNull(name, "name");
Expand All @@ -115,7 +115,7 @@ public Builder uuid(@NonNull UUID uuid) {
@NonNull
public Builder namespace(@NonNull URI namespace) {
if (IProperty.OSCAL_NAMESPACE.equals(namespace)) {
this.namespace = null;
this.namespace = null;
} else {
this.namespace = Objects.requireNonNull(namespace);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static <T, R> Function<? super T, String> identifierKey(@NonNull Function

public static <T> T mergeItem(@Nullable T original, @Nullable T additional) {
if (additional == null) {
return original;
return original;
}

return additional;
Expand All @@ -73,11 +73,11 @@ public static <T> T mergeItem(@Nullable T original, @Nullable T additional) {
public static <T> List<T> merge(@Nullable List<T> original, @Nullable List<T> additional,
Function<? super T, String> keyFunction) {
if (additional == null || additional.isEmpty()) {
return original;
return original;
}

if (original == null || original.isEmpty()) {
return additional;
return additional;
}

// reverse the stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public class ProfileResolver {
public class ProfileResolver {
private static final Logger LOGGER = LogManager.getLogger(ProfileResolver.class);
private static final MetapathExpression METAPATH_SET_PARAMETER
= MetapathExpression.compile("/profile/modify/set-parameter");
Expand Down Expand Up @@ -343,7 +343,7 @@ protected IIndexer resolveImport(
OscalBindingContext.instance().copyBoundObject(importedCatalog.getValue(), null),
importedCatalog.getDocumentUri());

IIndexer retval = new Import(profileDocument, profileImportItem)
IIndexer retval = new Import(profileDocument, profileImportItem)
.resolve(importedCatalog, resolvedCatalog);

return retval;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ private static <T> void handleCollection(
// }
// }

private static <T> boolean handleChild(
private static <T> boolean handleChild(
@NonNull TargetType itemType,
@NonNull Supplier<? extends List<T>> originalCollectionSupplier,
@NonNull Supplier<? extends List<T>> newItemsSupplier,
Expand Down Expand Up @@ -530,7 +530,7 @@ public boolean visitPart(ControlPart part, Context context) {
return retval;
}

static class Context {
static class Context {
@NonNull
private static final Set<TargetType> TITLE_TYPES = ObjectUtils.notNull(
Set.of(TargetType.CONTROL, TargetType.PART));
Expand Down Expand Up @@ -566,7 +566,7 @@ static class Context {
@NonNull
private final Set<TargetType> targetItemTypes;

public Context(
public Context(
@NonNull Control control,
@NonNull Position position,
@Nullable String byId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private static Set<TargetType> getApplicableTypes(@NonNull TargetType type) {
return APPLICABLE_TARGETS.getOrDefault(type, CollectionUtil.emptySet());
}

private static <T> boolean handle(
private static <T> boolean handle(
@NonNull TargetType itemType,
@NonNull Supplier<? extends Collection<T>> supplier,
@Nullable Function<T, Boolean> handler,
Expand Down Expand Up @@ -220,7 +220,7 @@ private static <T> boolean handle(
* @throws ProfileResolutionEvaluationException
* if a processing error occurred during profile resolution
*/
public static boolean remove(
public static boolean remove(
@NonNull Control control,
@Nullable String objectName,
@Nullable String objectClass,
Expand Down Expand Up @@ -387,7 +387,7 @@ public boolean visitMappingEntry(MappingEntry map, Context context) {
return retval;
}

static class Context {
static class Context {
/**
* Types with an "name" flag.
*/
Expand Down Expand Up @@ -508,7 +508,7 @@ protected boolean checkValue(@Nullable String actual, @Nullable String expected)
return expected == null || expected.equals(actual);
}

public boolean isApplicableTo(@NonNull Object obj) {
public boolean isApplicableTo(@NonNull Object obj) {
TargetType objectType = TargetType.forClass(obj.getClass());

boolean retval = objectType != null && getTargetItemTypes().contains(objectType);
Expand Down
Loading

0 comments on commit faa2006

Please sign in to comment.