File tree Expand file tree Collapse file tree
java/ql/lib/semmle/code/java/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 * may be appended to it, then check `InterestingPrefix.getAnAppendedExpression(Expr)` to get your results.
66 *
77 * For example, to identify expressions that may follow "foo:" in some string, we could define:
8- *
8+ *
99 * ```
10- * private class FooPrefix extends InterestingPrefix {
10+ * private class FooPrefix extends InterestingPrefix {
1111 * 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 }
1414 * };
15- *
15+ *
1616 * predicate mayFollowFoo(Expr e) { e = any(FooPrefix fp).getAnAppendedExpression() }
1717 * ```
1818 *
1919 * This will identify all the `suffix` expressions in contexts such as:
20- *
20+ *
2121 * ```
2222 * "foo:" + suffix1
2323 * "barfoo:" + suffix2
@@ -33,7 +33,7 @@ private import semmle.code.java.StringFormat
3333/**
3434 * A string constant that contains a prefix whose possible successor strings are returned
3535 * by `getAnAppendedExpression`.
36- *
36+ *
3737 * Extend this class to specify prefixes whose successors should be analysed.
3838 */
3939abstract class InterestingPrefix extends CompileTimeConstantExpr {
You can’t perform that action at this time.
0 commit comments