Skip to content

Commit 2d151f7

Browse files
authored
Merge pull request #701 from aschackmull/java/override-annot
Java: Add missing override annotations.
2 parents c0868bc + d3f6362 commit 2d151f7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

java/ql/src/Metrics/Internal/Extents.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import java
1515
* including the body (if any), as opposed to the location of its name only.
1616
*/
1717
class RangeCallable extends Callable {
18-
predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
18+
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
1919
exists(int elSuper, int ecSuper | super.hasLocationInfo(path, sl, sc, elSuper, ecSuper) |
2020
this.getBody().hasLocationInfo(path, _, _, el, ec)
2121
or
@@ -39,7 +39,7 @@ class RangeCallable extends Callable {
3939
* including the range of its members (if any), as opposed to the location of its name only.
4040
*/
4141
class RangeRefType extends RefType {
42-
predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
42+
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
4343
exists(int elSuper, int ecSuper | super.hasLocationInfo(path, sl, sc, elSuper, ecSuper) |
4444
lastMember().hasLocationInfo(path, _, _, el, ec)
4545
or

java/ql/src/external/CodeDuplication.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ class Copy extends @duplication_or_similarity {
5151
}
5252

5353
class DuplicateBlock extends Copy, @duplication {
54-
string toString() { result = "Duplicate code: " + sourceLines() + " duplicated lines." }
54+
override string toString() { result = "Duplicate code: " + sourceLines() + " duplicated lines." }
5555
}
5656

5757
class SimilarBlock extends Copy, @similarity {
58-
string toString() { result = "Similar code: " + sourceLines() + " almost duplicated lines." }
58+
override string toString() {
59+
result = "Similar code: " + sourceLines() + " almost duplicated lines."
60+
}
5961
}
6062

6163
Method sourceMethod() { hasLocation(result, _) and numlines(result, _, _, _) }

0 commit comments

Comments
 (0)