Skip to content

Commit

Permalink
Fix build failing in JDK 23 environments
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Nov 22, 2024
1 parent 2b3017f commit 4ab6015
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ subprojects {
test {
useJUnitPlatform()

// Required for Mockito in newer JDK's which disable useful features by default for 'integrity' reasons.
jvmArgs '-XX:+EnableDynamicAgentLoading'

systemProperty 'junit.jupiter.execution.parallel.enabled', true
systemProperty 'junit.jupiter.execution.parallel.mode.default', 'concurrent'

testLogging {
showStandardStreams = true
events "passed", "skipped", "failed"
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ treemapfx = "1.1.0"
vineflower = "1.10.1"
wordwrap = "0.1.12"
benmanes-versions = "0.42.0"
gradle-coverage-report-aggregator = "1.3.0"
gradle-coverage-report-aggregator = "1.3.2"
gradle-checker-processor = "2.0.2"
javafx-plugin = "0.1.0"
shadow = "8.1.1"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import software.coley.recaf.config.ConfigContainer;
import software.coley.recaf.config.ConfigGroups;
import software.coley.recaf.launch.LaunchCommand;
import software.coley.recaf.util.ExcludeFromJacocoGeneratedReport;
import software.coley.recaf.util.IOUtil;
import software.coley.recaf.util.PlatformType;

Expand All @@ -25,6 +26,7 @@
* @author Matt Coley
*/
@ApplicationScoped
@ExcludeFromJacocoGeneratedReport(justification = "We do not access the config directories in tests (avoiding IO is preferred anyways)")
public class RecafDirectoriesConfig extends BasicConfigContainer implements ConfigContainer {
private static final Logger logger = Logging.get(RecafDirectoriesConfig.class);
private final Path baseDirectory = createBaseDirectory();
Expand All @@ -48,9 +50,8 @@ public RecafDirectoriesConfig() {
* Path to current log-file.
*/
public void initCurrentLogPath(@Nonnull Path currentLog) {
if (this.currentLog == null) {
if (this.currentLog == null)
this.currentLog = currentLog;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static void main(String[] args) {

// Run compiler, it should fail with no passed workspace due to the unknown 'StringConsumer'
CompilerResult result = javac.compile(arguments, null, null);
assertEquals(1, result.getDiagnostics().size(), "Expected compilation failure");
assertFalse(result.getDiagnostics().isEmpty(), "Expected compilation failure");
assertFalse(result.getCompilations().containsKey("HelloWorld"), "Class should have failed compilation");

// First, create the class that was missing. We cannot use the existing StringConsumer because Javac will find
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jakarta.annotation.Nonnull;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import software.coley.recaf.services.decompile.fallback.FallbackDecompiler;
import software.coley.recaf.services.decompile.fallback.print.ClassPrinter;
import software.coley.recaf.services.text.TextFormatConfig;
import software.coley.recaf.test.TestClassUtils;
Expand All @@ -22,6 +23,9 @@
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Tests for {@link FallbackDecompiler}
*/
class FallbackDecompilerTest {
static TextFormatConfig textConfig = new TextFormatConfig();

Expand Down

0 comments on commit 4ab6015

Please sign in to comment.