Java: Fix test and some references.

This commit is contained in:
Anders Schack-Mulligen
2021-11-15 16:03:04 +01:00
parent c616f5784d
commit 1cd42ea668
7 changed files with 5 additions and 7 deletions

View File

@@ -262,7 +262,7 @@ class ManagedBeanImplEntryPoint extends EntryPoint, RegisteredManagedBeanImpl {
// Find the method that will be called for each method on each managed bean that this class
// implements.
this.inherits(result) and
result.overrides(this.getAnImplementedManagedBean().getAMethod())
result.overrides+(this.getAnImplementedManagedBean().getAMethod())
}
}

View File

@@ -19,7 +19,7 @@ class Struts1ActionEntryPoint extends EntryPoint, Class {
exists(Method methodFromAction |
methodFromAction.getDeclaringType().hasQualifiedName("org.apache.struts.action", "Action")
|
result.(Method).overrides(methodFromAction)
result.(Method).overrides+(methodFromAction)
)
or
this.getASupertype*().hasQualifiedName("org.apache.struts.actions", "DispatchAction") and

View File

@@ -27,7 +27,7 @@ class ThriftIface extends Interface {
Method getAnImplementingMethod() {
result.getDeclaringType().(Class).getASupertype+() = this and
result.overrides(this.getAMethod()) and
result.overrides+(this.getAMethod()) and
not result.getFile() = this.getFile()
}
}

View File

@@ -572,7 +572,7 @@ class RemoteInterface extends Interface {
* abstract methods or overriding within an interface hierarchy.
*/
Method getARemoteMethodImplementationChecked() {
result.overrides(this.getARemoteMethod()) and
result.overrides+(this.getARemoteMethod()) and
exists(result.getBody())
}

View File

@@ -54,7 +54,6 @@ where
sup.isSynchronized() and
not sub.isSynchronized() and
not delegatingOverride(sub, sup) and
not exists(Method mid | sub.overrides(mid) and mid.overrides(sup)) and
supSrc = sup.getDeclaringType().getSourceDeclaration()
select sub,
"Method '" + sub.getName() + "' overrides a synchronized method in $@ but is not synchronized.",

View File

@@ -45,7 +45,7 @@ where
// which is an access to the object being initialized, ...
ma = unqualifiedCallToNonAbstractMethod(c, m) and
// ... there exists an overriding method in a subtype,
n.overrides(m) and
n.overrides+(m) and
n.getDeclaringType().getASupertype+() = c.getDeclaringType() and
// ... the method is in a supertype of c,
m.getDeclaringType() = c.getDeclaringType().getASupertype*() and

View File

@@ -3,4 +3,3 @@
| ConstructedOverrides.java:17:7:17:9 | Sub | usedGeneric(U, String) | Super.class:0:0:0:0 | Super<String> | usedGeneric(U, String) |
| ConstructedOverrides.java:23:7:23:10 | Sub2 | unusedGeneric(V, String) | Super.class:0:0:0:0 | Super<String> | unusedGeneric(U, String) |
| ConstructedOverrides.java:23:7:23:10 | Sub2 | usedGeneric(V, String) | ConstructedOverrides.java:17:7:17:9 | Sub | usedGeneric(U, String) |
| ConstructedOverrides.java:23:7:23:10 | Sub2 | usedGeneric(V, String) | Super.class:0:0:0:0 | Super<String> | usedGeneric(U, String) |