some jdk12 stuff

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@380 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 1c8d109917
commit a6247e5b3e
  1. 8
      jode/jode/obfuscator/ClassIdentifier.java

@ -186,9 +186,10 @@ public class ClassIdentifier extends Identifier {
MethodInfo[] minfos = info.getMethods(); MethodInfo[] minfos = info.getMethods();
if (Obfuscator.swapOrder) { if (Obfuscator.swapOrder) {
Random rand = new Random(); Random rand = new Random();
// XXX replace the following for JDK12 with: ///#ifdef JDK12
// Collections.shuffle(Arrays.asList(finfos), rand); /// Collections.shuffle(Arrays.asList(finfos), rand);
// Collections.shuffle(Arrays.asList(minfos), rand); /// Collections.shuffle(Arrays.asList(minfos), rand);
///#else
for (int i=1; i < finfos.length; i++) { for (int i=1; i < finfos.length; i++) {
int j = (Math.abs(rand.nextInt()) % (i+1)); int j = (Math.abs(rand.nextInt()) % (i+1));
if (j != i) { if (j != i) {
@ -205,6 +206,7 @@ public class ClassIdentifier extends Identifier {
minfos[j] = tmp; minfos[j] = tmp;
} }
} }
///#endif
} }
fieldCount = finfos.length; fieldCount = finfos.length;
identifiers = new Identifier[finfos.length + minfos.length]; identifiers = new Identifier[finfos.length + minfos.length];

Loading…
Cancel
Save