CPD Results
The following document contains the results of PMD's CPD 7.7.0.
Duplications
File |
Line |
gov/nist/secauto/metaschema/core/model/IFeatureContainerModel.java |
40 |
gov/nist/secauto/metaschema/core/model/IFeatureContainerModelAbsolute.java |
30 |
@Override
default Collection<MI> getModelInstances() {
return getModelContainer().getModelInstances();
}
@Override
default NMI getNamedModelInstanceByName(QName name) {
return getModelContainer().getNamedModelInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<NMI> getNamedModelInstances() {
return getModelContainer().getNamedModelInstanceMap().values();
}
@Override
default FI getFieldInstanceByName(QName name) {
return getModelContainer().getFieldInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<FI> getFieldInstances() {
return getModelContainer().getFieldInstanceMap().values();
}
@Override
default AI getAssemblyInstanceByName(QName name) {
return getModelContainer().getAssemblyInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<AI> getAssemblyInstances() {
return getModelContainer().getAssemblyInstanceMap().values();
}
} |
File |
Line |
gov/nist/secauto/metaschema/core/model/IFeatureContainerModel.java |
41 |
gov/nist/secauto/metaschema/core/model/IFeatureContainerModelGrouped.java |
34 |
default Collection<MI> getModelInstances() {
return getModelContainer().getModelInstances();
}
@Override
default NMI getNamedModelInstanceByName(QName name) {
return getModelContainer().getNamedModelInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<NMI> getNamedModelInstances() {
return getModelContainer().getNamedModelInstanceMap().values();
}
@Override
default FI getFieldInstanceByName(QName name) {
return getModelContainer().getFieldInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<FI> getFieldInstances() {
return getModelContainer().getFieldInstanceMap().values();
}
@Override
default AI getAssemblyInstanceByName(QName name) {
return getModelContainer().getAssemblyInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<AI> getAssemblyInstances() {
return getModelContainer().getAssemblyInstanceMap().values();
}
} |
File |
Line |
gov/nist/secauto/metaschema/core/model/IFeatureContainerModelAbsolute.java |
31 |
gov/nist/secauto/metaschema/core/model/IFeatureContainerModelGrouped.java |
34 |
default Collection<MI> getModelInstances() {
return getModelContainer().getModelInstances();
}
@Override
default NMI getNamedModelInstanceByName(QName name) {
return getModelContainer().getNamedModelInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<NMI> getNamedModelInstances() {
return getModelContainer().getNamedModelInstanceMap().values();
}
@Override
default FI getFieldInstanceByName(QName name) {
return getModelContainer().getFieldInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<FI> getFieldInstances() {
return getModelContainer().getFieldInstanceMap().values();
}
@Override
default AI getAssemblyInstanceByName(QName name) {
return getModelContainer().getAssemblyInstanceMap().get(name);
}
@SuppressWarnings("null")
@Override
default Collection<AI> getAssemblyInstances() {
return getModelContainer().getAssemblyInstanceMap().values();
}
} |
File |
Line |
gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java |
55 |
gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java |
55 |
private FnSubstringAfter() {
// disable construction
}
@SuppressWarnings({ "unused", "PMD.OnlyOneReturn" })
@NonNull
private static ISequence<IStringItem> executeTwoArg(
@NonNull IFunction function,
@NonNull List<ISequence<?>> arguments,
@NonNull DynamicContext dynamicContext,
IItem focus) {
// From the XPath 3.1 specification:
// If the value of $arg1 or $arg2 is the empty sequence, or contains only
// ignorable collation units, it is interpreted as the zero-length string.
IStringItem arg1 = arguments.get(0).isEmpty()
? IStringItem.valueOf("")
: FunctionUtils.asType(ObjectUtils.notNull(arguments.get(0).getFirstItem(true)));
IStringItem arg2 = arguments.get(1).isEmpty()
? IStringItem.valueOf("")
: FunctionUtils.asType(ObjectUtils.notNull(arguments.get(1).getFirstItem(true)));
return ISequence.of(IStringItem.valueOf(fnSubstringAfter(arg1.asString(), arg2.asString()))); |
File |
Line |
gov/nist/secauto/metaschema/core/model/xml/impl/XmlFlagContainerSupport.java |
91 |
gov/nist/secauto/metaschema/core/model/xml/impl/XmlFlagContainerSupport.java |
114 |
@NonNull GlobalFieldDefinitionType xmlField,
@NonNull IFieldDefinition container) {
if (!xmlField.getFlagList().isEmpty() || !xmlField.getDefineFlagList().isEmpty()) {
IFlagContainerBuilder<IFlagInstance> builder = xmlField.isSetJsonKey()
? IContainerFlagSupport.builder(container.getContainingModule().toFlagQName(
ObjectUtils.requireNonNull(xmlField.getJsonKey().getFlagRef())))
: IContainerFlagSupport.builder();
parseLocalFlags(xmlField, container, builder);
return builder.build();
}
return IContainerFlagSupport.empty();
}
/**
* Generate a flag container from the provided XMLBeans instance.
*
* @param xmlField
* the XMLBeans instance
* @param container
* the field containing the flag
*/
@SuppressWarnings("PMD.OnlyOneReturn")
static IContainerFlagSupport<IFlagInstance> newInstance(
@NonNull InlineFieldDefinitionType xmlField, |
File |
Line |
gov/nist/secauto/metaschema/core/model/xml/impl/XmlFlagContainerSupport.java |
160 |
gov/nist/secauto/metaschema/core/model/xml/impl/XmlFlagContainerSupport.java |
183 |
@NonNull GlobalAssemblyDefinitionType xmlAssembly,
@NonNull IAssemblyDefinition container) {
if (!xmlAssembly.getFlagList().isEmpty() || !xmlAssembly.getDefineFlagList().isEmpty()) {
IFlagContainerBuilder<IFlagInstance> builder = xmlAssembly.isSetJsonKey()
? IContainerFlagSupport.builder(container.getContainingModule().toFlagQName(
ObjectUtils.requireNonNull(xmlAssembly.getJsonKey().getFlagRef())))
: IContainerFlagSupport.builder();
parseLocalFlags(xmlAssembly, container, builder);
return builder.build();
}
return IContainerFlagSupport.empty();
}
/**
* Generate a flag container from the provided XMLBeans instance.
*
* @param xmlField
* the XMLBeans instance
* @param container
* the field containing the flag
*/
@SuppressWarnings("PMD.OnlyOneReturn")
static IContainerFlagSupport<IFlagInstance> newInstance(
@NonNull InlineAssemblyDefinitionType xmlAssembly, |