Skip to content

Commit bb59eb4

Browse files
committed
Polishing.
Reformat code. See #3168
1 parent e79a2bd commit bb59eb4

File tree

1 file changed

+19
-57
lines changed

1 file changed

+19
-57
lines changed

src/main/java/org/springframework/data/mapping/model/BytecodeUtil.java

+19-57
Original file line numberDiff line numberDiff line change
@@ -88,65 +88,35 @@ static void autoboxIfNeeded(Class<?> in, Class<?> out, MethodVisitor visitor) {
8888

8989
if (in.equals(Boolean.class) && out.equals(Boolean.TYPE)) {
9090
visitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Boolean", "booleanValue", "()Z", false);
91-
}
92-
93-
else if (in.equals(Boolean.TYPE) && out.equals(Boolean.class)) {
91+
} else if (in.equals(Boolean.TYPE) && out.equals(Boolean.class)) {
9492
visitor.visitMethodInsn(INVOKESTATIC, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;", false);
95-
}
96-
97-
else if (in.equals(Byte.class) && out.equals(Byte.TYPE)) {
93+
} else if (in.equals(Byte.class) && out.equals(Byte.TYPE)) {
9894
visitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Byte", "byteValue", "()B", false);
99-
}
100-
101-
else if (in.equals(Byte.TYPE) && out.equals(Byte.class)) {
95+
} else if (in.equals(Byte.TYPE) && out.equals(Byte.class)) {
10296
visitor.visitMethodInsn(INVOKESTATIC, "java/lang/Byte", "valueOf", "(B)Ljava/lang/Byte;", false);
103-
}
104-
105-
else if (in.equals(Character.class) && out.equals(Character.TYPE)) {
97+
} else if (in.equals(Character.class) && out.equals(Character.TYPE)) {
10698
visitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Character", "charValue", "()C", false);
107-
}
108-
109-
else if (in.equals(Character.TYPE) && out.equals(Character.class)) {
99+
} else if (in.equals(Character.TYPE) && out.equals(Character.class)) {
110100
visitor.visitMethodInsn(INVOKESTATIC, "java/lang/Character", "valueOf", "(C)Ljava/lang/Character;", false);
111-
}
112-
113-
else if (in.equals(Double.class) && out.equals(Double.TYPE)) {
101+
} else if (in.equals(Double.class) && out.equals(Double.TYPE)) {
114102
visitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Double", "doubleValue", "()D", false);
115-
}
116-
117-
else if (in.equals(Double.TYPE) && out.equals(Double.class)) {
103+
} else if (in.equals(Double.TYPE) && out.equals(Double.class)) {
118104
visitor.visitMethodInsn(INVOKESTATIC, "java/lang/Double", "valueOf", "(D)Ljava/lang/Double;", false);
119-
}
120-
121-
else if (in.equals(Float.class) && out.equals(Float.TYPE)) {
105+
} else if (in.equals(Float.class) && out.equals(Float.TYPE)) {
122106
visitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Float", "floatValue", "()F", false);
123-
}
124-
125-
else if (in.equals(Float.TYPE) && out.equals(Float.class)) {
107+
} else if (in.equals(Float.TYPE) && out.equals(Float.class)) {
126108
visitor.visitMethodInsn(INVOKESTATIC, "java/lang/Float", "valueOf", "(F)Ljava/lang/Float;", false);
127-
}
128-
129-
else if (in.equals(Integer.class) && out.equals(Integer.TYPE)) {
109+
} else if (in.equals(Integer.class) && out.equals(Integer.TYPE)) {
130110
visitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false);
131-
}
132-
133-
else if (in.equals(Integer.TYPE) && out.equals(Integer.class)) {
111+
} else if (in.equals(Integer.TYPE) && out.equals(Integer.class)) {
134112
visitor.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false);
135-
}
136-
137-
else if (in.equals(Long.class) && out.equals(Long.TYPE)) {
113+
} else if (in.equals(Long.class) && out.equals(Long.TYPE)) {
138114
visitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Long", "longValue", "()J", false);
139-
}
140-
141-
else if (in.equals(Long.TYPE) && out.equals(Long.class)) {
115+
} else if (in.equals(Long.TYPE) && out.equals(Long.class)) {
142116
visitor.visitMethodInsn(INVOKESTATIC, "java/lang/Long", "valueOf", "(J)Ljava/lang/Long;", false);
143-
}
144-
145-
else if (in.equals(Short.class) && out.equals(Short.TYPE)) {
117+
} else if (in.equals(Short.class) && out.equals(Short.TYPE)) {
146118
visitor.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Short", "shortValue", "()S", false);
147-
}
148-
149-
else if (in.equals(Short.TYPE) && out.equals(Short.class)) {
119+
} else if (in.equals(Short.TYPE) && out.equals(Short.class)) {
150120
visitor.visitMethodInsn(INVOKESTATIC, "java/lang/Short", "valueOf", "(S)Ljava/lang/Short;", false);
151121
}
152122
}
@@ -265,21 +235,13 @@ static void visitDefaultValue(Class<?> parameterType, MethodVisitor mv) {
265235

266236
if (parameterType == Integer.TYPE || parameterType == Short.TYPE || parameterType == Boolean.TYPE) {
267237
mv.visitInsn(Opcodes.ICONST_0);
268-
}
269-
270-
else if (parameterType == Long.TYPE) {
238+
} else if (parameterType == Long.TYPE) {
271239
mv.visitInsn(Opcodes.LCONST_0);
272-
}
273-
274-
else if (parameterType == Double.TYPE) {
240+
} else if (parameterType == Double.TYPE) {
275241
mv.visitInsn(Opcodes.DCONST_0);
276-
}
277-
278-
else if (parameterType == Float.TYPE) {
242+
} else if (parameterType == Float.TYPE) {
279243
mv.visitInsn(Opcodes.FCONST_0);
280-
}
281-
282-
else if (parameterType == Character.TYPE || parameterType == Byte.TYPE) {
244+
} else if (parameterType == Character.TYPE || parameterType == Byte.TYPE) {
283245
mv.visitIntInsn(Opcodes.BIPUSH, 0);
284246
}
285247
} else {

0 commit comments

Comments
 (0)