src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect

src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java

Print this page




  60     }
  61 
  62     private ClassSource findSource(SearchFor searchFor, SearchPath searchPath) {
  63         ClassSource found = null;
  64 
  65         for (SourceProvider provider : providers) {
  66             if (!searchFor.isUnknown() && !provider.supports(searchFor.getType())) {
  67                 continue;
  68             }
  69 
  70             ClassSource source = provider.findSource(searchFor.getName(), searchPath);
  71             if (source != null) {
  72                 if (found != null) {
  73                     throw new InternalError("Multiple possible sources: " + source + " and: " + found);
  74                 }
  75                 found = source;
  76             }
  77         }
  78 
  79         if (found == null) {
  80             throw new InternalError("Failed to find: " + searchFor.toString());
  81         }
  82         return found;
  83     }
  84 
  85     public static List<SearchFor> makeList(String type, String argument) {
  86         List<SearchFor> list = new ArrayList<>();
  87         String[] elements = argument.split(":");
  88         for (String element : elements) {
  89             list.add(new SearchFor(element, type));
  90         }
  91         return list;
  92     }
  93 }


  60     }
  61 
  62     private ClassSource findSource(SearchFor searchFor, SearchPath searchPath) {
  63         ClassSource found = null;
  64 
  65         for (SourceProvider provider : providers) {
  66             if (!searchFor.isUnknown() && !provider.supports(searchFor.getType())) {
  67                 continue;
  68             }
  69 
  70             ClassSource source = provider.findSource(searchFor.getName(), searchPath);
  71             if (source != null) {
  72                 if (found != null) {
  73                     throw new InternalError("Multiple possible sources: " + source + " and: " + found);
  74                 }
  75                 found = source;
  76             }
  77         }
  78 
  79         if (found == null) {
  80             throw new InternalError("Failed to find " + searchFor.getType() + " file: " + searchFor.getName());
  81         }
  82         return found;
  83     }
  84 
  85     public static List<SearchFor> makeList(String type, String argument) {
  86         List<SearchFor> list = new ArrayList<>();
  87         String[] elements = argument.split(":");
  88         for (String element : elements) {
  89             list.add(new SearchFor(element, type));
  90         }
  91         return list;
  92     }
  93 }
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File