File tree Expand file tree Collapse file tree 15 files changed +26
-3
lines changed
log4j-api-test/src/main/java/org/apache/logging/log4j/test
log4j-core-test/src/main/java/org/apache/logging/log4j/core/test Expand file tree Collapse file tree 15 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .test ;
18
18
19
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
19
20
import java .io .ByteArrayOutputStream ;
20
21
import java .io .PrintStream ;
21
22
import java .util .ArrayList ;
@@ -58,6 +59,7 @@ public void logMessage(
58
59
}
59
60
60
61
@ Override
62
+ @ SuppressFBWarnings ("INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE" )
61
63
protected void log (
62
64
final Level level ,
63
65
final Marker marker ,
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .test .junit ;
18
18
19
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
19
20
import java .io .IOException ;
20
21
import java .nio .file .FileVisitResult ;
21
22
import java .nio .file .Files ;
29
30
30
31
class DirectoryCleaner extends AbstractFileCleaner {
31
32
@ Override
33
+ @ SuppressFBWarnings ("PATH_TRAVERSAL_IN" )
32
34
Collection <Path > getPathsForTest (final ExtensionContext context ) {
33
35
final Collection <Path > paths = new HashSet <>();
34
36
final CleanUpDirectories testClassAnnotation =
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .test .junit ;
18
18
19
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
19
20
import java .io .IOException ;
20
21
import java .nio .file .Files ;
21
22
import java .nio .file .Path ;
26
27
27
28
class FileCleaner extends AbstractFileCleaner {
28
29
@ Override
30
+ @ SuppressFBWarnings ("PATH_TRAVERSAL_IN" )
29
31
Collection <Path > getPathsForTest (final ExtensionContext context ) {
30
32
final Collection <Path > paths = new HashSet <>();
31
33
final CleanUpFiles testClassAnnotation = context .getRequiredTestClass ().getAnnotation (CleanUpFiles .class );
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .test .junit ;
18
18
19
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
19
20
import java .io .ByteArrayInputStream ;
20
21
import java .io .ByteArrayOutputStream ;
21
22
import java .io .ObjectInputStream ;
@@ -54,6 +55,7 @@ public static byte[] serialize(final Serializable obj) {
54
55
* @return the deserialized object
55
56
*/
56
57
@ SuppressWarnings ("unchecked" )
58
+ @ SuppressFBWarnings ("OBJECT_DESERIALIZATION" )
57
59
public static <T > T deserialize (final byte [] data ) {
58
60
try {
59
61
final ByteArrayInputStream bas = new ByteArrayInputStream (data );
Original file line number Diff line number Diff line change 31
31
<bnd .baseline.skip>true</bnd .baseline.skip>
32
32
<maven .deploy.skip>true</maven .deploy.skip>
33
33
<maven .install.skip>true</maven .install.skip>
34
+ <spotbugs .skip>true</spotbugs .skip>
34
35
</properties >
35
36
<dependencies >
36
37
<dependency >
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .core .test ;
18
18
19
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
19
20
import java .io .IOException ;
20
21
import java .net .DatagramSocket ;
21
22
import java .net .ServerSocket ;
28
29
/**
29
30
* Finds currently available server ports.
30
31
*/
32
+ @ SuppressFBWarnings ("UNENCRYPTED_SERVER_SOCKET" )
31
33
public final class AvailablePortFinder {
32
34
33
35
/**
Original file line number Diff line number Diff line change 22
22
23
23
import com .google .monitoring .runtime .instrumentation .AllocationRecorder ;
24
24
import com .google .monitoring .runtime .instrumentation .Sampler ;
25
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
25
26
import java .io .File ;
26
27
import java .net .URL ;
27
28
import java .nio .charset .Charset ;
@@ -206,6 +207,7 @@ private static void singleLoggingIteration(
206
207
logger .fatal (mapMessage ); // LOG4J2-1683
207
208
}
208
209
210
+ @ SuppressFBWarnings ("COMMAND_INJECTION" )
209
211
public static void runTest (final Class <?> cls ) throws Exception {
210
212
final String javaHome = System .getProperty ("java.home" );
211
213
final String javaBin = javaHome + File .separator + "bin" + File .separator + "java" ;
Original file line number Diff line number Diff line change 24
24
import org .apache .logging .log4j .core .appender .db .jdbc .AbstractConnectionSource ;
25
25
import org .apache .logging .log4j .core .appender .db .jdbc .ConnectionSource ;
26
26
27
+ @ SuppressFBWarnings ("HARD_CODE_PASSWORD" )
27
28
public class JdbcH2TestHelper {
28
29
29
30
/**
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .core .test .junit ;
18
18
19
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
19
20
import java .io .File ;
20
21
import java .io .IOException ;
21
22
import java .io .PrintStream ;
@@ -181,6 +182,7 @@ protected void println(final String msg) {
181
182
}
182
183
}
183
184
185
+ @ SuppressFBWarnings ("INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE" )
184
186
protected void printStackTrace (final Throwable t ) {
185
187
if (printStream != null ) {
186
188
t .printStackTrace (printStream );
Original file line number Diff line number Diff line change 16
16
*/
17
17
package org .apache .logging .log4j .core .test .junit ;
18
18
19
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
19
20
import java .sql .Connection ;
20
21
import java .sql .SQLException ;
21
22
import java .sql .Statement ;
33
34
*
34
35
* @since 2.8
35
36
*/
37
+ @ SuppressFBWarnings ("SQL_INJECTION_JDBC" )
36
38
public class JdbcRule implements TestRule {
37
39
38
40
private final ConnectionSource connectionSource ;
You can’t perform that action at this time.
0 commit comments