change protected and package scope fields to private
fixes gh-149
This commit is contained in:
@@ -36,13 +36,13 @@ public abstract class ServletWrappingEndpoint implements InitializingBean,
|
||||
|
||||
// TODO: move to spring-boot?
|
||||
|
||||
protected String path;
|
||||
private String path;
|
||||
|
||||
protected boolean sensitive;
|
||||
private boolean sensitive;
|
||||
|
||||
protected boolean enabled = true;
|
||||
private boolean enabled = true;
|
||||
|
||||
protected final ServletWrappingController controller = new ServletWrappingController();
|
||||
private final ServletWrappingController controller = new ServletWrappingController();
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
@@ -75,6 +75,13 @@ public abstract class ServletWrappingEndpoint implements InitializingBean,
|
||||
return this.controller.handleRequest(request, response);
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public ServletWrappingController getController() {
|
||||
return controller;
|
||||
}
|
||||
@Override
|
||||
public String getPath() {
|
||||
return this.path;
|
||||
|
||||
@@ -42,7 +42,7 @@ import com.netflix.discovery.converters.XmlXStream;
|
||||
public class EurekaClientAutoConfiguration {
|
||||
|
||||
@Autowired
|
||||
ApplicationContext context;
|
||||
private ApplicationContext context;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
||||
@@ -90,7 +90,7 @@ public class EurekaDiscoveryClient implements DiscoveryClient {
|
||||
}
|
||||
|
||||
static class EurekaServiceInstance implements ServiceInstance {
|
||||
InstanceInfo instance;
|
||||
private InstanceInfo instance;
|
||||
|
||||
EurekaServiceInstance(InstanceInfo instance) {
|
||||
this.instance = instance;
|
||||
|
||||
@@ -41,31 +41,31 @@ public class FeignConfiguration {
|
||||
ConfigurableEnvironmentConfiguration envConfig; // FIXME: howto enforce this?
|
||||
|
||||
@Autowired
|
||||
Decoder decoder;
|
||||
private Decoder decoder;
|
||||
|
||||
@Autowired
|
||||
Encoder encoder;
|
||||
private Encoder encoder;
|
||||
|
||||
@Autowired
|
||||
Logger logger;
|
||||
private Logger logger;
|
||||
|
||||
@Autowired
|
||||
Contract contract;
|
||||
private Contract contract;
|
||||
|
||||
@Autowired(required = false)
|
||||
Logger.Level logLevel;
|
||||
private Logger.Level logLevel;
|
||||
|
||||
@Autowired(required = false)
|
||||
Retryer retryer;
|
||||
private Retryer retryer;
|
||||
|
||||
@Autowired(required = false)
|
||||
ErrorDecoder errorDecoder;
|
||||
private ErrorDecoder errorDecoder;
|
||||
|
||||
@Autowired(required = false)
|
||||
Request.Options options;
|
||||
private Request.Options options;
|
||||
|
||||
@Autowired(required = false)
|
||||
Client ribbonClient;
|
||||
private Client ribbonClient;
|
||||
|
||||
protected Feign.Builder feign() {
|
||||
Feign.Builder builder = Feign.builder()
|
||||
|
||||
@@ -43,7 +43,7 @@ import static org.springframework.cloud.netflix.feign.FeignUtils.getHttpHeaders;
|
||||
public class SpringDecoder implements Decoder {
|
||||
|
||||
@Autowired
|
||||
Provider<HttpMessageConverters> messageConverters;
|
||||
private Provider<HttpMessageConverters> messageConverters;
|
||||
|
||||
public SpringDecoder() {
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class SpringEncoder implements Encoder {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SpringEncoder.class);
|
||||
|
||||
@Autowired
|
||||
Provider<HttpMessageConverters> messageConverters;
|
||||
private Provider<HttpMessageConverters> messageConverters;
|
||||
|
||||
@Override
|
||||
public void encode(Object requestBody, RequestTemplate request)
|
||||
@@ -105,7 +105,7 @@ public class SpringEncoder implements Encoder {
|
||||
|
||||
private class FeignOutputMessage implements HttpOutputMessage {
|
||||
|
||||
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
private final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
private final RequestTemplate request;
|
||||
|
||||
|
||||
@@ -104,8 +104,8 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
|
||||
}
|
||||
|
||||
protected static class RibbonServer implements ServiceInstance {
|
||||
protected String serviceId;
|
||||
protected Server server;
|
||||
private String serviceId;
|
||||
private Server server;
|
||||
|
||||
protected RibbonServer(String serviceId, Server server) {
|
||||
this.serviceId = serviceId;
|
||||
@@ -127,6 +127,9 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
|
||||
return this.server.getPort();
|
||||
}
|
||||
|
||||
public Server getServer() {
|
||||
return server;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ZuulProxyConfiguration extends ZuulConfiguration {
|
||||
private ProxyRouteLocator routeLocator;
|
||||
|
||||
@Autowired
|
||||
ZuulHandlerMapping zuulHandlerMapping;
|
||||
private ZuulHandlerMapping zuulHandlerMapping;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
|
||||
@@ -43,7 +43,7 @@ import com.netflix.zuul.http.HttpServletRequestWrapper;
|
||||
*/
|
||||
public class Servlet30WrapperFilter extends ZuulFilter {
|
||||
|
||||
protected Field requestField = null;
|
||||
private Field requestField = null;
|
||||
|
||||
public Servlet30WrapperFilter() {
|
||||
this.requestField = ReflectionUtils.findField(HttpServletRequestWrapper.class,
|
||||
@@ -52,6 +52,10 @@ public class Servlet30WrapperFilter extends ZuulFilter {
|
||||
this.requestField.setAccessible(true);
|
||||
}
|
||||
|
||||
protected Field getRequestField() {
|
||||
return requestField;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String filterType() {
|
||||
return "pre";
|
||||
|
||||
@@ -363,7 +363,7 @@ public class SimpleHostRoutingFilter extends ZuulFilter {
|
||||
}
|
||||
|
||||
public static class MySSLSocketFactory extends SSLSocketFactory {
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
private SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
|
||||
public MySSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException,
|
||||
KeyManagementException, KeyStoreException, UnrecoverableKeyException {
|
||||
|
||||
@@ -58,7 +58,7 @@ public class FeignClientTests extends FeignConfiguration {
|
||||
private int port = 0;
|
||||
|
||||
@Autowired
|
||||
TestClient testClient;
|
||||
private TestClient testClient;
|
||||
|
||||
// @FeignClient(value = "http://localhost:9876", loadbalance = false)
|
||||
@FeignClient("feignclienttest")
|
||||
|
||||
@@ -120,7 +120,7 @@ class HystrixOnlyApplication {
|
||||
}
|
||||
|
||||
@Autowired
|
||||
Service service;
|
||||
private Service service;
|
||||
|
||||
@RequestMapping("/")
|
||||
public String home() {
|
||||
|
||||
@@ -49,13 +49,13 @@ import static org.mockito.Mockito.verify;
|
||||
public class RibbonInterceptorTests {
|
||||
|
||||
@Mock
|
||||
HttpRequest request;
|
||||
private HttpRequest request;
|
||||
|
||||
@Mock
|
||||
ClientHttpRequestExecution execution;
|
||||
private ClientHttpRequestExecution execution;
|
||||
|
||||
@Mock
|
||||
ClientHttpResponse response;
|
||||
private ClientHttpResponse response;
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RibbonLoadBalancerClientTests {
|
||||
RibbonLoadBalancerClient client = getRibbonLoadBalancerClient(server);
|
||||
ServiceInstance serviceInstance = client.choose(server.getServiceId());
|
||||
URI uri = client.reconstructURI(serviceInstance, new URL("http://"
|
||||
+ server.serviceId).toURI());
|
||||
+ server.getServiceId()).toURI());
|
||||
assertEquals(server.getHost(), uri.getHost());
|
||||
assertEquals(server.getPort(), uri.getPort());
|
||||
}
|
||||
@@ -145,10 +145,10 @@ public class RibbonLoadBalancerClientTests {
|
||||
RibbonServer ribbonServer) {
|
||||
given(this.loadBalancer.getName()).willReturn(ribbonServer.getServiceId());
|
||||
given(this.loadBalancer.chooseServer(anyString()))
|
||||
.willReturn(ribbonServer.server);
|
||||
.willReturn(ribbonServer.getServer());
|
||||
given(this.loadBalancer.getLoadBalancerStats())
|
||||
.willReturn(this.loadBalancerStats);
|
||||
given(this.loadBalancerStats.getSingleServerStat(ribbonServer.server))
|
||||
given(this.loadBalancerStats.getSingleServerStat(ribbonServer.getServer()))
|
||||
.willReturn(this.serverStats);
|
||||
given(this.clientFactory.getLoadBalancer(this.loadBalancer.getName()))
|
||||
.willReturn(this.loadBalancer);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PreDecorationFilterTests {
|
||||
private PreDecorationFilter filter;
|
||||
|
||||
@Mock
|
||||
DiscoveryClient discovery;
|
||||
private DiscoveryClient discovery;
|
||||
|
||||
private ZuulProperties properties = new ZuulProperties();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class EurekaInstanceCanceledEvent extends ApplicationEvent {
|
||||
|
||||
private String serverId;
|
||||
|
||||
boolean replication;
|
||||
private boolean replication;
|
||||
|
||||
public EurekaInstanceCanceledEvent(Object source, String appName, String serverId,
|
||||
boolean replication) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class EurekaInstanceRegisteredEvent extends ApplicationEvent {
|
||||
|
||||
private int leaseDuration;
|
||||
|
||||
boolean replication;
|
||||
private boolean replication;
|
||||
|
||||
public EurekaInstanceRegisteredEvent(Object source, InstanceInfo instanceInfo,
|
||||
int leaseDuration, boolean replication) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class EurekaInstanceRenewedEvent extends ApplicationEvent {
|
||||
|
||||
private InstanceInfo instanceInfo;
|
||||
|
||||
boolean replication;
|
||||
private boolean replication;
|
||||
|
||||
public EurekaInstanceRenewedEvent(Object source, String appName, String serverId,
|
||||
InstanceInfo instanceInfo, boolean replication) {
|
||||
|
||||
Reference in New Issue
Block a user