private static Set<ModuleEntry> getDexFiles(Module M) { HashSet<ModuleEntry> result = HashSetFactory.make(); for (ModuleEntry entry : Iterator2Iterable.make(M.getEntries())) { if (entry instanceof DexModuleEntry) { result.add(entry); } } return result; }
private static Set<ModuleEntry> getDexFiles(Module M) { HashSet<ModuleEntry> result = HashSetFactory.make(); for (ModuleEntry entry : Iterator2Iterable.make(M.getEntries())) { if (entry instanceof DexModuleEntry) { result.add(entry); } } return result; }
/** * translate all relevant entities in the module to CAst, storing the results * in topLevelEntities */ private void translateModuleToCAst(Module module, CAst ast, Set<Pair<CAstEntity, ModuleEntry>> topLevelEntities) { for (ModuleEntry me : Iterator2Iterable.make(module.getEntries())) { translateModuleEntryToCAst(me, ast, topLevelEntities); } }
/** * translate all relevant entities in the module to CAst, storing the results * in topLevelEntities */ private void translateModuleToCAst(Module module, CAst ast, Set<Pair<CAstEntity, ModuleEntry>> topLevelEntities) { for (ModuleEntry me : Iterator2Iterable.make(module.getEntries())) { translateModuleEntryToCAst(me, ast, topLevelEntities); } }
public static Set<ModuleEntry> getJavaScriptCodeFromProject(String project) throws IOException, CoreException { IJavaScriptProject p = JavaScriptHeadlessUtil.getJavaScriptProjectFromWorkspace(project); JSCallGraphUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory()); AnalysisScope s = JavaScriptEclipseProjectPath.make(p, Collections.<Pair<String,Plugin>>emptySet()).toAnalysisScope(new CAstAnalysisScope(JSCallGraphUtil.makeLoaders(), Collections.singleton(JavaScriptLoader.JS))); List<Module> modules = s.getModules(JavaScriptTypes.jsLoader); Set<ModuleEntry> mes = HashSetFactory.make(); for(Module m : modules) { for(ModuleEntry entry : Iterator2Iterable.make(m.getEntries())) { mes.add(entry); } } return mes; }
@SuppressWarnings("unused") private Map<String, Map<String, Long>> getEntrySizes(Module module, String name) { Map<String, Map<String, Long>> result = HashMapFactory.make(); Map<String, Long> curFileResult = HashMapFactory.make(); for (ModuleEntry e : Iterator2Iterable.make(module.getEntries())) { if (e.isModuleFile()) { result.putAll(getEntrySizes(e.asModule(), e.getName())); } else { if (e instanceof JarFileEntry) { curFileResult.put(e.getName(), ((JarFileEntry) e).getSize()); } } } result.put(name, curFileResult); return result; }
@SuppressWarnings("unused") private Map<String, Map<String, Long>> getEntrySizes(Module module, String name) { Map<String, Map<String, Long>> result = HashMapFactory.make(); Map<String, Long> curFileResult = HashMapFactory.make(); for (ModuleEntry e : Iterator2Iterable.make(module.getEntries())) { if (e.isModuleFile()) { result.putAll(getEntrySizes(e.asModule(), e.getName())); } else { if (e instanceof JarFileEntry) { curFileResult.put(e.getName(), ((JarFileEntry) e).getSize()); } } } result.put(name, curFileResult); return result; }
/** * Return the Set of (ModuleEntry) source files found in a module. * * @param M the module * @return the Set of source files in the module */ @SuppressWarnings("unused") private Set<ModuleEntry> getSourceFiles(Module M) throws IOException { if (DEBUG_LEVEL > 0) { System.err.println("Get source files for " + M); } HashSet<ModuleEntry> result = HashSetFactory.make(); for (ModuleEntry entry : Iterator2Iterable.make(M.getEntries())) { if (DEBUG_LEVEL > 0) { System.err.println("consider entry for source information: " + entry); } if (entry.isSourceFile()) { if (DEBUG_LEVEL > 0) { System.err.println("found source file: " + entry); } result.add(entry); } else if (entry.isModuleFile()) { result.addAll(getSourceFiles(entry.asModule())); } } return result; }
/** * Return the Set of (ModuleEntry) source files found in a module. * * @param M the module * @return the Set of source files in the module */ @SuppressWarnings("unused") private Set<ModuleEntry> getSourceFiles(Module M) throws IOException { if (DEBUG_LEVEL > 0) { System.err.println("Get source files for " + M); } HashSet<ModuleEntry> result = HashSetFactory.make(); for (ModuleEntry entry : Iterator2Iterable.make(M.getEntries())) { if (DEBUG_LEVEL > 0) { System.err.println("consider entry for source information: " + entry); } if (entry.isSourceFile()) { if (DEBUG_LEVEL > 0) { System.err.println("found source file: " + entry); } result.add(entry); } else if (entry.isModuleFile()) { result.addAll(getSourceFiles(entry.asModule())); } } return result; }
for (ModuleEntry entry : Iterator2Iterable.make(M.getEntries())) { if (DEBUG_LEVEL > 0) { System.err.println("ClassLoaderImpl.getClassFiles:Got entry: " + entry);
for (ModuleEntry entry : Iterator2Iterable.make(M.getEntries())) { if (DEBUG_LEVEL > 0) { System.err.println("ClassLoaderImpl.getClassFiles:Got entry: " + entry);