mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8139751: Javac crash with -XDallowStringFolding=false
When string folding is disabled, need to keep the original expression. Reviewed-by: mcimadamore
This commit is contained in:
parent
11da417a28
commit
9cd68d0633
2 changed files with 7 additions and 4 deletions
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
* @test
|
||||
* @bug 7068902
|
||||
* @bug 7068902 8139751
|
||||
* @summary verify that string folding can be enabled or disabled
|
||||
* @modules jdk.compiler
|
||||
*/
|
||||
|
@ -86,11 +86,14 @@ public class StringFoldingTest {
|
|||
|
||||
if (disableStringFolding) {
|
||||
if (text.contains("FOLDED")) {
|
||||
throw new AssertionError("Expected string folding");
|
||||
throw new AssertionError("Expected no string folding");
|
||||
}
|
||||
if (!text.contains("\"F\"")) {
|
||||
throw new AssertionError("Expected content not found");
|
||||
}
|
||||
} else {
|
||||
if (!text.contains("FOLDED")) {
|
||||
throw new AssertionError("Expected no string folding");
|
||||
throw new AssertionError("Expected string folding");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue