Skip to content

Commit

Permalink
[java] Drop redundant suppression annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Apr 9, 2019
1 parent 912018d commit f7364ee
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion java/client/test/org/openqa/selenium/json/JsonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ public void canConstructASimpleString() {
assertThat(text).isEqualTo("cheese");
}

@SuppressWarnings("unchecked")
@Test
public void canPopulateAMap() {
String raw = "{\"cheese\": \"brie\", \"foodstuff\": \"cheese\"}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* been set to something other than localhost/127.0.0.1, although the real systems use
* localhost/127.0.0.1
*/
@SuppressWarnings({"UseOfSystemOutOrSystemErr", "UtilityClass"})
public class StubNetworkInterfaceProvider {
private StubNetworkInterfaceProvider() {
}
Expand Down
14 changes: 0 additions & 14 deletions java/client/test/org/openqa/selenium/remote/ErrorHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ private void assertThrowsCorrectExceptionType(int status, Class<? extends Runtim
.satisfies(e -> assertThat(type.isAssignableFrom(e.getClass())).isTrue());
}

@SuppressWarnings({"ThrowableInstanceNeverThrown"})
@Test
public void testShouldThrowAVanillaWebDriverExceptionIfServerDoesNotProvideAValue() {
Response response = createResponse(ErrorCodes.UNHANDLED_ERROR);
Expand All @@ -105,7 +104,6 @@ public void testShouldThrowAVanillaWebDriverExceptionIfServerDoesNotProvideAValu
.withMessageContaining(new WebDriverException().getMessage());
}

@SuppressWarnings({"ThrowableInstanceNeverThrown"})
@Test
public void testShouldNotSetCauseIfResponseValueIsJustAString() {
assertThatExceptionOfType(WebDriverException.class)
Expand All @@ -117,7 +115,6 @@ public void testShouldNotSetCauseIfResponseValueIsJustAString() {
.withMessageContaining(new WebDriverException().getMessage());
}

@SuppressWarnings({"ThrowableInstanceNeverThrown"})
@Test
public void testCauseShouldBeAnUnknownServerExceptionIfServerOnlyReturnsAMessage() {
assertThatExceptionOfType(WebDriverException.class)
Expand All @@ -128,7 +125,6 @@ public void testCauseShouldBeAnUnknownServerExceptionIfServerOnlyReturnsAMessage
.withMessageContaining(new WebDriverException().getMessage());
}

@SuppressWarnings({"ThrowableInstanceNeverThrown"})
@Test
public void testCauseShouldUseTheNamedClassIfAvailableOnTheClassPath() {
assertThatExceptionOfType(WebDriverException.class)
Expand All @@ -140,7 +136,6 @@ public void testCauseShouldUseTheNamedClassIfAvailableOnTheClassPath() {
.satisfies(expected -> assertThat(expected.getCause()).hasMessage("boom"));
}

@SuppressWarnings({"ThrowableInstanceNeverThrown"})
@Test
public void testCauseStackTraceShouldBeEmptyIfTheServerDidNotProvideThatInformation() {
assertThatExceptionOfType(WebDriverException.class)
Expand All @@ -155,7 +150,6 @@ public void testCauseStackTraceShouldBeEmptyIfTheServerDidNotProvideThatInformat
});
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void testShouldBeAbleToRebuildASerializedException() {
RuntimeException serverError = new RuntimeException("foo bar baz!\nCommand duration or timeout: 123 milliseconds");
Expand All @@ -171,7 +165,6 @@ public void testShouldBeAbleToRebuildASerializedException() {
});
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void testShouldIncludeScreenshotIfProvided() {
RuntimeException serverError = new RuntimeException("foo bar baz!");
Expand All @@ -196,7 +189,6 @@ public void testShouldIncludeScreenshotIfProvided() {
});
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void testShouldDefaultToWebDriverExceptionIfClassIsNotSpecified() {
RuntimeException serverError = new RuntimeException("foo bar baz!");
Expand All @@ -217,7 +209,6 @@ public void testShouldDefaultToWebDriverExceptionIfClassIsNotSpecified() {
});
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void testShouldStillTryToBuildWebDriverExceptionIfClassIsNotProvidedAndStackTraceIsNotForJava() {
Map<String, ?> data = ImmutableMap.of(
Expand Down Expand Up @@ -248,7 +239,6 @@ public void testShouldStillTryToBuildWebDriverExceptionIfClassIsNotProvidedAndSt
});
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void testToleratesNonNumericLineNumber() {
Map<String, ?> data = ImmutableMap.of(
Expand Down Expand Up @@ -279,7 +269,6 @@ public void testToleratesNonNumericLineNumber() {
});
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void testToleratesNumericLineNumberAsString() {
Map<String, ?> data = ImmutableMap.of(
Expand Down Expand Up @@ -311,7 +300,6 @@ public void testToleratesNumericLineNumberAsString() {
});
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void testShouldIndicateWhenTheServerReturnedAnExceptionThatWasSuppressed() {
RuntimeException serverError = new RuntimeException("foo bar baz!");
Expand All @@ -326,7 +314,6 @@ public void testShouldIndicateWhenTheServerReturnedAnExceptionThatWasSuppressed(
.withMessageContaining(new WebDriverException().getMessage());
}

@SuppressWarnings("ThrowableInstanceNeverThrown")
@Test
public void testShouldStillIncludeScreenshotEvenIfServerSideExceptionsAreDisabled() {
RuntimeException serverError = new RuntimeException("foo bar baz!");
Expand Down Expand Up @@ -413,7 +400,6 @@ private static void assertStackTracesEqual(StackTraceElement[] expected, StackTr
}
}

@SuppressWarnings({"unchecked"})
private static Map<String, Object> toMap(Object o) {
String rawJson = new Json().toJson(o);
return new Json().toType(rawJson, Map.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
import java.util.Set;
import java.util.regex.Pattern;

@SuppressWarnings("unchecked")
public class ExpectedConditionsTest {

@Mock
Expand Down

0 comments on commit f7364ee

Please sign in to comment.