tests for IDEA-135314 Inner classes constructors calls decompiled incorrectly

master
Egor.Ushakov 10 years ago
parent 0488e1b937
commit ae2c64a157
  1. 1
      test/org/jetbrains/java/decompiler/SingleClassesTest.java
  2. BIN
      testData/classes/pkg/TestInnerLocal.class
  3. BIN
      testData/classes/pkg/TestInnerLocalPkg$1Inner.class
  4. BIN
      testData/classes/pkg/TestInnerLocalPkg$2Inner.class
  5. BIN
      testData/classes/pkg/TestInnerLocalPkg$Inner1.class
  6. BIN
      testData/classes/pkg/TestInnerLocalPkg$Inner1Static$Inner2Static.class
  7. BIN
      testData/classes/pkg/TestInnerLocalPkg$Inner1Static.class
  8. BIN
      testData/classes/pkg/TestInnerLocalPkg.class
  9. 35
      testData/results/TestInnerLocal.dec
  10. 115
      testData/results/TestInnerLocalPkg.dec
  11. 10
      testData/src/pkg/TestInnerLocal.java
  12. 65
      testData/src/pkg/TestInnerLocalPkg.java

@ -58,5 +58,6 @@ public class SingleClassesTest extends SingleClassesTestBase {
@Test public void testAnonymousClass() { doTest("pkg/TestAnonymousClass"); }
@Test public void testThrowException() { doTest("pkg/TestThrowException"); }
@Test public void testInnerLocal() { doTest("pkg/TestInnerLocal"); }
@Test public void testInnerLocalPkg() { doTest("pkg/TestInnerLocalPkg"); }
@Test public void testInnerSignature() { doTest("pkg/TestInnerSignature"); }
}

@ -9,6 +9,8 @@ public class TestInnerLocal {
}
new Inner("test");// 25
new TestInnerLocal.Inner1Static("test");// 26
new TestInnerLocal.Inner1Static.Inner2Static("test");// 27
}
public void testMethod() {
@ -21,6 +23,9 @@ public class TestInnerLocal {
}
new Inner("test");// 37
new TestInnerLocal.Inner1Static("test");// 38
new TestInnerLocal.Inner1("test");// 39
new TestInnerLocal.Inner1Static.Inner2Static("test");// 40
}
static class Inner1Static {
@ -57,42 +62,52 @@ class 'TestInnerLocal$1Inner' {
class 'TestInnerLocal' {
method 'testStaticMethod ()V' {
4 10
e 11
18 12
}
method 'testMethod ()V' {
5 22
5 24
f 25
1a 26
24 27
}
}
class 'TestInnerLocal$2Inner' {
method '<init> (LTestInnerLocal;Ljava/lang/String;)V' {
b 18
b 20
}
}
class 'TestInnerLocal$Inner1Static' {
method '<init> (Ljava/lang/String;)V' {
6 29
6 34
}
}
class 'TestInnerLocal$Inner1Static$Inner2Static' {
method '<init> (Ljava/lang/String;)V' {
6 36
6 41
}
}
class 'TestInnerLocal$Inner1' {
method '<init> (LTestInnerLocal;Ljava/lang/String;)V' {
b 45
b 50
}
}
Lines mapping:
22 <-> 7
25 <-> 11
34 <-> 19
37 <-> 23
46 <-> 46
53 <-> 30
59 <-> 37
26 <-> 12
27 <-> 13
34 <-> 21
37 <-> 25
38 <-> 26
39 <-> 27
40 <-> 28
46 <-> 51
53 <-> 35
59 <-> 42

@ -0,0 +1,115 @@
package pkg;
public class TestInnerLocalPkg {
public static void testStaticMethod() {
class Inner {
final String x;
public Inner(String var1) {
this.x = var1;// 24
}
}
new Inner("test");// 27
new TestInnerLocalPkg.Inner1Static("test");// 28
new TestInnerLocalPkg.Inner1Static.Inner2Static("test");// 29
}
public void testMethod() {
class Inner {
final String x;
public Inner(String var2) {
this.x = var2;// 36
}
}
new Inner("test");// 39
new TestInnerLocalPkg.Inner1Static("test");// 40
new TestInnerLocalPkg.Inner1("test");// 41
new TestInnerLocalPkg.Inner1Static.Inner2Static("test");// 42
}
static class Inner1Static {
final String x;
public Inner1Static(String var1) {
this.x = var1;// 55
}
public static class Inner2Static {
final String x;
public Inner2Static(String var1) {
this.x = var1;// 61
}
}
}
class Inner1 {
final String x;
public Inner1(String var2) {
this.x = var2;// 48
}
}
}
class 'pkg/TestInnerLocalPkg$1Inner' {
method '<init> (Ljava/lang/String;)V' {
6 8
}
}
class 'pkg/TestInnerLocalPkg' {
method 'testStaticMethod ()V' {
4 12
e 13
18 14
}
method 'testMethod ()V' {
5 26
f 27
1a 28
24 29
}
}
class 'pkg/TestInnerLocalPkg$2Inner' {
method '<init> (Lpkg/TestInnerLocalPkg;Ljava/lang/String;)V' {
b 22
}
}
class 'pkg/TestInnerLocalPkg$Inner1Static' {
method '<init> (Ljava/lang/String;)V' {
6 36
}
}
class 'pkg/TestInnerLocalPkg$Inner1Static$Inner2Static' {
method '<init> (Ljava/lang/String;)V' {
6 43
}
}
class 'pkg/TestInnerLocalPkg$Inner1' {
method '<init> (Lpkg/TestInnerLocalPkg;Ljava/lang/String;)V' {
b 52
}
}
Lines mapping:
24 <-> 9
27 <-> 13
28 <-> 14
29 <-> 15
36 <-> 23
39 <-> 27
40 <-> 28
41 <-> 29
42 <-> 30
48 <-> 53
55 <-> 37
61 <-> 44

@ -23,8 +23,8 @@ public class TestInnerLocal {
}
}
new Inner("test");
//new Inner1Static("test");
//new Inner1Static.Inner2Static("test");
new Inner1Static("test");
new Inner1Static.Inner2Static("test");
}
public void testMethod() {
@ -35,9 +35,9 @@ public class TestInnerLocal {
}
}
new Inner("test");
//new Inner1Static("test");
//new Inner1("test");
//new Inner1Static.Inner2Static("test");
new Inner1Static("test");
new Inner1("test");
new Inner1Static.Inner2Static("test");
}
class Inner1 {

@ -0,0 +1,65 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package pkg;
public class TestInnerLocalPkg {
public static void testStaticMethod() {
class Inner {
final String x;
public Inner(String x) {
this.x = x;
}
}
new Inner("test");
new Inner1Static("test");
new Inner1Static.Inner2Static("test");
}
public void testMethod() {
class Inner {
final String x;
public Inner(String x) {
this.x = x;
}
}
new Inner("test");
new Inner1Static("test");
new Inner1("test");
new Inner1Static.Inner2Static("test");
}
class Inner1 {
final String x;
public Inner1(String x) {
this.x = x;
}
}
static class Inner1Static {
final String x;
public Inner1Static(String x) {
this.x = x;
}
public static class Inner2Static {
final String x;
public Inner2Static(String x) {
this.x = x;
}
}
}
}
Loading…
Cancel
Save