mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge pull request #4341 from joefarebrother/location-tostring
Java: Include column numbers in Location.toString
This commit is contained in:
@@ -150,12 +150,18 @@ class Location extends @location {
|
||||
|
||||
/** Gets a string representation containing the file and range for this location. */
|
||||
string toString() {
|
||||
exists(File f, int startLine, int endLine |
|
||||
locations_default(this, f, startLine, _, endLine, _)
|
||||
exists(File f, int startLine, int startCol, int endLine, int endCol |
|
||||
locations_default(this, f, startLine, startCol, endLine, endCol)
|
||||
|
|
||||
if endLine = startLine
|
||||
then result = f.toString() + ":" + startLine.toString()
|
||||
else result = f.toString() + ":" + startLine.toString() + "-" + endLine.toString()
|
||||
then
|
||||
result =
|
||||
f.toString() + ":" + startLine.toString() + "[" + startCol.toString() + "-" +
|
||||
endCol.toString() + "]"
|
||||
else
|
||||
result =
|
||||
f.toString() + ":" + startLine.toString() + "[" + startCol.toString() + "]-" +
|
||||
endLine.toString() + "[" + endCol.toString() + "]"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user