mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[java-decompiler] IDEA-367141 Support encoding for unicode characters at high and medium level
GitOrigin-RevId: 66fb6d059af434c0b4630638cd8cd500bc8939ff
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9b9ed3498f
commit
5295a5f150
@@ -49,7 +49,7 @@ private val highPreset: Map<String, String> = basePreset + mapOf(
|
||||
IFernflowerPreferences.DECOMPILE_ENUM to "1",
|
||||
IFernflowerPreferences.REMOVE_GET_CLASS_NEW to "1",
|
||||
IFernflowerPreferences.LITERALS_AS_IS to "0",
|
||||
IFernflowerPreferences.ASCII_STRING_CHARACTERS to "1",
|
||||
IFernflowerPreferences.ASCII_STRING_CHARACTERS to "0",
|
||||
IFernflowerPreferences.BOOLEAN_TRUE_ONE to "1",
|
||||
IFernflowerPreferences.UNDEFINED_PARAM_TYPE_OBJECT to "1",
|
||||
IFernflowerPreferences.USE_DEBUG_VAR_NAMES to "1",
|
||||
@@ -77,7 +77,7 @@ private val mediumPreset: Map<String, String> = basePreset + mapOf(
|
||||
IFernflowerPreferences.DECOMPILE_ENUM to "1",
|
||||
IFernflowerPreferences.REMOVE_GET_CLASS_NEW to "1",
|
||||
IFernflowerPreferences.LITERALS_AS_IS to "0",
|
||||
IFernflowerPreferences.ASCII_STRING_CHARACTERS to "1",
|
||||
IFernflowerPreferences.ASCII_STRING_CHARACTERS to "0",
|
||||
IFernflowerPreferences.BOOLEAN_TRUE_ONE to "1",
|
||||
IFernflowerPreferences.UNDEFINED_PARAM_TYPE_OBJECT to "1",
|
||||
IFernflowerPreferences.USE_DEBUG_VAR_NAMES to "1",
|
||||
|
||||
@@ -153,6 +153,16 @@ class IdeaDecompilerTest : LightJavaCodeInsightFixtureTestCase() {
|
||||
doTestNavigation(17, 28, 16, 13) // to "int r"
|
||||
}
|
||||
|
||||
fun testUnicode_high() {
|
||||
val state = IdeaDecompilerSettings.State.fromPreset(DecompilerPreset.HIGH)
|
||||
IdeaDecompilerSettings.getInstance().loadState(state)
|
||||
|
||||
val file = getTestFile("UnicodeTest.class")
|
||||
val decompiled = IdeaDecompiler().getText(file).toString()
|
||||
assertTrue(decompiled, decompiled.contains("你好"))
|
||||
assertFalse(decompiled, decompiled.contains("\\u4f60"))
|
||||
}
|
||||
|
||||
private fun doTestNavigation(line: Int, column: Int, expectedLine: Int, expectedColumn: Int) {
|
||||
val target = GotoDeclarationAction.findTargetElement(project, myFixture.editor, offset(line, column)) as Navigatable
|
||||
target.navigate(true)
|
||||
|
||||
BIN
plugins/java-decompiler/plugin/testData/UnicodeTest.class
Normal file
BIN
plugins/java-decompiler/plugin/testData/UnicodeTest.class
Normal file
Binary file not shown.
Reference in New Issue
Block a user