/** * Checks if the method could be a lambda. Notice this is a best-check, * since once compiled lambda methods are not univocally distinguishable. * * @param m The method to check if it's a lambda * @return True if this could be a lambda, false otherwise */ public static boolean couldBeLambda(final XMethod m) { return m.isPrivate() && m.isSynthetic(); }
if (tqa == null && (o instanceof XMethod) && !((XMethod) o).isStatic() && !((XMethod) o).isPrivate() && !"<init>".equals(((XMethod) o).getName())) { tqa = getInheritedTypeQualifierAnnotation((XMethod) o, typeQualifierValue);
private void addPropertiesForMethodContainingWarning(WarningPropertySet<WarningProperty> propertySet) { XMethod xMethod = XFactory.createXMethod(classContext.getJavaClass(), method); boolean uncallable = !AnalysisContext.currentXFactory().isCalledDirectlyOrIndirectly(xMethod) && xMethod.isPrivate(); if (uncallable) { propertySet.addProperty(GeneralWarningProperty.IN_UNCALLABLE_METHOD); } }
private void addPropertiesForMethodContainingWarning(WarningPropertySet<WarningProperty> propertySet) { XMethod xMethod = XFactory.createXMethod(classContext.getJavaClass(), method); boolean uncallable = !AnalysisContext.currentXFactory().isCalledDirectlyOrIndirectly(xMethod) && xMethod.isPrivate(); if (uncallable) { propertySet.addProperty(GeneralWarningProperty.IN_UNCALLABLE_METHOD); } }
if (tqa == null && !xmethod.isStatic() && !xmethod.isPrivate() && !"<init>".equals(xmethod.getName())) { if (DEBUG) { System.out.print(" (2) Checking inherited...");
if (!m.isStatic() && ("clone".equals(name) && "()Ljava/lang/Object;".equals(signature) || "toString".equals(name) && "()Ljava/lang/String;".equals(signature) || m.isPrivate() && "readResolve".equals(name) && "()Ljava/lang/Object;".equals(signature))) { NullnessAnnotation result = super.getDirectAnnotation(m);
if (!(xMethod.isFinal() || xMethod.isStatic() || xMethod.isPrivate())) { try { isExact = false;
if (!AnalysisContext.currentXFactory().isCalledDirectlyOrIndirectly(calledFrom) && calledFrom.isPrivate()) {
public boolean isCalledDirectlyOrIndirectly(XMethod m) { if (isCalled(m)) { return true; } if (m.isStatic() || m.isPrivate() || Const.CONSTRUCTOR_NAME.equals(m.getName())) { return false; } try { IAnalysisCache analysisCache = Global.getAnalysisCache(); XClass clazz = analysisCache.getClassAnalysis(XClass.class, m.getClassDescriptor()); if (isCalledDirectlyOrIndirectly(clazz.getSuperclassDescriptor(), m)) { return true; } for (ClassDescriptor i : clazz.getInterfaceDescriptorList()) { if (isCalledDirectlyOrIndirectly(i, m)) { return true; } } return false; } catch (edu.umd.cs.findbugs.classfile.MissingClassException e) { // AnalysisContext.reportMissingClass(e.getClassNotFoundException()); return false; } catch (MissingClassException e) { AnalysisContext.reportMissingClass(e.getClassNotFoundException()); return false; } catch (Exception e) { AnalysisContext.logError("Error checking to see if " + m + " is called (" + e.getClass().getCanonicalName() + ")", e); return false; } }
if (xmethod.isPrivate()) { stopAtMethodScope = true;
MethodAnnotation m = (MethodAnnotation) source; XMethod xm = m.toXMethod(); if (xm != null && (xm.isPrivate() || xm.isStatic()) && priority == Priorities.LOW_PRIORITY) { continue;
priority++; if (m.isPrivate() && priority == HIGH_PRIORITY) { priority = NORMAL_PRIORITY;
if (Const.CONSTRUCTOR_NAME.equals(getMethodName()) && seen == Const.INVOKEVIRTUAL) { XMethod m = getXMethodOperand(); if (m != null && !m.isPrivate() && !m.isFinal()) { int args = PreorderVisitor.getNumberArguments(m.getSignature()); OpcodeStack.Item item = stack.getStackItem(args);
priority--; if (xmethod.isStatic() || xmethod.isFinal() || xmethod.isPrivate() || Const.CONSTRUCTOR_NAME.equals(xmethod.getName()) || jclass.isFinal()) { priority--;
XMethod potentialMatch = null; for(XMethod m : from.getXMethods()) { if (!m.isStatic() && !m.isPrivate() && m.getName().toLowerCase().equals(obj.getName().toLowerCase())) { if (potentialMatch == null) { potentialMatch = m;
priority++; if (callSeen.isPrivate()) { priority++;
private void addPropertiesForMethodContainingWarning(WarningPropertySet<WarningProperty> propertySet) { XMethod xMethod = XFactory.createXMethod(classContext.getJavaClass(), method); boolean uncallable = !AnalysisContext.currentXFactory().isCalledDirectlyOrIndirectly(xMethod) && xMethod.isPrivate(); if (uncallable) { propertySet.addProperty(GeneralWarningProperty.IN_UNCALLABLE_METHOD); } }
private void addPropertiesForMethodContainingWarning(WarningPropertySet<WarningProperty> propertySet) { XMethod xMethod = XFactory.createXMethod(classContext.getJavaClass(), method); boolean uncallable = !AnalysisContext.currentXFactory().isCalledDirectlyOrIndirectly(xMethod) && xMethod.isPrivate(); if (uncallable) { propertySet.addProperty(GeneralWarningProperty.IN_UNCALLABLE_METHOD); } }
public boolean isCalledDirectlyOrIndirectly(XMethod m) { if (isCalled(m)) { return true; } if (m.isStatic() || m.isPrivate() || "<init>".equals(m.getName())) { return false; } try { IAnalysisCache analysisCache = Global.getAnalysisCache(); XClass clazz = analysisCache.getClassAnalysis(XClass.class, m.getClassDescriptor()); if (isCalledDirectlyOrIndirectly(clazz.getSuperclassDescriptor(), m)) { return true; } for (ClassDescriptor i : clazz.getInterfaceDescriptorList()) { if (isCalledDirectlyOrIndirectly(i, m)) { return true; } } return false; } catch (edu.umd.cs.findbugs.classfile.MissingClassException e) { // AnalysisContext.reportMissingClass(e.getClassNotFoundException()); return false; } catch (MissingClassException e) { AnalysisContext.reportMissingClass(e.getClassNotFoundException()); return false; } catch (Exception e) { AnalysisContext.logError("Error checking to see if " + m + " is called (" + e.getClass().getCanonicalName() + ")", e); return false; } }