Skip to content

Commit 3693185

Browse files
committed
Second pass
1 parent 1c1d264 commit 3693185

41 files changed

Lines changed: 416 additions & 420 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
query: DeadCode/DeadClass.ql
2-
postprocess: utils/test/InlineExpectationsTestQuery.ql
1+
DeadCode/DeadClass.ql
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
query: DeadCode/DeadMethod.ql
2-
postprocess: utils/test/InlineExpectationsTestQuery.ql
1+
DeadCode/DeadMethod.ql
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.semmle.camel;
22

33
/** Dead because it is not referenced in the {@code config.xml} file, or in the Java DSL. */
4-
public class DeadTarget { // $ Alert[java/dead-class]
4+
public class DeadTarget {
55
public Foo getFoo(Foo foo1) {
66
return new Foo();
77
}
88

9-
public static class Foo {} // $ Alert[java/dead-class]
9+
public static class Foo {}
1010
}

java/ql/test/query-tests/DeadCode/camel/com/semmle/camel/javadsl/CustomRouteBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
public class CustomRouteBuilder extends RouteBuilder {
77
@Override
8-
public void configure() throws Exception { // $ Alert[java/dead-function]
8+
public void configure() throws Exception {
99
from("direct:test")
1010
.to("bean:dslToTarget")
1111
.bean(DSLBeanTarget.class)

java/ql/test/query-tests/Javadoc/ImpossibleJavadocThrows.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ class ImpossibleJavadocThrows {
66

77
/**
88
*
9-
* @throws InterruptedException // $ Alert
9+
* @throws InterruptedException
1010
*/
1111
public void bad1() {
1212
}
1313

1414
/**
1515
*
16-
* @exception Exception // $ Alert
16+
* @exception Exception
1717
*/
1818
public void bad2() {
1919
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
query: Advisory/Documentation/ImpossibleJavadocThrows.ql
2-
postprocess: utils/test/InlineExpectationsTestQuery.ql
1+
Advisory/Documentation/ImpossibleJavadocThrows.ql

java/ql/test/query-tests/MissingSpaceTypo/A.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
public class A {
22
public void missing() {
33
String s;
4-
s = "this text" + // $
4+
s = "this text" +
55
"is missing a space"; // $ Alert
6-
s = "the class java.util.ArrayList" + // $
6+
s = "the class java.util.ArrayList" +
77
"without a space"; // $ Alert
8-
s = "This isn't" + // $
8+
s = "This isn't" +
99
"right."; // $ Alert
10-
s = "There's 1" + // $
10+
s = "There's 1" +
1111
"thing wrong"; // $ Alert
12-
s = "There's A/B" + // $
12+
s = "There's A/B" +
1313
"and no space"; // $ Alert
14-
s = "Wait for it...." + // $
14+
s = "Wait for it...." +
1515
"No space!"; // $ Alert
16-
s = "Is there a space?" + // $
16+
s = "Is there a space?" +
1717
"No!"; // $ Alert
1818
}
1919

java/ql/test/query-tests/SpuriousJavadocParam/Test.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,83 +54,83 @@ protected void ok8(){ }
5454
protected void ok9(int...param){ }
5555

5656
/**
57-
* @param prameter typo // $ Alert
57+
* @param prameter typo
5858
*/
5959
public void problem1(int parameter){ }
6060

6161
/**
62-
* @param Parameter capitalization // $ Alert
62+
* @param Parameter capitalization
6363
*/
6464
public void problem2(int parameter){ }
6565

6666
/**
67-
* @param parameter unmatched // $ Alert
67+
* @param parameter unmatched
6868
*/
6969
public void problem3(){ }
7070

7171
/**
7272
* @param someOtherParameter matched
73-
* @param parameter unmatched // $ Alert
73+
* @param parameter unmatched
7474
*/
7575
public void problem4(int someOtherParameter){ }
7676

7777
/**
78-
* @param <V> unmatched type parameter // $ Alert
78+
* @param <V> unmatched type parameter
7979
*/
8080
private <T> T problem5(){ return null; }
8181

8282
/**
8383
* @param <V> matched type parameter
84-
* @param <P> unmatched type parameter // $ Alert
85-
* @param n unmatched normal parameter // $ Alert
84+
* @param <P> unmatched type parameter
85+
* @param n unmatched normal parameter
8686
*/
8787
private <T,V> T problem6(V p){ return null; }
8888

8989
/**
9090
* param with immediate newline
91-
* @param // $ Alert
91+
* @param
9292
*/
9393
protected void problem7(){ }
9494

9595
/**
9696
* param without a value (followed by blanks)
97-
* @param // $ Alert
97+
* @param
9898
*/
9999
protected void problem8(){ }
100100

101101
class SomeClass {
102102
/**
103103
* @param i exists
104-
* @param k does not // $ Alert
104+
* @param k does not
105105
*/
106106
SomeClass(int i, int j) {}
107107
}
108108

109109
/**
110110
* @param <T> exists
111-
* @param T wrong syntax // $ Alert
112-
* @param <X> does not exist // $ Alert
111+
* @param T wrong syntax
112+
* @param <X> does not exist
113113
*/
114114
class GenericClass<T> {}
115115

116116
/**
117117
* @param <T> exists
118-
* @param T wrong syntax // $ Alert
119-
* @param <X> does not exist // $ Alert
118+
* @param T wrong syntax
119+
* @param <X> does not exist
120120
*/
121121
interface GenericInterface<T> {}
122122

123123
/**
124124
* @param i exists
125-
* @param k does not // $ Alert
125+
* @param k does not
126126
*/
127127
static record SomeRecord(int i, int j) {}
128128

129129
/**
130130
* @param <T> exists
131-
* @param <U> does not // $ Alert
131+
* @param <U> does not
132132
* @param i exists
133-
* @param k does not // $ Alert
133+
* @param k does not
134134
*/
135135
static record GenericRecord<T>(int i, int j) {}
136136
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
query: Advisory/Documentation/SpuriousJavadocParam.ql
2-
postprocess: utils/test/InlineExpectationsTestQuery.ql
1+
Advisory/Documentation/SpuriousJavadocParam.ql

java/ql/test/query-tests/security/CWE-020/ExternalAPISinkExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
99
throws ServletException, IOException {
1010
// BAD: a request parameter is written directly to an error response page
1111
response.sendError(HttpServletResponse.SC_NOT_FOUND,
12-
"The page \"" + request.getParameter("page") + "\" was not found."); // $ Alert
12+
"The page \"" + request.getParameter("page") + "\" was not found."); // $ Alert[java/untrusted-data-to-external-api]
1313
}
1414
}

0 commit comments

Comments
 (0)