boolean _not = (!_hasHashCode); if (_not) { ehUtil.addHashCode(it, util.getDataFields(it), ehUtil.hasSuperHashCode(it));
boolean _not = (!_hasHashCode); if (_not) { ehUtil.addHashCode(it, util.getDataFields(it), ehUtil.hasSuperHashCode(it));
@Override public void doTransform(final MutableClassDeclaration it, @Extension final TransformationContext context) { AnnotationReference _findAnnotation = it.findAnnotation(context.findTypeGlobally(Data.class)); boolean _tripleNotEquals = (_findAnnotation != null); if (_tripleNotEquals) { return; } @Extension final EqualsHashCodeProcessor.Util util = new EqualsHashCodeProcessor.Util(context); boolean _hasEquals = util.hasEquals(it); if (_hasEquals) { final AnnotationReference annotation = it.findAnnotation(context.findTypeGlobally(EqualsHashCode.class)); context.addWarning(annotation, "equals is already defined, this annotation has no effect"); } else { boolean _hasHashCode = util.hasHashCode(it); if (_hasHashCode) { context.addWarning(it, "hashCode is already defined, this annotation has no effect"); } else { final Function1<MutableFieldDeclaration, Boolean> _function = (MutableFieldDeclaration it_1) -> { return Boolean.valueOf((((!it_1.isStatic()) && (!it_1.isTransient())) && context.isThePrimaryGeneratedJavaElement(it_1))); }; final Iterable<? extends MutableFieldDeclaration> fields = IterableExtensions.filter(it.getDeclaredFields(), _function); util.addEquals(it, fields, util.hasSuperEquals(it)); util.addHashCode(it, fields, util.hasSuperHashCode(it)); } } } }
public boolean hasSuperHashCode(final ClassDeclaration cls) { boolean _xblockexpression = false; { Type _type = cls.getExtendedClass().getType(); final ClassDeclaration superClass = ((ClassDeclaration) _type); boolean _xifexpression = false; boolean _equals = this.context.newTypeReference(superClass).equals(this.context.getObject()); if (_equals) { _xifexpression = false; } else { boolean _xifexpression_1 = false; boolean _hasHashCode = this.hasHashCode(superClass); if (_hasHashCode) { _xifexpression_1 = true; } else { _xifexpression_1 = this.hasSuperHashCode(superClass); } _xifexpression = _xifexpression_1; } _xblockexpression = _xifexpression; } return _xblockexpression; }