fix some compiler warnings (#164)

This commit is contained in:
Pascal Schumacher
2016-11-17 22:31:17 +01:00
committed by Ricky Yim
parent bd6a9c7c08
commit 6315478306
4 changed files with 5 additions and 12 deletions
@@ -117,7 +117,7 @@ public class FakeValuesService {
final Locale normalized = normalizeLocale(from);
final List<Locale> chain = new ArrayList(3);
final List<Locale> chain = new ArrayList<Locale>(3);
chain.add(normalized);
if (!"".equals(normalized.getCountry()) && !Locale.ENGLISH.getLanguage().equals(normalized.getLanguage())) {
chain.add(new Locale(normalized.getLanguage()));
@@ -157,7 +157,7 @@ public class FakeValuesService {
* @return
*/
public Object fetch(String key) {
List valuesArray = (List) fetchObject(key);
List<Object> valuesArray = (List) fetchObject(key);
return valuesArray == null ? null : valuesArray.get(randomService.nextInt(valuesArray.size()));
}
@@ -183,7 +183,7 @@ public class FakeValuesService {
* @param key
* @return
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
public String safeFetch(String key, String defaultIfNull) {
Object o = fetchObject(key);
if (o == null) return defaultIfNull;
@@ -205,7 +205,7 @@ public class FakeValuesService {
* dot. E.g. name.first_name
* @return
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
public Object fetchObject(String key) {
String[] path = key.split("\\.");
@@ -1,6 +1,5 @@
package com.github.javafaker;
import org.junit.Before;
import org.junit.Test;
import static com.github.javafaker.matchers.MatchesRegularExpression.matchesRegularExpression;
@@ -27,8 +27,8 @@ public class MostSpecificLocaleIT {
}
@Test
@SuppressWarnings("unchecked")
public void resolvesTheMostSpecificLocale() {
final List<String> enDefaultCountries = (List<String>) en.fetchObject("address.default_country");
final List<String> enUsDefaultCountries = (List<String>) en_US.fetchObject("address.default_country");
@@ -267,10 +267,4 @@ public class FakeValuesServiceTest extends AbstractFakerTest {
return "Hello";
}
}
private static class AnotherDummyService {
public String firstName() {
return "John";
}
}
}