summaryrefslogtreecommitdiffstats
path: root/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java
diff options
context:
space:
mode:
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-08-29 21:58:12 +0400
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-08-29 21:58:12 +0400
commitf5431c3bb14854025dc1f0ec470b77497f79494c (patch)
tree909c1c06492d849fa062a60c56a02dd26e7095b6 /src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java
parent63b8d35d08a198215ddabb42cca5b0e823232768 (diff)
downloadfernflower-f5431c3bb14854025dc1f0ec470b77497f79494c.tar
fernflower-f5431c3bb14854025dc1f0ec470b77497f79494c.tar.gz
fernflower-f5431c3bb14854025dc1f0ec470b77497f79494c.tar.lz
fernflower-f5431c3bb14854025dc1f0ec470b77497f79494c.tar.xz
fernflower-f5431c3bb14854025dc1f0ec470b77497f79494c.zip
java-decompiler: post-import cleanup (common fixes and optimizations)
Diffstat (limited to 'src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java')
-rw-r--r--src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java b/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java
index 089225d..996607a 100644
--- a/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java
+++ b/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java
@@ -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];