Polish ternary expressions

Consistently format ternary expressions and always favor `!=` as the
the check.
This commit is contained in:
Phillip Webb
2018-05-02 12:41:51 -07:00
parent 690f946b6d
commit 3ee777e142
199 changed files with 419 additions and 412 deletions

View File

@@ -120,8 +120,8 @@ public abstract class AbstractHttpClientMockTests {
try {
HttpEntity entity = mock(HttpEntity.class);
given(entity.getContent()).willReturn(new ByteArrayInputStream(content));
Header contentTypeHeader = contentType != null
? new BasicHeader("Content-Type", contentType) : null;
Header contentTypeHeader = (contentType != null
? new BasicHeader("Content-Type", contentType) : null);
given(entity.getContentType()).willReturn(contentTypeHeader);
given(response.getEntity()).willReturn(entity);
return entity;
@@ -139,7 +139,7 @@ public abstract class AbstractHttpClientMockTests {
protected void mockHttpHeader(CloseableHttpResponse response, String headerName,
String value) {
Header header = value != null ? new BasicHeader(headerName, value) : null;
Header header = (value != null ? new BasicHeader(headerName, value) : null);
given(response.getFirstHeader(headerName)).willReturn(header);
}