Program: 39281
Project: 39281
Buggy source:
private void parseField(final XMLStreamReader reader,final String pluginIdentifier,final CtClass ctClass,final String tag,final List<String> fields) throws XMLStreamException, ModelXmlCompilingException {
  FieldsTag modelTag=FieldsTag.valueOf(tag.toUpperCase(Locale.ENGLISH));
  if (getBooleanAttribute(reader,"String_Node_Str",true) || getStringAttribute(reader,"String_Node_Str") == null) {
switch (modelTag) {
case PRIORITY:
case INTEGER:
      createField(ctClass,getStringAttribute(reader,"String_Node_Str"),Integer.class.getCanonicalName());
    fields.add(getStringAttribute(reader,"String_Node_Str"));
  break;
case STRING:
case FILE:
case TEXT:
case ENUM:
case DICTIONARY:
case PASSWORD:
createField(ctClass,getStringAttribute(reader,"String_Node_Str"),String.class.getCanonicalName());
fields.add(getStringAttribute(reader,"String_Node_Str"));
break;
case DECIMAL:
createField(ctClass,getStringAttribute(reader,"String_Node_Str"),BigDecimal.class.getCanonicalName());
fields.add(getStringAttribute(reader,"String_Node_Str"));
break;
case DATETIME:
case DATE:
createField(ctClass,getStringAttribute(reader,"String_Node_Str"),Date.class.getCanonicalName());
fields.add(getStringAttribute(reader,"String_Node_Str"));
break;
case BOOLEAN:
createField(ctClass,getStringAttribute(reader,"String_Node_Str"),Boolean.class.getCanonicalName());
fields.add(getStringAttribute(reader,"String_Node_Str"));
break;
case BELONGSTO:
createBelongsField(ctClass,pluginIdentifier,reader);
fields.add(getStringAttribute(reader,"String_Node_Str"));
break;
case MANYTOMANY:
createSetField(ctClass,reader);
fields.add(getStringAttribute(reader,"String_Node_Str"));
break;
case HASMANY:
case TREE:
createSetField(ctClass,reader);
break;
default :
break;
}
}
while (reader.hasNext() && reader.next() > 0) {
if (isTagEnded(reader,tag)) {
break;
}
}
}

Fixed version (ground truth):
private void parseField(final XMLStreamReader reader,final String pluginIdentifier,final CtClass ctClass,final String tag,final List<String> fields) throws XMLStreamException, ModelXmlCompilingException {
  FieldsTag modelTag=FieldsTag.valueOf(tag.toUpperCase(Locale.ENGLISH));
  if (getBooleanAttribute(reader,"String_Node_Str",true) || getStringAttribute(reader,"String_Node_Str") == null) {
switch (modelTag) {
case PRIORITY:
case INTEGER:
      createField(ctClass,getStringAttribute(reader,NAME),Integer.class.getCanonicalName());
    fields.add(getStringAttribute(reader,NAME));
  break;
case STRING:
case FILE:
case TEXT:
case ENUM:
case DICTIONARY:
case PASSWORD:
createField(ctClass,getStringAttribute(reader,NAME),String.class.getCanonicalName());
fields.add(getStringAttribute(reader,NAME));
break;
case DECIMAL:
createField(ctClass,getStringAttribute(reader,NAME),BigDecimal.class.getCanonicalName());
fields.add(getStringAttribute(reader,NAME));
break;
case DATETIME:
case DATE:
createField(ctClass,getStringAttribute(reader,NAME),Date.class.getCanonicalName());
fields.add(getStringAttribute(reader,NAME));
break;
case BOOLEAN:
createField(ctClass,getStringAttribute(reader,NAME),Boolean.class.getCanonicalName());
fields.add(getStringAttribute(reader,NAME));
break;
case BELONGSTO:
createBelongsField(ctClass,pluginIdentifier,reader);
fields.add(getStringAttribute(reader,NAME));
break;
case MANYTOMANY:
createSetField(ctClass,reader);
fields.add(getStringAttribute(reader,NAME));
break;
case HASMANY:
case TREE:
createSetField(ctClass,reader);
break;
default :
break;
}
}
while (reader.hasNext() && reader.next() > 0) {
if (isTagEnded(reader,tag)) {
break;
}
}
}