java-decompiler: post-import cleanup (common fixes and optimizations)

This commit is contained in:
Roman Shevchenko
2014-08-29 21:58:12 +04:00
parent 63b8d35d08
commit f5431c3bb1
62 changed files with 410 additions and 422 deletions

View File

@@ -253,7 +253,7 @@ public class FastSparseSetFactory<E> {
}
}
private void changeNext(int[] arrnext, int key, int oldnext, int newnext) {
private static void changeNext(int[] arrnext, int key, int oldnext, int newnext) {
for (int i = key - 1; i >= 0; i--) {
if (arrnext[i] == oldnext) {
arrnext[i] = newnext;

View File

@@ -83,9 +83,8 @@ public class InterpreterUtil {
return false;
}
HashSet<?> set = new HashSet(c1);
HashSet<Object> set = new HashSet<Object>(c1);
set.removeAll(c2);
return (set.size() == 0);
}

View File

@@ -27,7 +27,7 @@ public class SFormsFastMapDirect {
private int size;
private FastSparseSet<Integer>[][] elements = new FastSparseSet[3][];
@SuppressWarnings("unchecked") private FastSparseSet<Integer>[][] elements = new FastSparseSet[3][];
private int[][] next = new int[3][];
@@ -38,7 +38,8 @@ public class SFormsFastMapDirect {
private SFormsFastMapDirect(boolean initialize) {
if (initialize) {
for (int i = 2; i >= 0; i--) {
elements[i] = new FastSparseSet[0];
@SuppressWarnings("unchecked") FastSparseSet<Integer>[] empty = new FastSparseSet[0];
elements[i] = empty;
next[i] = new int[0];
}
}
@@ -50,7 +51,7 @@ public class SFormsFastMapDirect {
int[] arrnext = map.next[i];
int length = arr.length;
FastSparseSet<Integer>[] arrnew = new FastSparseSet[length];
@SuppressWarnings("unchecked") FastSparseSet<Integer>[] arrnew = new FastSparseSet[length];
int[] arrnextnew = new int[length];
System.arraycopy(arr, 0, arrnew, 0, length);
@@ -78,7 +79,7 @@ public class SFormsFastMapDirect {
if (length > 0) {
int[] arrnext = next[i];
FastSparseSet<Integer>[] arrnew = new FastSparseSet[length];
@SuppressWarnings("unchecked") FastSparseSet<Integer>[] arrnew = new FastSparseSet[length];
int[] arrnextnew = new int[length];
System.arraycopy(arrnext, 0, arrnextnew, 0, length);
@@ -174,7 +175,7 @@ public class SFormsFastMapDirect {
}
}
private void changeNext(int[] arrnext, int key, int oldnext, int newnext) {
private static void changeNext(int[] arrnext, int key, int oldnext, int newnext) {
for (int i = key - 1; i >= 0; i--) {
if (arrnext[i] == oldnext) {
arrnext[i] = newnext;
@@ -343,7 +344,7 @@ public class SFormsFastMapDirect {
}
Set<Integer> set = entry.getValue().toPlainSet();
buffer.append(entry.getKey() + "={" + set.toString() + "}");
buffer.append(entry.getKey()).append("={").append(set.toString()).append("}");
}
}
@@ -399,7 +400,7 @@ public class SFormsFastMapDirect {
}
}
FastSparseSet<Integer>[] arrnew = new FastSparseSet[minsize];
@SuppressWarnings("unchecked") FastSparseSet<Integer>[] arrnew = new FastSparseSet[minsize];
System.arraycopy(arr, 0, arrnew, 0, arr.length);
int[] arrnextnew = new int[minsize];

View File

@@ -115,7 +115,7 @@ public class VBStyleCollection<E, K> extends ArrayList<E> {
public E remove(int index) {
addToListIndex(index + 1, -1);
Object obj = lstKeys.get(index);
K obj = lstKeys.get(index);
if (obj != null) {
map.remove(obj);
}