Package edu.umd.cs.findbugs.ba

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


        return Parser.parse(ClassName.toDottedClassName(substring));
    }

    static boolean containsNullness(Collection<AnnotationValue> annotations, NullnessAnnotation nullness) {
        for (AnnotationValue annotation : annotations) {
            NullnessAnnotation check = Parser.parse(annotation.getAnnotationClass().getDottedClassName());
            if (check == nullness) {
                return true;
            }
        }
        return false;
View Full Code Here


            }
            if (nonNullParameter != null) {
                for(Map.Entry<Integer, NullnessAnnotation> e : nonNullParameter.entrySet()) {
                    int i = e.getKey();
                    if (containsNullness(method.getParameterAnnotations(i), CHECK_FOR_NULL)) {
                        NullnessAnnotation a = e.getValue();
                        BugInstance bug = new BugInstance(CheckRelaxingNullnessAnnotation.this,
                                "NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION", a.equals(NONNULL) ? HIGH_PRIORITY : NORMAL_PRIORITY);
                        bug.addClassAndMethod(xmethod);
                        LocalVariableAnnotation lva = null;
                        if (localVariables != null) {
                            for(LocalVariableNode lvn : localVariables) {
                                if (lvn.index == i+1) {
View Full Code Here

            }
            if (nonNullParameter != null) {
                for(Map.Entry<Integer, NullnessAnnotation> e : nonNullParameter.entrySet()) {
                    int i = e.getKey();
                    if (containsNullness(method.getParameterAnnotations(i), CHECK_FOR_NULL)) {
                        NullnessAnnotation a = e.getValue();
                        BugInstance bug = new BugInstance(CheckRelaxingNullnessAnnotation.this,
                                "NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION", a.equals(NONNULL) ? HIGH_PRIORITY : NORMAL_PRIORITY);
                        bug.addClassAndMethod(xmethod);
                        LocalVariableAnnotation lva = null;
                        if (localVariables != null) {
                            for(LocalVariableNode lvn : localVariables) {
                                if (lvn.index == i+1) {
View Full Code Here

    private boolean isExplicitlyNullable() {
        AnalysisContext analysisContext = AnalysisContext.currentAnalysisContext();
        INullnessAnnotationDatabase nullnessAnnotationDatabase = analysisContext.getNullnessAnnotationDatabase();
        XMethod xMethod = getXMethod();
        NullnessAnnotation na = nullnessAnnotationDatabase.getResolvedAnnotation(xMethod, true);
        return na != null && na != NullnessAnnotation.NONNULL;
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.NullnessAnnotation

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.