Skip to content

Commit

Permalink
Allow to override useUnsharedTable compiler argument
Browse files Browse the repository at this point in the history
fix #371
  • Loading branch information
slawekjaranowski committed Mar 7, 2024
1 parent e9ae6e7 commit 32cfc65
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public static String[] buildCompilerArguments(
args.add(value);
}

if (!config.isFork()) {
if (!config.isFork() && !args.contains("-XDuseUnsharedTable=false")) {
args.add("-XDuseUnsharedTable=true");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,29 @@ public void testMultipleAddExports() {
internalTest(compilerConfiguration, expectedArguments, "1.8");
}

@Test
public void testWithGivenUnsharedTable() {
List<String> expectedArguments = new ArrayList<>();

CompilerConfiguration compilerConfiguration = new CompilerConfiguration();

// outputLocation
compilerConfiguration.setOutputLocation("/output");
expectedArguments.add("-d");
expectedArguments.add(new File("/output").getAbsolutePath());

// releaseVersion
compilerConfiguration.setReleaseVersion("6");
expectedArguments.add("--release");
expectedArguments.add("6");

// unshared table
compilerConfiguration.addCompilerCustomArgument("-XDuseUnsharedTable=false", null);
expectedArguments.add("-XDuseUnsharedTable=false");

internalTest(compilerConfiguration, expectedArguments, "11.0.1");
}

/* This test fails on Java 1.4. The multiple parameters of the same source file cause an error, as it is interpreted as a DuplicateClass
* Setting the size of the array to 3 is fine, but does not exactly test what it is supposed to - disabling the test for now
public void testCommandLineTooLongWhenForking()
Expand Down

0 comments on commit 32cfc65

Please sign in to comment.