Java: Autoformat most queries.

This commit is contained in:
Anders Schack-Mulligen
2018-10-10 17:49:12 +02:00
parent 85cca69721
commit dd5a8f0c14
443 changed files with 2548 additions and 2043 deletions

View File

@@ -10,12 +10,11 @@
* correctness
* concurrency
*/
import java
class ThreadClass extends Class {
ThreadClass() {
this.hasQualifiedName("java.lang", "Thread")
}
ThreadClass() { this.hasQualifiedName("java.lang", "Thread") }
/**
* Any constructor of `java.lang.Thread` _without_ a parameter of type `Runnable`;
@@ -24,11 +23,13 @@ class ThreadClass extends Class {
Constructor getAConstructorWithoutRunnableParam() {
result = this.getAConstructor() and
(
result.getNumberOfParameters() = 0 or
result.getNumberOfParameters() = 0
or
(
result.getNumberOfParameters() = 1 and
result.getParameter(0).getType().(RefType).hasQualifiedName("java.lang", "String")
) or
)
or
(
result.getNumberOfParameters() = 2 and
result.getParameter(0).getType().(RefType).hasQualifiedName("java.lang", "ThreadGroup") and
@@ -61,4 +62,5 @@ where
) and
not cie.getConstructor().callsConstructor*(thread.getAConstructorWithRunnableParam()) and
cie.getType().(RefType).getSourceDeclaration() = emptythread
select cie, "Thread " + emptythread.getName() + " has a useless empty run() inherited from java.lang.Thread."
select cie,
"Thread " + emptythread.getName() + " has a useless empty run() inherited from java.lang.Thread."