Program: 15815
Project: 15815
Buggy source:
/** 
 * Creates the Web manager. It is singleton in a Web application and it is created automatically by   {@link DHtmlLayoutServlet}, so you rarely need to create it manually.
 * @since 3.6.0
 */
@SuppressWarnings("String_Node_Str") public WebManager(ServletContext ctx,String updateURI){
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + ctx);
  if (ctx == null || updateURI == null)   throw new IllegalArgumentException("String_Node_Str");
  if (getWebManagerIfAny(ctx) != null)   throw new UiException("String_Node_Str" + ctx);
  log.info("String_Node_Str" + org.zkoss.zk.Version.RELEASE + ' '+ WebApps.getEdition()+ "String_Node_Str"+ org.zkoss.zk.ui.impl.AbstractWebApp.loadBuild()+ ')');
  _ctx=ctx;
  _updateURI=updateURI;
  _ctx.setAttribute(ATTR_WEB_MANAGER,this);
  Servlets.setClientIdentifier(new ClientIdentifier());
  final Configuration config=new Configuration();
  final ConfigParser parser=new ConfigParser();
  try {
    parser.parseConfigXml(config);
  }
 catch (  Throwable ex) {
    log.error("String_Node_Str",ex);
  }
  String XML="String_Node_Str";
  try {
    final XMLResourcesLocator loc=Utils.getXMLResourcesLocator();
    final List<XMLResourcesLocator.Resource> xmls=loc.getDependentXMLResources(XML,"String_Node_Str","String_Node_Str");
    for (    XMLResourcesLocator.Resource res : xmls) {
      final URL cfgUrl=res.url;
      try {
        parser.parse(cfgUrl,config,loc);
      }
 catch (      Throwable ex) {
        log.error("String_Node_Str" + cfgUrl,ex);
      }
    }
  }
 catch (  Throwable ex) {
    log.error("String_Node_Str" + XML,ex);
  }
  XML="String_Node_Str";
  try {
    final URL cfgUrl=_ctx.getResource(XML);
    if (cfgUrl != null)     parser.parse(cfgUrl,config,new ServletContextLocator(_ctx,true));
  }
 catch (  Throwable ex) {
    log.error("String_Node_Str" + XML,ex);
  }
  LogConfigurer.configure();
  XML=Library.getProperty("String_Node_Str");
  if (XML != null && XML.length() > 0) {
    log.info("String_Node_Str" + XML);
    InputStream is=null;
    try {
      is=Servlets.getResourceAsStream(_ctx,XML);
      if (is != null)       parser.parse(is,config,new ServletContextLocator(_ctx,true));
 else       log.error("String_Node_Str" + XML);
    }
 catch (    Throwable ex) {
      log.error("String_Node_Str" + XML,ex);
    }
 finally {
      if (is != null)       try {
        is.close();
      }
 catch (      Throwable t) {
      }
    }
  }
  _cwr=ClassWebResource.getInstance(_ctx,_updateURI);
  _cwr.setCompress(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  String s=Library.getProperty("String_Node_Str");
  if (s != null && s.length() > 0) {
    if (s.charAt(0) != '/')     s='/' + s;
    _cwr.setExtraLocator(new ServletContextLocator(_ctx,null,s));
  }
  String[] labellocs=config.getLabelLocations();
  if (labellocs.length == 0)   Labels.register(new ServletLabelLocator(_ctx));
 else   for (int j=0; j < labellocs.length; ++j)   Labels.register(new ServletLabelLocator(_ctx,labellocs[j]));
  Labels.setVariableResolver(new ServletRequestResolver());
  Class cls=config.getWebAppFactoryClass();
  if (cls != null) {
    try {
      _wapp=((WebAppFactory)cls.newInstance()).newWebApp(_ctx,config);
    }
 catch (    Exception ex) {
      throw UiException.Aide.wrap(ex,"String_Node_Str" + cls);
    }
  }
 else {
    cls=config.getWebAppClass();
    if (cls != null) {
      try {
        _wapp=(WebApp)cls.newInstance();
      }
 catch (      Exception ex) {
        throw UiException.Aide.wrap(ex,"String_Node_Str" + cls);
      }
    }
 else {
      _wapp=new SimpleWebApp();
    }
  }
  WebAppsCtrl.setCurrent(_wapp);
  ((WebAppCtrl)_wapp).init(_ctx,config);
  _cwr.setEncodeURLPrefix(getCWRURLPrefix());
  _cwr.setDebugJS(config.isDebugJS());
  checkAndAddExtendlet("String_Node_Str",new WpdExtendlet());
  checkAndAddExtendlet("String_Node_Str",new WcsExtendlet());
  ZumlExtendlet extlet=null;
  for (Iterator<LanguageDefinition> it=LanguageDefinition.getAll().iterator(); it.hasNext(); ) {
    final LanguageDefinition langdef=it.next();
    final List<String> exts=langdef.getExtensions();
    if (!exts.isEmpty()) {
      if (extlet == null)       extlet=new ZumlExtendlet();
      checkAndAddExtendlet(exts.get(0),extlet);
    }
  }
  final List<WebManagerActivationListener> listeners=_actListeners.remove(_ctx);
  if (listeners != null) {
    for (Iterator<WebManagerActivationListener> it=CollectionsX.comodifiableIterator(listeners); it.hasNext(); ) {
      try {
        it.next().didActivate(this);
      }
 catch (      Throwable ex) {
        log.error("String_Node_Str",ex);
      }
    }
  }
  Registry.sign(_wapp,Registry.class,WebManager.class,WebAppFactoryImpl.class);
}

