java-decompiler: post-import cleanup (common fixes and optimizations)
This commit is contained in:
@@ -216,8 +216,11 @@ public class StructMethod implements CodeConstants {
|
||||
}
|
||||
}
|
||||
|
||||
private void readAttribute(DataInputFullStream in, ConstantPool pool, VBStyleCollection<StructGeneralAttribute, String> lstAttribute,
|
||||
int attr_nameindex, String attrname) throws IOException {
|
||||
private static void readAttribute(DataInputFullStream in,
|
||||
ConstantPool pool,
|
||||
VBStyleCollection<StructGeneralAttribute, String> lstAttribute,
|
||||
int attr_nameindex,
|
||||
String attrname) throws IOException {
|
||||
|
||||
StructGeneralAttribute attribute = StructGeneralAttribute.getMatchingAttributeInstance(attr_nameindex, attrname);
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ public class ConstantPool {
|
||||
buffer.append("[");
|
||||
}
|
||||
|
||||
buffer.append("L" + newname + ";");
|
||||
buffer.append("L").append(newname).append(";");
|
||||
}
|
||||
else {
|
||||
buffer.append(newname);
|
||||
|
||||
@@ -306,7 +306,7 @@ public class VarType { // TODO: optimize switch
|
||||
}
|
||||
}
|
||||
|
||||
private int getType(char c) {
|
||||
private static int getType(char c) {
|
||||
switch (c) {
|
||||
case 'B':
|
||||
return CodeConstants.TYPE_BYTE;
|
||||
@@ -343,7 +343,7 @@ public class VarType { // TODO: optimize switch
|
||||
}
|
||||
}
|
||||
|
||||
private String getChar(int type) {
|
||||
private static String getChar(int type) {
|
||||
switch (type) {
|
||||
case CodeConstants.TYPE_BYTE:
|
||||
return "B";
|
||||
|
||||
@@ -221,7 +221,7 @@ public class GenericMain {
|
||||
|
||||
String res = name.replace('/', '.');
|
||||
|
||||
if (res.indexOf("$") >= 0) {
|
||||
if (res.contains("$")) {
|
||||
StructClass cl = DecompilerContext.getStructcontext().getClass(name);
|
||||
if (cl == null || !cl.isOwn()) {
|
||||
res = res.replace('$', '.');
|
||||
|
||||
@@ -105,7 +105,7 @@ public class GenericType {
|
||||
}
|
||||
}
|
||||
|
||||
private String getNextClassSignature(String value) {
|
||||
private static String getNextClassSignature(String value) {
|
||||
|
||||
int counter = 0;
|
||||
int index = 0;
|
||||
@@ -131,7 +131,7 @@ public class GenericType {
|
||||
return value.substring(0, index);
|
||||
}
|
||||
|
||||
private void parseArgumentsList(String value, GenericType type) {
|
||||
private static void parseArgumentsList(String value, GenericType type) {
|
||||
|
||||
if (value == null) {
|
||||
return;
|
||||
@@ -214,7 +214,7 @@ public class GenericType {
|
||||
return value.substring(0, index + 1);
|
||||
}
|
||||
|
||||
private int getType(char c) {
|
||||
private static int getType(char c) {
|
||||
switch (c) {
|
||||
case 'B':
|
||||
return CodeConstants.TYPE_BYTE;
|
||||
|
||||
@@ -158,7 +158,7 @@ public class LazyLoader {
|
||||
return link == null ? null : getClassStream(link.externPath, link.internPath);
|
||||
}
|
||||
|
||||
private void skipAttributes(DataInputFullStream in) throws IOException {
|
||||
private static void skipAttributes(DataInputFullStream in) throws IOException {
|
||||
|
||||
int length = in.readUnsignedShort();
|
||||
for (int i = 0; i < length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user