Skip to content

Commit c88decb

Browse files
Merge pull request #16932 from hmdrzsharifi/BAEL-6141
Bael 6141: Intro to SpotBugs
2 parents f32fd57 + c5a75dc commit c88decb

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

testing-modules/testing-libraries-2/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,21 @@
156156
</environmentVariables>
157157
</configuration>
158158
</plugin>
159+
<plugin>
160+
<groupId>com.github.spotbugs</groupId>
161+
<artifactId>spotbugs-maven-plugin</artifactId>
162+
<version>${spotbugs-maven-plugin.version}</version>
163+
<dependencies>
164+
<dependency>
165+
<groupId>com.github.spotbugs</groupId>
166+
<artifactId>spotbugs</artifactId>
167+
<version>${spotbugs.version}</version>
168+
</dependency>
169+
</dependencies>
170+
<configuration>
171+
<htmlOutput>true</htmlOutput>
172+
</configuration>
173+
</plugin>
159174
</plugins>
160175
<resources>
161176
<resource>
@@ -172,6 +187,8 @@
172187
<system-stubs.version>2.1.3</system-stubs.version>
173188
<testng.version>7.8.0</testng.version>
174189
<junit.pioneer.version>2.1.0</junit.pioneer.version>
190+
<spotbugs-maven-plugin.version>4.8.5.0</spotbugs-maven-plugin.version>
191+
<spotbugs.version>4.8.5</spotbugs.version>
175192
</properties>
176193

177194
</project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.baeldung.spotbugs;
2+
3+
import java.nio.charset.StandardCharsets;
4+
import java.util.Scanner;
5+
6+
public class Application {
7+
8+
public static final String NAME = "Name: ";
9+
10+
private Application() {
11+
}
12+
13+
public static String readName() {
14+
Scanner scanner = new Scanner(System.in, StandardCharsets.UTF_8.displayName());
15+
String input = scanner.next();
16+
return NAME.concat(input);
17+
}
18+
}

0 commit comments

Comments
 (0)