Program: 64695
Project: 64695
Buggy source:
public void addToOROXProjectsForComplexTypes(List<CompositeDatabaseType> types,Project orProject,Project oxProject){
  for (  DatabaseType dbType : types) {
    String name;
    String alias;
    if (dbType.isPLSQLType()) {
      String catalogPattern=((PLSQLType)dbType).getParentType().getPackageName();
      String targetTypeName;
      if (catalogPattern == null) {
        name=dbType.getTypeName();
        targetTypeName=dbType.getTypeName();
      }
 else {
        name=catalogPattern + DOT + dbType.getTypeName();
        targetTypeName=catalogPattern + UNDERSCORE + dbType.getTypeName();
      }
      alias=targetTypeName.toLowerCase();
      name=name.replace(PERCENT,UNDERSCORE);
      targetTypeName=targetTypeName.replace(PERCENT,UNDERSCORE);
      if (dbType.isPLSQLRecordType()) {
        addToOXProjectForPLSQLRecordArg(dbType,oxProject,name,alias,targetTypeName,catalogPattern);
        addToORProjectForPLSQLRecordArg(dbType,orProject,name,alias,targetTypeName,catalogPattern);
      }
 else {
        addToOXProjectForPLSQLTableArg(dbType,oxProject,name,alias,targetTypeName,catalogPattern);
        addToORProjectForPLSQLTableArg(dbType,orProject,name,alias,targetTypeName,catalogPattern);
      }
    }
 else {
      if (Util.isTypeComplex(dbType)) {
        name=getGeneratedJavaClassName(dbType.getTypeName().toLowerCase(),dbwsBuilder.getProjectName());
      }
 else {
        name=dbType.getTypeName();
      }
      alias=dbType.getTypeName().toLowerCase();
      if (dbType.isVArrayType()) {
        addToOXProjectForVArrayArg(dbType,oxProject,name,alias);
        addToORProjectForVArrayArg(dbType,orProject,name,alias);
      }
 else       if (dbType.isObjectType()) {
        addToOXProjectForObjectTypeArg(dbType,oxProject,name,alias);
        addToORProjectForObjectTypeArg(dbType,orProject,name,alias);
      }
 else       if (dbType.isObjectTableType()) {
        addToOXProjectForObjectTableTypeArg(dbType,oxProject,name,alias);
        addToORProjectForObjectTableTypeArg(dbType,orProject,name,alias);
      }
    }
  }
}

Fixed version (ground truth):
public void addToOROXProjectsForComplexTypes(List<CompositeDatabaseType> types,Project orProject,Project oxProject){
  for (  DatabaseType dbType : types) {
    String name;
    String alias;
    if (dbType.isPLSQLType()) {
      dbType.setTypeName(dbType.getTypeName().toUpperCase());
      String catalogPattern=((PLSQLType)dbType).getParentType().getPackageName();
      String targetTypeName;
      if (catalogPattern == null) {
        name=dbType.getTypeName();
        targetTypeName=dbType.getTypeName();
      }
 else {
        name=catalogPattern + DOT + dbType.getTypeName();
        targetTypeName=catalogPattern + UNDERSCORE + dbType.getTypeName();
      }
      alias=targetTypeName.toLowerCase();
      name=name.replace(PERCENT,UNDERSCORE);
      targetTypeName=targetTypeName.replace(PERCENT,UNDERSCORE);
      if (dbType.isPLSQLRecordType()) {
        addToOXProjectForPLSQLRecordArg(dbType,oxProject,name,alias,targetTypeName,catalogPattern);
        addToORProjectForPLSQLRecordArg(dbType,orProject,name,alias,targetTypeName,catalogPattern);
      }
 else {
        addToOXProjectForPLSQLTableArg(dbType,oxProject,name,alias,targetTypeName,catalogPattern);
        addToORProjectForPLSQLTableArg(dbType,orProject,name,alias,targetTypeName,catalogPattern);
      }
    }
 else {
      if (Util.isTypeComplex(dbType)) {
        name=getGeneratedJavaClassName(dbType.getTypeName().toLowerCase(),dbwsBuilder.getProjectName());
      }
 else {
        name=dbType.getTypeName();
      }
      alias=dbType.getTypeName().toLowerCase();
      if (dbType.isVArrayType()) {
        addToOXProjectForVArrayArg(dbType,oxProject,name,alias);
        addToORProjectForVArrayArg(dbType,orProject,name,alias);
      }
 else       if (dbType.isObjectType()) {
        addToOXProjectForObjectTypeArg(dbType,oxProject,name,alias);
        addToORProjectForObjectTypeArg(dbType,orProject,name,alias);
      }
 else       if (dbType.isObjectTableType()) {
        addToOXProjectForObjectTableTypeArg(dbType,oxProject,name,alias);
        addToORProjectForObjectTableTypeArg(dbType,orProject,name,alias);
      }
    }
  }
}