Program: 89305
Project: 89305
Buggy source:
/** 
 * Execute custom Java logic
 * @param req  Web Script request
 * @param status  Web Script status
 * @param cache  Web Script cache
 * @param isRM  indicates whether the request comes from an RM site or not
 * @return custom service model
 */
private Map<String,Object> executeImpl(WebScriptRequest req,Status status,Cache cache,boolean isRM){
  QName classQName=null;
  String className=req.getServiceMatch().getTemplateVars().get(DICTIONARY_CLASS_NAME);
  if (className != null && className.length() != 0) {
    classQName=createClassQName(className);
    if (classQName == null) {
      throw new WebScriptException(Status.STATUS_NOT_FOUND,"String_Node_Str" + className + "String_Node_Str");
    }
  }
  String[] names=req.getParameterValues(PARAM_NAME);
  String namespacePrefix=req.getParameter(REQ_URL_TEMPL_VAR_NAMESPACE_PREFIX);
  String namespaceURI=null;
  if (namespacePrefix != null) {
    namespaceURI=this.namespaceService.getNamespaceURI(namespacePrefix);
  }
  Map<QName,PropertyDefinition> propMap=null;
  if (classQName == null) {
    if (names != null) {
      propMap=new HashMap<QName,PropertyDefinition>(names.length);
      for (      String name : names) {
        QName propQName=QName.createQName(name,namespaceService);
        PropertyDefinition propDef=dictionaryservice.getProperty(propQName);
        if (propDef != null) {
          propMap.put(propQName,propDef);
        }
      }
    }
 else {
      Collection<QName> propQNames=getProperties(isRM);
      propMap=new HashMap<QName,PropertyDefinition>(propQNames.size());
      for (      QName propQName : propQNames) {
        propMap.put(propQName,dictionaryservice.getProperty(propQName));
      }
    }
  }
 else {
    propMap=dictionaryservice.getClass(classQName).getProperties();
  }
  List<PropertyDefinition> props=new ArrayList<PropertyDefinition>(propMap.size());
  for (  Map.Entry<QName,PropertyDefinition> entry : propMap.entrySet()) {
    if ((namespaceURI != null && namespaceURI.equals(entry.getKey().getNamespaceURI())) || namespaceURI == null) {
      props.add(entry.getValue());
    }
  }
  Collections.sort(props,new DictionaryComparators.PropertyDefinitionComparator(dictionaryservice));
  Map<String,Object> model=new HashMap<String,Object>();
  model.put(MODEL_PROP_KEY_PROPERTY_DETAILS,props);
  model.put(MODEL_PROP_KEY_MESSAGE_LOOKUP,dictionaryservice);
  return model;
}

Fixed version (ground truth):
/** 
 * Execute custom Java logic
 * @param req  Web Script request
 * @param isRM  indicates whether the request comes from an RM site or not
 * @return custom service model
 */
private Map<String,Object> executeImpl(WebScriptRequest req,boolean isRM){
  QName classQName=null;
  String className=req.getServiceMatch().getTemplateVars().get(DICTIONARY_CLASS_NAME);
  if (className != null && className.length() != 0) {
    classQName=createClassQName(className);
    if (classQName == null) {
      throw new WebScriptException(Status.STATUS_NOT_FOUND,"String_Node_Str" + className + "String_Node_Str");
    }
  }
  String[] names=req.getParameterValues(PARAM_NAME);
  String namespacePrefix=req.getParameter(REQ_URL_TEMPL_VAR_NAMESPACE_PREFIX);
  String namespaceURI=null;
  if (namespacePrefix != null) {
    namespaceURI=this.namespaceService.getNamespaceURI(namespacePrefix);
  }
  Map<QName,PropertyDefinition> propMap=null;
  if (classQName == null) {
    if (names != null) {
      propMap=new HashMap<QName,PropertyDefinition>(names.length);
      for (      String name : names) {
        QName propQName=QName.createQName(name,namespaceService);
        PropertyDefinition propDef=dictionaryservice.getProperty(propQName);
        if (propDef != null) {
          propMap.put(propQName,propDef);
        }
      }
    }
 else {
      Collection<QName> propQNames=getProperties(isRM);
      propMap=new HashMap<QName,PropertyDefinition>(propQNames.size());
      for (      QName propQName : propQNames) {
        propMap.put(propQName,dictionaryservice.getProperty(propQName));
      }
    }
  }
 else {
    propMap=dictionaryservice.getClass(classQName).getProperties();
  }
  List<PropertyDefinition> props=new ArrayList<PropertyDefinition>(propMap.size());
  for (  Map.Entry<QName,PropertyDefinition> entry : propMap.entrySet()) {
    if ((namespaceURI != null && namespaceURI.equals(entry.getKey().getNamespaceURI())) || namespaceURI == null) {
      props.add(entry.getValue());
    }
  }
  Collections.sort(props,new DictionaryComparators.PropertyDefinitionComparator(dictionaryservice));
  Map<String,Object> model=new HashMap<String,Object>();
  model.put(MODEL_PROP_KEY_PROPERTY_DETAILS,props);
  model.put(MODEL_PROP_KEY_MESSAGE_LOOKUP,dictionaryservice);
  return model;
}