Compare arrays via equals (not Arrays.equals) in data classes

This commit is contained in:
Michael Bogdanov
2015-09-23 17:40:48 +03:00
parent cf57d56ab3
commit e5334ed9b8
6 changed files with 10 additions and 17 deletions
@@ -503,18 +503,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
Type otherPropertyType = genPropertyOnStack(iv, context, propertyDescriptor, 2);
StackValue.coerce(otherPropertyType, asmType, iv);
if (asmType.getSort() == Type.ARRAY) {
Type elementType = correctElementType(asmType);
if (elementType.getSort() == Type.OBJECT || elementType.getSort() == Type.ARRAY) {
iv.invokestatic("java/util/Arrays", "equals", "([Ljava/lang/Object;[Ljava/lang/Object;)Z", false);
}
else {
iv.invokestatic("java/util/Arrays", "equals",
"(" + asmType.getDescriptor() + asmType.getDescriptor() + ")Z", false);
}
iv.ifeq(ne);
}
else if (asmType.getSort() == Type.FLOAT) {
if (asmType.getSort() == Type.FLOAT) {
iv.invokestatic("java/lang/Float", "compare", "(FF)I", false);
iv.ifne(ne);
}