Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.BugInstance.addSourceLine()


                    } else {
                        bug = new BugInstance(this, "NP_NULL_ON_SOME_PATH", NORMAL_PRIORITY).addClassAndMethod(this);
                        bug.addOptionalAnnotation(variableAnnotation);
                        for (Location dereferenced : unconditionalDerefLocationSet) {
                            bug.addSourceLine(getClassContext(), getMethod(), dereferenced).describe("SOURCE_LINE_DEREF");
                        }

                        bug.addSourceLine(tested).describe("SOURCE_LINE_KNOWN_NULL");

                    }
View Full Code Here


                        bug.addOptionalAnnotation(variableAnnotation);
                        for (Location dereferenced : unconditionalDerefLocationSet) {
                            bug.addSourceLine(getClassContext(), getMethod(), dereferenced).describe("SOURCE_LINE_DEREF");
                        }

                        bug.addSourceLine(tested).describe("SOURCE_LINE_KNOWN_NULL");

                    }

                    bugReporter.reportBug(bug);
                }
View Full Code Here

                        pendingBugReportAboutOverwrittenParameter.addField(
                                FieldAnnotation.fromBCELField(classContext.getJavaClass(), shadowedField)).describe(
                                        FieldAnnotation.DID_YOU_MEAN_ROLE);
                    }

                    pendingBugReportAboutOverwrittenParameter.addSourceLine(classContext, methodGen, sourceFileName,
                            location.getHandle());
                    complainedAbout.set(local);
                }

                if (storeLive) {
View Full Code Here

            }

            BugInstance bug = new BugInstance(this, bugType, priority).addClass(className).addField(f);
            SourceLineAnnotation firstPC = firstFieldUse.get(f);
            if (firstPC != null) {
                bug.addSourceLine(firstPC);
            }
            bugReporter.reportBug(bug);

        }
    }
View Full Code Here

    // ============================= end of tests =============================

    private void checkSourceLink(String expectedLink, String className, int startLine) {
        BugInstance bug = createBug("ABBREV");
        bug.addSourceLine(new SourceLineAnnotation(className, "SomeClass.java", startLine, startLine, 0, 0));
        URL sourceLink = cloud.getSourceLink(bug);
        if (expectedLink == null) {
            assertNull(sourceLink);
        } else {
            assertNotNull(sourceLink);
View Full Code Here

            BugInstance bug = new BugInstance(this, t, HIGH_PRIORITY).addClassAndMethod(this);
            if (!t.equals("BIT_AND_ZZ")) {
                bug.addString("0x" + Long.toHexString(arg0)).addString("0x" + Long.toHexString(arg1));
            }

            bug.addSourceLine(this);
            bugReporter.reportBug(bug);
        }
        state = 0;
    }
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.