From a15c29436b4e41cf1b0a4ae051e3e7f7029a753f Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 28 Jun 1999 11:07:33 +0000 Subject: [PATCH] always use collection api git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@943 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/obfuscator/ClassIdentifier.java | 40 ++++++++++------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/jode/jode/obfuscator/ClassIdentifier.java b/jode/jode/obfuscator/ClassIdentifier.java index 501e8da..7921240 100644 --- a/jode/jode/obfuscator/ClassIdentifier.java +++ b/jode/jode/obfuscator/ClassIdentifier.java @@ -21,9 +21,22 @@ package jode.obfuscator; import jode.GlobalOptions; import jode.Obfuscator; import jode.bytecode.*; + +///#ifdef JDK12 +///import java.util.Collections; +///import java.util.Arrays; +///#else +import jode.util.Collections; +import jode.util.Arrays; +///#endif + import java.lang.reflect.Modifier; -import java.util.*; -import java.io.*; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.Random; +import java.util.Hashtable; +import java.util.Vector; +import java.util.Enumeration; public class ClassIdentifier extends Identifier { ClassBundle bundle; @@ -250,27 +263,8 @@ public class ClassIdentifier extends Identifier { MethodInfo[] minfos = info.getMethods(); if (Obfuscator.swapOrder) { Random rand = new Random(); -///#ifdef JDK12 -/// Collections.shuffle(Arrays.asList(finfos), rand); -/// Collections.shuffle(Arrays.asList(minfos), rand); -///#else - for (int i=1; i < finfos.length; i++) { - int j = (Math.abs(rand.nextInt()) % (i+1)); - if (j != i) { - FieldInfo tmp = finfos[i]; - finfos[i] = finfos[j]; - finfos[j] = tmp; - } - } - for (int i=1; i < minfos.length; i++) { - int j = (Math.abs(rand.nextInt()) % (i+1)); - if (j != i) { - MethodInfo tmp = minfos[i]; - minfos[i] = minfos[j]; - minfos[j] = tmp; - } - } -///#endif + Collections.shuffle(Arrays.asList(finfos), rand); + Collections.shuffle(Arrays.asList(minfos), rand); } fieldCount = finfos.length; identifiers = new Identifier[finfos.length + minfos.length];