/** * Return a class loader corresponding to a given class loader identifier. * Create one if necessary. * * @param classLoaderReference * identifier for the desired class loader */ @Override public IClassLoader getLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, AnalysisScope scope) throws IOException { if (classLoaderReference == null) { throw new IllegalArgumentException("null classLoaderReference"); } IClassLoader result = map.get(classLoaderReference); if (result == null) { ClassLoaderReference parentRef = classLoaderReference.getParent(); IClassLoader parent = null; if (parentRef != null) { parent = getLoader(parentRef, cha, scope); } IClassLoader cl = makeNewClassLoader(classLoaderReference, cha, parent, scope); map.put(classLoaderReference, cl); result = cl; } return result; }
protected ClassLoaderFactory makeClassLoaderFactory(SetOfClasses exclusions) { return new ClassLoaderFactoryImpl(exclusions); }
@Override protected IClassLoader makeNewClassLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent, AnalysisScope scope) throws IOException { if (classLoaderReference.equals(JavaSourceAnalysisScope.SOURCE)) { ClassLoaderImpl cl = makeSourceLoader(classLoaderReference, cha, parent); cl.init(scope.getModules(classLoaderReference)); return cl; } else { return super.makeNewClassLoader(classLoaderReference, cha, parent, scope); } }
@Override protected IClassLoader makeNewClassLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent, AnalysisScope scope) throws IOException { if (classLoaderReference.equals(JavaSourceAnalysisScope.SOURCE)) { ClassLoaderImpl cl = makeSourceLoader(classLoaderReference, cha, parent); cl.init(scope.getModules(classLoaderReference)); return cl; } else { return super.makeNewClassLoader(classLoaderReference, cha, parent, scope); } }
protected ClassLoaderFactory makeClassLoaderFactory(SetOfClasses exclusions) { return new ClassLoaderFactoryImpl(exclusions); }
/** * Return a class loader corresponding to a given class loader identifier. * Create one if necessary. * * @param classLoaderReference * identifier for the desired class loader */ @Override public IClassLoader getLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, AnalysisScope scope) throws IOException { if (classLoaderReference == null) { throw new IllegalArgumentException("null classLoaderReference"); } IClassLoader result = map.get(classLoaderReference); if (result == null) { ClassLoaderReference parentRef = classLoaderReference.getParent(); IClassLoader parent = null; if (parentRef != null) { parent = getLoader(parentRef, cha, scope); } IClassLoader cl = makeNewClassLoader(classLoaderReference, cha, parent, scope); map.put(classLoaderReference, cl); result = cl; } return result; }
@Override protected IClassLoader makeNewClassLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent, AnalysisScope scope) throws IOException { if (classLoaderReference.equals(JavaScriptTypes.jsLoader)) { JavaScriptLoader L = new JavaScriptLoader(cha, jsTranslatorFactory); L.init(scope.getModules(classLoaderReference)); return L; } else { return super.makeNewClassLoader(classLoaderReference, cha, parent, scope); } }
/** * temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor. */ public static ClassHierarchy make(AnalysisScope scope, IProgressMonitor monitor) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return make(scope, new ClassLoaderFactoryImpl(scope.getExclusions()), monitor); }
/** * @return a ClassHierarchy object representing the analysis scope */ public static ClassHierarchy make(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return make(scope, new ClassLoaderFactoryImpl(scope.getExclusions())); }
/** * @return a ClassHierarchy object representing the analysis scope */ public static ClassHierarchy make(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return make(scope, new ClassLoaderFactoryImpl(scope.getExclusions())); }
/** * @return a ClassHierarchy object representing the analysis scope, missing superclasses are * replaced by the ClassHierarchy root, i.e. java.lang.Object */ public static ClassHierarchy makeWithRoot(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return makeWithRoot(scope, new ClassLoaderFactoryImpl(scope.getExclusions())); }
/** * temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor. */ public static ClassHierarchy make(AnalysisScope scope, IProgressMonitor monitor) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return make(scope, new ClassLoaderFactoryImpl(scope.getExclusions()), monitor); }
/** * @return a ClassHierarchy object representing the analysis scope, missing superclasses are * replaced by the ClassHierarchy root, i.e. java.lang.Object */ public static ClassHierarchy makeWithRoot(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return makeWithRoot(scope, new ClassLoaderFactoryImpl(scope.getExclusions())); }
/** * @return a ClassHierarchy object representing the analysis scope, where phantom classes are * created when superclasses are missing */ public static ClassHierarchy makeWithPhantom(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return makeWithPhantom(scope, new ClassLoaderFactoryImpl(scope.getExclusions())); }
/** * temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor. */ public static ClassHierarchy make(AnalysisScope scope, IProgressMonitor monitor) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return make(scope, new ClassLoaderFactoryImpl(scope.getExclusions()), monitor); }
/** * @return a ClassHierarchy object representing the analysis scope */ public static ClassHierarchy make(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return make(scope, new ClassLoaderFactoryImpl(scope.getExclusions())); }
/** * @return a ClassHierarchy object representing the analysis scope, where phantom classes are * created when superclasses are missing */ public static ClassHierarchy makeWithPhantom(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return makeWithPhantom(scope, new ClassLoaderFactoryImpl(scope.getExclusions())); }
/** * temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor. */ public static ClassHierarchy make(AnalysisScope scope, IProgressMonitor monitor) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return make(scope, new ClassLoaderFactoryImpl(scope.getExclusions()), monitor); }
/** * @return a ClassHierarchy object representing the analysis scope */ public static ClassHierarchy make(AnalysisScope scope) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } return make(scope, new ClassLoaderFactoryImpl(scope.getExclusions())); }
@BeforeClass public static void beforeClass() throws Exception { scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), NullPointerExceptionIntraTest.class.getClassLoader()); ClassLoaderFactory factory = new ClassLoaderFactoryImpl(scope.getExclusions()); try { cha = ClassHierarchyFactory.make(scope, factory); } catch (ClassHierarchyException e) { throw new Exception(e); } }