Program: 70027
Project: 70027
Buggy source:
/** 
 * Main method called by DispatcherAction. This processess all requests for users who are not authenticated.
 * @param request
 * @param response
 * @param uriPrefix
 */
public void execute(HttpServletRequest request,HttpServletResponse response,String uriPrefix){
  if (rejectRequest(request,response)) {
    return;
  }
  UserRequest ureq=null;
  try {
    ureq=new UserRequest(uriPrefix,request,response);
  }
 catch (  NumberFormatException nfe) {
    if (Tracing.isDebugEnabled(DMZDispatcher.class)) {
      Tracing.logDebug("String_Node_Str" + request.getPathInfo(),this.getClass());
    }
    DispatcherAction.sendBadRequest(request.getPathInfo(),response);
    return;
  }
  try {
    String pathInfo=request.getContextPath() + request.getPathInfo();
    ChiefControllerCreator subPathccc=null;
    boolean dmzOnly=pathInfo.equals(uriPrefix);
    if (!dmzOnly) {
      int sl=pathInfo.indexOf('/',uriPrefix.length());
      String sub;
      if (sl > 1) {
        sub=pathInfo.substring(uriPrefix.length() - 1,sl + 1);
      }
 else {
        sub=pathInfo;
      }
      subPathccc=dmzServicesByPath.get(sub);
      UserSession usess=ureq.getUserSession();
      Windows ws=Windows.getWindows(usess);
synchronized (ws) {
        ChiefController occ;
        if (subPathccc != null) {
          occ=subPathccc.createChiefController(ureq);
          Window window=occ.getWindow();
          window.setUriPrefix(uriPrefix);
          ws.registerWindow(window);
          window.dispatchRequest(ureq,true);
          return;
        }
      }
    }
    UserSession usess=ureq.getUserSession();
    Windows ws=Windows.getWindows(usess);
synchronized (ws) {
      Window window;
      boolean windowHere=ws.isExisting(uriPrefix,ureq.getWindowID());
      boolean validDispatchUri=ureq.isValidDispatchURI();
      if (validDispatchUri && !windowHere) {
        window=null;
        usess.signOffAndClear();
        usess.setLocale(LocaleNegotiator.getPreferedLocale(ureq));
        I18nManager.updateLocaleInfoToThread(usess);
        ws=Windows.getWindows(usess);
      }
 else {
        if (validDispatchUri) {
          window=ws.getWindow(ureq);
        }
 else {
          window=null;
          usess.signOffAndClear();
          usess.setLocale(LocaleNegotiator.getPreferedLocale(ureq));
          I18nManager.updateLocaleInfoToThread(usess);
          ws=Windows.getWindows(usess);
        }
      }
      if (window == null) {
        ChiefController occ=chiefControllerCreator.createChiefController(ureq);
        window=occ.getWindow();
        window.setUriPrefix(uriPrefix);
        ws.registerWindow(window);
        String businessPath=(String)usess.removeEntryFromNonClearedStore(DMZDISPATCHER_BUSINESSPATH);
        if (businessPath != null) {
          List<ContextEntry> ces=BusinessControlFactory.getInstance().createCEListFromString(businessPath);
          DTabs dts=(DTabs)window.getAttribute("String_Node_Str");
          dts.activate(ureq,null,null,ces);
        }
        window.dispatchRequest(ureq);
      }
 else {
        window.dispatchRequest(ureq);
      }
    }
  }
 catch (  Throwable th) {
    try {
      ChiefController msgcc=MsgFactory.createMessageChiefController(ureq,th);
      msgcc.getWindow().dispatchRequest(ureq,true);
    }
 catch (    Throwable t) {
      Tracing.logError("String_Node_Str",t,DMZDispatcher.class);
    }
  }
 finally {
  }
}

Fixed version (ground truth):
/** 
 * Main method called by DispatcherAction. This processess all requests for users who are not authenticated.
 * @param request
 * @param response
 * @param uriPrefix
 */
public void execute(HttpServletRequest request,HttpServletResponse response,String uriPrefix){
  if (rejectRequest(request,response)) {
    return;
  }
  UserRequest ureq=null;
  try {
    ureq=new UserRequest(uriPrefix,request,response);
  }
 catch (  NumberFormatException nfe) {
    if (Tracing.isDebugEnabled(DMZDispatcher.class)) {
      Tracing.logDebug("String_Node_Str" + request.getPathInfo(),this.getClass());
    }
    DispatcherAction.sendBadRequest(request.getPathInfo(),response);
    return;
  }
  try {
    String pathInfo=request.getContextPath() + request.getPathInfo();
    ChiefControllerCreator subPathccc=null;
    boolean dmzOnly=pathInfo.equals(uriPrefix);
    if (!dmzOnly) {
      int sl=pathInfo.indexOf('/',uriPrefix.length());
      String sub;
      if (sl > 1) {
        sub=pathInfo.substring(uriPrefix.length() - 1,sl + 1);
      }
 else {
        sub=pathInfo;
      }
      subPathccc=dmzServicesByPath.get(sub);
      UserSession usess=ureq.getUserSession();
      Windows ws=Windows.getWindows(usess);
synchronized (ws) {
        ChiefController occ;
        if (subPathccc != null) {
          occ=subPathccc.createChiefController(ureq);
          Window window=occ.getWindow();
          window.setUriPrefix(uriPrefix);
          ws.registerWindow(window);
          window.dispatchRequest(ureq,true);
          return;
        }
      }
    }
    UserSession usess=ureq.getUserSession();
    Windows ws=Windows.getWindows(usess);
synchronized (usess) {
      Window window;
      boolean windowHere=ws.isExisting(uriPrefix,ureq.getWindowID());
      boolean validDispatchUri=ureq.isValidDispatchURI();
      if (validDispatchUri && !windowHere) {
        window=null;
        usess.signOffAndClear();
        usess.setLocale(LocaleNegotiator.getPreferedLocale(ureq));
        I18nManager.updateLocaleInfoToThread(usess);
        ws=Windows.getWindows(usess);
      }
 else {
        if (validDispatchUri) {
          window=ws.getWindow(ureq);
        }
 else {
          window=null;
          usess.signOffAndClear();
          usess.setLocale(LocaleNegotiator.getPreferedLocale(ureq));
          I18nManager.updateLocaleInfoToThread(usess);
          ws=Windows.getWindows(usess);
        }
      }
      if (window == null) {
        ChiefController occ=chiefControllerCreator.createChiefController(ureq);
        window=occ.getWindow();
        window.setUriPrefix(uriPrefix);
        ws.registerWindow(window);
        String businessPath=(String)usess.removeEntryFromNonClearedStore(DMZDISPATCHER_BUSINESSPATH);
        if (businessPath != null) {
          List<ContextEntry> ces=BusinessControlFactory.getInstance().createCEListFromString(businessPath);
          DTabs dts=(DTabs)window.getAttribute("String_Node_Str");
          dts.activate(ureq,null,null,ces);
        }
      }
      window.dispatchRequest(ureq);
    }
  }
 catch (  Throwable th) {
    try {
      ChiefController msgcc=MsgFactory.createMessageChiefController(ureq,th);
      msgcc.getWindow().dispatchRequest(ureq,true);
    }
 catch (    Throwable t) {
      Tracing.logError("String_Node_Str",t,DMZDispatcher.class);
    }
  }
 finally {
  }
}