Use final where possible

This commit is contained in:
wb9688 2020-08-16 10:24:58 +02:00
parent d306513319
commit 87228673b4
132 changed files with 1024 additions and 1005 deletions

View file

@ -12,7 +12,7 @@ public class TabTest {
public void checkIdDuplication() {
final Set<Integer> usedIds = new HashSet<>();
for (Tab.Type type : Tab.Type.values()) {
for (final Tab.Type type : Tab.Type.values()) {
final boolean added = usedIds.add(type.getTabId());
assertTrue("Id was already used: " + type.getTabId(), added);
}

View file

@ -53,13 +53,14 @@ public class TabsJsonHelperTest {
"{}"
);
for (String invalidContent : invalidList) {
for (final String invalidContent : invalidList) {
try {
TabsJsonHelper.getTabsFromJson(invalidContent);
fail("didn't throw exception");
} catch (Exception e) {
boolean isExpectedException = e instanceof TabsJsonHelper.InvalidJsonException;
} catch (final Exception e) {
final boolean isExpectedException
= e instanceof TabsJsonHelper.InvalidJsonException;
assertTrue("\"" + e.getClass().getSimpleName()
+ "\" is not the expected exception", isExpectedException);
}
@ -78,7 +79,7 @@ public class TabsJsonHelperTest {
}
private boolean isTabsArrayEmpty(final String returnedJson) throws JsonParserException {
JsonObject jsonObject = JsonParser.object().from(returnedJson);
final JsonObject jsonObject = JsonParser.object().from(returnedJson);
assertTrue(jsonObject.containsKey(JSON_TABS_ARRAY_KEY));
return jsonObject.getArray(JSON_TABS_ARRAY_KEY).size() == 0;
}