decompiler: extracted <init> and <clinit> to constants

This commit is contained in:
Egor.Ushakov
2015-01-22 12:30:12 +03:00
parent 9ba9af5425
commit effbed6727
9 changed files with 33 additions and 27 deletions

View File

@@ -92,10 +92,10 @@ public class InvocationExprent extends Exprent {
invokeDynamicClassSuffix = "##Lambda_" + cn.index1 + "_" + cn.index2;
}
if ("<init>".equals(name)) {
if (CodeConstants.INIT_NAME.equals(name)) {
functype = TYP_INIT;
}
else if ("<clinit>".equals(name)) {
else if (CodeConstants.CLINIT_NAME.equals(name)) {
functype = TYP_CLINIT;
}
@@ -307,7 +307,7 @@ public class InvocationExprent extends Exprent {
break;
case TYP_CLINIT:
throw new RuntimeException("Explicit invocation of <clinit>");
throw new RuntimeException("Explicit invocation of " + CodeConstants.CLINIT_NAME);
case TYP_INIT:
if (super_qualifier != null) {
buf.append("super(");
@@ -316,7 +316,7 @@ public class InvocationExprent extends Exprent {
buf.append("this(");
}
else {
throw new RuntimeException("Unrecognized invocation of <init>");
throw new RuntimeException("Unrecognized invocation of " + CodeConstants.INIT_NAME);
}
}
@@ -327,7 +327,7 @@ public class InvocationExprent extends Exprent {
if (newNode != null) { // own class
if (newNode.getWrapper() != null) {
sigFields = newNode.getWrapper().getMethodWrapper("<init>", stringDescriptor).signatureFields;
sigFields = newNode.getWrapper().getMethodWrapper(CodeConstants.INIT_NAME, stringDescriptor).signatureFields;
}
else {
if (newNode.type == ClassNode.CLASS_MEMBER && (newNode.access & CodeConstants.ACC_STATIC) == 0) { // non-static member class

View File

@@ -177,7 +177,7 @@ public class NewExprent extends Exprent {
List<VarVersionPair> sigFields = null;
if (newnode != null) { // own class
if (newnode.getWrapper() != null) {
sigFields = newnode.getWrapper().getMethodWrapper("<init>", invsuper.getStringDescriptor()).signatureFields;
sigFields = newnode.getWrapper().getMethodWrapper(CodeConstants.INIT_NAME, invsuper.getStringDescriptor()).signatureFields;
}
else {
if (newnode.type == ClassNode.CLASS_MEMBER && (newnode.access & CodeConstants.ACC_STATIC) == 0 &&
@@ -287,7 +287,7 @@ public class NewExprent extends Exprent {
List<VarVersionPair> sigFields = null;
if (newnode != null) { // own class
if (newnode.getWrapper() != null) {
sigFields = newnode.getWrapper().getMethodWrapper("<init>", constructor.getStringDescriptor()).signatureFields;
sigFields = newnode.getWrapper().getMethodWrapper(CodeConstants.INIT_NAME, constructor.getStringDescriptor()).signatureFields;
}
else {
if (newnode.type == ClassNode.CLASS_MEMBER && (newnode.access & CodeConstants.ACC_STATIC) == 0 &&