use of org.codehaus.groovy.ast.ClassHelper.int_TYPE in project groovy by apache.
the class RecordTypeASTTransformation method createRecordHashCode.
private void createRecordHashCode(ClassNode cNode) {
String desc = BytecodeHelper.getMethodDescriptor(ClassHelper.int_TYPE, new ClassNode[] { cNode });
Statement body = stmt(bytecodeX(ClassHelper.int_TYPE, mv -> {
mv.visitVarInsn(ALOAD, 0);
mv.visitInvokeDynamicInsn("hashCode", desc, createBootstrapMethod(), createBootstrapMethodArguments(cNode));
mv.visitInsn(IRETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
}));
addGeneratedMethod(cNode, "hashCode", PUBLIC_FINAL, ClassHelper.int_TYPE, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, body);
}
Aggregations