Program: 15818
Project: 15818
Buggy source:
private Method getCommandMethod(Class<?> clz,String command,CommandMethodInfoProvider cmdInfo,Map<Class<?>,Map<String,CachedItem<Method>>> cache){
  Map<String,CachedItem<Method>> methods;
synchronized (cache) {
    methods=cache.get(clz);
    if (methods == null) {
      methods=new HashMap<String,CachedItem<Method>>();
      cache.put(clz,methods);
    }
  }
  CachedItem<Method> method=null;
synchronized (methods) {
    method=methods.get(command);
    if (method != null) {
      return method.value;
    }
 else     if (methods.get(COMMAND_METHOD_MAP_INIT) != null) {
      method=methods.get(COMMAND_METHOD_DEFAULT);
      if (method != null) {
        return method.value;
      }
      return null;
    }
    methods.clear();
    for (    Method m : clz.getMethods()) {
      if (cmdInfo.isDefaultMethod(m)) {
        if (methods.get(COMMAND_METHOD_DEFAULT) != null) {
          throw new UiException("String_Node_Str" + cmdInfo.getDefaultAnnotationName() + "String_Node_Str"+ clz+ "String_Node_Str"+ methods.get(COMMAND_METHOD_DEFAULT).value+ "String_Node_Str"+ m);
        }
        methods.put(COMMAND_METHOD_DEFAULT,new CachedItem<Method>(m));
      }
      String[] vals=cmdInfo.getCommandName(m);
      if (vals == null)       continue;
      if (vals.length == 0) {
        vals=new String[]{m.getName()};
      }
      for (      String val : vals) {
        val=val.trim();
        if (methods.get(val) != null) {
          throw new UiException("String_Node_Str" + cmdInfo.getAnnotationName() + "String_Node_Str"+ val+ "String_Node_Str"+ clz+ "String_Node_Str"+ methods.get(val).value+ "String_Node_Str"+ m);
        }
        methods.put(val,new CachedItem<Method>(m));
      }
    }
    if (_matchMediaValues != null) {
      for (      String s : _matchMediaValues.keySet()) {
        methods.put(s,new CachedItem<Method>(_matchMediaValues.get(s)));
      }
    }
    methods.put(COMMAND_METHOD_MAP_INIT,NULL_METHOD);
  }
  method=methods.get(command);
  if (method != null) {
    return method.value;
  }
  method=methods.get(COMMAND_METHOD_DEFAULT);
  return method == null ? null : method.value;
}

Fixed version (ground truth):
private Method getCommandMethod(Class<?> clz,String command,CommandMethodInfoProvider cmdInfo,Map<Class<?>,Map<String,CachedItem<Method>>> cache){
  Map<String,CachedItem<Method>> methods;
synchronized (cache) {
    methods=cache.get(clz);
    if (methods == null) {
      methods=new HashMap<String,CachedItem<Method>>();
      cache.put(clz,methods);
    }
  }
  CachedItem<Method> method=null;
synchronized (methods) {
    method=methods.get(command);
    if (method != null) {
      return method.value;
    }
 else     if (methods.get(COMMAND_METHOD_MAP_INIT) != null) {
      method=methods.get(COMMAND_METHOD_DEFAULT);
      if (method != null) {
        return method.value;
      }
      return null;
    }
    methods.clear();
    for (    Method m : clz.getMethods()) {
      if (m.isBridge())       continue;
      if (cmdInfo.isDefaultMethod(m)) {
        if (methods.get(COMMAND_METHOD_DEFAULT) != null) {
          throw new UiException("String_Node_Str" + cmdInfo.getDefaultAnnotationName() + "String_Node_Str"+ clz+ "String_Node_Str"+ methods.get(COMMAND_METHOD_DEFAULT).value+ "String_Node_Str"+ m);
        }
        methods.put(COMMAND_METHOD_DEFAULT,new CachedItem<Method>(m));
      }
      String[] vals=cmdInfo.getCommandName(m);
      if (vals == null)       continue;
      if (vals.length == 0) {
        vals=new String[]{m.getName()};
      }
      for (      String val : vals) {
        val=val.trim();
        if (methods.get(val) != null) {
          throw new UiException("String_Node_Str" + cmdInfo.getAnnotationName() + "String_Node_Str"+ val+ "String_Node_Str"+ clz+ "String_Node_Str"+ methods.get(val).value+ "String_Node_Str"+ m);
        }
        methods.put(val,new CachedItem<Method>(m));
      }
    }
    if (_matchMediaValues != null) {
      for (      String s : _matchMediaValues.keySet()) {
        methods.put(s,new CachedItem<Method>(_matchMediaValues.get(s)));
      }
    }
    methods.put(COMMAND_METHOD_MAP_INIT,NULL_METHOD);
  }
  method=methods.get(command);
  if (method != null) {
    return method.value;
  }
  method=methods.get(COMMAND_METHOD_DEFAULT);
  return method == null ? null : method.value;
}