Program: 84481
Project: 84481
Buggy source:
/** 
 * Allow other services to be added to our service layer <br/> <br/> Classes will be found/loaded with the ModuleClassLoader <br/> <br/> <code>params</code>[0] = string representing the service interface<br/> <code>params</code>[1] = service instance
 * @param params list of parameters
 */
@SuppressWarnings("String_Node_Str") public void setModuleService(List<Object> params){
  String classString=(String)params.get(0);
  Object classInstance=params.get(1);
  if (classString == null || classInstance == null) {
    throw new APIException("String_Node_Str");
  }
  Class cls=null;
  try {
    if (useSystemClassLoader == false) {
      cls=OpenmrsClassLoader.getInstance().loadClass(classString);
      if (cls != null && log.isDebugEnabled()) {
        try {
          log.debug("String_Node_Str" + cls.getClass().getClassLoader() + "String_Node_Str"+ cls.getClass().getClassLoader().hashCode());
        }
 catch (        Exception e) {
        }
      }
    }
 else     if (useSystemClassLoader == true) {
      try {
        cls=Class.forName(classString);
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + cls.getClass().getClassLoader() + "String_Node_Str"+ cls.getClass().getClassLoader().hashCode());
          log.debug("String_Node_Str" + String.valueOf(cls == cls));
        }
      }
 catch (      Exception e) {
      }
    }
  }
 catch (  ClassNotFoundException e) {
    throw new APIException("String_Node_Str" + classString,e);
  }
  setService(cls,classInstance);
}

Fixed version (ground truth):
/** 
 * Allow other services to be added to our service layer <br/> <br/> Classes will be found/loaded with the ModuleClassLoader <br/> <br/> <code>params</code>[0] = string representing the service interface<br/> <code>params</code>[1] = service instance
 * @param params list of parameters
 */
@SuppressWarnings("String_Node_Str") public void setModuleService(List<Object> params){
  String classString=(String)params.get(0);
  Object classInstance=params.get(1);
  if (classString == null || classInstance == null) {
    throw new APIException("String_Node_Str");
  }
  Class cls=null;
  try {
    if (useSystemClassLoader == false) {
      cls=OpenmrsClassLoader.getInstance().loadClass(classString);
      if (cls != null && log.isDebugEnabled()) {
        try {
          log.debug("String_Node_Str" + cls.getClass().getClassLoader() + "String_Node_Str"+ cls.getClass().getClassLoader().hashCode());
        }
 catch (        Exception e) {
        }
      }
    }
 else     if (useSystemClassLoader == true) {
      try {
        cls=Class.forName(classString);
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + cls.getClass().getClassLoader() + "String_Node_Str"+ cls.getClass().getClassLoader().hashCode());
          log.debug("String_Node_Str" + String.valueOf(cls == cls));
        }
      }
 catch (      Exception e) {
      }
    }
  }
 catch (  ClassNotFoundException e) {
    throw new APIException("String_Node_Str" + classString,e);
  }
  setService(cls,classInstance);
  if (OpenmrsService.class.isAssignableFrom(classInstance.getClass())) {
    addModuleOpenmrsService(classString,(OpenmrsService)classInstance);
    runOpenmrsServiceOnStartup((OpenmrsService)classInstance,classString);
  }
}