Program: 185998
Project: 185998
Buggy source:
protected void importDef(AST importNode){
  boolean isStatic=importNode.getType() == STATIC_IMPORT;
  List<AnnotationNode> annotations=new ArrayList<AnnotationNode>();
  AST node=importNode.getFirstChild();
  if (isType(ANNOTATIONS,node)) {
    processAnnotations(annotations,node);
    node=node.getNextSibling();
  }
  String alias=null;
  if (isType(LITERAL_as,node)) {
    node=node.getFirstChild();
    AST aliasNode=node.getNextSibling();
    alias=identifier(aliasNode);
  }
  if (node.getNumberOfChildren() == 0) {
    String name=identifier(node);
    ClassNode type=ClassHelper.make(name);
    configureAST(type,importNode);
    addImport(type,name,alias,annotations);
    return;
  }
  AST packageNode=node.getFirstChild();
  String packageName=qualifiedName(packageNode);
  AST nameNode=packageNode.getNextSibling();
  if (isType(STAR,nameNode)) {
    if (isStatic) {
      ClassNode type=ClassHelper.make(packageName);
      configureAST(type,importNode);
      addStaticStarImport(type,packageName,annotations);
      ASTNode imp=(ASTNode)output.getStaticStarImports().get(packageName);
      configureAST(imp,importNode);
    }
 else {
      addStarImport(packageName,annotations);
      ASTNode imp=(ASTNode)output.getStarImports().get(output.getStarImports().size() - 1);
      configureAST(imp,importNode);
    }
    if (alias != null)     throw new GroovyBugError("String_Node_Str" + "String_Node_Str");
  }
 else {
    String name=identifier(nameNode);
    if (isStatic) {
      ClassNode type=ClassHelper.make(packageName);
      configureAST(type,importNode);
      addStaticImport(type,name,alias,annotations);
      ASTNode imp=(ASTNode)output.getStaticImports().get(alias == null ? name : alias);
      configureAST(imp,importNode);
    }
 else {
      ClassNode type=ClassHelper.make(packageName + "String_Node_Str" + name);
      configureAST(type,nameNode);
      addImport(type,name,alias,annotations);
    }
  }
}

Fixed version (ground truth):
protected void importDef(AST importNode){
  boolean isStatic=importNode.getType() == STATIC_IMPORT;
  List<AnnotationNode> annotations=new ArrayList<AnnotationNode>();
  AST node=importNode.getFirstChild();
  if (isType(ANNOTATIONS,node)) {
    processAnnotations(annotations,node);
    node=node.getNextSibling();
  }
  String alias=null;
  if (isType(LITERAL_as,node)) {
    node=node.getFirstChild();
    AST aliasNode=node.getNextSibling();
    alias=identifier(aliasNode);
  }
  if (node.getNumberOfChildren() == 0) {
    String name=identifier(node);
    ClassNode type=ClassHelper.make(name);
    configureAST(type,importNode);
    addImport(type,name,alias,annotations);
    return;
  }
  AST packageNode=node.getFirstChild();
  String packageName=qualifiedName(packageNode);
  AST nameNode=packageNode.getNextSibling();
  if (isType(STAR,nameNode)) {
    if (isStatic) {
      ClassNode type=ClassHelper.make(packageName);
      configureAST(type,importNode);
      addStaticStarImport(type,packageName,annotations);
      ASTNode imp=(ASTNode)output.getStaticStarImports().get(packageName);
      configureAST(imp,importNode);
    }
 else {
      addStarImport(packageName,annotations);
      ASTNode imp=(ASTNode)output.getStarImports().get(output.getStarImports().size() - 1);
      configureAST(imp,importNode);
    }
    if (alias != null)     throw new GroovyBugError("String_Node_Str" + "String_Node_Str");
  }
 else {
    String name=identifier(nameNode);
    if (isStatic) {
      ClassNode type=ClassHelper.make(packageName);
      configureAST(type,importNode);
      addStaticImport(type,name,alias,annotations);
      ASTNode imp=(ASTNode)output.getStaticImports().get(alias == null ? name : alias);
      configureAST(imp,importNode);
    }
 else {
      ClassNode type=ClassHelper.make(packageName + "String_Node_Str" + name);
      configureAST(type,nameNode);
      addImport(type,name,alias,annotations);
      ImportNode imp=output.getImport(alias == null ? name : alias);
      configureAST(imp,importNode);
    }
  }
}