Merge pull request #701 from aschackmull/java/override-annot

Java: Add missing override annotations.
This commit is contained in:
yh-semmle 2019-01-03 13:34:27 -05:00 коммит произвёл GitHub
Родитель c0868bcb9e d3f6362ba2
Коммит 2d151f71cf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -15,7 +15,7 @@ import java
* including the body (if any), as opposed to the location of its name only.
*/
class RangeCallable extends Callable {
predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
exists(int elSuper, int ecSuper | super.hasLocationInfo(path, sl, sc, elSuper, ecSuper) |
this.getBody().hasLocationInfo(path, _, _, el, ec)
or
@ -39,7 +39,7 @@ class RangeCallable extends Callable {
* including the range of its members (if any), as opposed to the location of its name only.
*/
class RangeRefType extends RefType {
predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
exists(int elSuper, int ecSuper | super.hasLocationInfo(path, sl, sc, elSuper, ecSuper) |
lastMember().hasLocationInfo(path, _, _, el, ec)
or

6
java/ql/src/external/CodeDuplication.qll поставляемый
Просмотреть файл

@ -51,11 +51,13 @@ class Copy extends @duplication_or_similarity {
}
class DuplicateBlock extends Copy, @duplication {
string toString() { result = "Duplicate code: " + sourceLines() + " duplicated lines." }
override string toString() { result = "Duplicate code: " + sourceLines() + " duplicated lines." }
}
class SimilarBlock extends Copy, @similarity {
string toString() { result = "Similar code: " + sourceLines() + " almost duplicated lines." }
override string toString() {
result = "Similar code: " + sourceLines() + " almost duplicated lines."
}
}
Method sourceMethod() { hasLocation(result, _) and numlines(result, _, _, _) }