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

fix missing Local assignments /Bytecodefrontend #706

Closed
wants to merge 6 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public int hashCode() {
return value.hashCode();
}

@Nonnull
public String getValue() {
return value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public Optional<? extends ClassType> resolveSuperclass() {
if (classNode.superName == null) {
return Optional.empty();
}
return Optional.ofNullable(AsmUtil.toJimpleClassType(classNode.superName));
return Optional.of(AsmUtil.toJimpleClassType(classNode.superName));
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,17 @@ public Optional<SootClassSource<JavaSootClass>> createClassSource(
SootClassNode classNode = new SootClassNode(analysisInputLocation);

try {
AsmUtil.initAsmClassSource(sourcePath, classNode);
final String actualClassSignatureStr =
AsmUtil.initAsmClassSource(sourcePath, classNode).replace('/', '.');
if (!actualClassSignatureStr.equals(
classType.getFullyQualifiedName())) { // in >Java9 omit the module part of the signature
throw new IllegalArgumentException(
"The given Classtype '"
+ classType
+ "' did not match the found ClassType in the compilation unit '"
+ actualClassSignatureStr
+ "'. Possibly the AnalysisInputLocation points to a subfolder already including the PackageName directory while the ClassType you wanted to retrieve is missing a PackageName.");
}
} catch (IOException | IllegalArgumentException exception) {
logger.warn(
"ASM could not resolve class source of "
Expand All @@ -72,6 +82,7 @@ public Optional<SootClassSource<JavaSootClass>> createClassSource(
}

JavaClassType klassType = (JavaClassType) classType;

if (klassType instanceof ModuleJavaClassType
&& klassType.getClassName().equals(JavaModuleIdentifierFactory.MODULE_INFO_FILE)) {
logger.warn("Can not create ClassSource from a module info descriptor! path:" + sourcePath);
Expand Down
Loading
Loading