Skip to content

Commit

Permalink
fix erroneous missing stub warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Jul 8, 2024
1 parent 9113f54 commit 9b35b61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ abstract class GenerateCtSymTask : ConventionTask() {
project.logger.lifecycle("[ct.sym] Processing $java at $home")
for (path in home.walk()
.filter { it.exists() && it.isRegularFile() && it.extension in setOf("jar", "jmod") }) {
if (path.extension == "jar" && path.nameWithoutExtension != "rt") continue
// for each jar/jmod list its contents
project.logger.info("[ct.sym] Found ${path.fileName}")
val modName = path.fileName.toString().removeSuffix(".jmod")
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx4G
org.gradle.parallel=true

version=0.8.1
version=0.8.2

asm_version=9.7

Expand All @@ -16,4 +16,4 @@ stubFromVersion=8
stubToVersion=22

maven_group=xyz.wagyourtail.jvmdowngrader
archives_base_name=jvmdowngrader
archives_base_name=jvmdowngrader
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@ public void addModify(MemberNameAndDesc member, Method method, Modify modify) {
methodModify.put(member, new Pair<>(method, modify));
}

public void warnMember(MemberNameAndDesc member, Set<String> warnings) {
public void warnMember(MemberNameAndDesc member, Set<String> warnings, boolean invoke_static) {
FullyQualifiedMemberNameAndDesc fqn = member.toFullyQualified(current);
String mod = coverage.checkMember(fqn);
if (mod != null) {
coverage.warnMember(fqn, warnings);
}
for (ClassMapping parent : parents.get()) {
parent.warnMember(member, warnings);
if (!invoke_static && !member.getName().equals("<init>")) {
for (ClassMapping parent : parents.get()) {
parent.warnMember(member, warnings, false);
}
}
}

Expand Down Expand Up @@ -205,7 +207,7 @@ public Pair<Method, Stub> getStubFor(MemberNameAndDesc member, boolean invoke_st
}
return getParentStubFor(member, runtimeAvailable, special, warnings);
}
warnMember(member, warnings);
warnMember(member, warnings, invoke_static);
return null;
}
Method m = pair.getFirst();
Expand Down Expand Up @@ -246,7 +248,7 @@ public Pair<Method, Modify> getModifyFor(MemberNameAndDesc member, boolean invok
}
return getParentModifyFor(member, warnings);
}
warnMember(member, warnings);
warnMember(member, warnings, invoke_static);
return null;
}
Method m = pair.getFirst();
Expand Down

0 comments on commit 9b35b61

Please sign in to comment.