IDEA-184560 Java decompiler doesn't use stored parameter names

This commit is contained in:
Egor Ushakov
2018-01-10 16:28:43 +03:00
parent 023bb2462a
commit 8b9687ed20
15 changed files with 279 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,125 @@
package decompiler;
public class TestMethodParametersAttr {
TestMethodParametersAttr(int p01) {
}// 19
void m1(int p02) {
}// 20
static void m2(int p03) {
}// 21
void local() {
class Local {
Local(final int this$0) {
}// 36
void m(int p32) {
}// 37
}
}// 39
abstract static class C4 {
abstract void m1(int p51);
abstract void m2(final int p52);
}
abstract class C3 {
abstract void m1(int p51);
abstract void m2(final int p52);
}
interface I1 {
void m1(int p41);
void m2(final int p42);
}
static class C2 {
C2(int p21) {
}// 29
void m1(int p22) {
}// 30
static void m2(int p23) {
}// 31
}
class C1 {
C1(final int this$0) {
}// 24
void m(int p12) {
}// 25
}
}
class 'decompiler/TestMethodParametersAttr' {
method '<init> (I)V' {
4 4
}
method 'm1 (I)V' {
0 7
}
method 'm2 (I)V' {
0 10
}
method 'local ()V' {
0 21
}
}
class 'decompiler/TestMethodParametersAttr$1Local' {
method '<init> (Ldecompiler/TestMethodParametersAttr;I)V' {
9 15
}
method 'm (I)V' {
0 18
}
}
class 'decompiler/TestMethodParametersAttr$C2' {
method '<init> (I)V' {
4 43
}
method 'm1 (I)V' {
0 46
}
method 'm2 (I)V' {
0 49
}
}
class 'decompiler/TestMethodParametersAttr$C1' {
method '<init> (Ldecompiler/TestMethodParametersAttr;I)V' {
9 54
}
method 'm (I)V' {
0 57
}
}
Lines mapping:
19 <-> 5
20 <-> 8
21 <-> 11
24 <-> 55
25 <-> 58
29 <-> 44
30 <-> 47
31 <-> 50
36 <-> 16
37 <-> 19
39 <-> 22

View File

@@ -0,0 +1,56 @@
/*
* 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 decompiler;
// compile with java 8: javap -parameters TestMethodParametersAttr.java
public class TestMethodParametersAttr {
TestMethodParametersAttr(int p01) { }
void m1(int p02) { }
static void m2(int p03) { }
class C1 {
C1(int p11) { }
void m(int p12) { }
}
static class C2 {
C2(int p21) { }
void m1(int p22) { }
static void m2(int p23) { }
}
void local() {
class Local {
Local(int p31) { }
void m(int p32) { }
}
}
interface I1 {
void m1(int p41);
void m2(final int p42);
}
abstract class C3 {
abstract void m1(int p51);
abstract void m2(final int p52);
}
static abstract class C4 {
abstract void m1(int p51);
abstract void m2(final int p52);
}
}