Package edu.umd.cs.findbugs.classfile

Examples of edu.umd.cs.findbugs.classfile.ClassDescriptor


                    List<? extends ReferenceType> parameters = genericMapType.getParameters();
                    if (parameters == null || parameters.size() != 2) {
                        break mapGetCheck;
                    }

                    ClassDescriptor c = DescriptorFactory.getClassDescriptor(genericMapType);
                    if (!Subtypes2.instanceOf(c, Map.class)) {
                        break mapGetCheck;
                    }
                    if (!isStraightGenericMap(c)) {
                        break mapGetCheck;
View Full Code Here


    public final TypeQualifierValue<?> nonnullTypeQualifierValue;

    final BugReporter reporter;

    public InconsistentAnnotations(BugReporter reporter) {
        ClassDescriptor nonnullClassDesc = DescriptorFactory.createClassDescriptor(javax.annotation.Nonnull.class);
        this.nonnullTypeQualifierValue = TypeQualifierValue.getValue(nonnullClassDesc, null);
        this.reporter = reporter;
    }
View Full Code Here

            boolean invokeInterface) {
        XMethod result = findMethod(jClass.getClassDescriptor(), methodName, methodSig, invokeStatic);
        if (result != null) {
            return result;
        }
        ClassDescriptor sClass = jClass.getSuperclassDescriptor();
        if (sClass != null) {
            result = findInvocationLeastUpperBound(sClass, methodName, methodSig, invokeStatic, invokeInterface);
            if (result != null) {
                return result;
            }
View Full Code Here

                if (result != null) {
                    return result;
                }
            }
        } else {
            ClassDescriptor sClass = jClass.getSuperclassDescriptor();
            if (sClass != null) {
                return findInvocationLeastUpperBound(sClass, methodName, methodSig, invokeStatic, invokeInterface);
            }
        }
        return null;
View Full Code Here


    public static @CheckForNull XMethod findFirstSuperMethod(XMethod m) {

        try {
            @CheckForNull ClassDescriptor c = m.getClassDescriptor();
            XClass xc = getXClass(c);
            c = xc.getSuperclassDescriptor();
            while (c != null) {
                xc = getXClass(c);
                XMethod xm = xc.findMatchingMethod(m.getMethodDescriptor());
View Full Code Here

    }

    public static Set<XMethod> resolveVirtualMethodCallTargets(String receiverClassName, String methodName, String methodSig,
            boolean receiverTypeIsExact, boolean invokeSpecial) throws ClassNotFoundException {
        ClassDescriptor receiverDesc = DescriptorFactory.createClassDescriptorFromDottedClassName(receiverClassName);
        return resolveVirtualMethodCallTargets(receiverDesc, methodName, methodSig, receiverTypeIsExact, invokeSpecial);
    }
View Full Code Here

            checkedDatabases = true;
        }

        XMethod xMethod = XFactory.createXMethod(classContext.getJavaClass(), method);

        ClassDescriptor junitTestAnnotation = DescriptorFactory.createClassDescriptor("org/junit/Test");
        AnnotationValue av = xMethod.getAnnotation(junitTestAnnotation);
        if (av != null) {
            Object value = av.getValue("expected");

            if (value instanceof Type) {
View Full Code Here

        if (true) {
            // If a parameter is already marked as nonnull, don't complain about
            // it here.
            nullArgSet = (BitSet) nullArgSet.clone();
            definitelyNullArgSet = (BitSet) definitelyNullArgSet.clone();
            ClassDescriptor nonnullClassDesc = DescriptorFactory.createClassDescriptor(javax.annotation.Nonnull.class);
            TypeQualifierValue<?> nonnullTypeQualifierValue = TypeQualifierValue.getValue(nonnullClassDesc, null);
            for (int i = nullArgSet.nextSetBit(0); i >= 0; i = nullArgSet.nextSetBit(i + 1)) {
                TypeQualifierAnnotation tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(calledMethod, i,
                        nonnullTypeQualifierValue);
                if (tqa != null && tqa.when == When.ALWAYS) {
View Full Code Here

    static public boolean analyzingApplicationClass() {
        AnalysisContext context = AnalysisContext.currentAnalysisContext();
        if (context == null) {
            return false;
        }
        ClassDescriptor clazz = context.getClassBeingAnalyzed();
        if (clazz == null) {
            return false;
        }
        return context.isApplicationClass(clazz);
    }
View Full Code Here

        // return isApplicationClass(javaClass);
        // } catch (ClassNotFoundException e) {
        // AnalysisContext.reportMissingClass(e);
        // return false;
        // }
        ClassDescriptor classDesc = DescriptorFactory.createClassDescriptorFromDottedClassName(className);
        return getSubtypes2().isApplicationClass(classDesc);
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.classfile.ClassDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.