Skip to content

Commit

Permalink
feat(impl):[#439] fix sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-ext-kmassalski committed Mar 12, 2024
1 parent a4566ae commit bdb191f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha

- EdcPolicyDefinitionService, EdcContractDefinitionService and EdcAssetService return existing resource if it exists in EDC
- Added AssetAdministrationShellDescriptor specificAssetIds support for externalSubjectId required for data provisioning
- Registering a job - aspects array is now accepting full urn of aspect model instead of name only, eg. 'urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt' instead 'SingleLevelBomAsBuilt' - #439
- Registering a job - aspects array is now accepting full urn of aspect model instead of name only, eg. 'urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt' instead 'SingleLevelBomAsBuilt'. #439

## [4.7.0] - 2024-03-04
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private void validateAspectTypeValues(final List<String> aspectTypeValues) {
final List<String> invalidAspectTypes = aspectTypeValues.stream()
.filter(s -> !availableUrns.contains(s)
|| !s.matches(
"^(urn:(b|s)amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$"))
"^(urn:[bs]amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$"))
.toList();
if (!invalidAspectTypes.isEmpty()) {
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
})
public class RegisterBatchOrder {

private static final String ASPECT_MODEL_REGEX = "^(urn:(b|s)amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$";
private static final String ASPECT_MODEL_REGEX = "^(urn:[bs]amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$";

@NotEmpty
@Valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class RegisterJob {
private static final String MAX_TREE_DEPTH_DESC = "100";
private static final int MIN_TREE_DEPTH = 1;
private static final int MAX_TREE_DEPTH = 100;
private static final String ASPECT_MODEL_REGEX = "^(urn:(b|s)amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$";
private static final String ASPECT_MODEL_REGEX = "^(urn:[bs]amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$";

@NotNull
@Valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public String getAspectType() {
/* package */ boolean isAspect(final String filterSemanticId) {
return Optional.ofNullable(getAspectType())
.filter(aspect -> StringUtils.hasLength(filterSemanticId))
.map(semanticId -> semanticId.contains(lowerCaseNameWithUnderscores(filterSemanticId))
|| semanticModelNamesMatchAndVersionIsInRange(semanticId, filterSemanticId))
.map(aspect -> aspect.contains(lowerCaseNameWithUnderscores(filterSemanticId))
|| semanticModelNamesMatchAndVersionIsInRange(aspect, filterSemanticId))
.orElse(false);
}

Expand Down

0 comments on commit bdb191f

Please sign in to comment.