private boolean isPotentialJavaOperation(XAbstractFeatureCall featureCall) { if (featureCall.isOperation()) { return true; } if (featureCall.eClass() == XbasePackage.Literals.XMEMBER_FEATURE_CALL && featureCall.isStatic() && featureCall.isExtension() && featureCall.getActualArguments().size() == 2) { JvmIdentifiableElement feature = featureCall.getFeature(); if (feature.eClass() == TypesPackage.Literals.JVM_OPERATION) { JvmDeclaredType declarator = ((JvmOperation) feature).getDeclaringType(); if (IntegerExtensions.class.getName().equals(declarator.getIdentifier()) || LongExtensions.class.getName().equals(declarator.getIdentifier())) { String simpleName = feature.getSimpleName(); if (simpleName.startsWith("bitwise") || simpleName.startsWith("shift")) { return true; } } } } return false; }
@Override protected String getFeatureTypeName() { XExpression expression = getExpression(); if (expression instanceof XAbstractFeatureCall && ((XAbstractFeatureCall) expression).isOperation()) { return "operator declaration"; } if (getPrimaryCandidate().isExtension()) { return "extension method"; } return super.getFeatureTypeName(); }
protected IScope getExecutableScope(XAbstractFeatureCall call, JvmIdentifiableElement feature) { final String simpleName = feature.getSimpleName(); QualifiedName name = QualifiedName.create(simpleName); if (call.isOperation()) { QualifiedName operator = getOperator(call, name); if (operator == null) { return IScope.NULLSCOPE; } return new SingletonScope(EObjectDescription.create(operator, feature), IScope.NULLSCOPE); } if (call instanceof XAssignment) { return getAccessorScope(simpleName, name, feature); } if (call.isExplicitOperationCallOrBuilderSyntax() || ((JvmExecutable) feature).getParameters().size() > 1 || (!call.isExtension() && ((JvmExecutable) feature).getParameters().size() == 1)) { return new SingletonScope(EObjectDescription.create(name, feature), IScope.NULLSCOPE); } return getAccessorScope(simpleName, name, feature); }
} else if ((next instanceof XAbstractFeatureCall && ((XAbstractFeatureCall) next).isOperation()) || (next instanceof XAssignment && currentThisType != null && !contains(currentThisType.getAllFeatures(), ((XAssignment) next).getFeature()))) { collectStaticImportsFrom((XAbstractFeatureCall) next, indexedAmbiguousCandidates.get(next));
} else if (feature instanceof JvmOperation && !featureCall.isOperation()) { JvmOperation jvmOperation = (JvmOperation) feature;
boolean _isOperation = ((XAbstractFeatureCall)contextObject).isOperation(); boolean _not = (!_isOperation); if (_not) {