java-decompiler: optimization (less string buffer allocations on generating text)

This commit is contained in:
Roman Shevchenko
2014-09-04 14:30:28 +04:00
parent f4f9e8be28
commit 1cea85e49a
20 changed files with 835 additions and 1055 deletions

View File

@@ -1,12 +1,9 @@
package pkg;
public class TestClassFields {
private static int[] sizes;
private static String[] names = new String[]{"name1", "name2"};
static {
sizes = new int[names.length];
}

View File

@@ -10,10 +10,8 @@ import java.util.function.Predicate;
import java.util.function.Supplier;
public class TestClassLambda {
public int field = 0;
public void testLambda() {
List var1 = Arrays.asList(new Integer[]{Integer.valueOf(1), Integer.valueOf(2), Integer.valueOf(3), Integer.valueOf(4), Integer.valueOf(5), Integer.valueOf(6), Integer.valueOf(7)});
int var2 = (int)Math.random();

View File

@@ -1,8 +1,6 @@
package pkg;
public class TestClassLoop {
public static void testSimpleInfinite() {
while(true) {
System.out.println();

View File

@@ -1,8 +1,6 @@
package pkg;
public class TestClassSwitch {
public void testCaseOrder(int var1) {
switch(var1) {
case 5:

View File

@@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List;
public class TestClassTypes {
public void testBoolean() {
byte var1 = 0;
long var2 = System.currentTimeMillis();

View File

@@ -1,12 +1,9 @@
package pkg;
public class TestClassVar {
private boolean field_boolean = Math.random() > 0.0D;
public int field_int = 0;
public void testFieldSSAU() {
for(int var1 = 0; var1 < 10; ++var1) {
try {

View File

@@ -1,11 +1,8 @@
package pkg;
class TestCodeConstructs {
private int count = 0;
void expressions() {
(new String()).hashCode();
}

View File

@@ -3,7 +3,6 @@ package pkg;
import java.util.Date;
public class TestConstants {
static final boolean T = true;
static final boolean F = false;
static final char C0 = '\n';
@@ -28,7 +27,6 @@ public class TestConstants {
static final double DMin = 4.9E-324D;
static final double DMax = 1.7976931348623157E308D;
@TestConstants.A(byte.class)
void m1() {
}
@@ -70,7 +68,6 @@ public class TestConstants {
}
@interface A {
Class<?> value();
}
}

View File

@@ -1,15 +1,12 @@
package pkg;
public class TestDeprecations {
/** @deprecated */
public int byComment;
/** @deprecated */
@Deprecated
public int byAnno;
/** @deprecated */
public void byComment() {
}
@@ -22,11 +19,9 @@ public class TestDeprecations {
/** @deprecated */
@Deprecated
public static class ByAnno {
}
/** @deprecated */
public static class ByComment {
}
}

View File

@@ -1,8 +1,6 @@
package pkg;
public enum TestEnum {
E1,
E2 {
public void m() {
@@ -13,8 +11,8 @@ public enum TestEnum {
public void m() {
}
};
private String s;
private String s;
public void m() {
}
@@ -26,5 +24,4 @@ public enum TestEnum {
private TestEnum(@Deprecated String var3) {
this.s = var3;
}
}

View File

@@ -1,8 +1,6 @@
package pkg;
public class TestExtendsList {
static <T extends Comparable<? super T>> T m1(T var0) {
return null;
}

View File

@@ -1,8 +1,6 @@
package pkg;
public class TestMethodParameters {
TestMethodParameters(@Deprecated int var1) {
}
@@ -14,7 +12,6 @@ public class TestMethodParameters {
void local() {
class Local {
Local(@Deprecated int var2) {
}
@@ -25,7 +22,6 @@ public class TestMethodParameters {
}
static class C2 {
C2(@Deprecated int var1) {
}
@@ -37,7 +33,6 @@ public class TestMethodParameters {
}
class C1 {
C1(@Deprecated int var2) {
}