Program: 64968
Project: 64968
Buggy source:
/** 
 * Build descriptor and mappings for a PL/SQL record argument.  The newly created descriptor will be added to the given OR project.
 */
@SuppressWarnings("String_Node_Str") protected void addToORProjectForPLSQLRecordArg(DatabaseType dbType,Project orProject,String recordName,String recordAlias,String targetTypeName,String catalogPattern){
  ObjectRelationalDataTypeDescriptor ordtDesc=(ObjectRelationalDataTypeDescriptor)orProject.getDescriptorForAlias(recordAlias);
  if (ordtDesc == null) {
    ordtDesc=buildAndAddNewObjectRelationalDataTypeDescriptor(orProject,recordAlias,recordName.toLowerCase());
  }
  PLSQLRecordType plsqlRecType=(PLSQLRecordType)dbType;
  for (  FieldType fType : plsqlRecType.getFields()) {
    String fieldName=fType.getFieldName();
    String lFieldName=fieldName.toLowerCase();
    boolean found=false;
    Vector orderedFields=ordtDesc.getOrderedFields();
    for (Iterator i=orderedFields.iterator(); i.hasNext(); ) {
      Object o=i.next();
      if (o instanceof DatabaseField) {
        DatabaseField field=(DatabaseField)o;
        if (field.getName().equalsIgnoreCase(fieldName)) {
          found=true;
          break;
        }
      }
    }
    if (!found) {
      ordtDesc.addFieldOrdering(fieldName);
    }
    if (ordtDesc.getMappingForAttributeName(lFieldName) == null) {
      if (fType.isComposite()) {
        if (fType.getEnclosedType().isPLSQLRecordType()) {
          buildAndAddStructureMapping(ordtDesc,lFieldName,fieldName,recordName.toLowerCase());
        }
 else         if (fType.getEnclosedType().isPLSQLCollectionType()) {
          PLSQLCollectionType tableType=(PLSQLCollectionType)fType.getEnclosedType();
          if (tableType.getEnclosedType().isComposite()) {
            buildAndAddObjectArrayMapping(ordtDesc,lFieldName,fieldName,(catalogPattern + "String_Node_Str" + tableType.getTypeName()).toLowerCase() + COLLECTION_WRAPPER_SUFFIX,getStructureNameForField(fType,catalogPattern));
          }
 else {
            buildAndAddArrayMapping(ordtDesc,lFieldName,fieldName,getStructureNameForField(fType,catalogPattern));
          }
        }
 else         if (fType.getEnclosedType().isObjectType()) {
          buildAndAddStructureMapping(ordtDesc,lFieldName,fieldName,getGeneratedJavaClassName(fType.getEnclosedType().getTypeName(),dbwsBuilder.getProjectName()));
        }
 else         if (fType.getEnclosedType().isVArrayType()) {
          if (((VArrayType)fType.getEnclosedType()).getEnclosedType().isComposite()) {
            buildAndAddObjectArrayMapping(ordtDesc,lFieldName,fieldName,getGeneratedJavaClassName(((VArrayType)fType.getEnclosedType()).getEnclosedType().getTypeName(),dbwsBuilder.getProjectName()),getStructureNameForField(fType,null));
          }
 else {
            buildAndAddArrayMapping(ordtDesc,lFieldName,fieldName,getStructureNameForField(fType,null));
          }
        }
 else         if (fType.getEnclosedType().isObjectTableType()) {
          ObjectType nestedType=(ObjectType)((ObjectTableType)fType.getEnclosedType()).getEnclosedType();
          String nestedTypeAlias=nestedType.getTypeName().toLowerCase();
          String nestedTypeName=getGeneratedJavaClassName(nestedTypeAlias,dbwsBuilder.getProjectName());
          buildAndAddObjectArrayMapping(ordtDesc,lFieldName,fieldName,nestedTypeName,nestedTypeAlias.toUpperCase());
        }
      }
 else {
        ordtDesc.addDirectMapping(lFieldName,fieldName);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Build descriptor and mappings for a PL/SQL record argument.  The newly created descriptor will be added to the given OR project.
 */
@SuppressWarnings("String_Node_Str") protected void addToORProjectForPLSQLRecordArg(DatabaseType dbType,Project orProject,String recordName,String recordAlias,String targetTypeName,String catalogPattern){
  ObjectRelationalDataTypeDescriptor ordtDesc=(ObjectRelationalDataTypeDescriptor)orProject.getDescriptorForAlias(recordAlias);
  if (ordtDesc == null) {
    ordtDesc=buildAndAddNewObjectRelationalDataTypeDescriptor(orProject,recordAlias,recordName.toLowerCase());
  }
  PLSQLRecordType plsqlRecType=(PLSQLRecordType)dbType;
  for (  FieldType fType : plsqlRecType.getFields()) {
    String fieldName=fType.getFieldName();
    String lFieldName=fieldName.toLowerCase();
    boolean found=false;
    Vector orderedFields=ordtDesc.getOrderedFields();
    for (Iterator i=orderedFields.iterator(); i.hasNext(); ) {
      Object o=i.next();
      if (o instanceof DatabaseField) {
        DatabaseField field=(DatabaseField)o;
        if (field.getName().equalsIgnoreCase(fieldName)) {
          found=true;
          break;
        }
      }
    }
    if (!found) {
      ordtDesc.addFieldOrdering(fieldName);
    }
    if (ordtDesc.getMappingForAttributeName(lFieldName) == null) {
      if (fType.isComposite()) {
        if (fType.getEnclosedType().isPLSQLRecordType()) {
          buildAndAddStructureMapping(ordtDesc,lFieldName,fieldName,recordName.toLowerCase());
        }
 else         if (fType.getEnclosedType().isPLSQLCollectionType()) {
          PLSQLCollectionType tableType=(PLSQLCollectionType)fType.getEnclosedType();
          if (tableType.getEnclosedType().isComposite()) {
            buildAndAddObjectArrayMapping(ordtDesc,lFieldName,fieldName,(catalogPattern + "String_Node_Str" + tableType.getTypeName()).toLowerCase() + COLLECTION_WRAPPER_SUFFIX,getStructureNameForField(fType,catalogPattern));
          }
 else {
            buildAndAddArrayMapping(ordtDesc,lFieldName,fieldName,getStructureNameForField(fType,catalogPattern));
          }
        }
 else         if (fType.getEnclosedType().isObjectType()) {
          buildAndAddStructureMapping(ordtDesc,lFieldName,fieldName,getGeneratedJavaClassName(fType.getEnclosedType().getTypeName(),dbwsBuilder.getProjectName()));
        }
 else         if (fType.getEnclosedType().isVArrayType()) {
          if (((VArrayType)fType.getEnclosedType()).getEnclosedType().isComposite()) {
            buildAndAddObjectArrayMapping(ordtDesc,lFieldName,fieldName,getGeneratedJavaClassName(((VArrayType)fType.getEnclosedType()).getEnclosedType().getTypeName(),dbwsBuilder.getProjectName()),getStructureNameForField(fType,null));
          }
 else {
            buildAndAddArrayMapping(ordtDesc,lFieldName,fieldName,getStructureNameForField(fType,null));
          }
        }
 else         if (fType.getEnclosedType().isObjectTableType()) {
          ObjectTableType nestedType=(ObjectTableType)fType.getEnclosedType();
          if (nestedType.getEnclosedType().isComposite()) {
            ObjectType oType=(ObjectType)nestedType.getEnclosedType();
            String oTypeAlias=oType.getTypeName().toLowerCase();
            String oTypeName=getGeneratedJavaClassName(oTypeAlias,dbwsBuilder.getProjectName());
            buildAndAddObjectArrayMapping(ordtDesc,lFieldName,fieldName,oTypeName,oTypeAlias.toUpperCase());
          }
 else {
            buildAndAddArrayMapping(ordtDesc,lFieldName,fieldName,nestedType.getTypeName().toUpperCase());
          }
        }
      }
 else {
        ordtDesc.addDirectMapping(lFieldName,fieldName);
      }
    }
  }
}