August 25, 2004

Unreadable Java

Who says Java code is easy to read: public FileTableModel(File dir) { this.dir = dir; java.util.List fnames=new ArrayList(Arrays.asList(dir.list(new FilenameFilter(){ public boolean accept(File file, String s) { return new File(file.getPath()+"/"+s).isDirectory(); } }))); for(Iterator it=(Arrays.asList(dir.list(new FilenameFilter(){ public boolean accept(File file, String s) { return new File(file.getPath()+"/"+s).isFile(); } }))).iterator(); it.hasNext();){ fnames.add(it.next()); } filenames=(String[])fnames.toArray(filenames); }

No comments: