Skip to content

Commit 0cdadae

Browse files
Daniel Muehlbachlerromani
authored andcommitted
Issue #274: update forbiddenapis
1 parent 424008b commit 0cdadae

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@
497497
<plugin>
498498
<groupId>de.thetaphi</groupId>
499499
<artifactId>forbiddenapis</artifactId>
500-
<version>2.2</version>
500+
<version>2.7</version>
501501
<configuration>
502502
<targetVersion>${java.version}</targetVersion>
503503
<failOnUnsupportedJava>false</failOnUnsupportedJava>

src/it/java/org/checkstyle/plugins/sonar/RunPluginTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.nio.file.Path;
2828
import java.nio.file.Paths;
2929
import java.util.List;
30+
import java.util.Locale;
3031
import java.util.Map;
3132
import java.util.stream.Collectors;
3233

@@ -241,7 +242,8 @@ private File prepareProject() throws IOException {
241242
.setParam("repositories", "checkstyle")
242243
.executeUnsafely();
243244
if (!activateRulesResponse.isSuccessful()) {
244-
fail(String.format("Failed to activate all rules. %s",
245+
fail(String.format(Locale.ROOT,
246+
"Failed to activate all rules. %s",
245247
activateRulesResponse.getBodyAsString()));
246248
}
247249
// deactivate some rules for test project
@@ -254,7 +256,8 @@ private File prepareProject() throws IOException {
254256
.setParam("profile_key", profileKey)
255257
.executeUnsafely();
256258
if (!deactivateRulesResponse.isSuccessful()) {
257-
fail(String.format("Failed to deactivate rule %s. %s",
259+
fail(String.format(Locale.ROOT,
260+
"Failed to deactivate rule %s. %s",
258261
ruleKey,
259262
deactivateRulesResponse.getBodyAsString()));
260263
}
@@ -272,7 +275,8 @@ private File prepareProject() throws IOException {
272275
.setParam("projectKey", PROJECT_KEY)
273276
.executeUnsafely();
274277
if (!assignQpResponse.isSuccessful()) {
275-
fail(String.format("Failed to add project to quality profile. %s",
278+
fail(String.format(Locale.ROOT,
279+
"Failed to add project to quality profile. %s",
276280
assignQpResponse.getBodyAsString()));
277281
}
278282

src/test/java/org/sonar/plugins/checkstyle/CheckstyleConstantsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class CheckstyleConstantsTest {
3131
public void privateConstructor() throws ReflectiveOperationException {
3232
final Constructor<CheckstyleConstants> constructor = CheckstyleConstants.class
3333
.getDeclaredConstructor();
34-
assertThat(constructor.isAccessible()).isFalse();
34+
assertThat(constructor.canAccess(null)).isFalse();
3535
constructor.setAccessible(true);
3636
constructor.newInstance();
3737
}

src/test/java/org/sonar/plugins/checkstyle/CheckstyleSeverityUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void testFromSeverity() {
7171
public void privateConstructor() throws ReflectiveOperationException {
7272
final Constructor<CheckstyleSeverityUtils> constructor = CheckstyleSeverityUtils.class
7373
.getDeclaredConstructor();
74-
assertThat(constructor.isAccessible()).isFalse();
74+
assertThat(constructor.canAccess(null)).isFalse();
7575
constructor.setAccessible(true);
7676
constructor.newInstance();
7777
}

0 commit comments

Comments
 (0)