public ShrikeCTMethod(IClass klass, int index) { super(klass); if (klass == null) { throw new IllegalArgumentException("klass is null"); } this.shrikeMethodIndex = index; this.cha = klass.getClassHierarchy(); }
public ShrikeCTMethod(IClass klass, int index) { super(klass); if (klass == null) { throw new IllegalArgumentException("klass is null"); } this.shrikeMethodIndex = index; this.cha = klass.getClassHierarchy(); }
@Override public boolean equals(Object obj) { if (!(obj instanceof PointType)) { return false; } PointType other = (PointType) obj; if (!type.getClassHierarchy().equals(other.type.getClassHierarchy())) { Assertions.UNREACHABLE("different chas " + this + ' ' + other); } return type.equals(other.type); }
public static boolean isThrowable(IClass c) { if (c == null) { throw new IllegalArgumentException("null c"); } return c.getClassHierarchy().isSubclassOf(c, c.getClassHierarchy().lookupClass(TypeReference.JavaLangThrowable)); }
@Override public boolean isRootFilter() { return concreteType.equals(concreteType.getClassHierarchy().getRootClass()); } }
@Override public boolean isRootFilter() { return concreteType.length == 1 && concreteType[0].getClassHierarchy().getRootClass().equals(concreteType[0]); } }
public static boolean isThrowable(IClass c) { if (c == null) { throw new IllegalArgumentException("null c"); } return c.getClassHierarchy().isSubclassOf(c, c.getClassHierarchy().lookupClass(TypeReference.JavaLangThrowable)); }
/** * @return a set of integers representing the instance keys that correspond to a given class, or null if there are none. * @throws IllegalArgumentException if klass is null */ public IntSet getInstanceKeysForClass(IClass klass) { if (klass == null) { throw new IllegalArgumentException("klass is null"); } assert klass != klass.getClassHierarchy().getRootClass(); return class2InstanceKey.get(klass); }
@Override public boolean isRootFilter() { return concreteType.equals(concreteType.getClassHierarchy().getRootClass()); } }
/** * @return a set of integers representing the instance keys that correspond to a given class, or null if there are none. * @throws IllegalArgumentException if klass is null */ public IntSet getInstanceKeysForClass(IClass klass) { if (klass == null) { throw new IllegalArgumentException("klass is null"); } assert klass != klass.getClassHierarchy().getRootClass(); return class2InstanceKey.get(klass); }
/** * All values used as property names get implicitly converted to strings in JavaScript. * @see com.ibm.wala.cast.ipa.callgraph.DelegatingAstPointerKeys#getFieldNameType(com.ibm.wala.ipa.callgraph.propagation.InstanceKey) */ @Override protected IClass getFieldNameType(InstanceKey F) { return F.getConcreteType().getClassHierarchy().lookupClass(JavaScriptTypes.String); } });
@Override public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) { MethodReference target = site.getDeclaredTarget(); if (isInvokeExact(target)) { if (! impls.containsKey(target)) { SyntheticMethod invokeExactTrampoline = new SyntheticMethod(target, receiver.getClassHierarchy().lookupClass(TypeReference.JavaLangInvokeMethodHandle), false, false); impls.put(target, invokeExactTrampoline); } return impls.get(target); } return base.getCalleeTarget(caller, site, receiver); } }
/** * @return an Iterator of IClass that implement this interface */ public Iterator<IClass> iterateImplementors() { return type.getClassHierarchy().getImplementors(getType().getReference()).iterator(); }
@Deprecated public static boolean isApplicationClass(IClass clazz) { // we need the additional check as framework classes from the support package are loaded via the Application classloader return clazz.getClassHierarchy().getScope().isApplicationLoader(clazz.getClassLoader()) && !clazz.getName().toString().startsWith("Landroid"); // strip android.v4 / android.v7 support packages as they are considered part of the framework // TODO necessary? support packages are loaded via Primordial! }
private static boolean isExcluded(final IClass cls) { final SetOfClasses set = cls.getClassHierarchy().getScope().getExclusions(); if (set == null) { return false; // exclusions null ==> no exclusions ==> no class is excluded } else { final String clsName = cls.getReference().getName().toString().substring(1); return set.contains(clsName); } }
private static boolean isExcluded(final IClass cls) { final SetOfClasses set = cls.getClassHierarchy().getScope().getExclusions(); if (set == null) { return false; // exclusions null ==> no exclusions ==> no class is excluded } else { final String clsName = cls.getReference().getName().toString().substring(1); return set.contains(clsName); } }
protected TypeInference(IR ir, boolean doPrimitives) { if (ir == null) { throw new IllegalArgumentException("ir is null"); } this.language = ir.getMethod().getDeclaringClass().getClassLoader().getLanguage(); this.cha = ir.getMethod().getDeclaringClass().getClassHierarchy(); this.ir = ir; this.doPrimitives = doPrimitives; this.BOTTOM = new ConeType(cha.getRootClass()); initialize(); solve(); }
protected TypeInference(IR ir, boolean doPrimitives) { if (ir == null) { throw new IllegalArgumentException("ir is null"); } this.language = ir.getMethod().getDeclaringClass().getClassLoader().getLanguage(); this.cha = ir.getMethod().getDeclaringClass().getClassHierarchy(); this.ir = ir; this.doPrimitives = doPrimitives; this.BOTTOM = new ConeType(cha.getRootClass()); initialize(); solve(); }
protected JavaField(CAstEntity fieldEntity, IClassLoader loader, IClass declaringClass, Collection<Annotation> annotations) { super(FieldReference.findOrCreate(declaringClass.getReference(), Atom.findOrCreateUnicodeAtom(fieldEntity.getName()), TypeReference.findOrCreate(loader.getReference(), TypeName.string2TypeName(fieldEntity.getType().getName()))), fieldEntity.getQualifiers(), declaringClass, declaringClass.getClassHierarchy(), annotations); } }
protected JavaField(CAstEntity fieldEntity, IClassLoader loader, IClass declaringClass, Collection<Annotation> annotations) { super(FieldReference.findOrCreate(declaringClass.getReference(), Atom.findOrCreateUnicodeAtom(fieldEntity.getName()), TypeReference.findOrCreate(loader.getReference(), TypeName.string2TypeName(fieldEntity.getType().getName()))), fieldEntity.getQualifiers(), declaringClass, declaringClass.getClassHierarchy(), annotations); } }