Program: 29319
Project: 29319
Buggy source:
private void _validate(final AMXProxy proxy,final ProblemList problems) throws InstanceNotFoundException {
  progress("String_Node_Str",proxy.objectName());
  final ObjectName objectName=proxy.objectName();
  try {
    validateObjectName(proxy);
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  try {
    validateMetadata(proxy,problems);
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  try {
    validateRequiredAttributes(proxy);
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  try {
    final String name=proxy.getName();
  }
 catch (  final Exception t) {
    problems.add("String_Node_Str",t);
  }
  try {
    final ObjectName parent=proxy.getParent();
  }
 catch (  final Exception t) {
    problems.add("String_Node_Str",t);
  }
  try {
    final ObjectName[] children=proxy.getChildren();
  }
 catch (  final Exception t) {
    problems.add("String_Node_Str",t);
  }
  final Pathnames paths=mDomainRoot.getPathnames();
  if (paths == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  try {
    final String path=proxy.path();
    final ObjectName actualObjectName=proxy.objectName();
    final ObjectName o=paths.resolvePath(path);
    if (o == null) {
      if (proxy.valid()) {
        problems.add("String_Node_Str" + path + "String_Node_Str"+ actualObjectName);
      }
    }
 else     if (!actualObjectName.equals(o)) {
      problems.add("String_Node_Str" + path + "String_Node_Str"+ actualObjectName);
    }
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  final Set<String> attributeNames=proxy.extra().attributeNames();
  for (  final String attrName : attributeNames) {
    try {
      final Object result=proxy.extra().getAttribute(attrName);
      checkLegalForRemote(result);
    }
 catch (    final Exception t) {
      if (attrName.equals(ATTR_NAME) || attrName.equals(ATTR_PARENT) || attrName.equals(ATTR_CHILDREN)) {
        problems.add("String_Node_Str" + attrName + "String_Node_Str",t);
      }
 else {
        logWarning("String_Node_Str" + attrName + "String_Node_Str"+ proxy.objectName(),ExceptionUtil.getRootCause(t));
      }
    }
  }
  List<String> tempProblems=null;
  try {
    validateChildren(proxy);
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  try {
    final AMXProxy parent=proxy.parent();
    if (parent == null && !proxy.type().equals(Util.deduceType(DomainRoot.class))) {
      final ObjectName parentObjectName=proxy.getParent();
      final boolean exists=mMBeanServer.isRegistered(proxy.objectName());
      problems.add("String_Node_Str" + proxy.objectName() + "String_Node_Str"+ exists+ "String_Node_Str"+ parentObjectName);
    }
    final String nameProp=proxy.nameProp();
    final boolean valid=proxy.valid();
    final String path=proxy.path();
    final Extra extra=proxy.extra();
    final String interfaceName=extra.interfaceName();
    final MBeanInfo mbeanInfo=extra.mbeanInfo();
    final String group=extra.group();
    final Class<? extends AMXProxy> genericInterface=extra.genericInterface();
    final boolean invariantMBeanInfo=extra.isInvariantMBeanInfo();
    final boolean supportsAdoption=extra.supportsAdoption();
    final String[] subTypes=extra.subTypes();
    final Set<AMXProxy> childrenSet=proxy.childrenSet();
    final Map<String,Map<String,AMXProxy>> childrenMaps=proxy.childrenMaps();
    final Map<String,Object> attributesMap=proxy.attributesMap();
    final Set<String> attrNames=proxy.attributeNames();
    if (!attrNames.equals(attributesMap.keySet())) {
      final Set<String> keys=new HashSet<String>(attributesMap.keySet());
      keys.removeAll(attrNames);
      if (keys.size() != 0) {
        throw new Exception("String_Node_Str" + keys);
      }
      if (mLogInaccessibleAttributes) {
        final Set<String> missing=new HashSet<String>(attrNames);
        missing.removeAll(attributesMap.keySet());
        logInfo("String_Node_Str" + missing + "String_Node_Str"+ proxy.objectName(),null);
      }
    }
    for (    final AMXProxy child : childrenSet) {
      if (child.extra().singleton()) {
        final String childType=child.type();
        if (!child.objectName().equals(proxy.child(childType).objectName())) {
          throw new Exception("String_Node_Str" + childType + "String_Node_Str");
        }
      }
    }
    for (    final String type : childrenMaps.keySet()) {
      final Map<String,AMXProxy> m=proxy.childrenMap(type);
      if (m.keySet().size() == 0) {
        throw new Exception("String_Node_Str" + type + "String_Node_Str");
      }
    }
  }
 catch (  final Exception t) {
    problems.add("String_Node_Str",t);
  }
  try {
    validateAMXConfig(proxy,problems);
  }
 catch (  final Exception t) {
    if (proxy.valid()) {
      problems.add("String_Node_Str",t);
    }
  }
}

Fixed version (ground truth):
private void _validate(final AMXProxy proxy,final ProblemList problems) throws InstanceNotFoundException {
  progress("String_Node_Str",proxy.objectName());
  try {
    validateObjectName(proxy);
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  try {
    validateMetadata(proxy,problems);
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  try {
    validateRequiredAttributes(proxy);
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  try {
    final String name=proxy.getName();
  }
 catch (  final Exception t) {
    problems.add("String_Node_Str",t);
  }
  try {
    final ObjectName parent=proxy.getParent();
  }
 catch (  final Exception t) {
    problems.add("String_Node_Str",t);
  }
  try {
    final ObjectName[] children=proxy.getChildren();
  }
 catch (  final Exception t) {
    problems.add("String_Node_Str",t);
  }
  final Pathnames paths=mDomainRoot.getPathnames();
  if (paths == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  try {
    final String path=proxy.path();
    final ObjectName actualObjectName=proxy.objectName();
    final ObjectName o=paths.resolvePath(path);
    if (o == null) {
      if (proxy.valid()) {
        problems.add("String_Node_Str" + path + "String_Node_Str"+ actualObjectName);
      }
    }
 else     if (!actualObjectName.equals(o)) {
      problems.add("String_Node_Str" + path + "String_Node_Str"+ actualObjectName);
    }
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  final Set<String> attributeNames=proxy.extra().attributeNames();
  for (  final String attrName : attributeNames) {
    try {
      final Object result=proxy.extra().getAttribute(attrName);
      checkLegalForRemote(result);
    }
 catch (    final Exception t) {
      if (attrName.equals(ATTR_NAME) || attrName.equals(ATTR_PARENT) || attrName.equals(ATTR_CHILDREN)) {
        problems.add("String_Node_Str" + attrName + "String_Node_Str",t);
      }
 else {
        logWarning("String_Node_Str" + attrName + "String_Node_Str"+ proxy.objectName(),ExceptionUtil.getRootCause(t));
      }
    }
  }
  try {
    validateChildren(proxy);
  }
 catch (  final Exception t) {
    problems.add(t);
  }
  try {
    final AMXProxy parent=proxy.parent();
    if (parent == null && !proxy.type().equals(Util.deduceType(DomainRoot.class))) {
      final ObjectName parentObjectName=proxy.getParent();
      final boolean exists=mMBeanServer.isRegistered(proxy.objectName());
      problems.add("String_Node_Str" + proxy.objectName() + "String_Node_Str"+ exists+ "String_Node_Str"+ parentObjectName);
    }
    final Set<AMXProxy> childrenSet=proxy.childrenSet();
    final Map<String,Map<String,AMXProxy>> childrenMaps=proxy.childrenMaps();
    final Map<String,Object> attributesMap=proxy.attributesMap();
    final Set<String> attrNames=proxy.attributeNames();
    if (!attrNames.equals(attributesMap.keySet())) {
      final Set<String> keys=new HashSet<String>(attributesMap.keySet());
      keys.removeAll(attrNames);
      if (!keys.isEmpty()) {
        throw new Exception("String_Node_Str" + keys);
      }
      if (mLogInaccessibleAttributes) {
        final Set<String> missing=new HashSet<String>(attrNames);
        missing.removeAll(attributesMap.keySet());
        logInfo("String_Node_Str" + missing + "String_Node_Str"+ proxy.objectName(),null);
      }
    }
    for (    final AMXProxy child : childrenSet) {
      if (child.extra().singleton()) {
        final String childType=child.type();
        if (!child.objectName().equals(proxy.child(childType).objectName())) {
          throw new Exception("String_Node_Str" + childType + "String_Node_Str");
        }
      }
    }
    for (    final String type : childrenMaps.keySet()) {
      final Map<String,AMXProxy> m=proxy.childrenMap(type);
      if (m.keySet().isEmpty()) {
        throw new Exception("String_Node_Str" + type + "String_Node_Str");
      }
    }
  }
 catch (  final Exception t) {
    problems.add("String_Node_Str",t);
  }
  try {
    validateAMXConfig(proxy,problems);
  }
 catch (  final Exception t) {
    if (proxy.valid()) {
      problems.add("String_Node_Str",t);
    }
  }
}