int idx = name.lastIndexOf('.'); String ext; if (idx > -1) { ext = name.substring(idx + 1); base = name.substring(0, idx); if (!ext.equals(m_extension)) { return false; } } else { return false;
for (Iterator it = names.iterator(); it.hasNext(); ) { String name = (String) it.next(); int idx = name.lastIndexOf('.');  if (idx < 0) { continue; }  String ext = name.substring(idx + 1); String base = name.substring(0, idx);  if (!ext.equals(m_extension)) { continue; }  idx = base.lastIndexOf('.'); int idx2 = base.lastIndexOf(File.separatorChar); if (idx > -1 && idx > idx2) { String sfx = base.substring(idx + 1);  if (!sfx.equals(m_suffix)) { continue; }  base = base.substring(0, idx); }  String cur = (String) accepted.get(base); if (cur == null || (cur.length() < name.length())) { accepted.put(base, name); }
    public boolean accept(String name) {        String base;        int idx = name.lastIndexOf('.');        String ext;        if (idx > -1) {            ext = name.substring(idx + 1);            base = name.substring(0, idx);            if (!ext.equals(m_extension)) { return false; }        } else {            return false;        }        idx = base.lastIndexOf('.');        int idx2 = base.lastIndexOf(File.separatorChar);        String sfx;        if (idx > -1 && idx > idx2) {            sfx = base.substring(idx + 1);            return sfx.equals(m_suffix);        } else {            return true;        }    }