Program: 6388
Project: 6388
Buggy source:
private void calculateVersionProposals(EObject model,ContentAssistContext context,ICompletionProposalAcceptor acceptor){
  ICompositeNode parentNode=NodeModelUtils.findActualNodeFor(model).getParent();
  Iterable<ILeafNode> leafs=parentNode.getLeafNodes();
  Iterable<ILeafNode> nonHidden=Iterables.filter(leafs,new Predicate<ILeafNode>(){
    public boolean apply(    ILeafNode node){
      return !node.isHidden();
    }
  }
);
  BindingModel moduleModel=(BindingModel)model.eContainer().eContainer().eContainer();
  EList<Import> imports=moduleModel.getImports();
  final Iterable<String> importedNamespaces=Lists.transform(imports,new Function<Import,String>(){
    public String apply(    Import from){
      return from.getImportedNamespace().replaceAll("String_Node_Str","String_Node_Str");
    }
  }
);
  Iterator<ILeafNode> leafIt=nonHidden.iterator();
  Iterable<String> canditateVersions=Sets.newHashSet();
  if (model.eContainer() instanceof ModuleRef) {
    boolean versionConstraintFound=false;
    StringBuilder nameParts=new StringBuilder();
    while (leafIt.hasNext() && !versionConstraintFound) {
      ILeafNode curNode=leafIt.next();
      if (curNode.getSemanticElement() instanceof VersionRef)       versionConstraintFound=true;
 else       nameParts.append(curNode.getText());
    }
    final String moduleName=nameParts.toString().trim();
    final String className=ModuleDslPackage.Literals.MODULE.getName();
    canditateVersions=getCanditateVersions(moduleName,className,importedNamespaces,model.eContainer() instanceof MajorVersionRef);
  }
 else   if (model.eContainer() instanceof ServiceRef) {
    boolean versionConstraintFound=false;
    StringBuilder nameParts=new StringBuilder();
    while (leafIt.hasNext() && !versionConstraintFound) {
      ILeafNode curNode=leafIt.next();
      if (curNode.getSemanticElement() instanceof VersionRef)       versionConstraintFound=true;
 else       nameParts.append(curNode.getText());
    }
    final String moduleName=nameParts.toString().trim();
    final String className=ServiceDslPackage.Literals.SERVICE.getName();
    canditateVersions=getCanditateVersions(moduleName,className,importedNamespaces,model.eContainer() instanceof MajorVersionRef);
  }
  for (  String version : canditateVersions) {
    acceptor.accept(createCompletionProposal(version,context));
  }
}

Fixed version (ground truth):
private void calculateVersionProposals(EObject model,ContentAssistContext context,ICompletionProposalAcceptor acceptor){
  ICompositeNode parentNode=NodeModelUtils.findActualNodeFor(model).getParent();
  Iterable<ILeafNode> leafs=parentNode.getLeafNodes();
  Iterable<ILeafNode> nonHidden=Iterables.filter(leafs,new Predicate<ILeafNode>(){
    public boolean apply(    ILeafNode node){
      return !node.isHidden();
    }
  }
);
  EObject canditateRoot=model;
  while (!(canditateRoot instanceof BindingModel) && model.eContainer() != null) {
    canditateRoot=canditateRoot.eContainer();
  }
  if (canditateRoot instanceof BindingModel) {
    BindingModel moduleModel=(BindingModel)canditateRoot;
    EList<Import> imports=moduleModel.getImports();
    final Iterable<String> importedNamespaces=Lists.transform(imports,new Function<Import,String>(){
      public String apply(      Import from){
        return from.getImportedNamespace().replaceAll("String_Node_Str","String_Node_Str");
      }
    }
);
    Iterator<ILeafNode> leafIt=nonHidden.iterator();
    Iterable<String> canditateVersions=Sets.newHashSet();
    if (model.eContainer() instanceof ModuleRef) {
      boolean versionConstraintFound=false;
      StringBuilder nameParts=new StringBuilder();
      while (leafIt.hasNext() && !versionConstraintFound) {
        ILeafNode curNode=leafIt.next();
        if (curNode.getSemanticElement() instanceof VersionRef)         versionConstraintFound=true;
 else         nameParts.append(curNode.getText());
      }
      final String moduleName=nameParts.toString().trim();
      final String className=ModuleDslPackage.Literals.MODULE.getName();
      canditateVersions=getCanditateVersions(moduleName,className,importedNamespaces,model.eContainer() instanceof MajorVersionRef);
    }
 else     if (model.eContainer() instanceof ServiceRef) {
      boolean versionConstraintFound=false;
      StringBuilder nameParts=new StringBuilder();
      while (leafIt.hasNext() && !versionConstraintFound) {
        ILeafNode curNode=leafIt.next();
        if (curNode.getSemanticElement() instanceof VersionRef)         versionConstraintFound=true;
 else         nameParts.append(curNode.getText());
      }
      final String svcName=nameParts.toString().trim();
      final String className=ServiceDslPackage.Literals.SERVICE.getName();
      canditateVersions=getCanditateVersions(svcName,className,importedNamespaces,model.eContainer() instanceof MajorVersionRef);
    }
    for (    String version : canditateVersions) {
      acceptor.accept(createCompletionProposal(version,context));
    }
  }
}