Skip to content
Discussion options

You must be logged in to vote

I'm sorry for the belated answer. If you are writing a detector, you can get the sourceline data from the instruction, the pc, or the visitor itself. I suggest you to take a look at the usages of the BugInstance.addSourceLine() functions in the SpotBugs code, especially in the detectors which are in the edu.umd.cs.findbugs.detect package.
If you want to refer the entire method, not a specific line, you can use one of the SourceLineAnnotation.forEntireMethod() methods.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by JuditKnoll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2948 on April 15, 2024 12:32.