Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant local variables #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private static Injector createInjector(Map<String, String> properties, Module mo
@SafeVarargs
private static <T> Module createModule(Key<T> key, Class<T> configClass, String prefix, ConfigDefaults<T>... configDefaults)
{
Module module = binder -> {
return binder -> {
ConfigBinder configBinder = configBinder(binder);

configBinder.bindConfig(key, configClass, prefix);
Expand All @@ -284,8 +284,6 @@ private static <T> Module createModule(Key<T> key, Class<T> configClass, String
configBinder.bindConfigDefaults(key, configDefault);
}
};

return module;
}

private static Map<String, String> prefix(String prefix, Map<String, String> properties)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ public Duration handle(Request request, Response response)
throw new DiscoveryException(String.format("Announcement failed with status code %s: %s", statusCode, getBodyForError(response)));
}

Duration maxAge = extractMaxAge(response);
return maxAge;
return extractMaxAge(response);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public HttpServiceSelector get()

ServiceSelector serviceSelector = injector.getInstance(Key.get(ServiceSelector.class, serviceType(type)));

HttpServiceSelector httpServiceSelector = new HttpServiceSelectorImpl(serviceSelector);
return httpServiceSelector;
return new HttpServiceSelectorImpl(serviceSelector);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ public ServiceSelector get()

ServiceSelectorConfig selectorConfig = injector.getInstance(Key.get(ServiceSelectorConfig.class, serviceType(type)));

ServiceSelector serviceSelector = serviceSelectorFactory.createServiceSelector(type, selectorConfig);
return serviceSelector;
return serviceSelectorFactory.createServiceSelector(type, selectorConfig);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ public static ResourceConfig createResourceConfig(Application application)
@TheServlet
public static Map<String, String> createTheServletParams()
{
Map<String, String> initParams = new HashMap<>();
return initParams;
return new HashMap<>();
}

public static class JaxRsApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ public Object readFrom(
{
try {
ThriftCodec<?> codec = thriftCodecManager.getCodec(genericType);
Object value = ThriftProtocolUtils.read(codec, getThriftProtocol(mediaType, codec), inputStream);
return value;
return ThriftProtocolUtils.read(codec, getThriftProtocol(mediaType, codec), inputStream);
}
catch (Exception e) {
// we want to return a 400 for bad Thrift but not for a real IO exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ private static byte[] loadPrivateKeyData(String keyFile)
if (!matcher.find()) {
throw new KeyStoreException("did not find a private key");
}
byte[] data = PemReader.base64Decode(matcher.group(2));
return data;
return PemReader.base64Decode(matcher.group(2));
}

private static File getResourceFile(String name)
Expand Down
Loading