Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated code #11268

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -139,21 +139,6 @@ void shouldReplaceExistingType() {
"""
);
}

@Test
void deprecatedApiShouldWork() {
JHipsterProjectFolder folder = projectWithPackageJson("src/test/resources/projects/empty-node/package.json");

packageJson.handle(Indentation.DEFAULT, folder, packageJson(p -> p.addType("module")), emptyModuleContext());

assertPackageJsonContent(
folder,
"""
"type": "module"
}
"""
);
}
}

@Nested
Expand Down