Beispiel #1
0
 @Check
 public void checkUseArguments(final SpeciesReference reference) {
   EList<Feature> _arguments = reference.getArguments();
   final int argSize = _arguments.size();
   Species _species = reference.getSpecies();
   EList<Feature> _parameters = _species.getParameters();
   final int paramSize = _parameters.size();
   if ((argSize == paramSize)) {
     int i = 0;
     final ComponentPart part = reference.getPart();
     while ((i < argSize)) {
       {
         Species _species_1 = reference.getSpecies();
         EList<Feature> _parameters_1 = _species_1.getParameters();
         Feature _get = _parameters_1.get(i);
         final LightweightTypeReference typeFrom = this._speADLUtils.resolveType(_get, part);
         EList<Feature> _arguments_1 = reference.getArguments();
         Feature _get_1 = _arguments_1.get(i);
         final LightweightTypeReference typeTo = this._speADLUtils.getTypeRef(_get_1);
         boolean _isAssignableFrom = typeFrom.isAssignableFrom(typeTo);
         boolean _not = (!_isAssignableFrom);
         if (_not) {
           this.error(
               ((("Incompatible types: " + typeFrom) + " is not the same or a supertype of ")
                   + typeTo),
               SpeadlPackage.Literals.SPECIES_REFERENCE__ARGUMENTS,
               i);
         }
         i = (i + 1);
       }
     }
   }
 }
