Program: 29320
Project: 29320
Buggy source:
private void validateMetadata(final AMXProxy proxy,final ProblemList problems) throws InstanceNotFoundException {
  final MBeanInfo mbeanInfo=proxy.extra().mbeanInfo();
  final Descriptor d=mbeanInfo.getDescriptor();
  final Set<String> LEGAL_AMX_DESCRIPTORS=SetUtil.newStringSet(DESC_GENERIC_INTERFACE_NAME,DESC_IS_SINGLETON,DESC_IS_GLOBAL_SINGLETON,DESC_GROUP,DESC_SUPPORTS_ADOPTION,DESC_SUB_TYPES);
  for (  final String fieldName : d.getFieldNames()) {
    if (fieldName.startsWith(DESC_PREFIX) && !LEGAL_AMX_DESCRIPTORS.contains(fieldName)) {
      problems.add("String_Node_Str" + fieldName + "String_Node_Str"+ d.getFieldValue(fieldName));
    }
  }
  final MetadataValidator val=new MetadataValidator(d,problems);
  val.validateMetadataBoolean(DESC_IS_SINGLETON);
  val.validateMetadataBoolean(DESC_SUPPORTS_ADOPTION);
  val.validateMetadataBoolean(DESC_STD_IMMUTABLE_INFO);
  val.validateMetadataString(DESC_STD_INTERFACE_NAME);
  val.validateMetadataString(DESC_GENERIC_INTERFACE_NAME);
  val.validateMetadataString(DESC_GROUP);
  val.validate(DESC_SUB_TYPES,String[].class);
  for (  final MBeanAttributeInfo attrInfo : mbeanInfo.getAttributes()) {
    checkLegalAttributeType(attrInfo.getType(),attrInfo.getName(),problems);
    new MetadataValidator(attrInfo.getDescriptor(),problems);
  }
  for (  final MBeanOperationInfo opInfo : mbeanInfo.getOperations()) {
    checkLegalReturnType(opInfo.getReturnType(),opInfo.getName(),problems);
    new MetadataValidator(opInfo.getDescriptor(),problems);
  }
  for (  final MBeanConstructorInfo cosntructorInfo : mbeanInfo.getConstructors()) {
    new MetadataValidator(cosntructorInfo.getDescriptor(),problems);
  }
  for (  final MBeanNotificationInfo notifInfo : mbeanInfo.getNotifications()) {
    new MetadataValidator(notifInfo.getDescriptor(),problems);
  }
  if (proxy.extra().globalSingleton()) {
    final ObjectName objectName=proxy.objectName();
    final ObjectName pattern=Util.newObjectNamePattern(objectName.getDomain(),Util.makeTypeProp(Util.getTypeProp(objectName)));
    try {
      final long start=System.currentTimeMillis();
      final Set<ObjectName> instances=mMBeanServer.queryNames(pattern,null);
      final long elapsed=System.currentTimeMillis() - start;
      if (instances.size() > 1) {
        problems.add("String_Node_Str" + objectName + "String_Node_Str"+ CollectionUtil.toString(instances,"String_Node_Str"));
      }
    }
 catch (    final Exception e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
private void validateMetadata(final AMXProxy proxy,final ProblemList problems) throws InstanceNotFoundException {
  final MBeanInfo mbeanInfo=proxy.extra().mbeanInfo();
  final Descriptor d=mbeanInfo.getDescriptor();
  final Set<String> LEGAL_AMX_DESCRIPTORS=SetUtil.newStringSet(DESC_GENERIC_INTERFACE_NAME,DESC_IS_SINGLETON,DESC_IS_GLOBAL_SINGLETON,DESC_GROUP,DESC_SUPPORTS_ADOPTION,DESC_SUB_TYPES);
  for (  final String fieldName : d.getFieldNames()) {
    if (fieldName.startsWith(DESC_PREFIX) && !LEGAL_AMX_DESCRIPTORS.contains(fieldName)) {
      problems.add("String_Node_Str" + fieldName + "String_Node_Str"+ d.getFieldValue(fieldName));
    }
  }
  final MetadataValidator val=new MetadataValidator(d,problems);
  val.validateMetadataBoolean(DESC_IS_SINGLETON);
  val.validateMetadataBoolean(DESC_SUPPORTS_ADOPTION);
  val.validateMetadataBoolean(DESC_STD_IMMUTABLE_INFO);
  val.validateMetadataString(DESC_STD_INTERFACE_NAME);
  val.validateMetadataString(DESC_GENERIC_INTERFACE_NAME);
  val.validateMetadataString(DESC_GROUP);
  val.validate(DESC_SUB_TYPES,String[].class);
  for (  final MBeanAttributeInfo attrInfo : mbeanInfo.getAttributes()) {
    checkLegalAttributeType(attrInfo.getType(),attrInfo.getName(),problems);
    new MetadataValidator(attrInfo.getDescriptor(),problems);
  }
  for (  final MBeanOperationInfo opInfo : mbeanInfo.getOperations()) {
    checkLegalReturnType(opInfo.getReturnType(),opInfo.getName(),problems);
    new MetadataValidator(opInfo.getDescriptor(),problems);
  }
  for (  final MBeanConstructorInfo cosntructorInfo : mbeanInfo.getConstructors()) {
    new MetadataValidator(cosntructorInfo.getDescriptor(),problems);
  }
  for (  final MBeanNotificationInfo notifInfo : mbeanInfo.getNotifications()) {
    new MetadataValidator(notifInfo.getDescriptor(),problems);
  }
  if (proxy.extra().globalSingleton()) {
    final ObjectName objectName=proxy.objectName();
    final ObjectName pattern=Util.newObjectNamePattern(objectName.getDomain(),Util.makeTypeProp(Util.getTypeProp(objectName)));
    try {
      final Set<ObjectName> instances=mMBeanServer.queryNames(pattern,null);
      if (instances.size() > 1) {
        problems.add("String_Node_Str" + objectName + "String_Node_Str"+ CollectionUtil.toString(instances,"String_Node_Str"));
      }
    }
 catch (    final Exception e) {
      throw new RuntimeException(e);
    }
  }
}