Set normalClasspathSet = new HashSet(); Set bootClasspathSet = new HashSet();
LinkedList normalClasspathList = new LinkedList(); LinkedList bootClasspathList = new LinkedList();
    public File[] getClasspathForSelectedDevices() {        Device[] selectedDevices = getSelectedDevices();        Environment env = null;        try {            env  = new Environment(new ExtensionManager(new Project()),new Project(),new PolishTask());        } catch (JDOMException exception) {            throw new RuntimeException("Could not create an Environment."+exception);        } catch (IOException exception) {            throw new RuntimeException("Could not create an Environment."+exception);        }        env.set("polish.home", this.deviceDatabase.getPolishHome());        env.set("polish.apidir", this.deviceDatabase.getApisHome());                for (int i = 0; i < selectedDevices.length; i++) {            Device selectedDevice = selectedDevices[i];            selectedDevice.setEnvironment(env);        }                Set normalClasspathSet = new HashSet();        Set bootClasspathSet = new HashSet();        for (int i = 0; i < selectedDevices.length; i++) {            Device device = selectedDevices[i];            String[] normalClasspath = device.getClassPaths();            String[] bootClasspath = device.getBootClassPaths();            for (int j = 0; j < normalClasspath.length; j++) {                normalClasspathSet.add(normalClasspath[j]);            }            for (int j = 0; j < bootClasspath.length; j++) {                String bootClasspathEntry = bootClasspath[j];                if(bootClasspathEntry != null) {                    bootClasspathSet.add(bootClasspath[j]);                }            }        }                String[] normalClasspathArray = (String[]) normalClasspathSet.toArray(new String[normalClasspathSet.size()]);        String[] bootClasspathArray = (String[]) bootClasspathSet.toArray(new String[bootClasspathSet.size()]);                Arrays.sort(normalClasspathArray);        Arrays.sort(bootClasspathArray);                String[] fullClasspathArray = new String[normalClasspathArray.length+bootClasspathArray.length];                System.arraycopy(bootClasspathArray,0,fullClasspathArray,0,bootClasspathArray.length);        System.arraycopy(normalClasspathArray,0,fullClasspathArray,bootClasspathArray.length,normalClasspathArray.length);                String [] filteredClasspathArray = filterPaths(fullClasspathArray);        File[] files = new File[filteredClasspathArray.length];        for (int i = 0; i < filteredClasspathArray.length; i++) {            files[i] = new File(filteredClasspathArray[i]);        }        return files;    }