Skip to content

Commit

Permalink
Remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
qmonmert committed Nov 1, 2024
1 parent 4ace8fb commit e3c6984
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
6 changes: 1 addition & 5 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e3c6984

Please sign in to comment.