Examples of XFactory


Examples of edu.umd.cs.findbugs.ba.XFactory

            if (priority <= NORMAL_PRIORITY) {
                // System.out.printf("  adding %d %s%n", priority,
                // MethodAnnotation.fromVisitedMethod(this).getSourceLines());
                doNotIgnore.add(m);
                if (!m.isStatic()) {
                    XFactory xFactory = AnalysisContext.currentXFactory();
                    xFactory.addFunctionThatMightBeMistakenForProcedures(getMethodDescriptor());
                    if (inferredMethod != null) {
                        inferredMethod.setPriority(priority);
                        inferredMethod.addString(String.format("%3d %3d %5d %3d", returnOther, returnSelf, returnNew, updates));
                        bugReporter.reportBug(inferredMethod);
                    }
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XFactory

     */
    private void sawMethodCallWithIgnoredReturnValue() {
        {
            CheckReturnValueAnnotation annotation = checkReturnAnnotationDatabase.getResolvedAnnotation(callSeen, false);
            if (annotation == null) {
                XFactory xFactory = AnalysisContext.currentXFactory();

                if (xFactory.isFunctionshatMightBeMistakenForProcedures(callSeen.getMethodDescriptor())) {
                    annotation = CheckReturnValueAnnotation.CHECK_RETURN_VALUE_INFERRED;
                }
            }
            if (annotation != null && annotation.getPriority() <= LOW_PRIORITY) {
                int popPC = getPC();
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XFactory

                    } catch (ClassNotFoundException e) {
                        priority++;
                        AnalysisContext.reportMissingClass(e);
                    }

                    XFactory xFactory = AnalysisContext.currentXFactory();
                    if (m3 == null && xFactory.isCalled(m)) {
                        propertySet.addProperty(NamingProperty.METHOD_IS_CALLED);
                    } else if (m.isDeprecated() || m2.isDeprecated()) {
                        propertySet.addProperty(NamingProperty.METHOD_IS_DEPRECATED);
                    }
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XFactory

            classesPerPass[0] = referencedClassSet.size();
            for (int i = 0; i < classesPerPass.length; i++) {
                classesPerPass[i] = i == 0 ? referencedClassSet.size() : appClassList.size();
            }
            progress.predictPassCount(classesPerPass);
            XFactory factory = AnalysisContext.currentXFactory();
            Collection<ClassDescriptor> badClasses = new LinkedList<ClassDescriptor>();
            for (ClassDescriptor desc : referencedClassSet) {
                try {
                    XClass info = Global.getAnalysisCache().getClassAnalysis(XClass.class, desc);
                    factory.intern(info);
                } catch (CheckedAnalysisException e) {
                    AnalysisContext.logError("Couldn't get class info for " + desc, e);
                    badClasses.add(desc);
                } catch (RuntimeException e) {
                    AnalysisContext.logError("Couldn't get class info for " + desc, e);
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XFactory

                return;
            }

            JavaClass clazz = getThisClass();
            XMethod xmethod = XFactory.createXMethod(clazz, obj);
            XFactory factory = AnalysisContext.currentXFactory();
            String key = obj.getName() + ":" + obj.getSignature();
            if (!factory.isCalled(xmethod) && (obj.isStatic() || !definedInSuperClassOrInterface(clazz, key))) {
                int priority = NORMAL_PRIORITY;
                JavaClass superClass = clazz.getSuperClass();
                String superClassName = superClass.getClassName();
                if (superClassName.equals("java.lang.Object")) {
                    priority = NORMAL_PRIORITY;
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XFactory

                System.out.println("  " + f);
            }
        }
        Set<XField> declaredFields = new HashSet<XField>();
        AnalysisContext currentAnalysisContext = AnalysisContext.currentAnalysisContext();
        XFactory xFactory = AnalysisContext.currentXFactory();
        for (XField f : AnalysisContext.currentXFactory().allFields()) {
            ClassDescriptor classDescriptor = f.getClassDescriptor();
            if (currentAnalysisContext.isApplicationClass(classDescriptor) && !currentAnalysisContext.isTooBig(classDescriptor)
                    && !xFactory.isReflectiveClass(classDescriptor)) {
                declaredFields.add(f);
            }
        }
        // Don't report anything about ejb3Fields
        HashSet<XField> unknownAnotationAndUnwritten = new HashSet<XField>(data.unknownAnnotation.keySet());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.