Ejemplo n.º 1
0
  @Override
  public String toJSONString() {
    JSONStringer stringer = new JSONStringer();
    try {
      stringer.object();
      super.toJSONString(stringer);

      stringer.key(Members.EXECUTE_LIST.name()).array();
      for (AbstractPlanNode node : m_list) {
        stringer.value(node.getPlanNodeId().intValue());
      }
      stringer.endArray(); // end execution list

      stringer.endObject(); // end PlanNodeList
    } catch (JSONException e) {
      // HACK ugly ugly to make the JSON handling
      // in QueryPlanner generate a JSONException for a plan we know
      // here that we can't serialize.  Making this method throw
      // JSONException pushes that exception deep into the bowels of
      // Volt with no good place to catch it and handle the error.
      // Consider this the coward's way out.
      return "This JSON error message is a lie";
    }
    return stringer.toString();
  }