Run more formatting fixes in preparation for the open-source change

Similar to [] these are issues found by Google Java Format. Most of the output is just using the standard [] formatter, then fixing any line-length issues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232488284
This commit is contained in:
gbrodman 2019-02-05 08:11:46 -08:00 committed by jianglai
parent 058ef07e16
commit 89802329b3
3 changed files with 173 additions and 148 deletions

View file

@ -50,9 +50,7 @@ public class RdapTestHelper {
} }
static ImmutableList<ImmutableMap<String, Object>> createNotices( static ImmutableList<ImmutableMap<String, Object>> createNotices(
String linkBase, String linkBase, ContactNoticeType contactNoticeType, @Nullable Object otherNotices) {
ContactNoticeType contactNoticeType,
@Nullable Object otherNotices) {
ImmutableList.Builder<ImmutableMap<String, Object>> noticesBuilder = ImmutableList.Builder<ImmutableMap<String, Object>> noticesBuilder =
getBuilderWithOthersAdded(otherNotices); getBuilderWithOthersAdded(otherNotices);
switch (contactNoticeType) { switch (contactNoticeType) {
@ -67,12 +65,14 @@ public class RdapTestHelper {
case CONTACT: case CONTACT:
noticesBuilder.add( noticesBuilder.add(
ImmutableMap.of( ImmutableMap.of(
"title", "Data Policy", "title",
"Data Policy",
"description", "description",
ImmutableList.of( ImmutableList.of(
"Some of the data in this object has been removed.", "Some of the data in this object has been removed.",
"Contact personal data is visible only to the owning registrar."), "Contact personal data is visible only to the owning registrar."),
"type", "object truncated due to authorization", "type",
"object truncated due to authorization",
"links", "links",
ImmutableList.of( ImmutableList.of(
ImmutableMap.of( ImmutableMap.of(
@ -215,11 +215,13 @@ public class RdapTestHelper {
static RdapJsonFormatter getTestRdapJsonFormatter() { static RdapJsonFormatter getTestRdapJsonFormatter() {
RdapJsonFormatter rdapJsonFormatter = new RdapJsonFormatter(); RdapJsonFormatter rdapJsonFormatter = new RdapJsonFormatter();
rdapJsonFormatter.rdapTosPath = "/tos"; rdapJsonFormatter.rdapTosPath = "/tos";
rdapJsonFormatter.rdapHelpMap = ImmutableMap.of( rdapJsonFormatter.rdapHelpMap =
ImmutableMap.of(
"/", "/",
RdapNoticeDescriptor.builder() RdapNoticeDescriptor.builder()
.setTitle("RDAP Help") .setTitle("RDAP Help")
.setDescription(ImmutableList.of( .setDescription(
ImmutableList.of(
"domain/XXXX", "domain/XXXX",
"nameserver/XXXX", "nameserver/XXXX",
"entity/XXXX", "entity/XXXX",
@ -237,9 +239,10 @@ public class RdapTestHelper {
"/tos", "/tos",
RdapNoticeDescriptor.builder() RdapNoticeDescriptor.builder()
.setTitle("RDAP Terms of Service") .setTitle("RDAP Terms of Service")
.setDescription(ImmutableList.of( .setDescription(
"By querying our Domain Database, you are agreeing to comply with these terms so" ImmutableList.of(
+ " please read them carefully.", "By querying our Domain Database, you are agreeing to comply with these"
+ " terms so please read them carefully.",
"Any information provided is 'as is' without any guarantee of accuracy.", "Any information provided is 'as is' without any guarantee of accuracy.",
"Please do not misuse the Domain Database. It is intended solely for" "Please do not misuse the Domain Database. It is intended solely for"
+ " query-based access.", + " query-based access.",
@ -247,13 +250,13 @@ public class RdapTestHelper {
+ " transmission of mass unsolicited, commercial advertising or" + " transmission of mass unsolicited, commercial advertising or"
+ " solicitations.", + " solicitations.",
"Don't access our Domain Database through the use of high volume, automated" "Don't access our Domain Database through the use of high volume, automated"
+ " electronic processes that send queries or data to the systems of any" + " electronic processes that send queries or data to the systems of"
+ " ICANN-accredited registrar.", + " any ICANN-accredited registrar.",
"You may only use the information contained in the Domain Database for lawful" "You may only use the information contained in the Domain Database for"
+ " purposes.", + " lawful purposes.",
"Do not compile, repackage, disseminate, or otherwise use the information" "Do not compile, repackage, disseminate, or otherwise use the information"
+ " contained in the Domain Database in its entirety, or in any substantial" + " contained in the Domain Database in its entirety, or in any"
+ " portion, without our prior written permission.", + " substantial portion, without our prior written permission.",
"We may retain certain details about queries to our Domain Database for the" "We may retain certain details about queries to our Domain Database for the"
+ " purposes of detecting and preventing misuse.", + " purposes of detecting and preventing misuse.",
"We reserve the right to restrict or deny your access to the database if we" "We reserve the right to restrict or deny your access to the database if we"

View file

@ -122,10 +122,11 @@ public class HexDumperTest {
assertThat(out.toString()).isEmpty(); assertThat(out.toString()).isEmpty();
// But one more byte will bring the total to N+1, thereby flushing a line of hexdump output. // But one more byte will bring the total to N+1, thereby flushing a line of hexdump output.
dumper.write(0); dumper.write(0);
assertThat(out.toString()).isEqualTo("" assertThat(out.toString())
+ "00000000 53 77 65 65 74 20 74 6f 20 74 6f 6e 67 75 65 20 61 6e 64 20 73 6f 75 6e 64 " .isEqualTo(
+ "20 74 6f 20 65 79 65 3b 20 43 6f 6d 65 20 62 75 79 2c 20 63 6f 6d 65 20 62 75 79 2e " "00000000 53 77 65 65 74 20 74 6f 20 74 6f 6e 67 75 65 20 61 6e 64 20 73 6f "
+ "00 Sweet to tongue and sound to eye; Come buy, come buy..\n"); + "75 6e 64 20 74 6f 20 65 79 65 3b 20 43 6f 6d 65 20 62 75 79 2c 20 63 6f 6d 65 "
+ "20 62 75 79 2e 00 Sweet to tongue and sound to eye; Come buy, come buy..\n");
// No additional data will need to be written upon close. // No additional data will need to be written upon close.
int oldTotal = out.toString().length(); int oldTotal = out.toString().length();
assertThat(out.toString().length()).isEqualTo(oldTotal); assertThat(out.toString().length()).isEqualTo(oldTotal);

View file

@ -44,7 +44,10 @@ public class PosixTarHeaderTest {
// head -c 1024 <hello.tar | base64 // head -c 1024 <hello.tar | base64
// //
// As you can see, we're only going to bother with the first 1024 characters. // As you can see, we're only going to bother with the first 1024 characters.
byte[] gnuTarGeneratedData = base64().decode("" byte[] gnuTarGeneratedData =
base64()
.decode(
""
+ "aGVsbG8ueG1sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "aGVsbG8ueG1sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAwMDA2NDAAMDU0MTI2" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAwMDA2NDAAMDU0MTI2"
+ "NgAwMDExNjEwADAwMDAwMDAwMDE0ADEyMjAyMzEwMzI0ADAxMjQ2MQAgMAAAAAAAAAAAAAAAAAAA" + "NgAwMDExNjEwADAwMDAwMDAwMDE0ADEyMjAyMzEwMzI0ADAxMjQ2MQAgMAAAAAAAAAAAAAAAAAAA"
@ -67,7 +70,8 @@ public class PosixTarHeaderTest {
// Now we have to replicate it. // Now we have to replicate it.
byte[] data = "hello kitty\n".getBytes(UTF_8); byte[] data = "hello kitty\n".getBytes(UTF_8);
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
new PosixTarHeader.Builder()
.setType(PosixTarHeader.Type.REGULAR) .setType(PosixTarHeader.Type.REGULAR)
.setName("hello.xml") .setName("hello.xml")
.setSize(data.length) .setSize(data.length)
@ -117,7 +121,8 @@ public class PosixTarHeaderTest {
@Test @Test
public void testFields() { public void testFields() {
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
new PosixTarHeader.Builder()
.setType(PosixTarHeader.Type.REGULAR) .setType(PosixTarHeader.Type.REGULAR)
.setName("(◕‿◕).txt") .setName("(◕‿◕).txt")
.setSize(666) .setSize(666)
@ -143,7 +148,8 @@ public class PosixTarHeaderTest {
@Test @Test
public void testFieldsSomeMoar() { public void testFieldsSomeMoar() {
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
new PosixTarHeader.Builder()
.setType(PosixTarHeader.Type.DIRECTORY) .setType(PosixTarHeader.Type.DIRECTORY)
.setName("Black lung full of fumes, choke on memories") .setName("Black lung full of fumes, choke on memories")
.setSize(1024 * 1024 * 1024) .setSize(1024 * 1024 * 1024)
@ -167,7 +173,8 @@ public class PosixTarHeaderTest {
@Test @Test
public void testLoad() { public void testLoad() {
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
new PosixTarHeader.Builder()
.setType(PosixTarHeader.Type.REGULAR) .setType(PosixTarHeader.Type.REGULAR)
.setName("(◕‿◕).txt") .setName("(◕‿◕).txt")
.setSize(31337) .setSize(31337)
@ -194,10 +201,8 @@ public class PosixTarHeaderTest {
@Test @Test
public void testBadChecksum() { public void testBadChecksum() {
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
.setName("(◕‿◕).txt") new PosixTarHeader.Builder().setName("(◕‿◕).txt").setSize(31337).build();
.setSize(31337)
.build();
byte[] bytes = header.getBytes(); byte[] bytes = header.getBytes();
bytes[150] = '0'; bytes[150] = '0';
bytes[151] = '0'; bytes[151] = '0';
@ -245,11 +250,15 @@ public class PosixTarHeaderTest {
// echo no wind can soothe my pain >inrain // echo no wind can soothe my pain >inrain
// chmod 0600 liketears inrain // chmod 0600 liketears inrain
// tar --format=ustar -c liketears inrain | gzip | base64 // tar --format=ustar -c liketears inrain | gzip | base64
InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" InputStream input =
+ "H4sIAIl5DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5hTH" new GZIPInputStream(
+ "4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh9Bu7L8+Sj" new ByteArrayInputStream(
+ "4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NLSr6/w1L/6cmHu79H" base64()
+ "7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA="))); .decode(
"H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5h"
+ "TH4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh"
+ "9Bu7L8+Sj4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NL"
+ "Sr6/w1L/6cmHu79H7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA=")));
PosixTarHeader header; PosixTarHeader header;
byte[] block = new byte[512]; byte[] block = new byte[512];
@ -299,11 +308,15 @@ public class PosixTarHeaderTest {
// echo no wind can soothe my pain >inrain // echo no wind can soothe my pain >inrain
// chmod 0600 liketears inrain // chmod 0600 liketears inrain
// tar -c liketears inrain | gzip | base64 // tar -c liketears inrain | gzip | base64
InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" InputStream input =
+ "H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5hTH" new GZIPInputStream(
+ "4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh9Bu7L8+Sj" new ByteArrayInputStream(
+ "4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NLSr6/w1L/6cmHu79H" base64()
+ "7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA="))); .decode(
"H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5h"
+ "TH4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh"
+ "9Bu7L8+Sj4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NL"
+ "Sr6/w1L/6cmHu79H7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA=")));
PosixTarHeader header; PosixTarHeader header;
byte[] block = new byte[512]; byte[] block = new byte[512];
@ -353,11 +366,15 @@ public class PosixTarHeaderTest {
// echo no wind can soothe my pain >inrain // echo no wind can soothe my pain >inrain
// chmod 0600 liketears inrain // chmod 0600 liketears inrain
// tar -c liketears inrain | gzip | base64 // tar -c liketears inrain | gzip | base64
InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" InputStream input =
+ "H4sIAHV8DVIAA+3TTQ6CMBCG4a49xRxhWqCcp1Ei+FMMYIi3t3RhXOkKjMn77Npp0klmvkt3bqY" new GZIPInputStream(
+ "mDKNZjyZe1WhVWud9Olvrreb7rKiNdU4LV3tblSaVnVcjumJPL/dxCoOIOYVh+vSuicct2tla7G" new ByteArrayInputStream(
+ "UIXZR9iDKHsZUwh4dcH5KXYvfr9rCyLi7jX/eP7/kv3vKf6larqiD/W0j5n7t4yPkf+35qmyX8t" base64()
+ "7QTZB8AAAAAAAAAAAAAAOAfPAE43i9LACgAAA=="))); .decode(
"H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4V"
+ "n3l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2V"
+ "fG8es77Kcu4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5"
+ "P8XUv6HEE9z/rum6etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA=")));
PosixTarHeader header; PosixTarHeader header;
byte[] block = new byte[512]; byte[] block = new byte[512];
@ -407,11 +424,15 @@ public class PosixTarHeaderTest {
// echo no wind can soothe my pain >inrain // echo no wind can soothe my pain >inrain
// chmod 0600 liketears inrain // chmod 0600 liketears inrain
// tar --format=ustar -c liketears inrain | gzip | base64 // tar --format=ustar -c liketears inrain | gzip | base64
InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" InputStream input =
+ "H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4Vn3" new GZIPInputStream(
+ "l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2VfG8es77Kc" new ByteArrayInputStream(
+ "u4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5P8XUv6HEE9z/rum6" base64()
+ "etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA="))); .decode(
"H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4V"
+ "n3l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2V"
+ "fG8es77Kcu4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5"
+ "P8XUv6HEE9z/rum6etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA=")));
PosixTarHeader header; PosixTarHeader header;
byte[] block = new byte[512]; byte[] block = new byte[512];