Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 7.10.0.

Duplications

File Line
gov/nist/secauto/metaschema/schemagen/json/impl/JsonSchemaDefinitionAssembly.java 61
gov/nist/secauto/metaschema/schemagen/json/impl/JsonSchemaPropertyGroupedAssembly.java 63
});
  }

  @Override
  public List<JsonSchemaHelper.Choice> getChoices() {
    return ObjectUtils.notNull(choices.get());
  }

  @Override
  public Stream<IJsonSchemaDefinable> collectDefinitions(
      Set<IJsonSchemaDefinitionAssembly> visited,
      IJsonGenerationState state) {
    Set<IJsonSchemaDefinitionAssembly> myVisited = ObjectUtils.notNull(Stream.concat(
        visited.stream(),
        Stream.of(this))
        .collect(Collectors.toUnmodifiableSet()));

    assert visited.contains(this) || visited.stream()
        .noneMatch(schema -> schema.getDefinition().equals(getDefinition()));

    return ObjectUtils.notNull(visited.contains(this)
        ? Stream.of(this)
        : Stream.concat(
            super.collectDefinitions(myVisited, state),
            choices.get().stream()
                .flatMap(choice -> choice.getCombinations().stream()
                    .flatMap(property -> property.collectDefinitions(myVisited, state)
File Line
gov/nist/secauto/metaschema/schemagen/json/impl/AbstractJsonSchemaModelDefinition.java 77
gov/nist/secauto/metaschema/schemagen/json/impl/AbstractJsonSchemaPropertyGrouped.java 88
}

  @Override
  public Stream<IJsonSchemaDefinable> collectDefinitions(
      Set<IJsonSchemaDefinitionAssembly> visited,
      IJsonGenerationState state) {
    Stream<IJsonSchemaDefinable> retval = Stream.concat(
        Stream.of(this),
        getFlagProperties().stream()
            .flatMap(property -> property.collectDefinitions(visited, state)));

    IFlagInstance jsonKeyFlag = getJsonKeyFlag();
    if (jsonKeyFlag != null) {
      retval = Stream.concat(retval, Stream.of(state.getFlagDefinition(jsonKeyFlag.getDefinition())));
    }

    return ObjectUtils.notNull(retval);
  }