public void intern(XClass c) { for (XMethod m : c.getXMethods()) { MethodInfo mi = (MethodInfo) m; methods.put(mi, mi); } for (XField f : c.getXFields()) { FieldInfo fi = (FieldInfo) f; fields.put(fi, fi); } }
private @CheckForNull XMethod getConstructorThatCallsSuperConstructor(XMethod superConstructor) { FieldSummary fieldSummary = AnalysisContext.currentAnalysisContext().getFieldSummary(); XMethod lookfor = "()V".equals(superConstructor.getSignature()) ? null : superConstructor; for (XMethod m : getXClass().getXMethods()) { if (Const.CONSTRUCTOR_NAME.equals(m.getName())) { if (fieldSummary.getSuperCall(m) == lookfor) { return m; } } } return null; }
/** * Add an application class, and its transitive supertypes, to the * inheritance graph. * * @param appXClass * application XClass to add to the inheritance graph */ public void addApplicationClass(XClass appXClass) { for (XMethod m : appXClass.getXMethods()) { if (m.isStub()) { return; } } ClassVertex vertex = addClassAndGetClassVertex(appXClass); vertex.markAsApplicationClass(); }
for (XMethod xMethod : classInfo.getXMethods()) { if (methodName != null && !methodName.equals(xMethod.getName())) { continue;
List<? extends XMethod> methods = xclass.getXMethods(); if (DEBUG) { System.out.println("CEW: checking " + xclass.toString());
isStrict1 = true; for (XMethod xmethod : xclass.getXMethods()) { if ("value".equals(xmethod.getName()) && xmethod.getSignature().startsWith("()")) { isExhaustive1 = xmethod.getAnnotation(EXHAUSTIVE_ANNOTATION) != null;
&& MUTABLE_COLLECTION_CLASSES.contains(superclassDescriptor.getClassName())) { mutableCollectionJustCreated = true; for (XMethod xMethod : xClass.getXMethods()) { if (xMethod != null && !Const.CONSTRUCTOR_NAME.equals(xMethod.getName()) && !Const.STATIC_INITIALIZER_NAME.equals(xMethod.getName())) { mutableCollectionJustCreated = false;
List<? extends XMethod> methods = xClass.getXMethods(); for (XMethod m : methods) {
done = checkMethod(method); } else { for (XMethod superMethod : superClass.getXMethods()) { if (name.equals(superMethod.getName()) && compatibleParameters(desc, superMethod.getSignature())) { if (checkMethod(superMethod)) {
DescriptorFactory.createClassDescriptor(java.io.Serializable.class)); superClassHasVoidConstructor = false; for (XMethod m : superXClass.getXMethods()) { if (Const.CONSTRUCTOR_NAME.equals(m.getName()) && "()V".equals(m.getSignature()) && !m.isPrivate()) { superClassHasVoidConstructor = true;
@Override public void visitClass(ClassDescriptor classDescriptor) throws CheckedAnalysisException { XClass xclass = Global.getAnalysisCache().getClassAnalysis(XClass.class, classDescriptor); // Is this class an obligation type? Obligation thisClassObligation = database.getFactory().getObligationByType(xclass.getClassDescriptor()); // Scan methods for uses of obligation-related annotations for (XMethod xmethod : xclass.getXMethods()) { // Is this method marked with @CreatesObligation? if (thisClassObligation != null) { if (xmethod.getAnnotation(createsObligation) != null) { database.addEntry(new MatchMethodEntry(xmethod, ObligationPolicyDatabaseActionType.ADD, ObligationPolicyDatabaseEntryType.STRONG, thisClassObligation)); } // Is this method marked with @DischargesObligation? if (xmethod.getAnnotation(dischargesObligation) != null) { database.addEntry(new MatchMethodEntry(xmethod, ObligationPolicyDatabaseActionType.DEL, ObligationPolicyDatabaseEntryType.STRONG, thisClassObligation)); } } addObligations(xmethod); } }
DescriptorFactory.createClassDescriptorFromDottedClassName(superclassName)); XMethod potentialMatch = null; for(XMethod m : from.getXMethods()) { if (!m.isStatic() && !m.isPrivate() && m.getName().toLowerCase().equals(obj.getName().toLowerCase())) { if (potentialMatch == null) {
public void intern(XClass c) { for (XMethod m : c.getXMethods()) { MethodInfo mi = (MethodInfo) m; methods.put(mi, mi); } for (XField f : c.getXFields()) { FieldInfo fi = (FieldInfo) f; fields.put(fi, fi); } }
private @CheckForNull XMethod getConstructorThatCallsSuperConstructor(XMethod superConstructor) { FieldSummary fieldSummary = AnalysisContext.currentAnalysisContext().getFieldSummary(); XMethod lookfor = "()V".equals(superConstructor.getSignature()) ? null : superConstructor; for (XMethod m : getXClass().getXMethods()) { if ("<init>".equals(m.getName())) { if (fieldSummary.getSuperCall(m) == lookfor) { return m; } } } return null; }
/** * Add an application class, and its transitive supertypes, to the * inheritance graph. * * @param appXClass * application XClass to add to the inheritance graph */ public void addApplicationClass(XClass appXClass) { for (XMethod m : appXClass.getXMethods()) { if (m.isStub()) { return; } } ClassVertex vertex = addClassAndGetClassVertex(appXClass); vertex.markAsApplicationClass(); }
for (XMethod xMethod : classInfo.getXMethods()) { if (methodName != null && !methodName.equals(xMethod.getName())) { continue;
List<? extends XMethod> methods = xClass.getXMethods(); for (XMethod m : methods) {
done = checkMethod(method); } else { for (XMethod superMethod : superClass.getXMethods()) { if (name.equals(superMethod.getName()) && compatibleParameters(desc, superMethod.getSignature())) { if (checkMethod(superMethod)) {
@Override public void visitClass(ClassDescriptor classDescriptor) throws CheckedAnalysisException { XClass xclass = Global.getAnalysisCache().getClassAnalysis(XClass.class, classDescriptor); // Is this class an obligation type? Obligation thisClassObligation = database.getFactory().getObligationByType(xclass.getClassDescriptor()); // Scan methods for uses of obligation-related annotations for (XMethod xmethod : xclass.getXMethods()) { // Is this method marked with @CreatesObligation? if (thisClassObligation != null) { if (xmethod.getAnnotation(createsObligation) != null) { database.addEntry(new MatchMethodEntry(xmethod, ObligationPolicyDatabaseActionType.ADD, ObligationPolicyDatabaseEntryType.STRONG, thisClassObligation)); } // Is this method marked with @DischargesObligation? if (xmethod.getAnnotation(dischargesObligation) != null) { database.addEntry(new MatchMethodEntry(xmethod, ObligationPolicyDatabaseActionType.DEL, ObligationPolicyDatabaseEntryType.STRONG, thisClassObligation)); } } addObligations(xmethod); } }
DescriptorFactory.createClassDescriptorFromDottedClassName(superclassName)); XMethod potentialMatch = null; for(XMethod m : from.getXMethods()) { if (!m.isStatic() && !m.isPrivate() && m.getName().toLowerCase().equals(obj.getName().toLowerCase())) { if (potentialMatch == null) {