private boolean isEnumExpectationInAnnotationValue(final XFeatureCall it, final JvmType expectedRawType) { if (((expectedRawType instanceof JvmEnumerationType) || ((expectedRawType instanceof JvmArrayType) && (((JvmArrayType) expectedRawType).getComponentType() instanceof JvmEnumerationType)))) { EObject container = it.eContainer(); if ((container instanceof XAnnotationElementValuePair)) { return true; } if ((container instanceof XAnnotation)) { return true; } if ((container instanceof XListLiteral)) { container = ((XListLiteral)container).eContainer(); if ((container instanceof XAnnotationElementValuePair)) { return true; } if ((container instanceof XAnnotation)) { return true; } } } return false; }
/** * Returns the node that best describes the error, e.g. if there is an expression * <code>com::foo::DoesNotExist::method()</code> the error will be rooted at <code>com</code>, but * the real problem is <code>com::foo::DoesNotExist</code>. */ private INode getErrorNode(XExpression expression, INode node) { if (expression instanceof XFeatureCall) { XFeatureCall featureCall = (XFeatureCall) expression; if (!canBeTypeLiteral(featureCall)) { return node; } if (featureCall.eContainingFeature() == XbasePackage.Literals.XMEMBER_FEATURE_CALL__MEMBER_CALL_TARGET) { XMemberFeatureCall container = (XMemberFeatureCall) featureCall.eContainer(); if (canBeTypeLiteral(container)) { boolean explicitStatic = container.isExplicitStatic(); XMemberFeatureCall outerMost = getLongestTypeLiteralCandidate(container, explicitStatic); if (outerMost != null) return NodeModelUtils.getNode(outerMost); } } } return node; }