Skip to content

Commit

Permalink
quiet flag
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed May 12, 2024
1 parent e49f681 commit b54ced3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/java/xyz/wagyourtail/jvmdg/ClassDowngrader.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import java.util.concurrent.atomic.AtomicReference;

public class ClassDowngrader {
public static final boolean QUIET = Boolean.getBoolean("jvmdg.quiet");

public static final ClassDowngrader currentVersionDowngrader = new ClassDowngrader(Utils.getCurrentClassVersion());

// because parent is null, this is (essentially) a wrapper around the bootstrap classloader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public List<ClassMapping> init() {
try {
List<Type> types = superTypeResolver.apply(type);
if (types == null) {
System.err.println(VersionProvider.this.getClass().getName() + " Could not find class " + type.getInternalName());
if (!ClassDowngrader.QUIET) System.err.println(VersionProvider.this.getClass().getName() + " Could not find class " + type.getInternalName());
types = Collections.emptyList();
}
List<ClassMapping> superTypes = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void testDowngrade(String mainClass, boolean eq) throws Exception {
Path.of("."),
Map.of(),
true,
List.of(/*"-Djvmdg.debug=true", */"-Djvmdg.java-api=" + javaApi, "-Djvmdg.log=false"),
List.of(/*"-Djvmdg.debug=true", */"-Djvmdg.java-api=" + javaApi, "-Djvmdg.log=false", "-Djvmdg.quiet=true"),
target.toOpcode(),
(String it) -> {
runtimeDowngradeLog.append(it).append("\n");
Expand Down

0 comments on commit b54ced3

Please sign in to comment.