Fixed version (ground truth):
/** 
 * Creates the Web manager. It is singleton in a Web application and it is created automatically by   {@link DHtmlLayoutServlet}, so you rarely need to create it manually.
 * @since 3.6.0
 */
@SuppressWarnings("String_Node_Str") public WebManager(ServletContext ctx,String updateURI){
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + ctx);
  if (ctx == null || updateURI == null)   throw new IllegalArgumentException("String_Node_Str");
  if (getWebManagerIfAny(ctx) != null)   throw new UiException("String_Node_Str" + ctx);
  log.info("String_Node_Str" + org.zkoss.zk.Version.RELEASE + ' '+ WebApps.getEdition()+ "String_Node_Str"+ org.zkoss.zk.ui.impl.AbstractWebApp.loadBuild()+ ')');
  _ctx=ctx;
  _updateURI=updateURI;
  _ctx.setAttribute(ATTR_WEB_MANAGER,this);
  Servlets.setClientIdentifier(new ClientIdentifier());
  final Configuration config=new Configuration();
  final ConfigParser parser=new ConfigParser();
  try {
    parser.parseConfigXml(config);
  }
 catch (  Throwable ex) {
    log.error("String_Node_Str",ex);
  }
  String XML="String_Node_Str";
  try {
    final XMLResourcesLocator loc=Utils.getXMLResourcesLocator();
    final List<XMLResourcesLocator.Resource> xmls=loc.getDependentXMLResources(XML,"String_Node_Str","String_Node_Str");
    for (    XMLResourcesLocator.Resource res : xmls) {
      final URL cfgUrl=res.url;
      try {
        parser.parse(cfgUrl,config,loc);
      }
 catch (      Throwable ex) {
        log.error("String_Node_Str" + cfgUrl,ex);
      }
    }
  }
 catch (  Throwable ex) {
    log.error("String_Node_Str" + XML,ex);
  }
  XML="String_Node_Str";
  try {
    final URL cfgUrl=_ctx.getResource(XML);
    if (cfgUrl != null)     parser.parse(cfgUrl,config,new ServletContextLocator(_ctx,true));
  }
 catch (  Throwable ex) {
    log.error("String_Node_Str" + XML,ex);
  }
  LogConfigurer.configure();
  XML=Library.getProperty("String_Node_Str");
  if (XML != null && XML.length() > 0) {
    log.info("String_Node_Str" + XML);
    InputStream is=null;
    try {
      is=Servlets.getResourceAsStream(_ctx,XML);
      if (is != null)       parser.parse(is,config,new ServletContextLocator(_ctx,true));
 else       log.error("String_Node_Str" + XML);
    }
 catch (    Throwable ex) {
      log.error("String_Node_Str" + XML,ex);
    }
 finally {
      if (is != null)       try {
        is.close();
      }
 catch (      Throwable t) {
      }
    }
  }
  _cwr=ClassWebResource.getInstance(_ctx,_updateURI);
  _cwr.setCompress(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  String s=Library.getProperty("String_Node_Str");
  if (s != null && s.length() > 0) {
    if (s.charAt(0) != '/')     s='/' + s;
    _cwr.setExtraLocator(new ServletContextLocator(_ctx,null,s,false,ClassWebResource.PATH_PREFIX));
  }
  String[] labellocs=config.getLabelLocations();
  if (labellocs.length == 0)   Labels.register(new ServletLabelLocator(_ctx));
 else   for (int j=0; j < labellocs.length; ++j)   Labels.register(new ServletLabelLocator(_ctx,labellocs[j]));
  Labels.setVariableResolver(new ServletRequestResolver());
  Class cls=config.getWebAppFactoryClass();
  if (cls != null) {
    try {
      _wapp=((WebAppFactory)cls.newInstance()).newWebApp(_ctx,config);
    }
 catch (    Exception ex) {
      throw UiException.Aide.wrap(ex,"String_Node_Str" + cls);
    }
  }
 else {
    cls=config.getWebAppClass();
    if (cls != null) {
      try {
        _wapp=(WebApp)cls.newInstance();
      }
 catch (      Exception ex) {
        throw UiException.Aide.wrap(ex,"String_Node_Str" + cls);
      }
    }
 else {
      _wapp=new SimpleWebApp();
    }
  }
  WebAppsCtrl.setCurrent(_wapp);
  ((WebAppCtrl)_wapp).init(_ctx,config);
  _cwr.setEncodeURLPrefix(getCWRURLPrefix());
  _cwr.setDebugJS(config.isDebugJS());
  checkAndAddExtendlet("String_Node_Str",new WpdExtendlet());
  checkAndAddExtendlet("String_Node_Str",new WcsExtendlet());
  ZumlExtendlet extlet=null;
  for (Iterator<LanguageDefinition> it=LanguageDefinition.getAll().iterator(); it.hasNext(); ) {
    final LanguageDefinition langdef=it.next();
    final List<String> exts=langdef.getExtensions();
    if (!exts.isEmpty()) {
      if (extlet == null)       extlet=new ZumlExtendlet();
      checkAndAddExtendlet(exts.get(0),extlet);
    }
  }
  final List<WebManagerActivationListener> listeners=_actListeners.remove(_ctx);
  if (listeners != null) {
    for (Iterator<WebManagerActivationListener> it=CollectionsX.comodifiableIterator(listeners); it.hasNext(); ) {
      try {
        it.next().didActivate(this);
      }
 catch (      Throwable ex) {
        log.error("String_Node_Str",ex);
      }
    }
  }
  Registry.sign(_wapp,Registry.class,WebManager.class,WebAppFactoryImpl.class);
}