Apply project formatting rules for ternary operator
Discovered via RegEx: ^\s+\?
This commit is contained in:
@@ -128,9 +128,8 @@ public class DefaultMethodReference implements MethodReference {
|
||||
return this.declaringClass + "::" + methodName;
|
||||
}
|
||||
else {
|
||||
return ((this.declaringClass != null)
|
||||
? "<" + this.declaringClass + ">" : "<instance>")
|
||||
+ "::" + methodName;
|
||||
return ((this.declaringClass != null) ?
|
||||
"<" + this.declaringClass + ">" : "<instance>") + "::" + methodName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@ public interface MethodReference {
|
||||
* @return a new {@link ArgumentCodeGenerator} instance
|
||||
*/
|
||||
static ArgumentCodeGenerator of(Class<?> argumentType, String argumentCode) {
|
||||
return from(candidateType -> (candidateType.equals(ClassName.get(argumentType))
|
||||
? CodeBlock.of(argumentCode) : null));
|
||||
return from(candidateType -> candidateType.equals(ClassName.get(argumentType)) ?
|
||||
CodeBlock.of(argumentCode) : null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,9 +47,8 @@ public abstract class AbstractTypeReference implements TypeReference {
|
||||
public String getName() {
|
||||
TypeReference enclosingType = getEnclosingType();
|
||||
String simpleName = getSimpleName();
|
||||
return (enclosingType != null
|
||||
? (enclosingType.getName() + '$' + simpleName)
|
||||
: addPackageIfNecessary(simpleName));
|
||||
return (enclosingType != null ? (enclosingType.getName() + '$' + simpleName) :
|
||||
addPackageIfNecessary(simpleName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,9 +35,8 @@ final class ReflectionTypeReference extends AbstractTypeReference {
|
||||
|
||||
@Nullable
|
||||
private static TypeReference getEnclosingClass(Class<?> type) {
|
||||
Class<?> candidate = (type.isArray()
|
||||
? type.getComponentType().getEnclosingClass()
|
||||
: type.getEnclosingClass());
|
||||
Class<?> candidate = (type.isArray() ? type.getComponentType().getEnclosingClass() :
|
||||
type.getEnclosingClass());
|
||||
return (candidate != null ? new ReflectionTypeReference(candidate) : null);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,9 +77,8 @@ public class PropertySourceProcessor {
|
||||
List<String> locations = descriptor.locations();
|
||||
Assert.isTrue(locations.size() > 0, "At least one @PropertySource(value) location is required");
|
||||
boolean ignoreResourceNotFound = descriptor.ignoreResourceNotFound();
|
||||
PropertySourceFactory factory = (descriptor.propertySourceFactory() != null
|
||||
? instantiateClass(descriptor.propertySourceFactory())
|
||||
: DEFAULT_PROPERTY_SOURCE_FACTORY);
|
||||
PropertySourceFactory factory = (descriptor.propertySourceFactory() != null ?
|
||||
instantiateClass(descriptor.propertySourceFactory()) : DEFAULT_PROPERTY_SOURCE_FACTORY);
|
||||
|
||||
for (String location : locations) {
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -180,9 +180,7 @@ class MergedAnnotationsComposedOnSingleAnnotatedElementTests {
|
||||
methods.add(method);
|
||||
}
|
||||
});
|
||||
Method bridgeMethod = methods.get(0).getReturnType().equals(Object.class)
|
||||
? methods.get(0)
|
||||
: methods.get(1);
|
||||
Method bridgeMethod = methods.get(0).getReturnType() == Object.class ? methods.get(0) : methods.get(1);
|
||||
assertThat(bridgeMethod.isBridge()).isTrue();
|
||||
return bridgeMethod;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user