Beispiel #2
0
 @Check
 public void checkProvidesOverrideAreOk(final ProvidedPort p) {
   JvmParameterizedTypeReference _typeReference = p.getTypeReference();
   Resource _eResource = p.eResource();
   final LightweightTypeReference typeTo =
       this._speADLUtils.toLightweightTypeReference(_typeReference, _eResource);
   final LightweightTypeReference typeFrom = this._speADLUtils.getOverridenPortTypeRef(p);
   boolean _and = false;
   boolean _tripleNotEquals = (typeFrom != null);
   if (!_tripleNotEquals) {
     _and = false;
   } else {
     boolean _tripleNotEquals_1 = (typeTo != null);
     _and = _tripleNotEquals_1;
   }
   if (_and) {
     boolean _isAssignableFrom = typeFrom.isAssignableFrom(typeTo);
     boolean _not = (!_isAssignableFrom);
     if (_not) {
       this.error(
           ((("Incompatible type override: " + typeFrom) + " is not the same or a supertype of ")
               + typeTo),
           SpeadlPackage.Literals.PORT__TYPE_REFERENCE);
     }
   }
 }
 @Test
 public void testBug457779_03() {
   final IFeatureCallArguments arguments =
       this.toArgumentsWithReceiver("String s, int[] i", "\"\"");
   final XExpression first = arguments.getArgument(0);
   Assert.assertNull(first);
   final LightweightTypeReference firstType = arguments.getDeclaredTypeForLambda(0);
   Assert.assertNull(firstType);
   final XExpression second = arguments.getArgument(1);
   Assert.assertTrue((second instanceof XStringLiteral));
   final LightweightTypeReference secondType = arguments.getDeclaredTypeForLambda(1);
   String _simpleName = secondType.getSimpleName();
   Assert.assertEquals("String", _simpleName);
   try {
     arguments.getArgument(2);
     Assert.fail("Expected exception");
   } catch (final Throwable _t) {
     if (_t instanceof IndexOutOfBoundsException) {
       final IndexOutOfBoundsException expected = (IndexOutOfBoundsException) _t;
     } else {
       throw Exceptions.sneakyThrow(_t);
     }
   }
   try {
     arguments.getDeclaredTypeForLambda(2);
     Assert.fail("Expected exception");
   } catch (final Throwable _t_1) {
     if (_t_1 instanceof IndexOutOfBoundsException) {
       final IndexOutOfBoundsException expected_1 = (IndexOutOfBoundsException) _t_1;
     } else {
       throw Exceptions.sneakyThrow(_t_1);
     }
   }
 }
 public void assertIdentifiableTypeIsResolved(
     final JvmIdentifiableElement identifiable, final IResolvedTypes types) {
   final LightweightTypeReference type = types.getActualType(identifiable);
   String _string = identifiable.toString();
   Assert.assertNotNull(_string, type);
   String _string_1 = identifiable.toString();
   String _plus = (_string_1 + " / ");
   String _plus_1 = (_plus + type);
   String _identifier = type.getIdentifier();
   Assert.assertNotNull(_plus_1, _identifier);
 }
 public IInputKey getExpressionType() {
   LightweightTypeReference expressionType =
       xbaseResolver.resolveTypes(xExpression).getReturnType(xExpression);
   if (expressionType == null) {
     return new JavaTransitiveInstancesKey(Object.class);
   } else if (expressionType instanceof UnknownTypeReference) {
     return new JavaTransitiveInstancesKey(Object.class);
   } else {
     return new JavaTransitiveInstancesKey(
         expressionType.getWrapperTypeIfPrimitive().getJavaIdentifier());
   }
 }
 protected void mergeTypesIntoParent(ResolvedTypes parent) {
   Map<JvmIdentifiableElement, LightweightTypeReference> types = basicGetTypes();
   if (!types.isEmpty()) {
     for (Map.Entry<JvmIdentifiableElement, LightweightTypeReference> entry : types.entrySet()) {
       LightweightTypeReference value = entry.getValue();
       if (value instanceof UnboundTypeReference
           && super.isResolved(((UnboundTypeReference) value).getHandle())) {
         parent.setType(
             entry.getKey(), value.getUpperBoundSubstitute().copyInto(parent.getReferenceOwner()));
       } else {
         parent.setType(entry.getKey(), value.copyInto(parent.getReferenceOwner()));
       }
     }
   }
 }
 protected TypeData prepareMerge(TypeData typeData, ITypeReferenceOwner owner) {
   LightweightTypeReference typeReference = typeData.getActualType();
   if (typeData.isOwnedBy(owner) && !(typeReference instanceof UnboundTypeReference))
     return typeData;
   if (typeReference instanceof UnboundTypeReference
       && super.isResolved(((UnboundTypeReference) typeReference).getHandle())) {
     typeReference = typeReference.getUpperBoundSubstitute();
   }
   return new TypeData(
       typeData.getExpression(),
       typeData.getExpectation().copyInto(owner),
       typeReference.copyInto(owner),
       typeData.getConformanceFlags(),
       typeData.isReturnType());
 }
 public void assertExpressionTypeIsResolved(
     final XExpression expression, final IResolvedTypes types) {
   final LightweightTypeReference type = types.getActualType(expression);
   String _string = expression.toString();
   String _plus = ("Type is not resolved. Expression: " + _string);
   Assert.assertNotNull(_plus, type);
   String _string_1 = expression.toString();
   String _plus_1 = (_string_1 + " / ");
   String _plus_2 = (_plus_1 + type);
   String _identifier = type.getIdentifier();
   Assert.assertNotNull(_plus_2, _identifier);
   final LightweightTypeReference expectedType = types.getExpectedType(expression);
   String _string_2 = expression.toString();
   String _valueOf = String.valueOf(expectedType);
   Assert.assertNotNull(_string_2, _valueOf);
 }
 @Test
 public void test_08() {
   final IFeatureCallArguments arguments =
       this.toArgumentsWithReceiver("String s, int i", "\"\", 1");
   int _argumentCount = arguments.getArgumentCount();
   Assert.assertEquals(3, _argumentCount);
   boolean _hasUnprocessedArguments = arguments.hasUnprocessedArguments();
   Assert.assertTrue(_hasUnprocessedArguments);
   final IFeatureCallArgumentSlot firstSlot = arguments.getNextUnprocessedArgumentSlot();
   boolean _isVarArg = firstSlot.isVarArg();
   Assert.assertFalse(_isVarArg);
   boolean _isSuperfluous = firstSlot.isSuperfluous();
   Assert.assertFalse(_isSuperfluous);
   XExpression _argumentExpression = firstSlot.getArgumentExpression();
   Assert.assertTrue((_argumentExpression instanceof XStringLiteral));
   LightweightTypeReference _declaredType = firstSlot.getDeclaredType();
   String _simpleName = _declaredType.getSimpleName();
   Assert.assertEquals("String", _simpleName);
   boolean _isProcessed = arguments.isProcessed(0);
   Assert.assertTrue(_isProcessed);
   boolean _isProcessed_1 = arguments.isProcessed(1);
   Assert.assertFalse(_isProcessed_1);
   firstSlot.markProcessed();
   boolean _isProcessed_2 = arguments.isProcessed(1);
   Assert.assertTrue(_isProcessed_2);
   boolean _hasUnprocessedArguments_1 = arguments.hasUnprocessedArguments();
   Assert.assertTrue(_hasUnprocessedArguments_1);
   final IFeatureCallArgumentSlot secondSlot = arguments.getNextUnprocessedArgumentSlot();
   boolean _isVarArg_1 = secondSlot.isVarArg();
   Assert.assertTrue(_isVarArg_1);
   boolean _isSuperfluous_1 = secondSlot.isSuperfluous();
   Assert.assertFalse(_isSuperfluous_1);
   XExpression _argumentExpression_1 = secondSlot.getArgumentExpression();
   Assert.assertTrue((_argumentExpression_1 instanceof XNumberLiteral));
   LightweightTypeReference _declaredType_1 = secondSlot.getDeclaredType();
   String _simpleName_1 = _declaredType_1.getSimpleName();
   Assert.assertEquals("int", _simpleName_1);
   boolean _isProcessed_3 = arguments.isProcessed(2);
   Assert.assertFalse(_isProcessed_3);
   secondSlot.markProcessed();
   boolean _isProcessed_4 = arguments.isProcessed(2);
   Assert.assertTrue(_isProcessed_4);
   boolean _hasUnprocessedArguments_2 = arguments.hasUnprocessedArguments();
   Assert.assertFalse(_hasUnprocessedArguments_2);
 }
 @Test
 public void test_03() {
   final IFeatureCallArguments arguments = this.toArgumentsWithoutReceiver("String s", "\"\"");
   boolean _hasUnprocessedArguments = arguments.hasUnprocessedArguments();
   Assert.assertTrue(_hasUnprocessedArguments);
   int _argumentCount = arguments.getArgumentCount();
   Assert.assertEquals(1, _argumentCount);
   final IFeatureCallArgumentSlot singleSlot = arguments.getNextUnprocessedArgumentSlot();
   boolean _isVarArg = singleSlot.isVarArg();
   Assert.assertTrue(_isVarArg);
   boolean _isSuperfluous = singleSlot.isSuperfluous();
   Assert.assertFalse(_isSuperfluous);
   XExpression _argumentExpression = singleSlot.getArgumentExpression();
   Assert.assertTrue((_argumentExpression instanceof XStringLiteral));
   LightweightTypeReference _declaredType = singleSlot.getDeclaredType();
   String _simpleName = _declaredType.getSimpleName();
   Assert.assertEquals("String", _simpleName);
   singleSlot.markProcessed();
   boolean _hasUnprocessedArguments_1 = arguments.hasUnprocessedArguments();
   Assert.assertFalse(_hasUnprocessedArguments_1);
 }
