Skip to content

Commit 627a74f

Browse files
committed
indentation cleanup
1 parent bbd8190 commit 627a74f

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed

src/main/java/com/fasterxml/jackson/databind/util/ClassUtil.java

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -919,67 +919,67 @@ private static class EnumTypeLocator
919919
private final Field enumMapTypeField;
920920

921921
private EnumTypeLocator() {
922-
//JDK uses following fields to store information about actual Enumeration
923-
// type for EnumSets, EnumMaps...
924-
enumSetTypeField = locateField(EnumSet.class, "elementType", Class.class);
925-
enumMapTypeField = locateField(EnumMap.class, "elementType", Class.class);
926-
}
922+
//JDK uses following fields to store information about actual Enumeration
923+
// type for EnumSets, EnumMaps...
924+
enumSetTypeField = locateField(EnumSet.class, "elementType", Class.class);
925+
enumMapTypeField = locateField(EnumMap.class, "elementType", Class.class);
926+
}
927927

928-
@SuppressWarnings("unchecked")
929-
public Class<? extends Enum<?>> enumTypeFor(EnumSet<?> set)
930-
{
931-
if (enumSetTypeField != null) {
932-
return (Class<? extends Enum<?>>) get(set, enumSetTypeField);
933-
}
934-
throw new IllegalStateException("Can not figure out type for EnumSet (odd JDK platform?)");
935-
}
928+
@SuppressWarnings("unchecked")
929+
public Class<? extends Enum<?>> enumTypeFor(EnumSet<?> set)
930+
{
931+
if (enumSetTypeField != null) {
932+
return (Class<? extends Enum<?>>) get(set, enumSetTypeField);
933+
}
934+
throw new IllegalStateException("Can not figure out type for EnumSet (odd JDK platform?)");
935+
}
936936

937-
@SuppressWarnings("unchecked")
938-
public Class<? extends Enum<?>> enumTypeFor(EnumMap<?,?> set)
937+
@SuppressWarnings("unchecked")
938+
public Class<? extends Enum<?>> enumTypeFor(EnumMap<?,?> set)
939939
{
940-
if (enumMapTypeField != null) {
941-
return (Class<? extends Enum<?>>) get(set, enumMapTypeField);
942-
}
943-
throw new IllegalStateException("Can not figure out type for EnumMap (odd JDK platform?)");
940+
if (enumMapTypeField != null) {
941+
return (Class<? extends Enum<?>>) get(set, enumMapTypeField);
942+
}
943+
throw new IllegalStateException("Can not figure out type for EnumMap (odd JDK platform?)");
944944
}
945945

946-
private Object get(Object bean, Field field)
947-
{
948-
try {
949-
return field.get(bean);
950-
} catch (Exception e) {
951-
throw new IllegalArgumentException(e);
952-
}
953-
}
946+
private Object get(Object bean, Field field)
947+
{
948+
try {
949+
return field.get(bean);
950+
} catch (Exception e) {
951+
throw new IllegalArgumentException(e);
952+
}
953+
}
954954

955-
private static Field locateField(Class<?> fromClass, String expectedName, Class<?> type)
956-
{
957-
Field found = null;
958-
// First: let's see if we can find exact match:
959-
Field[] fields = getDeclaredFields(fromClass);
960-
for (Field f : fields) {
961-
if (expectedName.equals(f.getName()) && f.getType() == type) {
962-
found = f;
963-
break;
964-
}
965-
}
966-
// And if not, if there is just one field with the type, that field
967-
if (found == null) {
955+
private static Field locateField(Class<?> fromClass, String expectedName, Class<?> type)
956+
{
957+
Field found = null;
958+
// First: let's see if we can find exact match:
959+
Field[] fields = getDeclaredFields(fromClass);
968960
for (Field f : fields) {
969-
if (f.getType() == type) {
970-
// If more than one, can't choose
971-
if (found != null) return null;
961+
if (expectedName.equals(f.getName()) && f.getType() == type) {
972962
found = f;
963+
break;
973964
}
974965
}
975-
}
976-
if (found != null) { // it's non-public, need to force accessible
977-
try {
978-
found.setAccessible(true);
979-
} catch (Throwable t) { }
980-
}
981-
return found;
982-
}
966+
// And if not, if there is just one field with the type, that field
967+
if (found == null) {
968+
for (Field f : fields) {
969+
if (f.getType() == type) {
970+
// If more than one, can't choose
971+
if (found != null) return null;
972+
found = f;
973+
}
974+
}
975+
}
976+
if (found != null) { // it's non-public, need to force accessible
977+
try {
978+
found.setAccessible(true);
979+
} catch (Throwable t) { }
980+
}
981+
return found;
982+
}
983983
}
984984

985985
/*

0 commit comments

Comments
 (0)