Reformat code

This commit is contained in:
Phillip Webb
2015-09-08 14:56:40 -07:00
parent 2615990ffb
commit 67402405db
56 changed files with 188 additions and 252 deletions

View File

@@ -31,7 +31,7 @@ import java.util.Map;
* @since 1.3.0
*/
@SuppressWarnings("serial")
public class ValueProvider implements Serializable{
public class ValueProvider implements Serializable {
private String name;

View File

@@ -138,18 +138,18 @@ public class ConfigurationMetadata {
it.remove();
}
}
if (candidates.size() == 1) {
if (candidates.size() == 1) {
return candidates.get(0);
}
for (ItemMetadata candidate : candidates) {
if (ObjectUtils.nullSafeEquals(candidate.getSourceType(), metadata.getSourceType())) {
if (ObjectUtils.nullSafeEquals(candidate.getSourceType(),
metadata.getSourceType())) {
return candidate;
}
}
return null;
}
public static String nestedPrefix(String prefix, String name) {
String nestedPrefix = (prefix == null ? "" : prefix);
String dashedName = toDashedCase(name);

View File

@@ -79,7 +79,7 @@ public class ItemHint implements Comparable<ItemHint> {
public static ItemHint newHint(String name, ValueHint... values) {
return new ItemHint(name, Arrays.asList(values),
Collections.<ValueProvider> emptyList());
Collections.<ValueProvider>emptyList());
}
@Override

View File

@@ -348,8 +348,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
public void mergingOfAdditionalProperty() throws Exception {
ItemMetadata property = ItemMetadata.newProperty(null, "foo",
"java.lang.String", AdditionalMetadata.class.getName(), null, null, null,null);
ItemMetadata property = ItemMetadata.newProperty(null, "foo", "java.lang.String",
AdditionalMetadata.class.getName(), null, null, null, null);
writeAdditionalMetadata(property);
ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(metadata, containsProperty("simple.comparator"));
@@ -360,16 +360,15 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
public void mergeExistingPropertyDefaultValue() throws Exception {
ItemMetadata property = ItemMetadata.newProperty("simple", "flag", null,
null, null, null, true, null);
ItemMetadata property = ItemMetadata.newProperty("simple", "flag", null, null,
null, null, true, null);
writeAdditionalMetadata(property);
ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(
metadata,
containsProperty("simple.flag", Boolean.class)
.fromSource(SimpleProperties.class)
.withDescription("A simple flag.")
.withDefaultValue(is(true)));
.withDescription("A simple flag.").withDefaultValue(is(true)));
assertThat(metadata.getItems().size(), is(4));
}
@@ -382,8 +381,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
assertThat(
metadata,
containsProperty("simple.comparator", "java.util.Comparator<?>")
.fromSource(SimpleProperties.class)
.withDescription("A nice comparator."));
.fromSource(SimpleProperties.class).withDescription(
"A nice comparator."));
assertThat(metadata.getItems().size(), is(4));
}
@@ -397,23 +396,23 @@ public class ConfigurationMetadataAnnotationProcessorTests {
assertThat(
metadata,
containsProperty("simple.comparator", "java.util.Comparator<?>")
.fromSource(SimpleProperties.class)
.withDeprecation("Don't use this.", "simple.complex-comparator"));
.fromSource(SimpleProperties.class).withDeprecation(
"Don't use this.", "simple.complex-comparator"));
assertThat(metadata.getItems().size(), is(4));
}
@Test
public void mergeExistingPropertyDeprecationOverride() throws Exception {
ItemMetadata property = ItemMetadata.newProperty("singledeprecated", "name", null,
null, null, null, null, new ItemDeprecation("Don't use this.",
ItemMetadata property = ItemMetadata.newProperty("singledeprecated", "name",
null, null, null, null, null, new ItemDeprecation("Don't use this.",
"single.name"));
writeAdditionalMetadata(property);
ConfigurationMetadata metadata = compile(DeprecatedSingleProperty.class);
assertThat(
metadata,
containsProperty("singledeprecated.name", String.class.getName())
.fromSource(DeprecatedSingleProperty.class)
.withDeprecation("Don't use this.", "single.name"));
.fromSource(DeprecatedSingleProperty.class).withDeprecation(
"Don't use this.", "single.name"));
assertThat(metadata.getItems().size(), is(3));
}
@@ -461,9 +460,9 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
public void mergingOfHintWithProvider() throws Exception {
writeAdditionalHints(new ItemHint("simple.theName",
Collections.<ItemHint.ValueHint> emptyList(), Arrays.asList(
Collections.<ItemHint.ValueHint>emptyList(), Arrays.asList(
new ItemHint.ValueProvider("first", Collections
.<String, Object> singletonMap("target", "org.foo")),
.<String, Object>singletonMap("target", "org.foo")),
new ItemHint.ValueProvider("second", null))));
ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(

View File

@@ -60,7 +60,7 @@ public class JsonMarshallerTests {
metadata.add(ItemHint.newHint("c", new ItemHint.ValueHint(123, "hey"),
new ItemHint.ValueHint(456, null)));
metadata.add(new ItemHint("d", null, Arrays.asList(new ItemHint.ValueProvider(
"first", Collections.<String, Object> singletonMap("target", "foo")),
"first", Collections.<String, Object>singletonMap("target", "foo")),
new ItemHint.ValueProvider("second", null))));
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
JsonMarshaller marshaller = new JsonMarshaller();

View File

@@ -93,7 +93,7 @@ public abstract class ManagedDependencies implements Dependencies {
* @see #get(Collection)
*/
public static ManagedDependencies get() {
return get(Collections.<Dependencies>emptySet());
return get(Collections.<Dependencies> emptySet());
}
/**

View File

@@ -35,7 +35,7 @@ public class ManagedDependenciesDelegateTests {
PropertiesFileDependencies extra = new PropertiesFileDependencies(getClass()
.getResourceAsStream("additional-external.properties"));
this.dependencies = new ManagedDependenciesDelegate(root,
Collections.<Dependencies>singleton(extra));
Collections.<Dependencies> singleton(extra));
}
@Test

View File

@@ -54,7 +54,7 @@ public class BootRunTask extends JavaExec {
@Override
public void exec() {
if(System.console() != null) {
if (System.console() != null) {
// Record that the console is available here for AnsiOutput to detect later
this.getEnvironment().put("spring.output.ansi.console-available", true);
}

View File

@@ -167,8 +167,8 @@ public abstract class SystemPropertyUtils {
/**
* Search the System properties and environment variables for a value with the
* provided key. Environment variables in {@code UPPER_CASE} style are allowed
* where System properties would normally be {@code lower.case}.
* provided key. Environment variables in {@code UPPER_CASE} style are allowed where
* System properties would normally be {@code lower.case}.
* @param key the key to resolve
* @param defaultValue the default value
* @param text optional extra context for an error message if the key resolution fails

View File

@@ -121,9 +121,10 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
private LayoutType layout;
/**
* A list of the libraries that must be unpacked from fat jars in order to run. Specify
* each library as a <code>&lt;dependency&gt;</code> with a <code>&lt;groupId&gt;</code> and a
* <code>&lt;artifactId&gt;</code> and they will be unpacked at runtime in <code>$TMPDIR/spring-boot-libs</code>.
* A list of the libraries that must be unpacked from fat jars in order to run.
* Specify each library as a <code>&lt;dependency&gt;</code> with a
* <code>&lt;groupId&gt;</code> and a <code>&lt;artifactId&gt;</code> and they will be
* unpacked at runtime in <code>$TMPDIR/spring-boot-libs</code>.
* @since 1.1
*/
@Parameter