Make fields private where possible
This commit is contained in:
parent
0160760568
commit
43e54d38f7
|
@ -32,7 +32,7 @@ public class InMemoryAuditEventRepository implements AuditEventRepository {
|
|||
|
||||
private int capacity = 100;
|
||||
|
||||
private Map<String, List<AuditEvent>> events = new HashMap<String, List<AuditEvent>>();
|
||||
private final Map<String, List<AuditEvent>> events = new HashMap<String, List<AuditEvent>>();
|
||||
|
||||
/**
|
||||
* @param capacity the capacity to set
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
public class AuditApplicationEvent extends ApplicationEvent {
|
||||
|
||||
private AuditEvent auditEvent;
|
||||
private final AuditEvent auditEvent;
|
||||
|
||||
/**
|
||||
* Create a new {@link AuditApplicationEvent} that wraps a newly created
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.springframework.context.annotation.Configuration;
|
|||
public class AuditAutoConfiguration {
|
||||
|
||||
@Autowired(required = false)
|
||||
private AuditEventRepository auditEventRepository = new InMemoryAuditEventRepository();
|
||||
private final AuditEventRepository auditEventRepository = new InMemoryAuditEventRepository();
|
||||
|
||||
@Bean
|
||||
public AuditListener auditListener() throws Exception {
|
||||
|
|
|
@ -340,9 +340,9 @@ public class CrshAutoConfiguration {
|
|||
private static class BeanFactoryFilteringPluginDiscovery extends
|
||||
ServiceLoaderDiscovery {
|
||||
|
||||
private ListableBeanFactory beanFactory;
|
||||
private final ListableBeanFactory beanFactory;
|
||||
|
||||
private String[] disabledPlugins;
|
||||
private final String[] disabledPlugins;
|
||||
|
||||
public BeanFactoryFilteringPluginDiscovery(ClassLoader classLoader,
|
||||
ListableBeanFactory beanFactory, String[] disabledPlugins)
|
||||
|
@ -409,7 +409,7 @@ public class CrshAutoConfiguration {
|
|||
*/
|
||||
private static class SimpleFileSystemDriver extends AbstractFSDriver<ResourceHandle> {
|
||||
|
||||
private ResourceHandle root;
|
||||
private final ResourceHandle root;
|
||||
|
||||
public SimpleFileSystemDriver(ResourceHandle handle) {
|
||||
this.root = handle;
|
||||
|
@ -463,7 +463,7 @@ public class CrshAutoConfiguration {
|
|||
*/
|
||||
private abstract static class ResourceHandle {
|
||||
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
public ResourceHandle(String name) {
|
||||
this.name = name;
|
||||
|
@ -480,7 +480,7 @@ public class CrshAutoConfiguration {
|
|||
*/
|
||||
private static class DirectoryHandle extends ResourceHandle {
|
||||
|
||||
private ResourcePatternResolver resourceLoader;
|
||||
private final ResourcePatternResolver resourceLoader;
|
||||
|
||||
public DirectoryHandle(String name, ResourcePatternResolver resourceLoader) {
|
||||
super(name);
|
||||
|
@ -505,7 +505,7 @@ public class CrshAutoConfiguration {
|
|||
*/
|
||||
private static class FileHandle extends ResourceHandle {
|
||||
|
||||
private Resource resource;
|
||||
private final Resource resource;
|
||||
|
||||
public FileHandle(String name, Resource resource) {
|
||||
super(name);
|
||||
|
|
|
@ -78,13 +78,13 @@ public class EndpointAutoConfiguration {
|
|||
private InfoPropertiesConfiguration properties;
|
||||
|
||||
@Autowired(required = false)
|
||||
private MetricReader metricRepository = new InMemoryMetricRepository();
|
||||
private final MetricReader metricRepository = new InMemoryMetricRepository();
|
||||
|
||||
@Autowired(required = false)
|
||||
private PublicMetrics metrics;
|
||||
|
||||
@Autowired(required = false)
|
||||
private TraceRepository traceRepository = new InMemoryTraceRepository();
|
||||
private final TraceRepository traceRepository = new InMemoryTraceRepository();
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
|
@ -170,7 +170,7 @@ public class EndpointAutoConfiguration {
|
|||
protected static class InfoPropertiesConfiguration {
|
||||
|
||||
@Autowired
|
||||
private ConfigurableEnvironment environment = new StandardEnvironment();
|
||||
private final ConfigurableEnvironment environment = new StandardEnvironment();
|
||||
@Value("${spring.git.properties:classpath:git.properties}")
|
||||
private Resource gitProperties;
|
||||
|
||||
|
@ -198,7 +198,7 @@ public class EndpointAutoConfiguration {
|
|||
|
||||
public static class GitInfo {
|
||||
private String branch;
|
||||
private Commit commit = new Commit();
|
||||
private final Commit commit = new Commit();
|
||||
|
||||
public String getBranch() {
|
||||
return this.branch;
|
||||
|
|
|
@ -89,7 +89,7 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
|
|||
@Conditional(ErrorTemplateMissingCondition.class)
|
||||
protected static class WhitelabelErrorViewConfiguration {
|
||||
|
||||
private SpelView defaultErrorView = new SpelView(
|
||||
private final SpelView defaultErrorView = new SpelView(
|
||||
"<html><body><h1>Whitelabel Error Page</h1>"
|
||||
+ "<p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>"
|
||||
+ "<div id='created'>${timestamp}</div>"
|
||||
|
|
|
@ -123,7 +123,7 @@ public class MetricRepositoryAutoConfiguration {
|
|||
|
||||
@Autowired(required = false)
|
||||
@Qualifier("metricsExecutor")
|
||||
private Executor executor = Executors.newSingleThreadExecutor();
|
||||
private final Executor executor = Executors.newSingleThreadExecutor();
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(name = "metricsChannel")
|
||||
|
|
|
@ -39,9 +39,9 @@ import org.springframework.core.env.Environment;
|
|||
public class BeansEndpoint extends AbstractEndpoint<List<Object>> implements
|
||||
ApplicationContextAware {
|
||||
|
||||
private LiveBeansView liveBeansView = new LiveBeansView();
|
||||
private final LiveBeansView liveBeansView = new LiveBeansView();
|
||||
|
||||
private JsonParser parser = JsonParserFactory.getJsonParser();
|
||||
private final JsonParser parser = JsonParserFactory.getJsonParser();
|
||||
|
||||
public BeansEndpoint() {
|
||||
super("beans");
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.springframework.util.Assert;
|
|||
@ConfigurationProperties(name = "endpoints.health", ignoreUnknownFields = false)
|
||||
public class HealthEndpoint<T> extends AbstractEndpoint<T> {
|
||||
|
||||
private HealthIndicator<? extends T> indicator;
|
||||
private final HealthIndicator<? extends T> indicator;
|
||||
|
||||
/**
|
||||
* Create a new {@link HealthIndicator} instance.
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.springframework.util.Assert;
|
|||
@ConfigurationProperties(name = "endpoints.info", ignoreUnknownFields = false)
|
||||
public class InfoEndpoint extends AbstractEndpoint<Map<String, Object>> {
|
||||
|
||||
private Map<String, ? extends Object> info;
|
||||
private final Map<String, ? extends Object> info;
|
||||
|
||||
/**
|
||||
* Create a new {@link InfoEndpoint} instance.
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.springframework.util.Assert;
|
|||
@ConfigurationProperties(name = "endpoints.metrics", ignoreUnknownFields = false)
|
||||
public class MetricsEndpoint extends AbstractEndpoint<Map<String, Object>> {
|
||||
|
||||
private PublicMetrics metrics;
|
||||
private final PublicMetrics metrics;
|
||||
|
||||
/**
|
||||
* Create a new {@link MetricsEndpoint} instance.
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.springframework.util.Assert;
|
|||
@ConfigurationProperties(name = "endpoints.trace", ignoreUnknownFields = false)
|
||||
public class TraceEndpoint extends AbstractEndpoint<List<Trace>> {
|
||||
|
||||
private TraceRepository repository;
|
||||
private final TraceRepository repository;
|
||||
|
||||
/**
|
||||
* Create a new {@link TraceEndpoint} instance.
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
public class VanillaPublicMetrics implements PublicMetrics {
|
||||
|
||||
private MetricReader reader;
|
||||
private final MetricReader reader;
|
||||
|
||||
public VanillaPublicMetrics(MetricReader reader) {
|
||||
Assert.notNull(reader, "MetricReader must not be null");
|
||||
|
|
|
@ -35,9 +35,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||
@ManagedResource
|
||||
public class EndpointMBean {
|
||||
|
||||
private Endpoint<?> endpoint;
|
||||
private final Endpoint<?> endpoint;
|
||||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
private final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
public EndpointMBean(String beanName, Endpoint<?> endpoint) {
|
||||
Assert.notNull(beanName, "BeanName must not be null");
|
||||
|
|
|
@ -66,7 +66,7 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
|
|||
private final MetadataNamingStrategy defaultNamingStrategy = new MetadataNamingStrategy(
|
||||
this.attributeSource);
|
||||
|
||||
private Set<Endpoint<?>> registeredEndpoints = new HashSet<Endpoint<?>>();
|
||||
private final Set<Endpoint<?>> registeredEndpoints = new HashSet<Endpoint<?>>();
|
||||
|
||||
private volatile boolean autoStartup = true;
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
|
|||
public class EndpointHandlerMapping extends RequestMappingHandlerMapping implements
|
||||
ApplicationContextAware {
|
||||
|
||||
private Set<? extends MvcEndpoint> endpoints;
|
||||
private final Set<? extends MvcEndpoint> endpoints;
|
||||
|
||||
private String prefix = "";
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
|
|||
|
||||
private boolean enabled = true;
|
||||
|
||||
private ServletWrappingController controller = new ServletWrappingController();
|
||||
private final ServletWrappingController controller = new ServletWrappingController();
|
||||
|
||||
public JolokiaMvcEndpoint() {
|
||||
this.path = "/jolokia";
|
||||
|
@ -123,7 +123,7 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
|
|||
|
||||
private static class PathStripper extends HttpServletRequestWrapper {
|
||||
|
||||
private String path;
|
||||
private final String path;
|
||||
|
||||
public PathStripper(HttpServletRequest request, String path) {
|
||||
super(request);
|
||||
|
|
|
@ -39,7 +39,7 @@ public class MvcEndpoints implements ApplicationContextAware, InitializingBean {
|
|||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
private Set<MvcEndpoint> endpoints = new HashSet<MvcEndpoint>();
|
||||
private final Set<MvcEndpoint> endpoints = new HashSet<MvcEndpoint>();
|
||||
|
||||
private Set<Class<?>> customTypes;
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ import org.springframework.boot.actuate.metrics.writer.Delta;
|
|||
public class InMemoryMetricRepository implements MetricRepository, MultiMetricRepository,
|
||||
PrefixMetricReader {
|
||||
|
||||
private SimpleInMemoryRepository<Metric<?>> metrics = new SimpleInMemoryRepository<Metric<?>>();
|
||||
private final SimpleInMemoryRepository<Metric<?>> metrics = new SimpleInMemoryRepository<Metric<?>>();
|
||||
|
||||
private Collection<String> groups = new HashSet<String>();
|
||||
private final Collection<String> groups = new HashSet<String>();
|
||||
|
||||
@Override
|
||||
public void increment(Delta<?> delta) {
|
||||
|
|
|
@ -47,11 +47,11 @@ public class RedisMetricRepository implements MetricRepository {
|
|||
|
||||
private String keys = this.prefix + "keys";
|
||||
|
||||
private BoundZSetOperations<String, String> zSetOperations;
|
||||
private final BoundZSetOperations<String, String> zSetOperations;
|
||||
|
||||
private RedisOperations<String, String> redisOperations;
|
||||
private final RedisOperations<String, String> redisOperations;
|
||||
|
||||
private ValueOperations<String, Long> longOperations;
|
||||
private final ValueOperations<String, Long> longOperations;
|
||||
|
||||
public RedisMetricRepository(RedisConnectionFactory redisConnectionFactory) {
|
||||
Assert.notNull(redisConnectionFactory, "RedisConnectionFactory must not be null");
|
||||
|
|
|
@ -46,9 +46,9 @@ public class RedisMultiMetricRepository implements MultiMetricRepository {
|
|||
|
||||
private String keys = this.prefix + "keys";
|
||||
|
||||
private BoundZSetOperations<String, String> zSetOperations;
|
||||
private final BoundZSetOperations<String, String> zSetOperations;
|
||||
|
||||
private RedisOperations<String, String> redisOperations;
|
||||
private final RedisOperations<String, String> redisOperations;
|
||||
|
||||
public RedisMultiMetricRepository(RedisConnectionFactory redisConnectionFactory) {
|
||||
Assert.notNull(redisConnectionFactory, "RedisConnectionFactory must not be null");
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.springframework.boot.actuate.metrics.writer.MetricWriter;
|
|||
*/
|
||||
public class InMemoryRichGaugeRepository implements RichGaugeRepository {
|
||||
|
||||
private SimpleInMemoryRepository<RichGauge> repository = new SimpleInMemoryRepository<RichGauge>();
|
||||
private final SimpleInMemoryRepository<RichGauge> repository = new SimpleInMemoryRepository<RichGauge>();
|
||||
|
||||
@Override
|
||||
public void increment(Delta<?> delta) {
|
||||
|
|
|
@ -30,9 +30,9 @@ import java.util.concurrent.ConcurrentSkipListMap;
|
|||
*/
|
||||
public class SimpleInMemoryRepository<T> {
|
||||
|
||||
private ConcurrentNavigableMap<String, T> values = new ConcurrentSkipListMap<String, T>();
|
||||
private final ConcurrentNavigableMap<String, T> values = new ConcurrentSkipListMap<String, T>();
|
||||
|
||||
private ConcurrentMap<String, Object> locks = new ConcurrentHashMap<String, Object>();
|
||||
private final ConcurrentMap<String, Object> locks = new ConcurrentHashMap<String, Object>();
|
||||
|
||||
public static interface Callback<T> {
|
||||
T modify(T current);
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.springframework.boot.actuate.metrics.Metric;
|
|||
*/
|
||||
public class CompositeMetricWriter implements MetricWriter {
|
||||
|
||||
private List<MetricWriter> writers = new ArrayList<MetricWriter>();
|
||||
private final List<MetricWriter> writers = new ArrayList<MetricWriter>();
|
||||
|
||||
public CompositeMetricWriter(MetricWriter... writers) {
|
||||
for (MetricWriter writer : writers) {
|
||||
|
|
|
@ -31,7 +31,7 @@ public class MessageChannelMetricWriter implements MetricWriter {
|
|||
|
||||
private static final String METRIC_NAME = "metricName";
|
||||
|
||||
private String DELETE = "delete";
|
||||
private final String DELETE = "delete";
|
||||
|
||||
private final MessageChannel channel;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public class ManagementServerProperties implements SecurityPrequisite {
|
|||
@NotNull
|
||||
private String contextPath = "";
|
||||
|
||||
private Security security = maybeCreateSecurity();
|
||||
private final Security security = maybeCreateSecurity();
|
||||
|
||||
/**
|
||||
* Returns the management port or {@code null} if the
|
||||
|
|
|
@ -57,9 +57,9 @@ public class ShellProperties {
|
|||
|
||||
private String[] disabledPlugins = new String[0];
|
||||
|
||||
private Ssh ssh = new Ssh();
|
||||
private final Ssh ssh = new Ssh();
|
||||
|
||||
private Telnet telnet = new Telnet();
|
||||
private final Telnet telnet = new Telnet();
|
||||
|
||||
public void setAuth(String auth) {
|
||||
Assert.hasLength(auth, "Auth must not be empty");
|
||||
|
|
|
@ -31,7 +31,7 @@ public class InMemoryTraceRepository implements TraceRepository {
|
|||
|
||||
private int capacity = 100;
|
||||
|
||||
private List<Trace> traces = new ArrayList<Trace>();
|
||||
private final List<Trace> traces = new ArrayList<Trace>();
|
||||
|
||||
/**
|
||||
* @param capacity the capacity to set
|
||||
|
|
|
@ -29,9 +29,9 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
public final class Trace {
|
||||
|
||||
private Date timestamp;
|
||||
private final Date timestamp;
|
||||
|
||||
private Map<String, Object> info;
|
||||
private final Map<String, Object> info;
|
||||
|
||||
public Trace(Date timestamp, Map<String, Object> info) {
|
||||
super();
|
||||
|
|
|
@ -55,7 +55,7 @@ public class WebRequestTraceFilter implements Filter, Ordered {
|
|||
|
||||
private int order = Integer.MAX_VALUE;
|
||||
|
||||
private ObjectMapper objectMapper = new ObjectMapper();
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
private BasicErrorController errorController;
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class BasicErrorController implements ErrorController {
|
|||
|
||||
private static final String ERROR_KEY = "error";
|
||||
|
||||
private Log logger = LogFactory.getLog(BasicErrorController.class);
|
||||
private final Log logger = LogFactory.getLog(BasicErrorController.class);
|
||||
|
||||
@Value("${error.path:/error}")
|
||||
private String errorPath;
|
||||
|
|
|
@ -29,7 +29,7 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class InMemoryAuditEventRepositoryTests {
|
||||
|
||||
private InMemoryAuditEventRepository repository = new InMemoryAuditEventRepository();
|
||||
private final InMemoryAuditEventRepository repository = new InMemoryAuditEventRepository();
|
||||
|
||||
@Test
|
||||
public void testAddToCapacity() throws Exception {
|
||||
|
|
|
@ -56,7 +56,7 @@ import static org.junit.Assert.assertThat;
|
|||
*/
|
||||
public class EndpointWebMvcAutoConfigurationTests {
|
||||
|
||||
private AnnotationConfigEmbeddedWebApplicationContext applicationContext = new AnnotationConfigEmbeddedWebApplicationContext();
|
||||
private final AnnotationConfigEmbeddedWebApplicationContext applicationContext = new AnnotationConfigEmbeddedWebApplicationContext();
|
||||
|
||||
@After
|
||||
public void close() {
|
||||
|
|
|
@ -44,7 +44,7 @@ import static org.junit.Assert.assertThat;
|
|||
*/
|
||||
public class EndpointHandlerMappingTests {
|
||||
|
||||
private StaticApplicationContext context = new StaticApplicationContext();
|
||||
private final StaticApplicationContext context = new StaticApplicationContext();
|
||||
private Method method;
|
||||
|
||||
@Before
|
||||
|
|
|
@ -40,7 +40,7 @@ import static org.mockito.Mockito.when;
|
|||
*/
|
||||
public class SimpleHealthIndicatorTests {
|
||||
|
||||
private SimpleHealthIndicator indicator = new SimpleHealthIndicator();
|
||||
private final SimpleHealthIndicator indicator = new SimpleHealthIndicator();
|
||||
private DriverManagerDataSource dataSource;
|
||||
|
||||
@Before
|
||||
|
|
|
@ -29,9 +29,9 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class MetricCopyExporterTests {
|
||||
|
||||
private InMemoryMetricRepository writer = new InMemoryMetricRepository();
|
||||
private InMemoryMetricRepository reader = new InMemoryMetricRepository();
|
||||
private MetricCopyExporter exporter = new MetricCopyExporter(this.reader, this.writer);
|
||||
private final InMemoryMetricRepository writer = new InMemoryMetricRepository();
|
||||
private final InMemoryMetricRepository reader = new InMemoryMetricRepository();
|
||||
private final MetricCopyExporter exporter = new MetricCopyExporter(this.reader, this.writer);
|
||||
|
||||
@Test
|
||||
public void export() {
|
||||
|
|
|
@ -32,11 +32,11 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class PrefixMetricGroupExporterTests {
|
||||
|
||||
private InMemoryMetricRepository reader = new InMemoryMetricRepository();
|
||||
private final InMemoryMetricRepository reader = new InMemoryMetricRepository();
|
||||
|
||||
private InMemoryMetricRepository writer = new InMemoryMetricRepository();
|
||||
private final InMemoryMetricRepository writer = new InMemoryMetricRepository();
|
||||
|
||||
private PrefixMetricGroupExporter exporter = new PrefixMetricGroupExporter(
|
||||
private final PrefixMetricGroupExporter exporter = new PrefixMetricGroupExporter(
|
||||
this.reader, this.writer);
|
||||
|
||||
@Test
|
||||
|
|
|
@ -29,9 +29,9 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class RichGaugeExporterTests {
|
||||
|
||||
private InMemoryRichGaugeRepository reader = new InMemoryRichGaugeRepository();
|
||||
private InMemoryMetricRepository writer = new InMemoryMetricRepository();
|
||||
private RichGaugeExporter exporter = new RichGaugeExporter(this.reader, this.writer);
|
||||
private final InMemoryRichGaugeRepository reader = new InMemoryRichGaugeRepository();
|
||||
private final InMemoryMetricRepository writer = new InMemoryMetricRepository();
|
||||
private final RichGaugeExporter exporter = new RichGaugeExporter(this.reader, this.writer);
|
||||
|
||||
@Test
|
||||
public void prefixedMetricsCopied() {
|
||||
|
|
|
@ -29,7 +29,7 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class InMemoryMetricRepositoryTests {
|
||||
|
||||
private InMemoryMetricRepository repository = new InMemoryMetricRepository();
|
||||
private final InMemoryMetricRepository repository = new InMemoryMetricRepository();
|
||||
|
||||
@Test
|
||||
public void increment() {
|
||||
|
|
|
@ -31,7 +31,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class InMemoryPrefixMetricRepositoryTests {
|
||||
|
||||
private InMemoryMetricRepository repository = new InMemoryMetricRepository();
|
||||
private final InMemoryMetricRepository repository = new InMemoryMetricRepository();
|
||||
|
||||
@Test
|
||||
public void registeredPrefixCounted() {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class RedisServer implements TestRule {
|
|||
|
||||
protected LettuceConnectionFactory resource;
|
||||
|
||||
private String resourceDescription = "Redis ConnectionFactory";
|
||||
private final String resourceDescription = "Redis ConnectionFactory";
|
||||
|
||||
private static final Log logger = LogFactory.getLog(RedisServer.class);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class InMemoryRichGaugeRepositoryTests {
|
||||
|
||||
private InMemoryRichGaugeRepository repository = new InMemoryRichGaugeRepository();
|
||||
private final InMemoryRichGaugeRepository repository = new InMemoryRichGaugeRepository();
|
||||
|
||||
@Test
|
||||
public void writeAndRead() {
|
||||
|
|
|
@ -37,7 +37,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class InMemoryRepositoryTests {
|
||||
|
||||
private SimpleInMemoryRepository<String> repository = new SimpleInMemoryRepository<String>();
|
||||
private final SimpleInMemoryRepository<String> repository = new SimpleInMemoryRepository<String>();
|
||||
|
||||
@Test
|
||||
public void setAndGet() {
|
||||
|
|
|
@ -29,8 +29,8 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class CodahaleMetricWriterTests {
|
||||
|
||||
private MetricRegistry registry = new MetricRegistry();
|
||||
private CodahaleMetricWriter writer = new CodahaleMetricWriter(this.registry);
|
||||
private final MetricRegistry registry = new MetricRegistry();
|
||||
private final CodahaleMetricWriter writer = new CodahaleMetricWriter(this.registry);
|
||||
|
||||
@Test
|
||||
public void incrementCounter() {
|
||||
|
|
|
@ -28,9 +28,9 @@ import static org.mockito.Mockito.verify;
|
|||
*/
|
||||
public class DefaultCounterServiceTests {
|
||||
|
||||
private MetricWriter repository = mock(MetricWriter.class);
|
||||
private final MetricWriter repository = mock(MetricWriter.class);
|
||||
|
||||
private DefaultCounterService service = new DefaultCounterService(this.repository);
|
||||
private final DefaultCounterService service = new DefaultCounterService(this.repository);
|
||||
|
||||
@Test
|
||||
public void incrementPrependsCounter() {
|
||||
|
|
|
@ -29,9 +29,9 @@ import static org.mockito.Mockito.verify;
|
|||
*/
|
||||
public class DefaultGaugeServiceTests {
|
||||
|
||||
private MetricWriter repository = mock(MetricWriter.class);
|
||||
private final MetricWriter repository = mock(MetricWriter.class);
|
||||
|
||||
private DefaultGaugeService service = new DefaultGaugeService(this.repository);
|
||||
private final DefaultGaugeService service = new DefaultGaugeService(this.repository);
|
||||
|
||||
@Test
|
||||
public void setPrependsGauge() {
|
||||
|
|
|
@ -30,9 +30,9 @@ import static org.mockito.Mockito.verify;
|
|||
*/
|
||||
public class MessageChannelMetricWriterTests {
|
||||
|
||||
private MessageChannel channel = mock(MessageChannel.class);
|
||||
private final MessageChannel channel = mock(MessageChannel.class);
|
||||
|
||||
private MessageChannelMetricWriter observer = new MessageChannelMetricWriter(
|
||||
private final MessageChannelMetricWriter observer = new MessageChannelMetricWriter(
|
||||
this.channel);
|
||||
|
||||
@Test
|
||||
|
|
|
@ -37,9 +37,9 @@ import static org.mockito.Mockito.verify;
|
|||
*/
|
||||
public class AuthenticationAuditListenerTests {
|
||||
|
||||
private AuthenticationAuditListener listener = new AuthenticationAuditListener();
|
||||
private final AuthenticationAuditListener listener = new AuthenticationAuditListener();
|
||||
|
||||
private ApplicationEventPublisher publisher = Mockito
|
||||
private final ApplicationEventPublisher publisher = Mockito
|
||||
.mock(ApplicationEventPublisher.class);
|
||||
|
||||
@Before
|
||||
|
|
|
@ -37,9 +37,9 @@ import static org.mockito.Mockito.verify;
|
|||
*/
|
||||
public class AuthorizationAuditListenerTests {
|
||||
|
||||
private AuthorizationAuditListener listener = new AuthorizationAuditListener();
|
||||
private final AuthorizationAuditListener listener = new AuthorizationAuditListener();
|
||||
|
||||
private ApplicationEventPublisher publisher = Mockito
|
||||
private final ApplicationEventPublisher publisher = Mockito
|
||||
.mock(ApplicationEventPublisher.class);
|
||||
|
||||
@Before
|
||||
|
|
|
@ -30,7 +30,7 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class InMemoryTraceRepositoryTests {
|
||||
|
||||
private InMemoryTraceRepository repository = new InMemoryTraceRepository();
|
||||
private final InMemoryTraceRepository repository = new InMemoryTraceRepository();
|
||||
|
||||
@Test
|
||||
public void capacityLimited() {
|
||||
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class WebRequestTraceFilterTests {
|
||||
|
||||
private WebRequestTraceFilter filter = new WebRequestTraceFilter(
|
||||
private final WebRequestTraceFilter filter = new WebRequestTraceFilter(
|
||||
new InMemoryTraceRepository());
|
||||
|
||||
@Test
|
||||
|
|
|
@ -119,7 +119,7 @@ public class AutoConfigurationReport {
|
|||
*/
|
||||
public static class ConditionAndOutcomes implements Iterable<ConditionAndOutcome> {
|
||||
|
||||
private Set<ConditionAndOutcome> outcomes = new LinkedHashSet<ConditionAndOutcome>();
|
||||
private final Set<ConditionAndOutcome> outcomes = new LinkedHashSet<ConditionAndOutcome>();
|
||||
|
||||
public void add(Condition condition, ConditionOutcome outcome) {
|
||||
this.outcomes.add(new ConditionAndOutcome(condition, outcome));
|
||||
|
|
|
@ -47,7 +47,7 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
class AutoConfigurationSorter {
|
||||
|
||||
private CachingMetadataReaderFactory metadataReaderFactory;
|
||||
private final CachingMetadataReaderFactory metadataReaderFactory;
|
||||
|
||||
public AutoConfigurationSorter(ResourceLoader resourceLoader) {
|
||||
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
|
||||
|
|
|
@ -42,9 +42,9 @@ public class BasicBatchConfigurer implements BatchConfigurer {
|
|||
|
||||
private static Log logger = LogFactory.getLog(BasicBatchConfigurer.class);
|
||||
|
||||
private DataSource dataSource;
|
||||
private final DataSource dataSource;
|
||||
|
||||
private EntityManagerFactory entityManagerFactory;
|
||||
private final EntityManagerFactory entityManagerFactory;
|
||||
|
||||
private PlatformTransactionManager transactionManager;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.springframework.context.ApplicationEvent;
|
|||
*/
|
||||
public class JobExecutionEvent extends ApplicationEvent {
|
||||
|
||||
private JobExecution execution;
|
||||
private final JobExecution execution;
|
||||
|
||||
/**
|
||||
* @param execution the job execution
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.springframework.context.ApplicationListener;
|
|||
public class JobExecutionExitCodeGenerator implements
|
||||
ApplicationListener<JobExecutionEvent>, ExitCodeGenerator {
|
||||
|
||||
private List<JobExecution> executions = new ArrayList<JobExecution>();
|
||||
private final List<JobExecution> executions = new ArrayList<JobExecution>();
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(JobExecutionEvent event) {
|
||||
|
|
|
@ -53,7 +53,7 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner,
|
|||
private static Log logger = LogFactory.getLog(JobLauncherCommandLineRunner.class);
|
||||
|
||||
@Autowired(required = false)
|
||||
private JobParametersConverter converter = new DefaultJobParametersConverter();
|
||||
private final JobParametersConverter converter = new DefaultJobParametersConverter();
|
||||
|
||||
@Autowired
|
||||
private JobLauncher jobLauncher;
|
||||
|
@ -64,7 +64,7 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner,
|
|||
private String jobName;
|
||||
|
||||
@Autowired(required = false)
|
||||
private Collection<Job> jobs = Collections.emptySet();
|
||||
private final Collection<Job> jobs = Collections.emptySet();
|
||||
|
||||
private ApplicationEventPublisher publisher;
|
||||
|
||||
|
|
|
@ -180,13 +180,13 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
|
|||
|
||||
private static class BeanSearchSpec {
|
||||
|
||||
private List<String> names = new ArrayList<String>();
|
||||
private final List<String> names = new ArrayList<String>();
|
||||
|
||||
private List<String> types = new ArrayList<String>();
|
||||
private final List<String> types = new ArrayList<String>();
|
||||
|
||||
private List<String> annotations = new ArrayList<String>();
|
||||
private final List<String> annotations = new ArrayList<String>();
|
||||
|
||||
private SearchStrategy strategy;
|
||||
private final SearchStrategy strategy;
|
||||
|
||||
public BeanSearchSpec(ConditionContext context, AnnotatedTypeMetadata metadata,
|
||||
Class<?> annotationType) {
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.springframework.util.MultiValueMap;
|
|||
*/
|
||||
class OnResourceCondition extends SpringBootCondition {
|
||||
|
||||
private ResourceLoader defaultResourceLoader = new DefaultResourceLoader();
|
||||
private final ResourceLoader defaultResourceLoader = new DefaultResourceLoader();
|
||||
|
||||
@Override
|
||||
public ConditionOutcome getMatchOutcome(ConditionContext context,
|
||||
|
|
|
@ -252,7 +252,7 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
|
|||
*/
|
||||
static class BasicDatabaseCondition extends NonEmbeddedDatabaseCondition {
|
||||
|
||||
private Condition tomcatCondition = new TomcatDatabaseCondition();
|
||||
private final Condition tomcatCondition = new TomcatDatabaseCondition();
|
||||
|
||||
@Override
|
||||
protected String getDataSourceClassName() {
|
||||
|
@ -286,9 +286,9 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
|
|||
*/
|
||||
static class EmbeddedDatabaseCondition extends SpringBootCondition {
|
||||
|
||||
private SpringBootCondition tomcatCondition = new TomcatDatabaseCondition();
|
||||
private final SpringBootCondition tomcatCondition = new TomcatDatabaseCondition();
|
||||
|
||||
private SpringBootCondition dbcpCondition = new BasicDatabaseCondition();
|
||||
private final SpringBootCondition dbcpCondition = new BasicDatabaseCondition();
|
||||
|
||||
@Override
|
||||
public ConditionOutcome getMatchOutcome(ConditionContext context,
|
||||
|
@ -311,11 +311,11 @@ public class DataSourceAutoConfiguration implements EnvironmentAware {
|
|||
*/
|
||||
static class DatabaseCondition extends SpringBootCondition {
|
||||
|
||||
private SpringBootCondition tomcatCondition = new TomcatDatabaseCondition();
|
||||
private final SpringBootCondition tomcatCondition = new TomcatDatabaseCondition();
|
||||
|
||||
private SpringBootCondition dbcpCondition = new BasicDatabaseCondition();
|
||||
private final SpringBootCondition dbcpCondition = new BasicDatabaseCondition();
|
||||
|
||||
private SpringBootCondition embeddedCondition = new EmbeddedDatabaseCondition();
|
||||
private final SpringBootCondition embeddedCondition = new EmbeddedDatabaseCondition();
|
||||
|
||||
@Override
|
||||
public ConditionOutcome getMatchOutcome(ConditionContext context,
|
||||
|
|
|
@ -40,13 +40,13 @@ public class SecurityProperties implements SecurityPrequisite {
|
|||
|
||||
private Basic basic = new Basic();
|
||||
|
||||
private Headers headers = new Headers();
|
||||
private final Headers headers = new Headers();
|
||||
|
||||
private SessionCreationPolicy sessions = SessionCreationPolicy.STATELESS;
|
||||
|
||||
private List<String> ignored = new ArrayList<String>();
|
||||
|
||||
private User user = new User();
|
||||
private final User user = new User();
|
||||
|
||||
public Headers getHeaders() {
|
||||
return this.headers;
|
||||
|
|
|
@ -63,7 +63,7 @@ public class ThymeleafAutoConfiguration {
|
|||
public static class DefaultTemplateResolverConfiguration implements EnvironmentAware {
|
||||
|
||||
@Autowired
|
||||
private ResourceLoader resourceLoader = new DefaultResourceLoader();
|
||||
private final ResourceLoader resourceLoader = new DefaultResourceLoader();
|
||||
|
||||
private RelaxedPropertyResolver environment;
|
||||
|
||||
|
@ -108,10 +108,10 @@ public class ThymeleafAutoConfiguration {
|
|||
protected static class ThymeleafDefaultConfiguration {
|
||||
|
||||
@Autowired
|
||||
private Collection<ITemplateResolver> templateResolvers = Collections.emptySet();
|
||||
private final Collection<ITemplateResolver> templateResolvers = Collections.emptySet();
|
||||
|
||||
@Autowired(required = false)
|
||||
private Collection<IDialect> dialects = Collections.emptySet();
|
||||
private final Collection<IDialect> dialects = Collections.emptySet();
|
||||
|
||||
@Bean
|
||||
public SpringTemplateEngine templateEngine() {
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupp
|
|||
*/
|
||||
public class HttpMessageConverters implements Iterable<HttpMessageConverter<?>> {
|
||||
|
||||
private List<HttpMessageConverter<?>> converters;
|
||||
private final List<HttpMessageConverter<?>> converters;
|
||||
|
||||
/**
|
||||
* Create a new {@link HttpMessageConverters} instance with the specified additional
|
||||
|
|
|
@ -50,7 +50,7 @@ import com.fasterxml.jackson.datatype.joda.JodaModule;
|
|||
public class HttpMessageConvertersAutoConfiguration {
|
||||
|
||||
@Autowired(required = false)
|
||||
private List<HttpMessageConverter<?>> converters = Collections.emptyList();
|
||||
private final List<HttpMessageConverter<?>> converters = Collections.emptyList();
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
|
|
|
@ -56,7 +56,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
|
|||
@NotNull
|
||||
private String contextPath = "";
|
||||
|
||||
private Tomcat tomcat = new Tomcat();
|
||||
private final Tomcat tomcat = new Tomcat();
|
||||
|
||||
public Tomcat getTomcat() {
|
||||
return this.tomcat;
|
||||
|
|
|
@ -69,7 +69,7 @@ public class WebSocketAutoConfiguration {
|
|||
protected static class WebSocketRegistrationConfiguration implements
|
||||
BeanPostProcessor, BeanFactoryAware, WebSocketConfigurer {
|
||||
|
||||
private Map<String, WebSocketHandler> prefixes = new HashMap<String, WebSocketHandler>();
|
||||
private final Map<String, WebSocketHandler> prefixes = new HashMap<String, WebSocketHandler>();
|
||||
|
||||
private ListableBeanFactory beanFactory;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class PropertyPlaceholderAutoConfigurationTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@After
|
||||
public void close() {
|
||||
|
|
|
@ -29,7 +29,7 @@ import static org.junit.Assert.assertEquals;
|
|||
*/
|
||||
public class JobExecutionExitCodeGeneratorTests {
|
||||
|
||||
private JobExecutionExitCodeGenerator generator = new JobExecutionExitCodeGenerator();
|
||||
private final JobExecutionExitCodeGenerator generator = new JobExecutionExitCodeGenerator();
|
||||
|
||||
@Test
|
||||
public void testExitCodeForRunning() {
|
||||
|
|
|
@ -37,7 +37,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class ConditionalOnBeanTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testNameOnBeanCondition() {
|
||||
|
|
|
@ -34,7 +34,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class ConditionalOnClassTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testVanillaOnClassCondition() {
|
||||
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class ConditionalOnExpressionTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testResourceExists() {
|
||||
|
|
|
@ -41,7 +41,7 @@ import static org.junit.Assert.assertTrue;
|
|||
@SuppressWarnings("resource")
|
||||
public class ConditionalOnMissingBeanTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testNameOnMissingBeanCondition() {
|
||||
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class ConditionalOnMissingClassTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testVanillaOnClassCondition() {
|
||||
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class ConditionalOnNotWebApplicationTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testWebApplication() {
|
||||
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class ConditionalOnResourceTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testResourceExists() {
|
||||
|
|
|
@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class ConditionalOnWebApplicationTests {
|
||||
|
||||
private AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
|
||||
private final AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testWebApplication() {
|
||||
|
|
|
@ -30,7 +30,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
*/
|
||||
public class CommonsDataSourceConfigurationTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testDataSourceExists() throws Exception {
|
||||
|
|
|
@ -54,7 +54,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
public class DataSourceAutoConfigurationTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testDefaultDataSourceExists() throws Exception {
|
||||
|
|
|
@ -33,7 +33,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
*/
|
||||
public class DataSourceTransactionManagerAutoConfigurationTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void testDataSourceExists() throws Exception {
|
||||
|
|
|
@ -38,7 +38,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
*/
|
||||
public class TomcatDataSourceConfigurationTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@After
|
||||
public void restore() {
|
||||
|
|
|
@ -28,7 +28,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
*/
|
||||
public class ReactorAutoConfigurationTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
|
||||
@Test
|
||||
public void reactorIsAvailable() {
|
||||
|
|
|
@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify;
|
|||
*/
|
||||
public class ServerPropertiesTests {
|
||||
|
||||
private ServerProperties properties = new ServerProperties();
|
||||
private final ServerProperties properties = new ServerProperties();
|
||||
|
||||
@Test
|
||||
public void testAddressBinding() throws Exception {
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.Collection;
|
|||
*/
|
||||
public abstract class OptionParsingCommand extends AbstractCommand {
|
||||
|
||||
private OptionHandler handler;
|
||||
private final OptionHandler handler;
|
||||
|
||||
protected OptionParsingCommand(String name, String description, OptionHandler handler) {
|
||||
super(name, description);
|
||||
|
|
|
@ -33,9 +33,9 @@ import org.springframework.boot.cli.util.ResourceUtils;
|
|||
*/
|
||||
public class SourceOptions {
|
||||
|
||||
private List<String> sources;
|
||||
private final List<String> sources;
|
||||
|
||||
private List<?> args;
|
||||
private final List<?> args;
|
||||
|
||||
/**
|
||||
* Create a new {@link SourceOptions} instance.
|
||||
|
|
|
@ -30,7 +30,7 @@ class AnsiString {
|
|||
|
||||
private final Terminal terminal;
|
||||
|
||||
private StringBuilder value = new StringBuilder();
|
||||
private final StringBuilder value = new StringBuilder();
|
||||
|
||||
/**
|
||||
* Create a new {@link AnsiString} for the given {@link Terminal}.
|
||||
|
|
|
@ -44,9 +44,9 @@ public class CommandCompleter extends StringsCompleter {
|
|||
|
||||
private final Map<String, Completer> commandCompleters = new HashMap<String, Completer>();
|
||||
|
||||
private List<Command> commands = new ArrayList<Command>();
|
||||
private final List<Command> commands = new ArrayList<Command>();
|
||||
|
||||
private ConsoleReader console;
|
||||
private final ConsoleReader console;
|
||||
|
||||
public CommandCompleter(ConsoleReader consoleReader,
|
||||
ArgumentDelimiter argumentDelimiter, Iterable<Command> commands) {
|
||||
|
|
|
@ -62,13 +62,13 @@ public class Shell {
|
|||
|
||||
private static final String DEFAULT_PROMPT = "$ ";
|
||||
|
||||
private ShellCommandRunner commandRunner;
|
||||
private final ShellCommandRunner commandRunner;
|
||||
|
||||
private ConsoleReader consoleReader;
|
||||
private final ConsoleReader consoleReader;
|
||||
|
||||
private EscapeAwareWhiteSpaceArgumentDelimiter argumentDelimiter = new EscapeAwareWhiteSpaceArgumentDelimiter();
|
||||
private final EscapeAwareWhiteSpaceArgumentDelimiter argumentDelimiter = new EscapeAwareWhiteSpaceArgumentDelimiter();
|
||||
|
||||
private Stack<String> prompts = new Stack<String>();
|
||||
private final Stack<String> prompts = new Stack<String>();
|
||||
|
||||
/**
|
||||
* Create a new {@link Shell} instance.
|
||||
|
|
|
@ -65,7 +65,7 @@ public class GroovyBeansTransformation implements ASTTransformation {
|
|||
private static final String SOURCE_INTERFACE = "org.springframework.boot.BeanDefinitionLoader.GroovyBeanDefinitionSource";
|
||||
private static final String BEANS = "beans";
|
||||
private final SourceUnit source;
|
||||
private ClassNode classNode;
|
||||
private final ClassNode classNode;
|
||||
private boolean xformed = false;
|
||||
|
||||
public ClassVisitor(SourceUnit source, ClassNode classNode) {
|
||||
|
|
|
@ -48,13 +48,13 @@ import org.springframework.boot.cli.util.OutputCapture;
|
|||
*/
|
||||
public class CliTester implements TestRule {
|
||||
|
||||
private OutputCapture outputCapture = new OutputCapture();
|
||||
private final OutputCapture outputCapture = new OutputCapture();
|
||||
|
||||
private long timeout = TimeUnit.MINUTES.toMillis(6);
|
||||
|
||||
private List<AbstractCommand> commands = new ArrayList<AbstractCommand>();
|
||||
private final List<AbstractCommand> commands = new ArrayList<AbstractCommand>();
|
||||
|
||||
private String prefix;
|
||||
private final String prefix;
|
||||
|
||||
public CliTester(String prefix) {
|
||||
this.prefix = prefix;
|
||||
|
|
|
@ -56,7 +56,7 @@ public class CommandRunnerTests {
|
|||
@Mock
|
||||
private Command anotherCommand;
|
||||
|
||||
private Set<Call> calls = EnumSet.noneOf(Call.class);
|
||||
private final Set<Call> calls = EnumSet.noneOf(Call.class);
|
||||
|
||||
private ClassLoader loader;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import static org.junit.Assert.assertThat;
|
|||
*/
|
||||
public class EscapeAwareWhiteSpaceArgumentDelimiterTests {
|
||||
|
||||
private EscapeAwareWhiteSpaceArgumentDelimiter delimiter = new EscapeAwareWhiteSpaceArgumentDelimiter();
|
||||
private final EscapeAwareWhiteSpaceArgumentDelimiter delimiter = new EscapeAwareWhiteSpaceArgumentDelimiter();
|
||||
|
||||
@Test
|
||||
public void simple() throws Exception {
|
||||
|
|
|
@ -28,13 +28,13 @@ public class HotelSummary implements Serializable {
|
|||
private static final MathContext MATH_CONTEXT = new MathContext(2,
|
||||
RoundingMode.HALF_UP);
|
||||
|
||||
private City city;
|
||||
private final City city;
|
||||
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
private Double averageRating;
|
||||
private final Double averageRating;
|
||||
|
||||
private Integer averageRatingRounded;
|
||||
private final Integer averageRatingRounded;
|
||||
|
||||
public HotelSummary(City city, String name, Double averageRating) {
|
||||
this.city = city;
|
||||
|
|
|
@ -22,9 +22,9 @@ public class RatingCount implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Rating rating;
|
||||
private final Rating rating;
|
||||
|
||||
private long count;
|
||||
private final long count;
|
||||
|
||||
public RatingCount(Rating rating, long count) {
|
||||
this.rating = rating;
|
||||
|
|
|
@ -82,7 +82,7 @@ class HotelServiceImpl implements HotelService {
|
|||
|
||||
private static class ReviewsSummaryImpl implements ReviewsSummary {
|
||||
|
||||
private Map<Rating, Long> ratingCount;
|
||||
private final Map<Rating, Long> ratingCount;
|
||||
|
||||
public ReviewsSummaryImpl(List<RatingCount> ratingCounts) {
|
||||
this.ratingCount = new HashMap<Rating, Long>();
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
public class InMemoryMessageRespository implements MessageRepository {
|
||||
|
||||
private static AtomicLong counter = new AtomicLong();
|
||||
private ConcurrentMap<Long, Message> messages = new ConcurrentHashMap<Long, Message>();
|
||||
private final ConcurrentMap<Long, Message> messages = new ConcurrentHashMap<Long, Message>();
|
||||
|
||||
@Override
|
||||
public Iterable<Message> findAll() {
|
||||
|
|
|
@ -34,7 +34,7 @@ import sample.ui.MessageRepository;
|
|||
@Controller
|
||||
@RequestMapping("/")
|
||||
public class MessageController {
|
||||
private MessageRepository messageRepository;
|
||||
private final MessageRepository messageRepository;
|
||||
|
||||
@Autowired
|
||||
public MessageController(MessageRepository messageRepository) {
|
||||
|
|
|
@ -31,7 +31,7 @@ public class SimpleClientWebSocketHandler extends TextWebSocketHandler {
|
|||
|
||||
private final GreetingService greetingService;
|
||||
|
||||
private CountDownLatch latch;
|
||||
private final CountDownLatch latch;
|
||||
|
||||
@Autowired
|
||||
public SimpleClientWebSocketHandler(GreetingService greetingService,
|
||||
|
|
|
@ -83,7 +83,7 @@ public class SampleWebSocketsApplicationTests {
|
|||
@Configuration
|
||||
static class ClientConfiguration implements CommandLineRunner {
|
||||
|
||||
private CountDownLatch latch = new CountDownLatch(1);
|
||||
private final CountDownLatch latch = new CountDownLatch(1);
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
|
|
|
@ -222,7 +222,7 @@ class JarWriter {
|
|||
|
||||
private static final byte[] ZIP_HEADER = new byte[] { 0x50, 0x4b, 0x03, 0x04 };
|
||||
|
||||
private byte[] header;
|
||||
private final byte[] header;
|
||||
|
||||
private ByteArrayInputStream headerStream;
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ public class TestJarFile {
|
|||
|
||||
private final byte[] buffer = new byte[4096];
|
||||
|
||||
private TemporaryFolder temporaryFolder;
|
||||
private final TemporaryFolder temporaryFolder;
|
||||
|
||||
private File jarSource;
|
||||
private final File jarSource;
|
||||
|
||||
public TestJarFile(TemporaryFolder temporaryFolder) throws IOException {
|
||||
this.temporaryFolder = temporaryFolder;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue