File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
java/ql/lib/semmle/code/java/dataflow Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 5
5
* may be appended to it, then check `InterestingPrefix.getAnAppendedExpression(Expr)` to get your results.
6
6
*
7
7
* For example, to identify expressions that may follow "foo:" in some string, we could define:
8
- *
8
+ *
9
9
* ```
10
- * private class FooPrefix extends InterestingPrefix {
10
+ * private class FooPrefix extends InterestingPrefix {
11
11
* int offset;
12
- * FooPrefix() { this.getStringValue().substring("foo:") = offset };
13
- * override int getOffset() { result = offset }
12
+ * FooPrefix() { this.getStringValue().substring("foo:") = offset };
13
+ * override int getOffset() { result = offset }
14
14
* };
15
- *
15
+ *
16
16
* predicate mayFollowFoo(Expr e) { e = any(FooPrefix fp).getAnAppendedExpression() }
17
17
* ```
18
18
*
19
19
* This will identify all the `suffix` expressions in contexts such as:
20
- *
20
+ *
21
21
* ```
22
22
* "foo:" + suffix1
23
23
* "barfoo:" + suffix2
@@ -33,7 +33,7 @@ private import semmle.code.java.StringFormat
33
33
/**
34
34
* A string constant that contains a prefix whose possible successor strings are returned
35
35
* by `getAnAppendedExpression`.
36
- *
36
+ *
37
37
* Extend this class to specify prefixes whose successors should be analysed.
38
38
*/
39
39
abstract class InterestingPrefix extends CompileTimeConstantExpr {
You can’t perform that action at this time.
0 commit comments