Beispiel #11
0
 /**
  * See checkLocalUsageOfDeclaredFields for hilighting unbinded part! And
  * checkNonInitializedFieldsHaveAType if we want to infer type of already bound provides, would be
  * nice...
  */
 @Check
 public void checkPortRef(final PortRef pr) {
   boolean _or = false;
   Port _port = pr.getPort();
   boolean _tripleEquals = (_port == null);
   if (_tripleEquals) {
     _or = true;
   } else {
     Port _port_1 = pr.getPort();
     boolean _eIsProxy = _port_1.eIsProxy();
     _or = _eIsProxy;
   }
   if (_or) {
     return;
   }
   boolean _and = false;
   Part _part = pr.getPart();
   boolean _tripleNotEquals = (_part != null);
   if (!_tripleNotEquals) {
     _and = false;
   } else {
     Part _part_1 = pr.getPart();
     boolean _eIsProxy_1 = _part_1.eIsProxy();
     _and = _eIsProxy_1;
   }
   if (_and) {
     return;
   }
   final LightweightTypeReference typeTo = this._speADLUtils.resolveType(pr);
   LightweightTypeReference _switchResult = null;
   EObject _eContainer = pr.eContainer();
   final EObject cont = _eContainer;
   boolean _matched = false;
   if (!_matched) {
     if (cont instanceof Binding) {
       _matched = true;
       _switchResult = this._speADLUtils.resolveTypeFrom(((Binding) cont));
     }
   }
   if (!_matched) {
     if (cont instanceof ProvidedPort) {
       _matched = true;
       JvmParameterizedTypeReference _typeReference = ((ProvidedPort) cont).getTypeReference();
       Resource _eResource = pr.eResource();
       _switchResult = this._speADLUtils.toLightweightTypeReference(_typeReference, _eResource);
     }
   }
   final LightweightTypeReference typeFrom = _switchResult;
   boolean _and_1 = false;
   boolean _tripleNotEquals_1 = (typeFrom != null);
   if (!_tripleNotEquals_1) {
     _and_1 = false;
   } else {
     boolean _tripleNotEquals_2 = (typeTo != null);
     _and_1 = _tripleNotEquals_2;
   }
   if (_and_1) {
     boolean _isAssignableFrom = typeFrom.isAssignableFrom(typeTo);
     boolean _not = (!_isAssignableFrom);
     if (_not) {
       this.error(
           ((("Incompatible types: " + typeFrom) + " is not the same or a supertype of ")
               + typeTo),
           SpeadlPackage.Literals.PORT_REF__PORT);
     }
   }
 }
 public LightweightTypeReference resolvesTo(final String expression, final String type) {
   try {
     final XExpression xExpression = this.expression(expression, false);
     Resource _eResource = xExpression.eResource();
     EList<Diagnostic> _errors = _eResource.getErrors();
     String _string = _errors.toString();
     Resource _eResource_1 = xExpression.eResource();
     EList<Diagnostic> _errors_1 = _eResource_1.getErrors();
     boolean _isEmpty = _errors_1.isEmpty();
     Assert.assertTrue(_string, _isEmpty);
     Resource _eResource_2 = xExpression.eResource();
     EList<Diagnostic> _warnings = _eResource_2.getWarnings();
     String _string_1 = _warnings.toString();
     Resource _eResource_3 = xExpression.eResource();
     EList<Diagnostic> _warnings_1 = _eResource_3.getWarnings();
     boolean _isEmpty_1 = _warnings_1.isEmpty();
     Assert.assertTrue(_string_1, _isEmpty_1);
     IBatchTypeResolver _typeResolver = this.getTypeResolver();
     final IResolvedTypes resolvedTypes = _typeResolver.resolveTypes(xExpression);
     final LightweightTypeReference resolvedType = resolvedTypes.getActualType(xExpression);
     String _simpleName = resolvedType.getSimpleName();
     Assert.assertEquals(type, _simpleName);
     TreeIterator<EObject> _eAllContents = xExpression.eAllContents();
     Iterable<EObject> _iterable = IteratorExtensions.<EObject>toIterable(_eAllContents);
     for (final EObject content : _iterable) {
       boolean _matched = false;
       if (!_matched) {
         if (content instanceof XSwitchExpression) {
           final XSwitchExpression _xSwitchExpression = (XSwitchExpression) content;
           _matched = true;
           this.assertExpressionTypeIsResolved(_xSwitchExpression, resolvedTypes);
           String _localVarName = _xSwitchExpression.getLocalVarName();
           boolean _notEquals = (!Objects.equal(_localVarName, null));
           if (_notEquals) {
             this.assertIdentifiableTypeIsResolved(_xSwitchExpression, resolvedTypes);
           }
         }
       }
       if (!_matched) {
         if (content instanceof XAbstractFeatureCall) {
           final XAbstractFeatureCall _xAbstractFeatureCall = (XAbstractFeatureCall) content;
           _matched = true;
           this.assertExpressionTypeIsResolved(_xAbstractFeatureCall, resolvedTypes);
           XExpression _implicitReceiver = _xAbstractFeatureCall.getImplicitReceiver();
           boolean _notEquals = (!Objects.equal(_implicitReceiver, null));
           if (_notEquals) {
             XExpression _implicitReceiver_1 = _xAbstractFeatureCall.getImplicitReceiver();
             this.assertExpressionTypeIsResolved(_implicitReceiver_1, resolvedTypes);
           }
         }
       }
       if (!_matched) {
         if (content instanceof XExpression) {
           final XExpression _xExpression = (XExpression) content;
           _matched = true;
           this.assertExpressionTypeIsResolved(_xExpression, resolvedTypes);
         }
       }
       if (!_matched) {
         if (content instanceof JvmIdentifiableElement) {
           final JvmIdentifiableElement _jvmIdentifiableElement = (JvmIdentifiableElement) content;
           _matched = true;
           this.assertIdentifiableTypeIsResolved(_jvmIdentifiableElement, resolvedTypes);
         }
       }
     }
     TreeIterator<EObject> _eAllContents_1 = xExpression.eAllContents();
     Iterable<EObject> _iterable_1 = IteratorExtensions.<EObject>toIterable(_eAllContents_1);
     for (final EObject content_1 : _iterable_1) {
       boolean _matched_1 = false;
       if (!_matched_1) {
         if (content_1 instanceof XConstructorCall) {
           final XConstructorCall _xConstructorCall = (XConstructorCall) content_1;
           _matched_1 = true;
           Object _eGet = _xConstructorCall.eGet(Literals.XCONSTRUCTOR_CALL__CONSTRUCTOR, false);
           final InternalEObject constructor = ((InternalEObject) _eGet);
           String _string_2 = _xConstructorCall.toString();
           Assert.assertNotNull(_string_2, constructor);
           String _string_3 = _xConstructorCall.toString();
           boolean _eIsProxy = constructor.eIsProxy();
           Assert.assertFalse(_string_3, _eIsProxy);
         }
       }
       if (!_matched_1) {
         if (content_1 instanceof XAbstractFeatureCall) {
           final XAbstractFeatureCall _xAbstractFeatureCall = (XAbstractFeatureCall) content_1;
           _matched_1 = true;
           Object _eGet =
               _xAbstractFeatureCall.eGet(Literals.XABSTRACT_FEATURE_CALL__FEATURE, false);
           final InternalEObject feature = ((InternalEObject) _eGet);
           String _string_2 = _xAbstractFeatureCall.toString();
           Assert.assertNotNull(_string_2, feature);
           String _string_3 = _xAbstractFeatureCall.toString();
           boolean _eIsProxy = feature.eIsProxy();
           Assert.assertFalse(_string_3, _eIsProxy);
           XExpression _implicitReceiver = _xAbstractFeatureCall.getImplicitReceiver();
           boolean _notEquals = (!Objects.equal(_implicitReceiver, null));
           if (_notEquals) {
             XExpression _implicitReceiver_1 = _xAbstractFeatureCall.getImplicitReceiver();
             Object _eGet_1 =
                 _implicitReceiver_1.eGet(Literals.XABSTRACT_FEATURE_CALL__FEATURE, false);
             final InternalEObject implicitFeature = ((InternalEObject) _eGet_1);
             String _string_4 = implicitFeature.toString();
             Assert.assertNotNull(_string_4, feature);
             String _string_5 = implicitFeature.toString();
             boolean _eIsProxy_1 = feature.eIsProxy();
             Assert.assertFalse(_string_5, _eIsProxy_1);
           }
         }
       }
     }
     Resource _eResource_4 = xExpression.eResource();
     Iterable<Diagnostic> _linkingAndSyntaxErrors = this.getLinkingAndSyntaxErrors(_eResource_4);
     String _string_2 = _linkingAndSyntaxErrors.toString();
     Resource _eResource_5 = xExpression.eResource();
     Iterable<Diagnostic> _linkingAndSyntaxErrors_1 = this.getLinkingAndSyntaxErrors(_eResource_5);
     boolean _isEmpty_2 = IterableExtensions.isEmpty(_linkingAndSyntaxErrors_1);
     Assert.assertTrue(_string_2, _isEmpty_2);
     Resource _eResource_6 = xExpression.eResource();
     EList<Diagnostic> _warnings_2 = _eResource_6.getWarnings();
     String _string_3 = _warnings_2.toString();
     Resource _eResource_7 = xExpression.eResource();
     EList<Diagnostic> _warnings_3 = _eResource_7.getWarnings();
     boolean _isEmpty_3 = _warnings_3.isEmpty();
     Assert.assertTrue(_string_3, _isEmpty_3);
     return resolvedType;
   } catch (Throwable _e) {
     throw Exceptions.sneakyThrow(_e);
   }
 }
 protected void appendParameters(
     final StringBuilder result,
     final JvmExecutable executable,
     final int insignificantParameters,
     final LightweightTypeReferenceFactory ownedConverter) {
   final EList<JvmFormalParameter> declaredParameters = executable.getParameters();
   int _size = declaredParameters.size();
   int _min = Math.min(insignificantParameters, _size);
   int _size_1 = declaredParameters.size();
   final List<JvmFormalParameter> relevantParameters = declaredParameters.subList(_min, _size_1);
   for (int i = 0; (i < relevantParameters.size()); i++) {
     {
       final JvmFormalParameter parameter = relevantParameters.get(i);
       if ((i != 0)) {
         result.append(", ");
       }
       boolean _and = false;
       boolean _and_1 = false;
       int _size_2 = relevantParameters.size();
       int _minus = (_size_2 - 1);
       boolean _equals = (i == _minus);
       if (!_equals) {
         _and_1 = false;
       } else {
         boolean _isVarArgs = executable.isVarArgs();
         _and_1 = _isVarArgs;
       }
       if (!_and_1) {
         _and = false;
       } else {
         JvmTypeReference _parameterType = parameter.getParameterType();
         _and = (_parameterType instanceof JvmGenericArrayTypeReference);
       }
       if (_and) {
         JvmTypeReference _parameterType_1 = parameter.getParameterType();
         final JvmGenericArrayTypeReference parameterType =
             ((JvmGenericArrayTypeReference) _parameterType_1);
         JvmTypeReference _componentType = parameterType.getComponentType();
         LightweightTypeReference _lightweightReference =
             ownedConverter.toLightweightReference(_componentType);
         String _humanReadableName = _lightweightReference.getHumanReadableName();
         result.append(_humanReadableName);
         result.append("...");
       } else {
         JvmTypeReference _parameterType_2 = parameter.getParameterType();
         boolean _notEquals = (!Objects.equal(_parameterType_2, null));
         if (_notEquals) {
           JvmTypeReference _parameterType_3 = parameter.getParameterType();
           LightweightTypeReference _lightweightReference_1 =
               ownedConverter.toLightweightReference(_parameterType_3);
           final String simpleName = _lightweightReference_1.getHumanReadableName();
           boolean _notEquals_1 = (!Objects.equal(simpleName, null));
           if (_notEquals_1) {
             result.append(simpleName);
           }
         }
       }
       result.append(" ");
       String _name = parameter.getName();
       String _valueOf = String.valueOf(_name);
       result.append(_valueOf);
     }
   }
 }
 protected void addNameAndDescription(
     final ContentAssistEntry entry,
     final JvmFeature feature,
     final boolean withParents,
     final int insignificantParameters,
     final String shortName,
     final LightweightTypeReferenceFactory converter) {
   final StringBuilder labelBuilder = new StringBuilder(shortName);
   final StringBuilder descriptionBuilder = new StringBuilder();
   if ((feature instanceof JvmOperation)) {
     if (withParents) {
       labelBuilder.append("(");
       this.appendParameters(
           labelBuilder, ((JvmExecutable) feature), insignificantParameters, converter);
       labelBuilder.append(")");
     }
     final JvmTypeReference returnType = ((JvmOperation) feature).getReturnType();
     boolean _and = false;
     boolean _notEquals = (!Objects.equal(returnType, null));
     if (!_notEquals) {
       _and = false;
     } else {
       String _simpleName = returnType.getSimpleName();
       boolean _notEquals_1 = (!Objects.equal(_simpleName, null));
       _and = _notEquals_1;
     }
     if (_and) {
       labelBuilder.append(" : ");
       LightweightTypeReference _lightweightReference =
           converter.toLightweightReference(returnType);
       String _humanReadableName = _lightweightReference.getHumanReadableName();
       labelBuilder.append(_humanReadableName);
     }
     JvmDeclaredType _declaringType = ((JvmOperation) feature).getDeclaringType();
     LightweightTypeReference _plainTypeReference = converter.toPlainTypeReference(_declaringType);
     String _humanReadableName_1 = _plainTypeReference.getHumanReadableName();
     descriptionBuilder.append(_humanReadableName_1);
     if ((!withParents)) {
       descriptionBuilder.append(".");
       String _simpleName_1 = ((JvmOperation) feature).getSimpleName();
       descriptionBuilder.append(_simpleName_1);
       descriptionBuilder.append("()");
     }
   } else {
     if ((feature instanceof JvmField)) {
       labelBuilder.append(" : ");
       JvmTypeReference _type = ((JvmField) feature).getType();
       boolean _notEquals_2 = (!Objects.equal(_type, null));
       if (_notEquals_2) {
         JvmTypeReference _type_1 = ((JvmField) feature).getType();
         LightweightTypeReference _lightweightReference_1 =
             converter.toLightweightReference(_type_1);
         final String fieldType = _lightweightReference_1.getHumanReadableName();
         boolean _notEquals_3 = (!Objects.equal(fieldType, null));
         if (_notEquals_3) {
           labelBuilder.append(fieldType);
         }
       }
       JvmDeclaredType _declaringType_1 = ((JvmField) feature).getDeclaringType();
       LightweightTypeReference _plainTypeReference_1 =
           converter.toPlainTypeReference(_declaringType_1);
       String _humanReadableName_2 = _plainTypeReference_1.getHumanReadableName();
       descriptionBuilder.append(_humanReadableName_2);
     } else {
       if ((feature instanceof JvmConstructor)) {
         if (withParents) {
           labelBuilder.append("(");
           this.appendParameters(
               labelBuilder, ((JvmExecutable) feature), insignificantParameters, converter);
           labelBuilder.append(")");
         }
       }
     }
   }
   String _string = labelBuilder.toString();
   entry.setLabel(_string);
   String _string_1 = descriptionBuilder.toString();
   entry.setDescription(_string_1);
 }
 protected XbaseIdeCrossrefProposalProvider.ProposalBracketInfo getProposalBracketInfo(
     final IEObjectDescription proposedDescription,
     final ContentAssistContext contentAssistContext) {
   final XbaseIdeCrossrefProposalProvider.ProposalBracketInfo info =
       new XbaseIdeCrossrefProposalProvider.ProposalBracketInfo();
   if ((proposedDescription instanceof IIdentifiableElementDescription)) {
     final JvmIdentifiableElement jvmFeature =
         ((IIdentifiableElementDescription) proposedDescription).getElementOrProxy();
     if ((jvmFeature instanceof JvmExecutable)) {
       final EList<JvmFormalParameter> parameters = ((JvmExecutable) jvmFeature).getParameters();
       int _numberOfParameters =
           ((IIdentifiableElementDescription) proposedDescription).getNumberOfParameters();
       boolean _equals = (_numberOfParameters == 1);
       if (_equals) {
         boolean _and = false;
         String _simpleName = ((JvmExecutable) jvmFeature).getSimpleName();
         boolean _startsWith = _simpleName.startsWith("set");
         if (!_startsWith) {
           _and = false;
         } else {
           QualifiedName _name = ((IIdentifiableElementDescription) proposedDescription).getName();
           String _firstSegment = _name.getFirstSegment();
           boolean _startsWith_1 = _firstSegment.startsWith("set");
           boolean _not = (!_startsWith_1);
           _and = _not;
         }
         if (_and) {
           info.brackets = " = value";
           int _length = "value".length();
           int _minus = (-_length);
           info.selectionOffset = _minus;
           int _length_1 = "value".length();
           info.selectionLength = _length_1;
           return info;
         }
         JvmFormalParameter _last = IterableExtensions.<JvmFormalParameter>last(parameters);
         final JvmTypeReference parameterType = _last.getParameterType();
         XtextResource _resource = contentAssistContext.getResource();
         LightweightTypeReferenceFactory _typeConverter = this.getTypeConverter(_resource);
         final LightweightTypeReference light =
             _typeConverter.toLightweightReference(parameterType);
         boolean _isFunctionType = light.isFunctionType();
         if (_isFunctionType) {
           FunctionTypeReference _asFunctionTypeReference = light.getAsFunctionTypeReference();
           List<LightweightTypeReference> _parameterTypes =
               _asFunctionTypeReference.getParameterTypes();
           final int numParameters = _parameterTypes.size();
           if ((numParameters == 1)) {
             info.brackets = "[]";
             info.caretOffset = (-1);
             return info;
           } else {
             if ((numParameters == 0)) {
               info.brackets = "[|]";
               info.caretOffset = (-1);
               return info;
             } else {
               final StringBuilder b = new StringBuilder();
               for (int i = 0; (i < numParameters); i++) {
                 {
                   if ((i != 0)) {
                     b.append(", ");
                   }
                   b.append(("p" + Integer.valueOf((i + 1))));
                 }
               }
               String _string = b.toString();
               String _plus = ("[" + _string);
               String _plus_1 = (_plus + "|]");
               info.brackets = _plus_1;
               info.caretOffset = (-1);
               int _length_2 = b.length();
               int _minus_1 = (-_length_2);
               int _minus_2 = (_minus_1 - 2);
               info.selectionOffset = _minus_2;
               int _length_3 = b.length();
               info.selectionLength = _length_3;
               return info;
             }
           }
         }
       }
     }
     boolean _isExplicitOperationCall =
         this.isExplicitOperationCall(((IIdentifiableElementDescription) proposedDescription));
     if (_isExplicitOperationCall) {
       info.brackets = "()";
       info.selectionOffset = (-1);
     }
   }
   return info;
 }