From a375e186eda535d3df4a4370e6cb077b385a8ceb Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 11 Jun 2026 21:53:01 +0200 Subject: [PATCH] Third pass --- .../ConstantExpAppearsNonConstant.qlref | 3 ++- .../AbstractToConcreteCollection.qlref | 3 ++- .../ql/test-kotlin1/query-tests/AutoBoxing/AutoBoxing.qlref | 3 ++- .../test-kotlin1/query-tests/CloseReader/CloseReader.qlref | 3 ++- .../test-kotlin1/query-tests/CloseWriter/CloseWriter.qlref | 3 ++- .../ConfusingOverloading/ConfusingOverloading.qlref | 3 ++- java/ql/test-kotlin1/query-tests/ConstantLoopCondition/A.kt | 6 +++--- .../ConstantLoopCondition/ConstantLoopCondition.qlref | 3 ++- java/ql/test-kotlin1/query-tests/DeadCode/DeadClass.qlref | 3 ++- java/ql/test-kotlin1/query-tests/DeadCode/DeadMethod.qlref | 3 ++- .../query-tests/DeadRefTypes/DeadRefTypes.qlref | 3 ++- java/ql/test-kotlin1/query-tests/DeadRefTypes/test.kt | 2 +- .../ql/test-kotlin1/query-tests/EmptyBlock/EmptyBlock.qlref | 3 ++- .../ExposeRepresentation/ExposeRepresentation.qlref | 3 ++- .../InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref | 3 ++- .../MissingInstanceofInEquals.qlref | 3 ++- .../MissingOverrideAnnotation.qlref | 3 ++- .../query-tests/MutualDependency/MutualDependency.qlref | 3 ++- .../NamingConventionsRefTypes.qlref | 3 ++- .../query-tests/NamingConventionsRefTypes/Test.kt | 2 +- .../NonSerializableField/NonSerializableField.qlref | 3 ++- .../NonSerializableInnerClass.qlref | 3 ++- java/ql/test-kotlin1/query-tests/NullMaybe/NullMaybe.qlref | 3 ++- .../OneStatementPerLine/OneStatementPerLine.qlref | 3 ++- .../PartiallyMaskedCatch/PartiallyMaskedCatch.qlref | 3 ++- .../query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref | 3 ++- .../query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref | 3 ++- .../UnderscoreIdentifier/UnderscoreIdentifier.qlref | 3 ++- .../test-kotlin1/query-tests/UnreadLocal/UnreadLocal.qlref | 3 ++- java/ql/test-kotlin1/query-tests/UnreadLocal/test.kt | 4 ++-- java/ql/test-kotlin1/query-tests/UselessNullCheck/Test.kt | 2 +- .../query-tests/UselessNullCheck/UselessNullCheck.qlref | 3 ++- .../query-tests/UselessParameter/UselessParameter.qlref | 3 ++- .../WhitespaceContradictsPrecedence.qlref | 3 ++- .../AbstractToConcreteCollection.qlref | 3 ++- .../ql/test-kotlin2/query-tests/AutoBoxing/AutoBoxing.qlref | 3 ++- .../test-kotlin2/query-tests/CloseReader/CloseReader.qlref | 3 ++- .../test-kotlin2/query-tests/CloseWriter/CloseWriter.qlref | 3 ++- .../ConfusingOverloading/ConfusingOverloading.qlref | 3 ++- java/ql/test-kotlin2/query-tests/ConstantLoopCondition/A.kt | 6 +++--- .../ConstantLoopCondition/ConstantLoopCondition.qlref | 3 ++- java/ql/test-kotlin2/query-tests/DeadCode/DeadClass.qlref | 3 ++- java/ql/test-kotlin2/query-tests/DeadCode/DeadMethod.qlref | 3 ++- .../query-tests/DeadRefTypes/DeadRefTypes.qlref | 3 ++- java/ql/test-kotlin2/query-tests/DeadRefTypes/test.kt | 2 +- .../ql/test-kotlin2/query-tests/EmptyBlock/EmptyBlock.qlref | 3 ++- .../ExposeRepresentation/ExposeRepresentation.qlref | 3 ++- .../InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref | 3 ++- .../MissingInstanceofInEquals.qlref | 3 ++- .../MissingOverrideAnnotation.qlref | 3 ++- .../query-tests/MutualDependency/MutualDependency.qlref | 3 ++- .../NamingConventionsRefTypes.qlref | 3 ++- .../query-tests/NamingConventionsRefTypes/Test.kt | 2 +- .../NonSerializableField/NonSerializableField.qlref | 3 ++- .../NonSerializableInnerClass.qlref | 3 ++- java/ql/test-kotlin2/query-tests/NullMaybe/NullMaybe.qlref | 3 ++- .../OneStatementPerLine/OneStatementPerLine.qlref | 3 ++- .../PartiallyMaskedCatch/PartiallyMaskedCatch.qlref | 3 ++- .../query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref | 3 ++- .../query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref | 3 ++- .../UnderscoreIdentifier/UnderscoreIdentifier.qlref | 3 ++- .../test-kotlin2/query-tests/UnreadLocal/UnreadLocal.qlref | 3 ++- java/ql/test-kotlin2/query-tests/UnreadLocal/test.kt | 4 ++-- java/ql/test-kotlin2/query-tests/UselessNullCheck/Test.kt | 2 +- .../query-tests/UselessNullCheck/UselessNullCheck.qlref | 3 ++- .../query-tests/UselessParameter/UselessParameter.qlref | 3 ++- .../WhitespaceContradictsPrecedence.qlref | 3 ++- 67 files changed, 130 insertions(+), 73 deletions(-) diff --git a/java/ql/integration-tests/kotlin/all-platforms/gradle_kotlinx_serialization/ConstantExpAppearsNonConstant.qlref b/java/ql/integration-tests/kotlin/all-platforms/gradle_kotlinx_serialization/ConstantExpAppearsNonConstant.qlref index 6d7e1f5cb7f..924600d5a4d 100644 --- a/java/ql/integration-tests/kotlin/all-platforms/gradle_kotlinx_serialization/ConstantExpAppearsNonConstant.qlref +++ b/java/ql/integration-tests/kotlin/all-platforms/gradle_kotlinx_serialization/ConstantExpAppearsNonConstant.qlref @@ -1 +1,2 @@ -Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql \ No newline at end of file +query: Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/AbstractToConcreteCollection/AbstractToConcreteCollection.qlref b/java/ql/test-kotlin1/query-tests/AbstractToConcreteCollection/AbstractToConcreteCollection.qlref index ddc5d95d9d1..d7ef72c65e3 100644 --- a/java/ql/test-kotlin1/query-tests/AbstractToConcreteCollection/AbstractToConcreteCollection.qlref +++ b/java/ql/test-kotlin1/query-tests/AbstractToConcreteCollection/AbstractToConcreteCollection.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql \ No newline at end of file +query: Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/AutoBoxing/AutoBoxing.qlref b/java/ql/test-kotlin1/query-tests/AutoBoxing/AutoBoxing.qlref index f116f3bd8b4..dc47875616d 100644 --- a/java/ql/test-kotlin1/query-tests/AutoBoxing/AutoBoxing.qlref +++ b/java/ql/test-kotlin1/query-tests/AutoBoxing/AutoBoxing.qlref @@ -1 +1,2 @@ -Violations of Best Practice/legacy/AutoBoxing.ql +query: Violations of Best Practice/legacy/AutoBoxing.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/CloseReader/CloseReader.qlref b/java/ql/test-kotlin1/query-tests/CloseReader/CloseReader.qlref index 1c808bb9f46..9fae04fe76d 100644 --- a/java/ql/test-kotlin1/query-tests/CloseReader/CloseReader.qlref +++ b/java/ql/test-kotlin1/query-tests/CloseReader/CloseReader.qlref @@ -1 +1,2 @@ -Likely Bugs/Resource Leaks/CloseReader.ql +query: Likely Bugs/Resource Leaks/CloseReader.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/CloseWriter/CloseWriter.qlref b/java/ql/test-kotlin1/query-tests/CloseWriter/CloseWriter.qlref index 88008367363..d81d6020dae 100644 --- a/java/ql/test-kotlin1/query-tests/CloseWriter/CloseWriter.qlref +++ b/java/ql/test-kotlin1/query-tests/CloseWriter/CloseWriter.qlref @@ -1 +1,2 @@ -Likely Bugs/Resource Leaks/CloseWriter.ql +query: Likely Bugs/Resource Leaks/CloseWriter.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/ConfusingOverloading/ConfusingOverloading.qlref b/java/ql/test-kotlin1/query-tests/ConfusingOverloading/ConfusingOverloading.qlref index 4fc71295c2c..e74bc1b00aa 100644 --- a/java/ql/test-kotlin1/query-tests/ConfusingOverloading/ConfusingOverloading.qlref +++ b/java/ql/test-kotlin1/query-tests/ConfusingOverloading/ConfusingOverloading.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql \ No newline at end of file +query: Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/ConstantLoopCondition/A.kt b/java/ql/test-kotlin1/query-tests/ConstantLoopCondition/A.kt index 8c111c58fe7..b04d3135e8f 100644 --- a/java/ql/test-kotlin1/query-tests/ConstantLoopCondition/A.kt +++ b/java/ql/test-kotlin1/query-tests/ConstantLoopCondition/A.kt @@ -2,21 +2,21 @@ fun fn0(f: Function0) = f() fun fn1() { var c = true - while (c) { // TODO: false positive + while (c) { // $ SPURIOUS: Alert // TODO: false positive fn0 { c = false } } var d = true - while (d) { + while (d) { // $ Alert fn0 { println(d) } } val e = true - while (e) { + while (e) { // $ Alert fn0 { println(e) } diff --git a/java/ql/test-kotlin1/query-tests/ConstantLoopCondition/ConstantLoopCondition.qlref b/java/ql/test-kotlin1/query-tests/ConstantLoopCondition/ConstantLoopCondition.qlref index 37e6a9b72fe..f7081322f7d 100644 --- a/java/ql/test-kotlin1/query-tests/ConstantLoopCondition/ConstantLoopCondition.qlref +++ b/java/ql/test-kotlin1/query-tests/ConstantLoopCondition/ConstantLoopCondition.qlref @@ -1 +1,2 @@ -Likely Bugs/Termination/ConstantLoopCondition.ql +query: Likely Bugs/Termination/ConstantLoopCondition.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/DeadCode/DeadClass.qlref b/java/ql/test-kotlin1/query-tests/DeadCode/DeadClass.qlref index d726e7e0849..b94832ebfca 100644 --- a/java/ql/test-kotlin1/query-tests/DeadCode/DeadClass.qlref +++ b/java/ql/test-kotlin1/query-tests/DeadCode/DeadClass.qlref @@ -1 +1,2 @@ -DeadCode/DeadClass.ql +query: DeadCode/DeadClass.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/DeadCode/DeadMethod.qlref b/java/ql/test-kotlin1/query-tests/DeadCode/DeadMethod.qlref index 76204a1df5a..743a5f15775 100644 --- a/java/ql/test-kotlin1/query-tests/DeadCode/DeadMethod.qlref +++ b/java/ql/test-kotlin1/query-tests/DeadCode/DeadMethod.qlref @@ -1 +1,2 @@ -DeadCode/DeadMethod.ql +query: DeadCode/DeadMethod.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/DeadRefTypes/DeadRefTypes.qlref b/java/ql/test-kotlin1/query-tests/DeadRefTypes/DeadRefTypes.qlref index 2b925a78cbb..e8f47f2d682 100644 --- a/java/ql/test-kotlin1/query-tests/DeadRefTypes/DeadRefTypes.qlref +++ b/java/ql/test-kotlin1/query-tests/DeadRefTypes/DeadRefTypes.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Dead Code/DeadRefTypes.ql \ No newline at end of file +query: Violations of Best Practice/Dead Code/DeadRefTypes.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/DeadRefTypes/test.kt b/java/ql/test-kotlin1/query-tests/DeadRefTypes/test.kt index 6a38aa0f748..c65e8ab0d58 100644 --- a/java/ql/test-kotlin1/query-tests/DeadRefTypes/test.kt +++ b/java/ql/test-kotlin1/query-tests/DeadRefTypes/test.kt @@ -1,4 +1,4 @@ -private class C1 { } +private class C1 { } // $ Alert private class C2 { } diff --git a/java/ql/test-kotlin1/query-tests/EmptyBlock/EmptyBlock.qlref b/java/ql/test-kotlin1/query-tests/EmptyBlock/EmptyBlock.qlref index b0a56e88aa4..5fe264815b8 100644 --- a/java/ql/test-kotlin1/query-tests/EmptyBlock/EmptyBlock.qlref +++ b/java/ql/test-kotlin1/query-tests/EmptyBlock/EmptyBlock.qlref @@ -1 +1,2 @@ -Likely Bugs/Statements/EmptyBlock.ql \ No newline at end of file +query: Likely Bugs/Statements/EmptyBlock.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/ExposeRepresentation/ExposeRepresentation.qlref b/java/ql/test-kotlin1/query-tests/ExposeRepresentation/ExposeRepresentation.qlref index 6452bb942d2..e47d860dcc2 100644 --- a/java/ql/test-kotlin1/query-tests/ExposeRepresentation/ExposeRepresentation.qlref +++ b/java/ql/test-kotlin1/query-tests/ExposeRepresentation/ExposeRepresentation.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql +query: Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref b/java/ql/test-kotlin1/query-tests/InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref index 3d3b5444609..68cb3e6761e 100644 --- a/java/ql/test-kotlin1/query-tests/InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref +++ b/java/ql/test-kotlin1/query-tests/InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref @@ -1 +1,2 @@ -Performance/InnerClassCouldBeStatic.ql \ No newline at end of file +query: Performance/InnerClassCouldBeStatic.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/MissingInstanceofInEquals/MissingInstanceofInEquals.qlref b/java/ql/test-kotlin1/query-tests/MissingInstanceofInEquals/MissingInstanceofInEquals.qlref index 40038cf027a..d1a5c7d8130 100644 --- a/java/ql/test-kotlin1/query-tests/MissingInstanceofInEquals/MissingInstanceofInEquals.qlref +++ b/java/ql/test-kotlin1/query-tests/MissingInstanceofInEquals/MissingInstanceofInEquals.qlref @@ -1 +1,2 @@ -Likely Bugs/Comparison/MissingInstanceofInEquals.ql \ No newline at end of file +query: Likely Bugs/Comparison/MissingInstanceofInEquals.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/MissingOverrideAnnotation/MissingOverrideAnnotation.qlref b/java/ql/test-kotlin1/query-tests/MissingOverrideAnnotation/MissingOverrideAnnotation.qlref index c74780e7d24..885c1312f9e 100644 --- a/java/ql/test-kotlin1/query-tests/MissingOverrideAnnotation/MissingOverrideAnnotation.qlref +++ b/java/ql/test-kotlin1/query-tests/MissingOverrideAnnotation/MissingOverrideAnnotation.qlref @@ -1 +1,2 @@ -Advisory/Declarations/MissingOverrideAnnotation.ql \ No newline at end of file +query: Advisory/Declarations/MissingOverrideAnnotation.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/MutualDependency/MutualDependency.qlref b/java/ql/test-kotlin1/query-tests/MutualDependency/MutualDependency.qlref index ab1dbe353ef..273ed4d757a 100644 --- a/java/ql/test-kotlin1/query-tests/MutualDependency/MutualDependency.qlref +++ b/java/ql/test-kotlin1/query-tests/MutualDependency/MutualDependency.qlref @@ -1 +1,2 @@ -Architecture/Dependencies/MutualDependency.ql \ No newline at end of file +query: Architecture/Dependencies/MutualDependency.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.qlref b/java/ql/test-kotlin1/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.qlref index 6f76aed32cb..52bea60e468 100644 --- a/java/ql/test-kotlin1/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.qlref +++ b/java/ql/test-kotlin1/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.qlref @@ -1 +1,2 @@ -Advisory/Naming/NamingConventionsRefTypes.ql \ No newline at end of file +query: Advisory/Naming/NamingConventionsRefTypes.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/NamingConventionsRefTypes/Test.kt b/java/ql/test-kotlin1/query-tests/NamingConventionsRefTypes/Test.kt index f62497d59c6..1374f616316 100644 --- a/java/ql/test-kotlin1/query-tests/NamingConventionsRefTypes/Test.kt +++ b/java/ql/test-kotlin1/query-tests/NamingConventionsRefTypes/Test.kt @@ -9,4 +9,4 @@ class Foo { } } -class aaaa {} \ No newline at end of file +class aaaa {} // $ Alert diff --git a/java/ql/test-kotlin1/query-tests/NonSerializableField/NonSerializableField.qlref b/java/ql/test-kotlin1/query-tests/NonSerializableField/NonSerializableField.qlref index 401d63757af..1b3b59559be 100644 --- a/java/ql/test-kotlin1/query-tests/NonSerializableField/NonSerializableField.qlref +++ b/java/ql/test-kotlin1/query-tests/NonSerializableField/NonSerializableField.qlref @@ -1 +1,2 @@ -Likely Bugs/Serialization/NonSerializableField.ql +query: Likely Bugs/Serialization/NonSerializableField.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/NonSerializableInnerClass/NonSerializableInnerClass.qlref b/java/ql/test-kotlin1/query-tests/NonSerializableInnerClass/NonSerializableInnerClass.qlref index 4cbb0995764..0ce5b0819e9 100644 --- a/java/ql/test-kotlin1/query-tests/NonSerializableInnerClass/NonSerializableInnerClass.qlref +++ b/java/ql/test-kotlin1/query-tests/NonSerializableInnerClass/NonSerializableInnerClass.qlref @@ -1 +1,2 @@ -Likely Bugs/Serialization/NonSerializableInnerClass.ql +query: Likely Bugs/Serialization/NonSerializableInnerClass.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/NullMaybe/NullMaybe.qlref b/java/ql/test-kotlin1/query-tests/NullMaybe/NullMaybe.qlref index ab01473d8e5..19125c7bc59 100644 --- a/java/ql/test-kotlin1/query-tests/NullMaybe/NullMaybe.qlref +++ b/java/ql/test-kotlin1/query-tests/NullMaybe/NullMaybe.qlref @@ -1 +1,2 @@ -Likely Bugs/Nullness/NullMaybe.ql +query: Likely Bugs/Nullness/NullMaybe.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/OneStatementPerLine/OneStatementPerLine.qlref b/java/ql/test-kotlin1/query-tests/OneStatementPerLine/OneStatementPerLine.qlref index 99f3f3f3293..dbe810b5208 100644 --- a/java/ql/test-kotlin1/query-tests/OneStatementPerLine/OneStatementPerLine.qlref +++ b/java/ql/test-kotlin1/query-tests/OneStatementPerLine/OneStatementPerLine.qlref @@ -1 +1,2 @@ -Advisory/Statements/OneStatementPerLine.ql \ No newline at end of file +query: Advisory/Statements/OneStatementPerLine.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/PartiallyMaskedCatch/PartiallyMaskedCatch.qlref b/java/ql/test-kotlin1/query-tests/PartiallyMaskedCatch/PartiallyMaskedCatch.qlref index c2db43d8953..a129d30287b 100644 --- a/java/ql/test-kotlin1/query-tests/PartiallyMaskedCatch/PartiallyMaskedCatch.qlref +++ b/java/ql/test-kotlin1/query-tests/PartiallyMaskedCatch/PartiallyMaskedCatch.qlref @@ -1 +1,2 @@ -Likely Bugs/Statements/PartiallyMaskedCatch.ql \ No newline at end of file +query: Likely Bugs/Statements/PartiallyMaskedCatch.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref b/java/ql/test-kotlin1/query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref index ef1dc964d95..ab13392ec55 100644 --- a/java/ql/test-kotlin1/query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref +++ b/java/ql/test-kotlin1/query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref @@ -1 +1,2 @@ -Likely Bugs/Statements/ReturnValueIgnored.ql \ No newline at end of file +query: Likely Bugs/Statements/ReturnValueIgnored.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref b/java/ql/test-kotlin1/query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref index d071e989ebb..45d0db5559c 100644 --- a/java/ql/test-kotlin1/query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref +++ b/java/ql/test-kotlin1/query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql +query: Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/UnderscoreIdentifier/UnderscoreIdentifier.qlref b/java/ql/test-kotlin1/query-tests/UnderscoreIdentifier/UnderscoreIdentifier.qlref index dbed8c6f411..7aa4b4176e3 100644 --- a/java/ql/test-kotlin1/query-tests/UnderscoreIdentifier/UnderscoreIdentifier.qlref +++ b/java/ql/test-kotlin1/query-tests/UnderscoreIdentifier/UnderscoreIdentifier.qlref @@ -1 +1,2 @@ -Compatibility/JDK9/UnderscoreIdentifier.ql \ No newline at end of file +query: Compatibility/JDK9/UnderscoreIdentifier.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/UnreadLocal/UnreadLocal.qlref b/java/ql/test-kotlin1/query-tests/UnreadLocal/UnreadLocal.qlref index 5a77117711e..dc6fb57ca6a 100644 --- a/java/ql/test-kotlin1/query-tests/UnreadLocal/UnreadLocal.qlref +++ b/java/ql/test-kotlin1/query-tests/UnreadLocal/UnreadLocal.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Dead Code/UnreadLocal.ql +query: Violations of Best Practice/Dead Code/UnreadLocal.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/UnreadLocal/test.kt b/java/ql/test-kotlin1/query-tests/UnreadLocal/test.kt index e1663d7c116..a7537d128d8 100644 --- a/java/ql/test-kotlin1/query-tests/UnreadLocal/test.kt +++ b/java/ql/test-kotlin1/query-tests/UnreadLocal/test.kt @@ -5,13 +5,13 @@ fun fn0(size: Int) { } fun fn1(a: Array) { - for (e in a) { + for (e in a) { // $ Alert println() } } fun fn2(a: Array) { - for ((idx, e) in a.withIndex()) { + for ((idx, e) in a.withIndex()) { // $ Alert println() } } diff --git a/java/ql/test-kotlin1/query-tests/UselessNullCheck/Test.kt b/java/ql/test-kotlin1/query-tests/UselessNullCheck/Test.kt index 138309dc9de..365eb5083a2 100644 --- a/java/ql/test-kotlin1/query-tests/UselessNullCheck/Test.kt +++ b/java/ql/test-kotlin1/query-tests/UselessNullCheck/Test.kt @@ -13,6 +13,6 @@ fun fn(x:Any?, y: Any?) { fun fn0(o: Any?) { if (o != null) { o?.toString() - o.toString() + o.toString() // $ Alert } } diff --git a/java/ql/test-kotlin1/query-tests/UselessNullCheck/UselessNullCheck.qlref b/java/ql/test-kotlin1/query-tests/UselessNullCheck/UselessNullCheck.qlref index 8b5a095d396..68c4adcf428 100644 --- a/java/ql/test-kotlin1/query-tests/UselessNullCheck/UselessNullCheck.qlref +++ b/java/ql/test-kotlin1/query-tests/UselessNullCheck/UselessNullCheck.qlref @@ -1 +1,2 @@ -Language Abuse/UselessNullCheck.ql +query: Language Abuse/UselessNullCheck.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/UselessParameter/UselessParameter.qlref b/java/ql/test-kotlin1/query-tests/UselessParameter/UselessParameter.qlref index b1ceb2751a6..7de29d4e3f4 100644 --- a/java/ql/test-kotlin1/query-tests/UselessParameter/UselessParameter.qlref +++ b/java/ql/test-kotlin1/query-tests/UselessParameter/UselessParameter.qlref @@ -1 +1,2 @@ -DeadCode/UselessParameter.ql \ No newline at end of file +query: DeadCode/UselessParameter.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin1/query-tests/WhitespaceContradictsPrecedence/WhitespaceContradictsPrecedence.qlref b/java/ql/test-kotlin1/query-tests/WhitespaceContradictsPrecedence/WhitespaceContradictsPrecedence.qlref index e8331b4132f..470fdcfe273 100644 --- a/java/ql/test-kotlin1/query-tests/WhitespaceContradictsPrecedence/WhitespaceContradictsPrecedence.qlref +++ b/java/ql/test-kotlin1/query-tests/WhitespaceContradictsPrecedence/WhitespaceContradictsPrecedence.qlref @@ -1 +1,2 @@ -Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql \ No newline at end of file +query: Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/AbstractToConcreteCollection/AbstractToConcreteCollection.qlref b/java/ql/test-kotlin2/query-tests/AbstractToConcreteCollection/AbstractToConcreteCollection.qlref index ddc5d95d9d1..d7ef72c65e3 100644 --- a/java/ql/test-kotlin2/query-tests/AbstractToConcreteCollection/AbstractToConcreteCollection.qlref +++ b/java/ql/test-kotlin2/query-tests/AbstractToConcreteCollection/AbstractToConcreteCollection.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql \ No newline at end of file +query: Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/AutoBoxing/AutoBoxing.qlref b/java/ql/test-kotlin2/query-tests/AutoBoxing/AutoBoxing.qlref index f116f3bd8b4..dc47875616d 100644 --- a/java/ql/test-kotlin2/query-tests/AutoBoxing/AutoBoxing.qlref +++ b/java/ql/test-kotlin2/query-tests/AutoBoxing/AutoBoxing.qlref @@ -1 +1,2 @@ -Violations of Best Practice/legacy/AutoBoxing.ql +query: Violations of Best Practice/legacy/AutoBoxing.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/CloseReader/CloseReader.qlref b/java/ql/test-kotlin2/query-tests/CloseReader/CloseReader.qlref index 1c808bb9f46..9fae04fe76d 100644 --- a/java/ql/test-kotlin2/query-tests/CloseReader/CloseReader.qlref +++ b/java/ql/test-kotlin2/query-tests/CloseReader/CloseReader.qlref @@ -1 +1,2 @@ -Likely Bugs/Resource Leaks/CloseReader.ql +query: Likely Bugs/Resource Leaks/CloseReader.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/CloseWriter/CloseWriter.qlref b/java/ql/test-kotlin2/query-tests/CloseWriter/CloseWriter.qlref index 88008367363..d81d6020dae 100644 --- a/java/ql/test-kotlin2/query-tests/CloseWriter/CloseWriter.qlref +++ b/java/ql/test-kotlin2/query-tests/CloseWriter/CloseWriter.qlref @@ -1 +1,2 @@ -Likely Bugs/Resource Leaks/CloseWriter.ql +query: Likely Bugs/Resource Leaks/CloseWriter.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/ConfusingOverloading/ConfusingOverloading.qlref b/java/ql/test-kotlin2/query-tests/ConfusingOverloading/ConfusingOverloading.qlref index 4fc71295c2c..e74bc1b00aa 100644 --- a/java/ql/test-kotlin2/query-tests/ConfusingOverloading/ConfusingOverloading.qlref +++ b/java/ql/test-kotlin2/query-tests/ConfusingOverloading/ConfusingOverloading.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql \ No newline at end of file +query: Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/ConstantLoopCondition/A.kt b/java/ql/test-kotlin2/query-tests/ConstantLoopCondition/A.kt index 8c111c58fe7..b04d3135e8f 100644 --- a/java/ql/test-kotlin2/query-tests/ConstantLoopCondition/A.kt +++ b/java/ql/test-kotlin2/query-tests/ConstantLoopCondition/A.kt @@ -2,21 +2,21 @@ fun fn0(f: Function0) = f() fun fn1() { var c = true - while (c) { // TODO: false positive + while (c) { // $ SPURIOUS: Alert // TODO: false positive fn0 { c = false } } var d = true - while (d) { + while (d) { // $ Alert fn0 { println(d) } } val e = true - while (e) { + while (e) { // $ Alert fn0 { println(e) } diff --git a/java/ql/test-kotlin2/query-tests/ConstantLoopCondition/ConstantLoopCondition.qlref b/java/ql/test-kotlin2/query-tests/ConstantLoopCondition/ConstantLoopCondition.qlref index 37e6a9b72fe..f7081322f7d 100644 --- a/java/ql/test-kotlin2/query-tests/ConstantLoopCondition/ConstantLoopCondition.qlref +++ b/java/ql/test-kotlin2/query-tests/ConstantLoopCondition/ConstantLoopCondition.qlref @@ -1 +1,2 @@ -Likely Bugs/Termination/ConstantLoopCondition.ql +query: Likely Bugs/Termination/ConstantLoopCondition.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/DeadCode/DeadClass.qlref b/java/ql/test-kotlin2/query-tests/DeadCode/DeadClass.qlref index d726e7e0849..b94832ebfca 100644 --- a/java/ql/test-kotlin2/query-tests/DeadCode/DeadClass.qlref +++ b/java/ql/test-kotlin2/query-tests/DeadCode/DeadClass.qlref @@ -1 +1,2 @@ -DeadCode/DeadClass.ql +query: DeadCode/DeadClass.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/DeadCode/DeadMethod.qlref b/java/ql/test-kotlin2/query-tests/DeadCode/DeadMethod.qlref index 76204a1df5a..743a5f15775 100644 --- a/java/ql/test-kotlin2/query-tests/DeadCode/DeadMethod.qlref +++ b/java/ql/test-kotlin2/query-tests/DeadCode/DeadMethod.qlref @@ -1 +1,2 @@ -DeadCode/DeadMethod.ql +query: DeadCode/DeadMethod.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/DeadRefTypes/DeadRefTypes.qlref b/java/ql/test-kotlin2/query-tests/DeadRefTypes/DeadRefTypes.qlref index 2b925a78cbb..e8f47f2d682 100644 --- a/java/ql/test-kotlin2/query-tests/DeadRefTypes/DeadRefTypes.qlref +++ b/java/ql/test-kotlin2/query-tests/DeadRefTypes/DeadRefTypes.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Dead Code/DeadRefTypes.ql \ No newline at end of file +query: Violations of Best Practice/Dead Code/DeadRefTypes.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/DeadRefTypes/test.kt b/java/ql/test-kotlin2/query-tests/DeadRefTypes/test.kt index 6a38aa0f748..c65e8ab0d58 100644 --- a/java/ql/test-kotlin2/query-tests/DeadRefTypes/test.kt +++ b/java/ql/test-kotlin2/query-tests/DeadRefTypes/test.kt @@ -1,4 +1,4 @@ -private class C1 { } +private class C1 { } // $ Alert private class C2 { } diff --git a/java/ql/test-kotlin2/query-tests/EmptyBlock/EmptyBlock.qlref b/java/ql/test-kotlin2/query-tests/EmptyBlock/EmptyBlock.qlref index b0a56e88aa4..5fe264815b8 100644 --- a/java/ql/test-kotlin2/query-tests/EmptyBlock/EmptyBlock.qlref +++ b/java/ql/test-kotlin2/query-tests/EmptyBlock/EmptyBlock.qlref @@ -1 +1,2 @@ -Likely Bugs/Statements/EmptyBlock.ql \ No newline at end of file +query: Likely Bugs/Statements/EmptyBlock.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/ExposeRepresentation/ExposeRepresentation.qlref b/java/ql/test-kotlin2/query-tests/ExposeRepresentation/ExposeRepresentation.qlref index 6452bb942d2..e47d860dcc2 100644 --- a/java/ql/test-kotlin2/query-tests/ExposeRepresentation/ExposeRepresentation.qlref +++ b/java/ql/test-kotlin2/query-tests/ExposeRepresentation/ExposeRepresentation.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql +query: Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref b/java/ql/test-kotlin2/query-tests/InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref index 3d3b5444609..68cb3e6761e 100644 --- a/java/ql/test-kotlin2/query-tests/InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref +++ b/java/ql/test-kotlin2/query-tests/InnerClassCouldBeStatic/InnerClassCouldBeStatic.qlref @@ -1 +1,2 @@ -Performance/InnerClassCouldBeStatic.ql \ No newline at end of file +query: Performance/InnerClassCouldBeStatic.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/MissingInstanceofInEquals/MissingInstanceofInEquals.qlref b/java/ql/test-kotlin2/query-tests/MissingInstanceofInEquals/MissingInstanceofInEquals.qlref index 40038cf027a..d1a5c7d8130 100644 --- a/java/ql/test-kotlin2/query-tests/MissingInstanceofInEquals/MissingInstanceofInEquals.qlref +++ b/java/ql/test-kotlin2/query-tests/MissingInstanceofInEquals/MissingInstanceofInEquals.qlref @@ -1 +1,2 @@ -Likely Bugs/Comparison/MissingInstanceofInEquals.ql \ No newline at end of file +query: Likely Bugs/Comparison/MissingInstanceofInEquals.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/MissingOverrideAnnotation/MissingOverrideAnnotation.qlref b/java/ql/test-kotlin2/query-tests/MissingOverrideAnnotation/MissingOverrideAnnotation.qlref index c74780e7d24..885c1312f9e 100644 --- a/java/ql/test-kotlin2/query-tests/MissingOverrideAnnotation/MissingOverrideAnnotation.qlref +++ b/java/ql/test-kotlin2/query-tests/MissingOverrideAnnotation/MissingOverrideAnnotation.qlref @@ -1 +1,2 @@ -Advisory/Declarations/MissingOverrideAnnotation.ql \ No newline at end of file +query: Advisory/Declarations/MissingOverrideAnnotation.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/MutualDependency/MutualDependency.qlref b/java/ql/test-kotlin2/query-tests/MutualDependency/MutualDependency.qlref index ab1dbe353ef..273ed4d757a 100644 --- a/java/ql/test-kotlin2/query-tests/MutualDependency/MutualDependency.qlref +++ b/java/ql/test-kotlin2/query-tests/MutualDependency/MutualDependency.qlref @@ -1 +1,2 @@ -Architecture/Dependencies/MutualDependency.ql \ No newline at end of file +query: Architecture/Dependencies/MutualDependency.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.qlref b/java/ql/test-kotlin2/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.qlref index 6f76aed32cb..52bea60e468 100644 --- a/java/ql/test-kotlin2/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.qlref +++ b/java/ql/test-kotlin2/query-tests/NamingConventionsRefTypes/NamingConventionsRefTypes.qlref @@ -1 +1,2 @@ -Advisory/Naming/NamingConventionsRefTypes.ql \ No newline at end of file +query: Advisory/Naming/NamingConventionsRefTypes.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/NamingConventionsRefTypes/Test.kt b/java/ql/test-kotlin2/query-tests/NamingConventionsRefTypes/Test.kt index f62497d59c6..1374f616316 100644 --- a/java/ql/test-kotlin2/query-tests/NamingConventionsRefTypes/Test.kt +++ b/java/ql/test-kotlin2/query-tests/NamingConventionsRefTypes/Test.kt @@ -9,4 +9,4 @@ class Foo { } } -class aaaa {} \ No newline at end of file +class aaaa {} // $ Alert diff --git a/java/ql/test-kotlin2/query-tests/NonSerializableField/NonSerializableField.qlref b/java/ql/test-kotlin2/query-tests/NonSerializableField/NonSerializableField.qlref index 401d63757af..1b3b59559be 100644 --- a/java/ql/test-kotlin2/query-tests/NonSerializableField/NonSerializableField.qlref +++ b/java/ql/test-kotlin2/query-tests/NonSerializableField/NonSerializableField.qlref @@ -1 +1,2 @@ -Likely Bugs/Serialization/NonSerializableField.ql +query: Likely Bugs/Serialization/NonSerializableField.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/NonSerializableInnerClass/NonSerializableInnerClass.qlref b/java/ql/test-kotlin2/query-tests/NonSerializableInnerClass/NonSerializableInnerClass.qlref index 4cbb0995764..0ce5b0819e9 100644 --- a/java/ql/test-kotlin2/query-tests/NonSerializableInnerClass/NonSerializableInnerClass.qlref +++ b/java/ql/test-kotlin2/query-tests/NonSerializableInnerClass/NonSerializableInnerClass.qlref @@ -1 +1,2 @@ -Likely Bugs/Serialization/NonSerializableInnerClass.ql +query: Likely Bugs/Serialization/NonSerializableInnerClass.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/NullMaybe/NullMaybe.qlref b/java/ql/test-kotlin2/query-tests/NullMaybe/NullMaybe.qlref index ab01473d8e5..19125c7bc59 100644 --- a/java/ql/test-kotlin2/query-tests/NullMaybe/NullMaybe.qlref +++ b/java/ql/test-kotlin2/query-tests/NullMaybe/NullMaybe.qlref @@ -1 +1,2 @@ -Likely Bugs/Nullness/NullMaybe.ql +query: Likely Bugs/Nullness/NullMaybe.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/OneStatementPerLine/OneStatementPerLine.qlref b/java/ql/test-kotlin2/query-tests/OneStatementPerLine/OneStatementPerLine.qlref index 99f3f3f3293..dbe810b5208 100644 --- a/java/ql/test-kotlin2/query-tests/OneStatementPerLine/OneStatementPerLine.qlref +++ b/java/ql/test-kotlin2/query-tests/OneStatementPerLine/OneStatementPerLine.qlref @@ -1 +1,2 @@ -Advisory/Statements/OneStatementPerLine.ql \ No newline at end of file +query: Advisory/Statements/OneStatementPerLine.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/PartiallyMaskedCatch/PartiallyMaskedCatch.qlref b/java/ql/test-kotlin2/query-tests/PartiallyMaskedCatch/PartiallyMaskedCatch.qlref index c2db43d8953..a129d30287b 100644 --- a/java/ql/test-kotlin2/query-tests/PartiallyMaskedCatch/PartiallyMaskedCatch.qlref +++ b/java/ql/test-kotlin2/query-tests/PartiallyMaskedCatch/PartiallyMaskedCatch.qlref @@ -1 +1,2 @@ -Likely Bugs/Statements/PartiallyMaskedCatch.ql \ No newline at end of file +query: Likely Bugs/Statements/PartiallyMaskedCatch.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref b/java/ql/test-kotlin2/query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref index ef1dc964d95..ab13392ec55 100644 --- a/java/ql/test-kotlin2/query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref +++ b/java/ql/test-kotlin2/query-tests/ReturnValueIgnored/ReturnValueIgnored.qlref @@ -1 +1,2 @@ -Likely Bugs/Statements/ReturnValueIgnored.ql \ No newline at end of file +query: Likely Bugs/Statements/ReturnValueIgnored.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref b/java/ql/test-kotlin2/query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref index d071e989ebb..45d0db5559c 100644 --- a/java/ql/test-kotlin2/query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref +++ b/java/ql/test-kotlin2/query-tests/SimplifyBoolExpr/SimplifyBoolExpr.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql +query: Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/UnderscoreIdentifier/UnderscoreIdentifier.qlref b/java/ql/test-kotlin2/query-tests/UnderscoreIdentifier/UnderscoreIdentifier.qlref index dbed8c6f411..7aa4b4176e3 100644 --- a/java/ql/test-kotlin2/query-tests/UnderscoreIdentifier/UnderscoreIdentifier.qlref +++ b/java/ql/test-kotlin2/query-tests/UnderscoreIdentifier/UnderscoreIdentifier.qlref @@ -1 +1,2 @@ -Compatibility/JDK9/UnderscoreIdentifier.ql \ No newline at end of file +query: Compatibility/JDK9/UnderscoreIdentifier.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/UnreadLocal/UnreadLocal.qlref b/java/ql/test-kotlin2/query-tests/UnreadLocal/UnreadLocal.qlref index 5a77117711e..dc6fb57ca6a 100644 --- a/java/ql/test-kotlin2/query-tests/UnreadLocal/UnreadLocal.qlref +++ b/java/ql/test-kotlin2/query-tests/UnreadLocal/UnreadLocal.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Dead Code/UnreadLocal.ql +query: Violations of Best Practice/Dead Code/UnreadLocal.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/UnreadLocal/test.kt b/java/ql/test-kotlin2/query-tests/UnreadLocal/test.kt index e1663d7c116..a7537d128d8 100644 --- a/java/ql/test-kotlin2/query-tests/UnreadLocal/test.kt +++ b/java/ql/test-kotlin2/query-tests/UnreadLocal/test.kt @@ -5,13 +5,13 @@ fun fn0(size: Int) { } fun fn1(a: Array) { - for (e in a) { + for (e in a) { // $ Alert println() } } fun fn2(a: Array) { - for ((idx, e) in a.withIndex()) { + for ((idx, e) in a.withIndex()) { // $ Alert println() } } diff --git a/java/ql/test-kotlin2/query-tests/UselessNullCheck/Test.kt b/java/ql/test-kotlin2/query-tests/UselessNullCheck/Test.kt index 138309dc9de..365eb5083a2 100644 --- a/java/ql/test-kotlin2/query-tests/UselessNullCheck/Test.kt +++ b/java/ql/test-kotlin2/query-tests/UselessNullCheck/Test.kt @@ -13,6 +13,6 @@ fun fn(x:Any?, y: Any?) { fun fn0(o: Any?) { if (o != null) { o?.toString() - o.toString() + o.toString() // $ Alert } } diff --git a/java/ql/test-kotlin2/query-tests/UselessNullCheck/UselessNullCheck.qlref b/java/ql/test-kotlin2/query-tests/UselessNullCheck/UselessNullCheck.qlref index 8b5a095d396..68c4adcf428 100644 --- a/java/ql/test-kotlin2/query-tests/UselessNullCheck/UselessNullCheck.qlref +++ b/java/ql/test-kotlin2/query-tests/UselessNullCheck/UselessNullCheck.qlref @@ -1 +1,2 @@ -Language Abuse/UselessNullCheck.ql +query: Language Abuse/UselessNullCheck.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/UselessParameter/UselessParameter.qlref b/java/ql/test-kotlin2/query-tests/UselessParameter/UselessParameter.qlref index b1ceb2751a6..7de29d4e3f4 100644 --- a/java/ql/test-kotlin2/query-tests/UselessParameter/UselessParameter.qlref +++ b/java/ql/test-kotlin2/query-tests/UselessParameter/UselessParameter.qlref @@ -1 +1,2 @@ -DeadCode/UselessParameter.ql \ No newline at end of file +query: DeadCode/UselessParameter.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test-kotlin2/query-tests/WhitespaceContradictsPrecedence/WhitespaceContradictsPrecedence.qlref b/java/ql/test-kotlin2/query-tests/WhitespaceContradictsPrecedence/WhitespaceContradictsPrecedence.qlref index e8331b4132f..470fdcfe273 100644 --- a/java/ql/test-kotlin2/query-tests/WhitespaceContradictsPrecedence/WhitespaceContradictsPrecedence.qlref +++ b/java/ql/test-kotlin2/query-tests/WhitespaceContradictsPrecedence/WhitespaceContradictsPrecedence.qlref @@ -1 +1,2 @@ -Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql \ No newline at end of file +query: Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql