Program: 16537
Project: 16537
Buggy source:
private static final String outLangJavaScripts(Execution exec,WebApp wapp,String deviceType){
  final ServletRequest request=ServletFns.getCurrentRequest();
  if (WebManager.getRequestLocal(request,ATTR_LANG_JS_GENED) != null)   return "String_Node_Str";
  WebManager.setRequestLocal(request,ATTR_LANG_JS_GENED,Boolean.TRUE);
  final Desktop desktop=exec.getDesktop();
  if (wapp == null)   wapp=desktop.getWebApp();
  if (deviceType == null)   deviceType=desktop.getDeviceType();
  final Configuration config=wapp.getConfiguration();
  final StringBuffer sb=new StringBuffer(1536);
  final Set jses=new LinkedHashSet(32);
  for (Iterator it=LanguageDefinition.getByDeviceType(deviceType).iterator(); it.hasNext(); )   jses.addAll(((LanguageDefinition)it.next()).getJavaScripts());
  for (Iterator it=jses.iterator(); it.hasNext(); )   append(sb,(JavaScript)it.next());
  sb.append("String_Node_Str").append("String_Node_Str").append(wapp.getVersion()).append("String_Node_Str").append(wapp.getBuild()).append("String_Node_Str").append(config.getProcessingPromptDelay()).append("String_Node_Str").append(config.getTooltipDelay()).append("String_Node_Str").append(config.getResendDelay()).append("String_Node_Str").append(config.getClickFilterDelay()).append("String_Node_Str");
  Boolean autoTimeout=getAutomaticTimeout(desktop);
  final Device device=Devices.getDevice(deviceType);
  if (autoTimeout != null ? autoTimeout.booleanValue() : device.isAutomaticTimeout()) {
    int tmout=desktop.getSession().getMaxInactiveInterval();
    if (tmout > 0) {
      int extra=tmout / 8;
      tmout+=extra > 180 ? 180 : extra;
      sb.append("String_Node_Str").append(tmout).append("String_Node_Str");
    }
  }
  if (config.isDebugJS())   sb.append("String_Node_Str");
  if (config.isDisableBehindModalEnabled())   sb.append("String_Node_Str");
  if (config.isKeepDesktopAcrossVisits() || request.getAttribute(Attributes.NO_CACHE) == null)   sb.append("String_Node_Str");
  if (config.getPerformanceMeter() != null)   sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  final int[] cers=config.getClientErrorReloadCodes();
  boolean first=true;
  for (int j=0; j < cers.length; ++j) {
    final String uri=config.getClientErrorReload(cers[j]);
    if (uri != null) {
      if (first)       first=false;
 else       sb.append(',');
      sb.append("String_Node_Str").append(cers[j]).append("String_Node_Str").append(Strings.escape(uri,"String_Node_Str")).append('\'');
    }
  }
  sb.append("String_Node_Str");
  for (Iterator it=LanguageDefinition.getByDeviceType(deviceType).iterator(); it.hasNext(); ) {
    final LanguageDefinition langdef=(LanguageDefinition)it.next();
    final Set mods=langdef.getJavaScriptModules().entrySet();
    if (!mods.isEmpty()) {
      for (Iterator e=mods.iterator(); e.hasNext(); ) {
        final Map.Entry me=(Map.Entry)e.next();
        sb.append("String_Node_Str").append(me.getKey()).append("String_Node_Str").append(me.getValue()).append("String_Node_Str");
      }
    }
  }
  sb.append("String_Node_Str");
  final String s=device.getEmbedded();
  if (s != null)   sb.append(s).append('\n');
  return sb.toString();
}

Fixed version (ground truth):
private static final String outLangJavaScripts(Execution exec,WebApp wapp,String deviceType){
  final ServletRequest request=ServletFns.getCurrentRequest();
  if (WebManager.getRequestLocal(request,ATTR_LANG_JS_GENED) != null)   return "String_Node_Str";
  WebManager.setRequestLocal(request,ATTR_LANG_JS_GENED,Boolean.TRUE);
  final Desktop desktop=exec.getDesktop();
  if (wapp == null)   wapp=desktop.getWebApp();
  if (deviceType == null)   deviceType=desktop.getDeviceType();
  final Configuration config=wapp.getConfiguration();
  final StringBuffer sb=new StringBuffer(1536);
  final Set jses=new LinkedHashSet(32);
  for (Iterator it=LanguageDefinition.getByDeviceType(deviceType).iterator(); it.hasNext(); )   jses.addAll(((LanguageDefinition)it.next()).getJavaScripts());
  for (Iterator it=jses.iterator(); it.hasNext(); )   append(sb,(JavaScript)it.next());
  sb.append("String_Node_Str").append("String_Node_Str").append(wapp.getVersion()).append("String_Node_Str").append(wapp.getBuild()).append("String_Node_Str").append(config.getProcessingPromptDelay()).append("String_Node_Str").append(config.getTooltipDelay()).append("String_Node_Str").append(config.getResendDelay()).append("String_Node_Str").append(config.getClickFilterDelay()).append("String_Node_Str");
  final Device device=Devices.getDevice(deviceType);
  if (desktop != null) {
    Boolean autoTimeout=getAutomaticTimeout(desktop);
    if (autoTimeout != null ? autoTimeout.booleanValue() : device.isAutomaticTimeout()) {
      int tmout=desktop.getSession().getMaxInactiveInterval();
      if (tmout > 0) {
        int extra=tmout / 8;
        tmout+=extra > 180 ? 180 : extra;
        sb.append("String_Node_Str").append(tmout).append("String_Node_Str");
      }
    }
  }
  if (config.isDebugJS())   sb.append("String_Node_Str");
  if (config.isDisableBehindModalEnabled())   sb.append("String_Node_Str");
  if (config.isKeepDesktopAcrossVisits() || request.getAttribute(Attributes.NO_CACHE) == null)   sb.append("String_Node_Str");
  if (config.getPerformanceMeter() != null)   sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  final int[] cers=config.getClientErrorReloadCodes();
  boolean first=true;
  for (int j=0; j < cers.length; ++j) {
    final String uri=config.getClientErrorReload(cers[j]);
    if (uri != null) {
      if (first)       first=false;
 else       sb.append(',');
      sb.append("String_Node_Str").append(cers[j]).append("String_Node_Str").append(Strings.escape(uri,"String_Node_Str")).append('\'');
    }
  }
  sb.append("String_Node_Str");
  for (Iterator it=LanguageDefinition.getByDeviceType(deviceType).iterator(); it.hasNext(); ) {
    final LanguageDefinition langdef=(LanguageDefinition)it.next();
    final Set mods=langdef.getJavaScriptModules().entrySet();
    if (!mods.isEmpty()) {
      for (Iterator e=mods.iterator(); e.hasNext(); ) {
        final Map.Entry me=(Map.Entry)e.next();
        sb.append("String_Node_Str").append(me.getKey()).append("String_Node_Str").append(me.getValue()).append("String_Node_Str");
      }
    }
  }
  sb.append("String_Node_Str");
  final String s=device.getEmbedded();
  if (s != null)   sb.append(s).append('\n');
  return sb.toString();
}