Java Code Examples for lombok.javac.JavacTreeMaker#TypeCast

The following examples show how to use lombok.javac.JavacTreeMaker#TypeCast . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HandleEqualsAndHashCode.java    From EasyMPermission with MIT License 5 votes vote down vote up
/** The 2 references must be clones of each other. */
public JCExpression longToIntForHashCode(JavacTreeMaker maker, JCExpression ref1, JCExpression ref2) {
	/* (int)(ref >>> 32 ^ ref) */
	JCExpression shift = maker.Binary(CTC_UNSIGNED_SHIFT_RIGHT, ref1, maker.Literal(32));
	JCExpression xorBits = maker.Binary(CTC_BITXOR, shift, ref2);
	return maker.TypeCast(maker.TypeIdent(CTC_INT), xorBits);
}