Skip to content

Commit

Permalink
remove useless code
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <thibault.vallin@oracle.com>
  • Loading branch information
tvallin committed Jul 17, 2023
1 parent a7bd04d commit 01f84f2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void testIt() throws Exception {
.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
DefaultPrettyPrinter printer = new DefaultPrettyPrinter();
String json = mapper.writer(printer).writeValueAsString(customNamed);
json = json.replace("\r\n", "\n");
assertThat(json, equalTo("{\n" + " \"stringSet\" : [ \"b\", \"a\", \"y\" ]\n" + "}"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,27 +276,17 @@ protected String determinePackageName(Optional<ServiceProvider<ModuleComponent>>
// check for the existence of the file
packageName = loadAppPackageName().orElse(null);
if (packageName != null) {
getLog().debug("Errors: Package : " + packageName);
if (!"unnamed".equals(packageName)) {
return packageName;
}
return packageName;
}

ServiceProvider<ModuleComponent> moduleSp = optModuleSp.orElse(null);
if (moduleSp != null) {
packageName = moduleSp.serviceInfo().serviceTypeName().packageName();
if ("unnamed".equals(packageName)) {
getLog().debug("Errors: module-sp");
}
} else {
if (descriptor == null) {
packageName = toSuggestedGeneratedPackageName(typeNames, "pico");
getLog().debug("Errors: pico");
} else {
packageName = toSuggestedGeneratedPackageName(typeNames, "pico", descriptor);
if ("unnamed".equals(packageName)) {
getLog().debug("Errors: descriptor");
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,10 @@ private Optional<ModuleInfoDescriptor> tryFindModuleInfoTheUnconventionalWayFrom
if (srcPath != null && srcPath.get() != null && srcPath.get().getPath().replace("\\", "/").contains(TARGET_DIR)) {
String path = srcPath.get().getPath();
path = path.replace("\\", "/");
log("Path here : " + path);
int pos = path.indexOf(TARGET_DIR);
path = path.substring(0, pos);
File srcRoot = new File(path, SRC_MAIN_JAVA_DIR);
File file = new File(srcRoot, REAL_MODULE_INFO_JAVA_NAME);
log("Path here testing : " + file.toPath());
if (file.exists()) {
try {
log("Path here exist : " + file.toPath());
Expand Down Expand Up @@ -243,7 +241,6 @@ private Optional<ModuleInfoDescriptor> tryFindModuleInfoTheConventionalWay(Stand
filePath = Path.of(filePath.toString().replace("\\", "/"));
Path parent = filePath.getParent();
if (srcPath != null) {
log("Source path : " + parent.toFile());
srcPath.set(parent.toFile());
}
if (typeSuffix != null) {
Expand All @@ -255,7 +252,6 @@ private Optional<ModuleInfoDescriptor> tryFindModuleInfoTheConventionalWay(Stand
moduleInfoFile.set(filePath.toFile());
}
ModuleInfoDescriptor mid = ModuleInfoDescriptor.create(filePath);
log("Module info desc : " + mid);
return Optional.of(mid);
}
}
Expand Down
1 change: 1 addition & 0 deletions pico/tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<groupId>io.helidon.common</groupId>
<artifactId>helidon-common</artifactId>
</dependency>
<!-- TODO - Remove this dependency -->
<dependency>
<groupId>io.helidon.build-tools.common</groupId>
<artifactId>helidon-build-common</artifactId>
Expand Down

0 comments on commit 01f84f2

Please sign in to comment.