Formatting

This commit is contained in:
Phillip Webb
2018-05-04 12:06:19 -07:00
parent 86f43c4750
commit 6e09e497f2
96 changed files with 217 additions and 135 deletions

View File

@@ -30,4 +30,5 @@ public class TestMethodConfiguration {
public Object method() {
return null;
}
}

View File

@@ -29,4 +29,5 @@ import java.io.OutputStream;
@TestConditionalOnClass(name = "java.io.InputStream", value = OutputStream.class)
@TestAutoConfigureOrder(123)
public class TestOrderedClassConfiguration {
}

View File

@@ -151,8 +151,8 @@ public class ConfigurationMetadata {
}
candidates.removeIf((itemMetadata) -> !itemMetadata.hasSameType(metadata));
if (candidates.size() > 1 && metadata.getType() != null) {
candidates.removeIf((itemMetadata) ->
!metadata.getType().equals(itemMetadata.getType()));
candidates.removeIf(
(itemMetadata) -> !metadata.getType().equals(itemMetadata.getType()));
}
if (candidates.size() == 1) {
return candidates.get(0);

View File

@@ -742,8 +742,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
"java.lang.String", null, null, null, null, null);
writeAdditionalMetadata(property);
ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(metadata).has(Metadata.withGroup("simple")
.fromSource(SimpleProperties.class));
assertThat(metadata)
.has(Metadata.withGroup("simple").fromSource(SimpleProperties.class));
assertThat(metadata).has(Metadata.withProperty("simple", String.class));
}

View File

@@ -57,8 +57,10 @@ public interface RandomAccessData {
* @param length the number of bytes to be read
* @return the data
* @throws IOException if the data cannot be read
* @throws IndexOutOfBoundsException if offset is beyond the end of the file or subsection
* @throws EOFException if offset plus length is greater than the length of the file or subsection
* @throws IndexOutOfBoundsException if offset is beyond the end of the file or
* subsection
* @throws EOFException if offset plus length is greater than the length of the file
* or subsection
*/
byte[] read(long offset, long length) throws IOException;

View File

@@ -110,20 +110,23 @@ public class RandomAccessDataFileTests {
}
@Test
public void readWhenOffsetIsBeyondEndOfSubsectionShouldThrowException() throws Exception {
public void readWhenOffsetIsBeyondEndOfSubsectionShouldThrowException()
throws Exception {
this.thrown.expect(IndexOutOfBoundsException.class);
RandomAccessData subsection = this.file.getSubsection(0, 10);
subsection.read(11, 0);
}
@Test
public void readWhenOffsetPlusLengthGreaterThanEOFShouldThrowException() throws Exception {
public void readWhenOffsetPlusLengthGreaterThanEOFShouldThrowException()
throws Exception {
this.thrown.expect(EOFException.class);
this.file.read(256, 1);
}
@Test
public void readWhenOffsetPlusLengthGreaterThanEndOfSubsectionShouldThrowException() throws Exception {
public void readWhenOffsetPlusLengthGreaterThanEndOfSubsectionShouldThrowException()
throws Exception {
this.thrown.expect(EOFException.class);
RandomAccessData subsection = this.file.getSubsection(0, 10);
subsection.read(10, 1);

View File

@@ -199,4 +199,5 @@ public class AsciiBytesTests {
private void matchesSameAsString(String input) {
assertThat(new AsciiBytes(input).matches(input, NO_SUFFIX)).isTrue();
}
}