Replace space indentation with tabs
Issue: SPR-10127
This commit is contained in:
committed by
Chris Beams
parent
1762157ad1
commit
2cf45bad86
@@ -319,17 +319,17 @@ public class Constants {
|
||||
* @see #toCodeForProperty
|
||||
*/
|
||||
public String propertyToConstantNamePrefix(String propertyName) {
|
||||
StringBuilder parsedPrefix = new StringBuilder();
|
||||
for(int i = 0; i < propertyName.length(); i++) {
|
||||
char c = propertyName.charAt(i);
|
||||
if (Character.isUpperCase(c)) {
|
||||
parsedPrefix.append("_");
|
||||
parsedPrefix.append(c);
|
||||
}
|
||||
else {
|
||||
parsedPrefix.append(Character.toUpperCase(c));
|
||||
}
|
||||
}
|
||||
StringBuilder parsedPrefix = new StringBuilder();
|
||||
for (int i = 0; i < propertyName.length(); i++) {
|
||||
char c = propertyName.charAt(i);
|
||||
if (Character.isUpperCase(c)) {
|
||||
parsedPrefix.append("_");
|
||||
parsedPrefix.append(c);
|
||||
}
|
||||
else {
|
||||
parsedPrefix.append(Character.toUpperCase(c));
|
||||
}
|
||||
}
|
||||
return parsedPrefix.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -94,23 +94,23 @@ public interface GenericConverter {
|
||||
return this.targetType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || obj.getClass() != ConvertiblePair.class) {
|
||||
if (obj == null || obj.getClass() != ConvertiblePair.class) {
|
||||
return false;
|
||||
}
|
||||
ConvertiblePair other = (ConvertiblePair) obj;
|
||||
return this.sourceType.equals(other.sourceType) && this.targetType.equals(other.targetType);
|
||||
ConvertiblePair other = (ConvertiblePair) obj;
|
||||
return this.sourceType.equals(other.sourceType) && this.targetType.equals(other.targetType);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.sourceType.hashCode() * 31 + this.targetType.hashCode();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.sourceType.hashCode() * 31 + this.targetType.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public abstract class AbstractResource implements Resource {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return (obj == this ||
|
||||
(obj instanceof Resource && ((Resource) obj).getDescription().equals(getDescription())));
|
||||
(obj instanceof Resource && ((Resource) obj).getDescription().equals(getDescription())));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ByteArrayResource extends AbstractResource {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return (obj == this ||
|
||||
(obj instanceof ByteArrayResource && Arrays.equals(((ByteArrayResource) obj).byteArray, this.byteArray)));
|
||||
(obj instanceof ByteArrayResource && Arrays.equals(((ByteArrayResource) obj).byteArray, this.byteArray)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,7 +70,7 @@ public class DescriptiveResource extends AbstractResource {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return (obj == this ||
|
||||
(obj instanceof DescriptiveResource && ((DescriptiveResource) obj).description.equals(this.description)));
|
||||
(obj instanceof DescriptiveResource && ((DescriptiveResource) obj).description.equals(this.description)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -204,7 +204,7 @@ public class FileSystemResource extends AbstractResource implements WritableReso
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return (obj == this ||
|
||||
(obj instanceof FileSystemResource && this.path.equals(((FileSystemResource) obj).path)));
|
||||
(obj instanceof FileSystemResource && this.path.equals(((FileSystemResource) obj).path)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,7 +111,7 @@ public class InputStreamResource extends AbstractResource {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return (obj == this ||
|
||||
(obj instanceof InputStreamResource && ((InputStreamResource) obj).inputStream.equals(this.inputStream)));
|
||||
(obj instanceof InputStreamResource && ((InputStreamResource) obj).inputStream.equals(this.inputStream)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -207,7 +207,7 @@ public class UrlResource extends AbstractFileResolvingResource {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return (obj == this ||
|
||||
(obj instanceof UrlResource && this.cleanedUrl.equals(((UrlResource) obj).cleanedUrl)));
|
||||
(obj instanceof UrlResource && this.cleanedUrl.equals(((UrlResource) obj).cleanedUrl)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class FileCopyUtils {
|
||||
Assert.notNull(in, "No input File specified");
|
||||
Assert.notNull(out, "No output File specified");
|
||||
return copy(new BufferedInputStream(new FileInputStream(in)),
|
||||
new BufferedOutputStream(new FileOutputStream(out)));
|
||||
new BufferedOutputStream(new FileOutputStream(out)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,78 +28,78 @@ import static org.junit.Assert.*;
|
||||
*/
|
||||
public class ExceptionDepthComparatorTests {
|
||||
|
||||
@Test
|
||||
public void targetBeforeSameDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(TargetException.class, SameDepthException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void targetBeforeSameDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(TargetException.class, SameDepthException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sameDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(SameDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void sameDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(SameDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lowestDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(LowestDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void lowestDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(LowestDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void targetBeforeLowestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(TargetException.class, LowestDepthException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void targetBeforeLowestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(TargetException.class, LowestDepthException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(NoDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void noDepthBeforeTarget() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(NoDepthException.class, TargetException.class);
|
||||
assertEquals(TargetException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noDepthBeforeHighestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(NoDepthException.class, HighestDepthException.class);
|
||||
assertEquals(HighestDepthException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void noDepthBeforeHighestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(NoDepthException.class, HighestDepthException.class);
|
||||
assertEquals(HighestDepthException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void highestDepthBeforeNoDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(HighestDepthException.class, NoDepthException.class);
|
||||
assertEquals(HighestDepthException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void highestDepthBeforeNoDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(HighestDepthException.class, NoDepthException.class);
|
||||
assertEquals(HighestDepthException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void highestDepthBeforeLowestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(HighestDepthException.class, LowestDepthException.class);
|
||||
assertEquals(LowestDepthException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void highestDepthBeforeLowestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(HighestDepthException.class, LowestDepthException.class);
|
||||
assertEquals(LowestDepthException.class, foundClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lowestDepthBeforeHighestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(LowestDepthException.class, HighestDepthException.class);
|
||||
assertEquals(LowestDepthException.class, foundClass);
|
||||
}
|
||||
@Test
|
||||
public void lowestDepthBeforeHighestDepth() throws Exception {
|
||||
Class<? extends Throwable> foundClass = findClosestMatch(LowestDepthException.class, HighestDepthException.class);
|
||||
assertEquals(LowestDepthException.class, foundClass);
|
||||
}
|
||||
|
||||
private Class<? extends Throwable> findClosestMatch(Class<? extends Throwable>... classes) {
|
||||
return ExceptionDepthComparator.findClosestMatch(Arrays.asList(classes), new TargetException());
|
||||
}
|
||||
private Class<? extends Throwable> findClosestMatch(
|
||||
Class<? extends Throwable>... classes) {
|
||||
return ExceptionDepthComparator.findClosestMatch(Arrays.asList(classes), new TargetException());
|
||||
}
|
||||
|
||||
public class HighestDepthException extends Throwable {
|
||||
}
|
||||
|
||||
public class HighestDepthException extends Throwable {
|
||||
}
|
||||
public class LowestDepthException extends HighestDepthException {
|
||||
}
|
||||
|
||||
public class LowestDepthException extends HighestDepthException {
|
||||
}
|
||||
public class TargetException extends LowestDepthException {
|
||||
}
|
||||
|
||||
public class TargetException extends LowestDepthException {
|
||||
}
|
||||
public class SameDepthException extends LowestDepthException {
|
||||
}
|
||||
|
||||
public class SameDepthException extends LowestDepthException {
|
||||
}
|
||||
|
||||
public class NoDepthException extends TargetException {
|
||||
}
|
||||
public class NoDepthException extends TargetException {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -130,26 +130,26 @@ public class GenericTypeResolverTests {
|
||||
assertEquals(Object.class, resolveReturnTypeForGenericMethod(extractMagicValue, new Object[] { map }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.2
|
||||
*/
|
||||
@Test
|
||||
public void testResolveType() {
|
||||
Method intMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerInputMessage", MyInterfaceType.class);
|
||||
MethodParameter intMessageMethodParam = new MethodParameter(intMessageMethod, 0);
|
||||
assertEquals(MyInterfaceType.class,
|
||||
resolveType(intMessageMethodParam.getGenericParameterType(), new HashMap<TypeVariable, Type>()));
|
||||
/**
|
||||
* @since 3.2
|
||||
*/
|
||||
@Test
|
||||
public void testResolveType() {
|
||||
Method intMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerInputMessage", MyInterfaceType.class);
|
||||
MethodParameter intMessageMethodParam = new MethodParameter(intMessageMethod, 0);
|
||||
assertEquals(MyInterfaceType.class,
|
||||
resolveType(intMessageMethodParam.getGenericParameterType(), new HashMap<TypeVariable, Type>()));
|
||||
|
||||
Method intArrMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerArrayInputMessage", MyInterfaceType[].class);
|
||||
MethodParameter intArrMessageMethodParam = new MethodParameter(intArrMessageMethod, 0);
|
||||
assertEquals(MyInterfaceType[].class,
|
||||
resolveType(intArrMessageMethodParam.getGenericParameterType(), new HashMap<TypeVariable, Type>()));
|
||||
Method intArrMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerArrayInputMessage", MyInterfaceType[].class);
|
||||
MethodParameter intArrMessageMethodParam = new MethodParameter(intArrMessageMethod, 0);
|
||||
assertEquals(MyInterfaceType[].class,
|
||||
resolveType(intArrMessageMethodParam.getGenericParameterType(), new HashMap<TypeVariable, Type>()));
|
||||
|
||||
Method genericArrMessageMethod = findMethod(MySimpleTypeWithMethods.class, "readGenericArrayInputMessage", Object[].class);
|
||||
MethodParameter genericArrMessageMethodParam = new MethodParameter(genericArrMessageMethod, 0);
|
||||
Map<TypeVariable, Type> varMap = getTypeVariableMap(MySimpleTypeWithMethods.class);
|
||||
assertEquals(Integer[].class, resolveType(genericArrMessageMethodParam.getGenericParameterType(), varMap));
|
||||
}
|
||||
Method genericArrMessageMethod = findMethod(MySimpleTypeWithMethods.class, "readGenericArrayInputMessage", Object[].class);
|
||||
MethodParameter genericArrMessageMethodParam = new MethodParameter(genericArrMessageMethod, 0);
|
||||
Map<TypeVariable, Type> varMap = getTypeVariableMap(MySimpleTypeWithMethods.class);
|
||||
assertEquals(Integer[].class, resolveType(genericArrMessageMethodParam.getGenericParameterType(), varMap));
|
||||
}
|
||||
|
||||
|
||||
public interface MyInterfaceType<T> {
|
||||
@@ -234,14 +234,14 @@ public class GenericTypeResolverTests {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void readIntegerInputMessage(MyInterfaceType<Integer> message) {
|
||||
}
|
||||
public void readIntegerInputMessage(MyInterfaceType<Integer> message) {
|
||||
}
|
||||
|
||||
public void readIntegerArrayInputMessage(MyInterfaceType<Integer>[] message) {
|
||||
}
|
||||
public void readIntegerArrayInputMessage(MyInterfaceType<Integer>[] message) {
|
||||
}
|
||||
|
||||
public void readGenericArrayInputMessage(T[] message) {
|
||||
}
|
||||
public void readGenericArrayInputMessage(T[] message) {
|
||||
}
|
||||
}
|
||||
|
||||
public static class MySimpleTypeWithMethods extends MyTypeWithMethods<Integer> {
|
||||
|
||||
Reference in New Issue
Block a user