Skip to content

Commit 3ca576d

Browse files
authored
Merge pull request #680 from soot-oss/removeIncompleteMultiReleaseHandling
remove incomplete multi release handling in the class type generation…
2 parents c8bea01 + 51afb96 commit 3ca576d

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

sootup.java.core/src/main/java/sootup/java/core/JavaIdentifierFactory.java

+4-14
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import javax.annotation.Nonnull;
3434
import org.apache.commons.io.FilenameUtils;
3535
import org.apache.commons.lang3.ClassUtils;
36-
import org.apache.commons.lang3.StringUtils;
3736
import sootup.core.IdentifierFactory;
3837
import sootup.core.model.SootClass;
3938
import sootup.core.signatures.FieldSignature;
@@ -234,24 +233,15 @@ public AnnotationType getAnnotationType(final String fullyQualifiedClassName) {
234233
@Override
235234
@Nonnull
236235
public JavaClassType fromPath(@Nonnull final Path rootDirectory, @Nonnull final Path file) {
237-
String path = file.toString();
238-
String separator = file.getFileSystem().getSeparator();
239-
240-
// for multi release jars, remove beginning of path
241-
// /META-INF/versions/15/de/upb...
242-
// we only want /de/upb...
243-
if (path.startsWith("/META-INF/")) {
244-
// start at 4th separator
245-
int index = StringUtils.ordinalIndexOf(path, separator, 4);
246-
path = path.substring(index);
247-
}
248236

249237
final int nameCountBaseDir =
250238
rootDirectory.toString().isEmpty() ? 0 : rootDirectory.getNameCount();
251239

252240
String fullyQualifiedName =
253241
FilenameUtils.removeExtension(
254-
file.subpath(nameCountBaseDir, file.getNameCount()).toString().replace(separator, "."));
242+
file.subpath(nameCountBaseDir, file.getNameCount())
243+
.toString()
244+
.replace(file.getFileSystem().getSeparator(), "."));
255245

256246
return getClassType(fullyQualifiedName);
257247
}
@@ -524,7 +514,7 @@ public MethodSubSignature parseMethodSubSignature(@Nonnull String subSignature)
524514

525515
return true;
526516
})
527-
.map(typeName -> getType(typeName))
517+
.map(this::getType)
528518
.collect(Collectors.toList());
529519

530520
return getMethodSubSignature(methodName, getType(returnName), argsList);

0 commit comments

Comments
 (0)