Program: 50774
Project: 50774
Buggy source:
/** 
 * This method handles queries.
 * @param qspec The query spec
 * @return The list of objects
 * @throws Exception Failed to query
 */
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public String overview(@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") int width) throws Exception {
  String ret="String_Node_Str";
  if (_acmManager != null && _servDefns == null) {
    _servDefns=_acmManager.getActiveCollection("String_Node_Str");
  }
  if (_acmManager != null && _situations == null) {
    _situations=_acmManager.getActiveCollection("String_Node_Str");
  }
  if (_servDefns == null) {
    throw new Exception("String_Node_Str");
  }
  if (_situations == null) {
    throw new Exception("String_Node_Str");
  }
  java.util.Set<ServiceDefinition> sds=new java.util.HashSet<ServiceDefinition>();
  for (  Object entry : _servDefns) {
    if (entry instanceof ActiveMap.Entry && ((ActiveMap.Entry)entry).getValue() instanceof ServiceDefinition) {
      sds.add((ServiceDefinition)((ActiveMap.Entry)entry).getValue());
    }
  }
  java.util.List<Situation> situations=new java.util.ArrayList<Situation>();
  for (  Object obj : _situations) {
    if (obj instanceof Situation) {
      situations.add((Situation)obj);
    }
  }
  ServiceGraph graph=ServiceDependencyBuilder.buildGraph(sds,situations);
  if (graph == null) {
    throw new Exception("String_Node_Str");
  }
  graph.setDescription("String_Node_Str" + new java.util.Date());
  ServiceGraphLayoutImpl layout=new ServiceGraphLayoutImpl();
  layout.layout(graph);
  SVGServiceGraphGenerator generator=new SVGServiceGraphGenerator();
  MVELColorSelector selector=new MVELColorSelector();
  selector.setScriptLocation("String_Node_Str");
  try {
    selector.init();
    generator.setColorSelector(selector);
  }
 catch (  Exception e) {
    LOG.log(Level.SEVERE,"String_Node_Str",e);
  }
  java.io.ByteArrayOutputStream os=new java.io.ByteArrayOutputStream();
  generator.generate(graph,width,os);
  os.close();
  ret=new String(os.toByteArray());
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + ret);
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method handles queries.
 * @param width The optional width
 * @return The list of objects
 * @throws Exception Failed to query
 */
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public String overview(@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") int width) throws Exception {
  String ret="String_Node_Str";
  if (_acmManager != null && _servDefns == null) {
    _servDefns=_acmManager.getActiveCollection("String_Node_Str");
  }
  if (_acmManager != null && _situations == null) {
    _situations=_acmManager.getActiveCollection("String_Node_Str");
  }
  if (_servDefns == null) {
    throw new Exception("String_Node_Str");
  }
  if (_situations == null) {
    throw new Exception("String_Node_Str");
  }
  java.util.Set<ServiceDefinition> sds=new java.util.HashSet<ServiceDefinition>();
  for (  Object entry : _servDefns) {
    if (entry instanceof ActiveMap.Entry && ((ActiveMap.Entry)entry).getValue() instanceof ServiceDefinition) {
      sds.add((ServiceDefinition)((ActiveMap.Entry)entry).getValue());
    }
  }
  java.util.List<Situation> situations=new java.util.ArrayList<Situation>();
  for (  Object obj : _situations) {
    if (obj instanceof Situation) {
      situations.add((Situation)obj);
    }
  }
  ServiceGraph graph=ServiceDependencyBuilder.buildGraph(sds,situations);
  if (graph == null) {
    throw new Exception("String_Node_Str");
  }
  graph.setDescription("String_Node_Str" + new java.util.Date());
  ServiceGraphLayoutImpl layout=new ServiceGraphLayoutImpl();
  layout.layout(graph);
  SVGServiceGraphGenerator generator=new SVGServiceGraphGenerator();
  MVELColorSelector selector=new MVELColorSelector();
  selector.setScriptLocation("String_Node_Str");
  try {
    selector.init();
    generator.setColorSelector(selector);
  }
 catch (  Exception e) {
    LOG.log(Level.SEVERE,"String_Node_Str",e);
  }
  java.io.ByteArrayOutputStream os=new java.io.ByteArrayOutputStream();
  generator.generate(graph,width,os);
  os.close();
  ret=new String(os.toByteArray());
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + ret);
  }
  return (ret);
}