You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static <T> T get(final String jsonPath, final Class<T> clazz)
{
try
{
return JsonPath.using(JSONPATH_CONFIGURATION).parse(getDataAsJsonObject()).read(jsonPath, clazz);
}
catch (PathNotFoundException e)
{
return null;
}
}
YamlProperties class line 163-190
public static Properties build(final File file)
{
try (final Reader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8"))))
{
final Yaml yaml = new Yaml();
final Map<String, Object> map = yaml.load(reader);
if (map == null)
{
// the localization file is empty
return null;
}
final YamlProperties yamlProperties = new YamlProperties();
yamlProperties.yamlToJavaProperties(map);
return yamlProperties.properties;
}
catch (final FileNotFoundException e)
{
return null;
}
catch (final IOException e)
{
return null;
}
}
NeodymiumProxyHttpClientFactory line 130-139
@Override
public Request authenticate(Route route, Response response) throws IOException
{
if (response.request().header(headerName) != null)
{
return null; // Give up, we've already attempted to authenticate.
}
return response.request().newBuilder()
.header(headerName, credentials)
.build();
}
IMO, we could replace all the null returns with optional ones. The last method (NeodymiumProxyHttpClientFactory line 130-139) wouldn't allow us to do so due to overriding, so I suggest throwing an exception in case of authentication failure.
Try to remove returning
null
where possible to improve our API.Let's detect and discuss those areas first and change the API after the discussion.
E.g. return empty Strings or empty Collections or consider using Optional
The text was updated successfully, but these errors were encountered: