[tests] generic vararg decompilation test case (IDEA-204272)

master
Roman Shevchenko 6 years ago
parent e9cae6c720
commit 17a9fb2526
  1. 1
      test/org/jetbrains/java/decompiler/SingleClassesTest.java
  2. BIN
      testData/classes/pkg/TestGenericArgs.class
  3. 55
      testData/results/TestGenericArgs.dec
  4. 15
      testData/src/pkg/TestGenericArgs.java

@ -126,6 +126,7 @@ public class SingleClassesTest {
@Test public void testPrivateClasses() { doTest("pkg/PrivateClasses"); } @Test public void testPrivateClasses() { doTest("pkg/PrivateClasses"); }
@Test public void testSuspendLambda() { doTest("pkg/TestSuspendLambdaKt"); } @Test public void testSuspendLambda() { doTest("pkg/TestSuspendLambdaKt"); }
@Test public void testNamedSuspendFun2Kt() { doTest("pkg/TestNamedSuspendFun2Kt"); } @Test public void testNamedSuspendFun2Kt() { doTest("pkg/TestNamedSuspendFun2Kt"); }
@Test public void testGenericArgs() { doTest("pkg/TestGenericArgs"); }
private void doTest(String testFile, String... companionFiles) { private void doTest(String testFile, String... companionFiles) {
ConsoleDecompiler decompiler = fixture.getDecompiler(); ConsoleDecompiler decompiler = fixture.getDecompiler();

@ -0,0 +1,55 @@
package pkg;
public class TestGenericArgs {
private static <T> void genericSingle(Class<T> var0) {
}// 4
private static <T> void genericVarArgs(Class<T>... var0) {
}// 6
private static <T> void genericArray(Class<T>[] var0) {
}// 8
private static <T> void single(Class var0) {
}// 10
private static <T> void varArgs(Class... var0) {
}// 12
private static <T> void array(Class[] var0) {
}// 14
}
class 'pkg/TestGenericArgs' {
method 'genericSingle (Ljava/lang/Class;)V' {
0 4
}
method 'genericVarArgs ([Ljava/lang/Class;)V' {
0 7
}
method 'genericArray ([Ljava/lang/Class;)V' {
0 10
}
method 'single (Ljava/lang/Class;)V' {
0 13
}
method 'varArgs ([Ljava/lang/Class;)V' {
0 16
}
method 'array ([Ljava/lang/Class;)V' {
0 19
}
}
Lines mapping:
4 <-> 5
6 <-> 8
8 <-> 11
10 <-> 14
12 <-> 17
14 <-> 20

@ -0,0 +1,15 @@
package pkg;
public class TestGenericArgs {
private static <T> void genericSingle(Class<T> param) { }
private static <T> void genericVarArgs(Class<T>... param) { }
private static <T> void genericArray(Class<T>[] param) { }
private static <T> void single(Class param) { }
private static <T> void varArgs(Class... param) { }
private static <T> void array(Class[] param) { }
}
Loading…
Cancel
Save