jdk/src/share/classes/sun/tools/java/ClassPath.java
changeset 25799 1afc4675dc75
parent 12429 91210fbc1747
equal deleted inserted replaced
25798:0b2f54e47bc4 25799:1afc4675dc75
   231     }
   231     }
   232 
   232 
   233     /**
   233     /**
   234      * Returns list of files given a package name and extension.
   234      * Returns list of files given a package name and extension.
   235      */
   235      */
   236     public Enumeration getFiles(String pkg, String ext) {
   236     public Enumeration<ClassFile> getFiles(String pkg, String ext) {
   237         Hashtable files = new Hashtable();
   237         Hashtable<String, ClassFile> files = new Hashtable<>();
   238         for (int i = path.length; --i >= 0; ) {
   238         for (int i = path.length; --i >= 0; ) {
   239             if (path[i].zip != null) {
   239             if (path[i].zip != null) {
   240                 Enumeration e = path[i].zip.entries();
   240                 Enumeration<? extends ZipEntry> e = path[i].zip.entries();
   241                 while (e.hasMoreElements()) {
   241                 while (e.hasMoreElements()) {
   242                     ZipEntry entry = (ZipEntry)e.nextElement();
   242                     ZipEntry entry = (ZipEntry)e.nextElement();
   243                     String name = entry.getName();
   243                     String name = entry.getName();
   244                     name = name.replace('/', File.separatorChar);
   244                     name = name.replace('/', File.separatorChar);
   245                     if (name.startsWith(pkg) && name.endsWith(ext)) {
   245                     if (name.startsWith(pkg) && name.endsWith(ext)) {
   285  */
   285  */
   286 class ClassPathEntry {
   286 class ClassPathEntry {
   287     File dir;
   287     File dir;
   288     ZipFile zip;
   288     ZipFile zip;
   289 
   289 
   290     Hashtable subdirs = new Hashtable(29); // cache of sub-directory listings
   290     Hashtable<String, String[]> subdirs = new Hashtable<>(29); // cache of sub-directory listings:
   291     String[] getFiles(String subdir) {
   291     String[] getFiles(String subdir) {
   292         String files[] = (String[]) subdirs.get(subdir);
   292         String files[] = subdirs.get(subdir);
   293         if (files == null) {
   293         if (files == null) {
   294             // search the directory, exactly once
   294             // search the directory, exactly once
   295             File sd = new File(dir.getPath(), subdir);
   295             File sd = new File(dir.getPath(), subdir);
   296             if (sd.isDirectory()) {
   296             if (sd.isDirectory()) {
   297                 files = sd.list();
   297                 files = sd.list();