Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9bb949a

Browse files
committed
Java: make some SMAP predicates private and add QLDoc
1 parent c077ca3 commit 9bb949a

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

java/ql/src/semmle/code/Location.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import FileSystem
88
import semmle.code.java.Element
9-
import semmle.code.SMAP
9+
private import semmle.code.SMAP
1010

1111
/** Holds if element `e` has name `name`. */
1212
predicate hasName(Element e, string name) {
@@ -72,7 +72,7 @@ class Top extends @top {
7272
)
7373
}
7474

75-
predicate hasLocationInfoAux(
75+
private predicate hasLocationInfoAux(
7676
string filepath, int startline, int startcolumn, int endline, int endcolumn
7777
) {
7878
exists(File f, Location l | fixedHasLocation(this, l, f) |

java/ql/src/semmle/code/SMAP.qll

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
/**
2+
* Provides classes and predicates for working with SMAP files (see JSR-045).
3+
*/
4+
15
import java
26

3-
predicate smap(File inputFile, int inLine, File outputFile, int outLineStart, int outLineEnd) {
7+
/**
8+
* Holds if there exists a mapping between an SMAP input file and line
9+
* and a corresponding SMAP output file and line range.
10+
*/
11+
private predicate smap(File inputFile, int inLine, File outputFile, int outLineStart, int outLineEnd) {
412
exists(
513
string defaultStratum, int inputFileNum, int inStart, int inCount, int outStart, int outIncr,
614
int n
@@ -15,13 +23,24 @@ predicate smap(File inputFile, int inLine, File outputFile, int outLineStart, in
1523
)
1624
}
1725

18-
predicate smap(File inputFile, int inLine, File outputFile, int outLine) {
26+
/**
27+
* Holds if there exists a mapping between an SMAP input file and line
28+
* and a corresponding SMAP output file and line.
29+
*/
30+
private predicate smap(File inputFile, int inLine, File outputFile, int outLine) {
1931
exists(int outLineStart, int outLineEnd |
2032
smap(inputFile, inLine, outputFile, outLineStart, outLineEnd) and
2133
outLine in [outLineStart .. outLineEnd]
2234
)
2335
}
2436

37+
/**
38+
* Holds if an SMAP input location (with path, line and column information)
39+
* has a corresponding SMAP output location (with path and line information).
40+
*
41+
* For example, an SMAP input location may be a location within a JSP file,
42+
* which may have a corresponding SMAP output location in generated Java code.
43+
*/
2544
predicate hasSmapLocationInfo(
2645
string inputPath, int isl, int isc, int iel, int iec, string outputPath, int osl, int oel
2746
) {

0 commit comments

Comments
 (0)