diff --git a/sonar-project.properties b/sonar-project.properties index 4f82af0c641..0a770a9bafb 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -33,7 +33,7 @@ sonar.test.exclusions=\ sonar.typescript.tsconfigPath=tsconfig.json -sonar.issue.ignore.multicriteria=S1640,S3437,S4502,S4684,S4032,S5778,S1133,S119,UndocumentedApi,S5976,S2068,S117,S5738,S2083,S6206,S6564,S4649,S7027,S7091 +sonar.issue.ignore.multicriteria=S1640,S3437,S4502,S4684,S4032,S5778,S1133,S119,UndocumentedApi,S5976,S2068,S117,S2083,S6206,S6564,S4649,S7027,S7091 # Rule: Replace map by enum map sonar.issue.ignore.multicriteria.S1640.resourceKey=src/main/java/**/* @@ -84,10 +84,6 @@ sonar.issue.ignore.multicriteria.S2068.ruleKey=java:S2068 sonar.issue.ignore.multicriteria.S117.resourceKey=src/main/java/**/* sonar.issue.ignore.multicriteria.S117.ruleKey=java:S117 -# Rule: avoid calling deprecated methods -sonar.issue.ignore.multicriteria.S5738.resourceKey=src/**/java/**/* -sonar.issue.ignore.multicriteria.S5738.ruleKey=java:S5738 - # Rule: Allow writing to user controlled paths sonar.issue.ignore.multicriteria.S2083.resourceKey=src/main/java/**/* sonar.issue.ignore.multicriteria.S2083.ruleKey=javasecurity:S2083 diff --git a/src/main/java/tech/jhipster/lite/module/domain/packagejson/JHipsterModulePackageJson.java b/src/main/java/tech/jhipster/lite/module/domain/packagejson/JHipsterModulePackageJson.java index c326253607e..1e090c18f27 100644 --- a/src/main/java/tech/jhipster/lite/module/domain/packagejson/JHipsterModulePackageJson.java +++ b/src/main/java/tech/jhipster/lite/module/domain/packagejson/JHipsterModulePackageJson.java @@ -1,7 +1,6 @@ package tech.jhipster.lite.module.domain.packagejson; import java.util.*; -import java.util.stream.Stream; import tech.jhipster.lite.module.domain.JHipsterModule.JHipsterModuleBuilder; import tech.jhipster.lite.module.domain.npm.NpmVersionSourceFactory; import tech.jhipster.lite.shared.error.domain.Assert; @@ -195,23 +194,6 @@ public JHipsterModulePackageJsonBuilder removeDevDependency(PackageName packageN return this; } - /** - * Add a type to the {@code package.json}. - * - * @param moduleFormat the moduleFormat - * @return the builder itself - * @deprecated Use {@link #type(NodeModuleFormat)} instead - */ - @Deprecated(forRemoval = true, since = "1.17.0") - public JHipsterModulePackageJsonBuilder addType(String moduleFormat) { - nodeModuleFormat = Stream.of(NodeModuleFormat.values()) - .filter(enumValue -> enumValue.name().equalsIgnoreCase(moduleFormat)) - .findFirst() - .orElseThrow(); - - return this; - } - /** * Defines the module format ("type") in the {@code package.json}. * diff --git a/src/test/java/tech/jhipster/lite/module/infrastructure/secondary/FileSystemPackageJsonHandlerTest.java b/src/test/java/tech/jhipster/lite/module/infrastructure/secondary/FileSystemPackageJsonHandlerTest.java index 529fa76a132..8fc1f4d5d4c 100644 --- a/src/test/java/tech/jhipster/lite/module/infrastructure/secondary/FileSystemPackageJsonHandlerTest.java +++ b/src/test/java/tech/jhipster/lite/module/infrastructure/secondary/FileSystemPackageJsonHandlerTest.java @@ -144,7 +144,7 @@ void shouldReplaceExistingType() { void deprecatedApiShouldWork() { JHipsterProjectFolder folder = projectWithPackageJson("src/test/resources/projects/empty-node/package.json"); - packageJson.handle(Indentation.DEFAULT, folder, packageJson(p -> p.addType("module")), emptyModuleContext()); + packageJson.handle(Indentation.DEFAULT, folder, packageJson(p -> p.type(MODULE)), emptyModuleContext()); assertPackageJsonContent( folder,