Program: 29218
Project: 29218
Buggy source:
@Override public void execute(final AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  if (parentBean == null) {
    String msg=localStrings.getLocalString(GenericCrudCommand.class,"String_Node_Str","String_Node_Str",resolver.getClass().toString(),parentType,targetType);
    report.failure(logger,msg);
    return;
  }
  if (outputOpts != null) {
    longOpt=true;
  }
  List<ColumnInfo> cols=null;
  ColumnFormatter colfm=null;
  if (longOpt) {
    cols=getColumnInfo(targetType);
    if (!isOutputOptsValid(cols,outputOpts)) {
      String collist=arrayToString(getColumnHeadings(cols));
      String msg=localStrings.getLocalString(GenericCrudCommand.class,"String_Node_Str","String_Node_Str",collist);
      report.failure(logger,msg);
      return;
    }
    cols=filterColumns(cols,outputOpts);
    Collections.sort(cols,new Comparator<ColumnInfo>(){
      @Override public int compare(      ColumnInfo o1,      ColumnInfo o2){
        return Integer.compare(o1.order,o2.order);
      }
    }
);
    colfm=headerOpt ? new ColumnFormatter(getColumnHeadings(cols)) : new ColumnFormatter();
  }
  List<Map> list=new ArrayList<Map>();
  Properties props=report.getExtraProperties();
  if (props == null) {
    props=new Properties();
    report.setExtraProperties(props);
  }
  try {
    List<ConfigBeanProxy> children=(List<ConfigBeanProxy>)targetMethod.invoke(parentBean);
    for (    ConfigBeanProxy child : children) {
      Map<String,String> map=new HashMap<String,String>();
      if (longOpt) {
        String data[]=getColumnData(child,cols);
        colfm.addRow(data);
        for (int i=0; i < data.length; i++) {
          map.put(cols.get(i).xmlName,data[i]);
        }
      }
 else {
        Dom childDom=Dom.unwrap(child);
        String key=childDom.getKey();
        if (key == null) {
          String msg=localStrings.getLocalString(GenericCrudCommand.class,"String_Node_Str","String_Node_Str",targetType);
          report.failure(logger,msg);
          return;
        }
        report.addSubActionsReport().setMessage(key);
        map.put("String_Node_Str",key);
      }
      list.add(map);
    }
    if (longOpt) {
      report.appendMessage(colfm.toString());
    }
    if (!list.isEmpty()) {
      props.put(elementName(Dom.unwrap(parentBean).document,parentType,targetType),list);
    }
  }
 catch (  Exception e) {
    String msg=localStrings.getLocalString(GenericCrudCommand.class,"String_Node_Str","String_Node_Str",targetMethod.toString(),e.toString());
    report.failure(logger,msg,e);
  }
}

Fixed version (ground truth):
@Override public void execute(final AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  if (parentBean == null) {
    String msg=localStrings.getLocalString(GenericCrudCommand.class,"String_Node_Str","String_Node_Str",resolver.getClass().toString(),parentType,targetType);
    report.failure(logger,msg);
    return;
  }
  List<ColumnInfo> cols=null;
  ColumnFormatter colfm=null;
  if (longOpt) {
    cols=getColumnInfo(targetType);
    if (!isOutputOptsValid(cols,outputOpts)) {
      String collist=arrayToString(getColumnHeadings(cols));
      String msg=localStrings.getLocalString(GenericCrudCommand.class,"String_Node_Str","String_Node_Str",collist);
      report.failure(logger,msg);
      return;
    }
    cols=filterColumns(cols,outputOpts);
    Collections.sort(cols,new Comparator<ColumnInfo>(){
      @Override public int compare(      ColumnInfo o1,      ColumnInfo o2){
        return Integer.valueOf(o1.order).compareTo(Integer.valueOf(o2.order));
      }
    }
);
    colfm=headerOpt ? new ColumnFormatter(getColumnHeadings(cols)) : new ColumnFormatter();
  }
  List<Map> list=new ArrayList<Map>();
  Properties props=report.getExtraProperties();
  if (props == null) {
    props=new Properties();
    report.setExtraProperties(props);
  }
  try {
    List<ConfigBeanProxy> children=(List<ConfigBeanProxy>)targetMethod.invoke(parentBean);
    for (    ConfigBeanProxy child : children) {
      Map<String,String> map=new HashMap<String,String>();
      if (longOpt) {
        String data[]=getColumnData(child,cols);
        colfm.addRow(data);
        for (int i=0; i < data.length; i++) {
          map.put(cols.get(i).xmlName,data[i]);
        }
      }
 else {
        Dom childDom=Dom.unwrap(child);
        String key=childDom.getKey();
        if (key == null) {
          String msg=localStrings.getLocalString(GenericCrudCommand.class,"String_Node_Str","String_Node_Str",targetType);
          report.failure(logger,msg);
          return;
        }
        report.addSubActionsReport().setMessage(key);
        map.put("String_Node_Str",key);
      }
      list.add(map);
    }
    if (longOpt) {
      report.appendMessage(colfm.toString());
    }
    if (!list.isEmpty()) {
      props.put(elementName(Dom.unwrap(parentBean).document,parentType,targetType),list);
    }
  }
 catch (  Exception e) {
    String msg=localStrings.getLocalString(GenericCrudCommand.class,"String_Node_Str","String_Node_Str",targetMethod.toString(),e.toString());
    report.failure(logger,msg,e);
  }
}