mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Java: remove support for legacy syntax
This commit is contained in:
@@ -52,23 +52,6 @@ class AccessPath extends string instanceof AccessPath::Range {
|
||||
AccessPathToken getLastToken(int n) { result = getToken(getNumToken() - 1 - n) }
|
||||
}
|
||||
|
||||
/**
|
||||
* An access path that uses `A of B` syntax, which should now be written as `B.A`.
|
||||
*
|
||||
* This is a compatibility layer to help test at checkpoints during transition to the new syntax.
|
||||
*/
|
||||
private class LegacyAccessPath extends AccessPath {
|
||||
LegacyAccessPath() { this.matches("% of %") }
|
||||
|
||||
private string getRawSplit(int n) { result = this.splitAt(" of ", n) }
|
||||
|
||||
private int getNumRawSplits() { result = strictcount(int n | exists(getRawSplit(n))) }
|
||||
|
||||
override string getRawToken(int n) { result = getRawSplit(getNumRawSplits() - n - 1) }
|
||||
|
||||
override predicate hasSyntaxError() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* An access part token such as `Argument[1]` or `ReturnValue`, appearing in one or more access paths.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user