mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Merge pull request #6680 from github/igfoo/java_location
Java: Use the standard URL format for Location.toString()
This commit is contained in:
@@ -168,18 +168,10 @@ class Location extends @location {
|
||||
|
||||
/** Gets a string representation containing the file and range for this location. */
|
||||
string toString() {
|
||||
exists(File f, int startLine, int startCol, int endLine, int endCol |
|
||||
locations_default(this, f, startLine, startCol, endLine, endCol)
|
||||
exists(string filepath, int startLine, int startCol, int endLine, int endCol |
|
||||
this.hasLocationInfo(filepath, startLine, startCol, endLine, endCol)
|
||||
|
|
||||
if endLine = startLine
|
||||
then
|
||||
result =
|
||||
f.toString() + ":" + startLine.toString() + "[" + startCol.toString() + "-" +
|
||||
endCol.toString() + "]"
|
||||
else
|
||||
result =
|
||||
f.toString() + ":" + startLine.toString() + "[" + startCol.toString() + "]-" +
|
||||
endLine.toString() + "[" + endCol.toString() + "]"
|
||||
toUrl(filepath, startLine, startCol, endLine, endCol, result)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user