|
33 | 33 | import javax.annotation.Nonnull;
|
34 | 34 | import org.apache.commons.io.FilenameUtils;
|
35 | 35 | import org.apache.commons.lang3.ClassUtils;
|
36 |
| -import org.apache.commons.lang3.StringUtils; |
37 | 36 | import sootup.core.IdentifierFactory;
|
38 | 37 | import sootup.core.model.SootClass;
|
39 | 38 | import sootup.core.signatures.FieldSignature;
|
@@ -234,24 +233,15 @@ public AnnotationType getAnnotationType(final String fullyQualifiedClassName) {
|
234 | 233 | @Override
|
235 | 234 | @Nonnull
|
236 | 235 | 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 |
| - } |
248 | 236 |
|
249 | 237 | final int nameCountBaseDir =
|
250 | 238 | rootDirectory.toString().isEmpty() ? 0 : rootDirectory.getNameCount();
|
251 | 239 |
|
252 | 240 | String fullyQualifiedName =
|
253 | 241 | FilenameUtils.removeExtension(
|
254 |
| - file.subpath(nameCountBaseDir, file.getNameCount()).toString().replace(separator, ".")); |
| 242 | + file.subpath(nameCountBaseDir, file.getNameCount()) |
| 243 | + .toString() |
| 244 | + .replace(file.getFileSystem().getSeparator(), ".")); |
255 | 245 |
|
256 | 246 | return getClassType(fullyQualifiedName);
|
257 | 247 | }
|
@@ -524,7 +514,7 @@ public MethodSubSignature parseMethodSubSignature(@Nonnull String subSignature)
|
524 | 514 |
|
525 | 515 | return true;
|
526 | 516 | })
|
527 |
| - .map(typeName -> getType(typeName)) |
| 517 | + .map(this::getType) |
528 | 518 | .collect(Collectors.toList());
|
529 | 519 |
|
530 | 520 | return getMethodSubSignature(methodName, getType(returnName), argsList);
|
|
0 commit comments