protected String getExtensionSignature(IIdentifiableElementDescription desc) { JvmOperation operation = (JvmOperation) desc.getElementOrProxy(); StringBuilder builder = new StringBuilder(64).append(desc.getName()); String opName = operation.getSimpleName(); if (opName.length() - 3 == desc.getName().getFirstSegment().length() && opName.startsWith("set")) { builder.append("="); } appendParameters(operation, builder, desc.isExtension()); return builder.toString(); }
@Override public boolean apply(final IEObjectDescription input) { if ((input instanceof IIdentifiableElementDescription)) { if (((!((IIdentifiableElementDescription)input).isVisible()) || (!((IIdentifiableElementDescription)input).isValidStaticState()))) { return false; } boolean _startsWith = ((IIdentifiableElementDescription)input).getName().getFirstSegment().startsWith("operator_"); if (_startsWith) { QualifiedName _operator = this.operatorMapping.getOperator(((IIdentifiableElementDescription)input).getName()); return (_operator == null); } } return true; } }
protected String getSignature(IIdentifiableElementDescription desc) { String descName = desc.getName().getFirstSegment(); StringBuilder builder = new StringBuilder(64).append(descName); JvmIdentifiableElement elementOrProxy = desc.getElementOrProxy(); if (elementOrProxy instanceof JvmExecutable) { JvmExecutable executable = (JvmExecutable) desc.getElementOrProxy(); String opName = executable.getSimpleName(); if (opName.length() - 3 == descName.length() && opName.startsWith("set")) { builder.append("="); } appendParameters(executable, builder, desc.isExtension()); } return builder.toString(); }
protected boolean isValidAssignmentName(IIdentifiableElementDescription description) { JvmIdentifiableElement candidate = description.getElementOrProxy(); if (candidate.eClass() == TypesPackage.Literals.JVM_OPERATION) { if (candidate.getSimpleName().equals(description.getName().getFirstSegment())) { return false; } else if (!candidate.getSimpleName().startsWith("set")) { return false; } } return true; }
private boolean isInvalidThisReference(IIdentifiableElementDescription desc) { EObject object = desc.getEObjectOrProxy(); return object instanceof JvmGenericType && ((JvmGenericType) object).isInterface() && IFeatureNames.THIS.equals(desc.getName()); }
@Override protected void preApply() { XAbstractFeatureCall expression = getExpression(); JvmType type = getType(); if (expression instanceof XMemberFeatureCall) { if (type instanceof JvmDeclaredType) { JvmDeclaredType declaredType = (JvmDeclaredType) type; if (declaredType.getDeclaringType() == null) { helper.applyPackageFragment((XMemberFeatureCall) expression, declaredType); } else { String queriedName = description.getName().toString(); // may be Map$Entry String qualifiedName = declaredType.getIdentifier(); String packageName = Strings.emptyIfNull(declaredType.getPackageName()); if (packageName.length() + 1 + queriedName.length() == qualifiedName.length()) { helper.applyPackageFragment((XMemberFeatureCall) expression, declaredType); } } } } }
boolean _equals = (_numberOfParameters == 1); if (_equals) { if ((((JvmExecutable)jvmFeature).getSimpleName().startsWith("set") && (!((IIdentifiableElementDescription)proposedDescription).getName().getFirstSegment().startsWith("set")))) { info.brackets = " = value"; int _length = "value".length();
protected IConstructorLinkingCandidate createCandidate(XConstructorCall constructorCall, IIdentifiableElementDescription description) { StackedResolvedTypes stackedResolvedTypes = resolvedTypes.pushTypes(constructorCall); ExpressionTypeComputationState state = createExpressionComputationState(constructorCall, stackedResolvedTypes); if (description instanceof ScopeProviderAccess.ErrorDescription) { return new UnresolvableConstructorCall(constructorCall, ((ScopeProviderAccess.ErrorDescription) description).getNode(), description.getName().toString(), state); } else if (description.getElementOrProxy() instanceof JvmType) { return new TypeInsteadOfConstructorLinkingCandidate(constructorCall, description, state); } else { return new ConstructorLinkingCandidate(constructorCall, description, getSingleExpectation(state), state); } }
protected IFeatureLinkingCandidate createCandidate(XAbstractFeatureCall featureCall, final StackedResolvedTypes demandComputedTypes, IIdentifiableElementDescription description) { if (description.getSyntacticReceiverType() != null) { return createCandidateWithReceiverType(featureCall, demandComputedTypes, description); } // pretty much the same constraints as in #createCandidateWithReceiverType ExpressionAwareStackedResolvedTypes resolvedTypes = this.resolvedTypes.pushTypes(featureCall); ExpressionTypeComputationState state = createExpressionComputationState(featureCall, resolvedTypes); if (description instanceof ScopeProviderAccess.ErrorDescription) { ScopeProviderAccess.ErrorDescription errorDescription = (ScopeProviderAccess.ErrorDescription) description; boolean followUpError = errorDescription.isFollowUpError(); if (followUpError) { return new FollowUpError(featureCall, state); } return new UnresolvableFeatureCall(featureCall, errorDescription.getNode(), description.getName().toString(), state); } else if (description.isTypeLiteral()) { return new TypeLiteralLinkingCandidate(featureCall, description, getSingleExpectation(state), state); } else { return new FeatureLinkingCandidate(featureCall, description, getSingleExpectation(state), state); } }
CommonTypeComputationServices services = getState().getReferenceOwner().getServices(); OperatorMapping operatorMapping = services.getOperatorMapping(); if (operatorMapping.getCompoundOperators().contains(description.getName())) { JvmIdentifiableElement feature = description.getElementOrProxy(); String methodName = feature.getSimpleName();
return new UnresolvableFeatureCall(featureCall, errorDescription.getNode(), description.getName().toString(), state) { @Override public void applyToComputationState() {
String concreteSyntax = description.getName().getFirstSegment(); if (getFeature().getSimpleName().equals(concreteSyntax) && (getFeatureCall().isExplicitOperationCallOrBuilderSyntax() == getFeature() instanceof JvmExecutable)) { return CandidateCompareResult.THIS;