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

@@ -24,7 +24,6 @@ import javax.lang.model.element.VariableElement;
import org.junit.Test;
import org.springframework.boot.configurationsample.simple.DeprecatedProperties;
import org.springframework.boot.configurationsample.simple.DeprecatedSingleProperty;
import org.springframework.boot.configurationsample.simple.SimpleCollectionProperties;
import org.springframework.boot.configurationsample.simple.SimpleProperties;
@@ -196,14 +195,15 @@ public class JavaBeanPropertyDescriptorTests extends PropertyDescriptorTests {
@Test
@SuppressWarnings("deprecation")
public void javaBeanDeprecatedPropertyOnClass() throws IOException {
process(DeprecatedProperties.class, (roundEnv, metadataEnv) -> {
TypeElement ownerElement = roundEnv
.getRootElement(DeprecatedProperties.class);
JavaBeanPropertyDescriptor property = createPropertyDescriptor(ownerElement,
"name");
assertItemMetadata(metadataEnv, property).isProperty()
.isDeprecatedWithNoInformation();
});
process(org.springframework.boot.configurationsample.simple.DeprecatedProperties.class,
(roundEnv, metadataEnv) -> {
TypeElement ownerElement = roundEnv.getRootElement(
org.springframework.boot.configurationsample.simple.DeprecatedProperties.class);
JavaBeanPropertyDescriptor property = createPropertyDescriptor(
ownerElement, "name");
assertItemMetadata(metadataEnv, property).isProperty()
.isDeprecatedWithNoInformation();
});
}
@Test

View File

@@ -25,7 +25,6 @@ import javax.lang.model.element.VariableElement;
import org.junit.Test;
import org.springframework.boot.configurationsample.lombok.LombokDefaultValueProperties;
import org.springframework.boot.configurationsample.lombok.LombokDeprecatedProperties;
import org.springframework.boot.configurationsample.lombok.LombokDeprecatedSingleProperty;
import org.springframework.boot.configurationsample.lombok.LombokExplicitProperties;
import org.springframework.boot.configurationsample.lombok.LombokInnerClassProperties;
@@ -229,14 +228,15 @@ public class LombokPropertyDescriptorTests extends PropertyDescriptorTests {
@Test
@SuppressWarnings("deprecation")
public void lombokDeprecatedPropertyOnClass() throws IOException {
process(LombokDeprecatedProperties.class, (roundEnv, metadataEnv) -> {
TypeElement ownerElement = roundEnv
.getRootElement(LombokDeprecatedProperties.class);
LombokPropertyDescriptor property = createPropertyDescriptor(ownerElement,
"name");
assertItemMetadata(metadataEnv, property).isProperty()
.isDeprecatedWithNoInformation();
});
process(org.springframework.boot.configurationsample.lombok.LombokDeprecatedProperties.class,
(roundEnv, metadataEnv) -> {
TypeElement ownerElement = roundEnv.getRootElement(
org.springframework.boot.configurationsample.lombok.LombokDeprecatedProperties.class);
LombokPropertyDescriptor property = createPropertyDescriptor(
ownerElement, "name");
assertItemMetadata(metadataEnv, property).isProperty()
.isDeprecatedWithNoInformation();
});
}
@Test

View File

@@ -23,6 +23,7 @@ import java.util.Map;
* A pojo with a complex generic signature.
*
* @author Stephane Nicoll
* @param <T> the generic type
*/
public class UpperBoundGenericPojo<T extends Enum<T>> {

View File

@@ -26,6 +26,7 @@ import org.springframework.boot.configurationsample.DefaultValue;
*
* @author Stephane Nicoll
*/
@SuppressWarnings("unused")
public class ImmutableCollectionProperties {
private final List<String> names;

View File

@@ -27,6 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
*/
@Data
@ConfigurationProperties("default")
@SuppressWarnings("unused")
public class LombokDefaultValueProperties {
private String description = "my description";

View File

@@ -30,6 +30,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
@Setter
@ConfigurationProperties(prefix = "deprecated")
@Deprecated
@SuppressWarnings("unused")
public class LombokDeprecatedProperties {
private String name;

View File

@@ -27,6 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
*/
@Data
@ConfigurationProperties("singledeprecated")
@SuppressWarnings("unused")
public class LombokDeprecatedSingleProperty {
@Deprecated