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

Allow to override useUnsharedTable compiler argument #373

Merged
merged 1 commit into from
Mar 7, 2024
Merged
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 @@ -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