Fix compiler warnings and polish

Fix various compiler warnings and apply a little polish.
This commit is contained in:
Phillip Webb
2019-04-24 14:33:18 -07:00
parent 4754386361
commit 1e44aba772
61 changed files with 212 additions and 125 deletions

View File

@@ -108,7 +108,6 @@ class ImportsContextCustomizer implements ContextCustomizer {
throw new IllegalStateException("Could not locate BeanDefinitionRegistry");
}
@SuppressWarnings("unchecked")
private BeanDefinition registerBean(BeanDefinitionRegistry registry,
AnnotatedBeanDefinitionReader reader, String beanName, Class<?> type) {
reader.registerBean(type, beanName);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,7 +54,8 @@ public interface ApplicationContextAssertProvider<C extends ApplicationContext>
/**
* Return an assert for AspectJ.
* @return an AspectJ assert
* @deprecated use standard AssertJ {@code assertThat(context)...} calls instead.
* @deprecated to prevent accidental use. Prefer standard AssertJ
* {@code assertThat(context)...} calls instead.
*/
@Deprecated
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,8 +55,8 @@ public final class JsonContent<T> implements AssertProvider<JsonContentAssert> {
/**
* Use AssertJ's {@link org.assertj.core.api.Assertions#assertThat assertThat}
* instead.
* @deprecated in favor of AssertJ's {@link org.assertj.core.api.Assertions#assertThat
* assertThat}
* @deprecated to prevent accidental use. Prefer standard AssertJ
* {@code assertThat(context)...} calls instead.
*/
@Override
@Deprecated

View File

@@ -29,6 +29,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for {@link TestRestTemplateContextCustomizer} to ensure
* early-initialization of factory beans doesn't occur.
@@ -47,6 +49,7 @@ public class TestRestTemplateContextCustomizerWithFactoryBeanTests {
@Test
public void test() {
assertThat(this.restTemplate).isNotNull();
}
@Configuration

View File

@@ -21,9 +21,13 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
/**
* A simple factory bean with no generics. Used to test early initialization doesn't
* occur.
*
* @author Madhura Bhave
*/
@Component
@SuppressWarnings("rawtypes")
public class SimpleFactoryBean implements FactoryBean {
private static boolean isInitializedEarly = false;
@@ -40,10 +44,12 @@ public class SimpleFactoryBean implements FactoryBean {
}
}
@Override
public Object getObject() {
return new Object();
}
@Override
public Class<?> getObjectType() {
return Object.class;
}