Performs the global bundle rendering

@param ctx
the context
@param out
the writer
@param debugOn
the flag indicating if we are in debug mode or not
@throws IOException
if an IO exception occurs
174567
protected void performGlobalBundleLinksRendering(BundleRendererContext ctx, Writer out, boolean debugOn)
			throws IOException {

		ResourceBundlePathsIterator resourceBundleIterator = bundler.getGlobalResourceBundlePaths(getDebugMode(debugOn),
				new ConditionalCommentRenderer(out), ctx.getVariants());
		renderBundleLinks(resourceBundleIterator, ctx, debugOn, out);
	}
217245
@Override
    protected void debugTrace(Object logTool, String msg, Object... parameters) {
        Tr.debug((TraceComponent) logTool, msg, parameters);
    }
627300
def debug(dbg=True):
    """"""
    global _debug_handler
    if dbg and _debug_handler is None:
        _debug_handler = logging.StreamHandler()
        logger.addHandler(_debug_handler)
        logger.setLevel(logging.DEBUG)
    elif not dbg and _debug_handler is not None:
        logger.removeHandler(_debug_handler)
        _debug_handler = None
        logger.setLevel(logging.WARNING)
991366
private void renderIeCssBundleLink(BundleRendererContext ctx, Writer out, BundlePath bundlePath)
			throws IOException {
		Random randomSeed = new Random();
		int random = randomSeed.nextInt();
		if (random < 0)
			random *= -1;
		String path = GeneratorRegistry.IE_CSS_GENERATOR_PREFIX + GeneratorRegistry.PREFIX_SEPARATOR
				+ bundlePath.getPath();
		path = PathNormalizer.createGenerationPath(path, bundler.getConfig().getGeneratorRegistry(), "d=" + random);
		out.write(createBundleLink(path, null, null, ctx.getContextPath(), ctx.isSslRequest()));
	}
229325
protected void generateBlockBundleCreation(SourceWriter sourceWriter, TreeLogger logger,
      GeneratorContext context) {

    // find all subclasses of NlsBundle
    TypeOracle typeOracle = context.getTypeOracle();
    JClassType bundleClass = typeOracle.findType(NlsBundle.class.getName());
    JClassType bundleWithLookupClass = typeOracle.findType(NlsBundleWithLookup.class.getName());
    JClassType[] types = typeOracle.getTypes();
    int bundleCount = 0;
    logger.log(Type.INFO, "Checking " + types.length + " types...");
    for (JClassType type : types) {
      if ((type.isAssignableTo(bundleClass))
          && (!type.equals(bundleClass) && (!type.equals(bundleWithLookupClass)))) {
        logger.log(Type.INFO, "Found NlsBundle interface: " + type);

        sourceWriter.print("if (");
        sourceWriter.print(type.getQualifiedSourceName());
        sourceWriter.println(".class == bundleInterface) {");
        sourceWriter.indent();

        sourceWriter.print("bundle = GWT.create(");
        sourceWriter.print(type.getQualifiedSourceName());
        sourceWriter.println(".class);");

        sourceWriter.println("register(bundleInterface, bundle);");

        sourceWriter.outdent();
        sourceWriter.print("} else ");

        bundleCount++;
      }
    }
    sourceWriter.println("{");
    sourceWriter.indent();

    sourceWriter.print("throw new ");
    sourceWriter.print(IllegalStateException.class.getSimpleName());
    sourceWriter.println("(\"Undefined NlsBundle \" + bundleInterface.getName());");

    sourceWriter.outdent();
    sourceWriter.println("}");

    logger.log(Type.INFO, "Found " + bundleCount + " NlsBundle interface(s).");
  }
587758
public void dump(final PrintWriter out, final boolean includeDoc) {
        visitVariables(new Visitor() {
            public void visit(Variable var) {
                var.write(out, includeDoc);
            }
        });
    }
494710
public void debug(Throwable t) {
        if (isEnabled() && isDebugEnabled()) {
            dispatchLogException(new LogEvent(this, LogEvent.DEBUG_TYPE, t));
        }
    }
1161663
@Override
    public void writeExternal(ObjectOutput s) throws IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "writeExternal(ObjectOutput)");
        }
        convertBufferIfNeeded();
        super.writeExternal(s);
    }
115756
private void renderApplication() throws IOException {
		StringBuilder sb = new StringBuilder();

		// First pages
		sb.append( renderDocumentTitle());
		sb.append( renderPageBreak());

		sb.append( renderParagraph( this.messages.get( "intro" ))); //$NON-NLS-1$
		sb.append( renderPageBreak());

		sb.append( renderDocumentIndex());
		sb.append( renderPageBreak());

		sb.append( startTable());
		sb.append( addTableLine( this.messages.get( "app.name" ), this.applicationTemplate.getName())); //$NON-NLS-1$
		sb.append( addTableLine( this.messages.get( "app.qualifier" ), this.applicationTemplate.getVersion())); //$NON-NLS-1$
		sb.append( endTable());

		sb.append( renderApplicationDescription());
		sb.append( renderPageBreak());
		sb.append( renderSections( new ArrayList<String>( 0 )));

		// Render information about components
		sb.append( renderComponents());

		// Render information about initial instances
		sb.append( renderInstances());

		writeFileContent( sb.toString());
	}
577114
protected void renderLayer (Graphics2D g, Rectangle bounds, JLayeredPane pane,
                                boolean[] clipped, Integer layer)
    {
        // stop now if there are no components in that layer
        int ccount = pane.getComponentCountInLayer(layer.intValue());
        if (ccount == 0) {
            return;
        }

        // render them up
        Component[] comps = pane.getComponentsInLayer(layer.intValue());
        for (int ii = 0; ii < ccount; ii++) {
            Component comp = comps[ii];
            if (!comp.isVisible() || comp instanceof SafeLayerComponent) {
                continue;
            }

            // if this overlay does not intersect the component we just rendered, we don't need to
            // repaint it
            Rectangle compBounds = new Rectangle(0, 0, comp.getWidth(), comp.getHeight());
            getRoot(comp, compBounds);
            if (!compBounds.intersects(bounds)) {
                continue;
            }

            // if the clipping region has not yet been set during this render pass, the time has
            // come to do so
            if (!clipped[0]) {
                g.setClip(bounds);
                clipped[0] = true;
            }

            // translate into the components coordinate system and render
            g.translate(compBounds.x, compBounds.y);
            try {
                comp.paint(g);
            } catch (Exception e) {
                log.warning("Component choked while rendering.", e);
            }
            g.translate(-compBounds.x, -compBounds.y);
        }
    }
1107613
protected void writeDebugInfo(final WComponent component, final XmlStringBuilder xml) {
		if (component != null && (component.isVisible() || component instanceof WInvisibleContainer)) {
			xml.appendTagOpen("ui:debugInfo");
			xml.appendAttribute("for", component.getId());
			xml.appendAttribute("class", component.getClass().getName());
			xml.appendOptionalAttribute("type", getType(component));
			xml.appendClose();

			xml.appendTagOpen("ui:debugDetail");
			xml.appendAttribute("key", "defaultState");
			xml.appendAttribute("value", component.isDefaultState());
			xml.appendEnd();

			xml.appendEndTag("ui:debugInfo");

			if (component instanceof WRepeater) {
				// special case for WRepeaters - we must paint the info for each row.
				WRepeater repeater = (WRepeater) component;

				List<UIContext> contexts = repeater.getRowContexts();

				for (int i = 0; i < contexts.size(); i++) {
					UIContextHolder.pushContext(contexts.get(i));

					try {
						writeDebugInfo(repeater.getRepeatedComponent(i), xml);
					} finally {
						UIContextHolder.popContext();
					}
				}
			} else if (component instanceof WCardManager) {
				writeDebugInfo(((WCardManager) component).getVisible(), xml);
			} else if (component instanceof Container) {
				final int size = ((Container) component).getChildCount();

				for (int i = 0; i < size; i++) {
					writeDebugInfo(((Container) component).getChildAt(i), xml);
				}
			}
		}
	}
1096422
@Override
	public void render(final WComponent component, final RenderContext context) {
		PrintWriter out = ((WebXmlRenderContext) context).getWriter();

		// If we are debugging the layout, write markers so that the html
		// designer can see where templates start and end.
		boolean debugLayout = ConfigurationProperties.getDeveloperVelocityDebug();

		if (debugLayout) {
			String templateUrl = url;

			if (url == null && component instanceof AbstractWComponent) {
				templateUrl = ((AbstractWComponent) component).getTemplate();
			}

			out.println("<!-- Start " + templateUrl + " -->");
			paintXml(component, out);
			out.println("<!-- End   " + templateUrl + " -->");
		} else {
			paintXml(component, out);
		}
	}
1125023
@Override
	protected void performGlobalBundleLinksRendering(BundleRendererContext ctx, Writer out, boolean debugOn)
			throws IOException {

		if (isForcedToRenderIeCssBundleInDebug(ctx, debugOn)) {
			ResourceBundlePathsIterator resourceBundleIterator = bundler.getGlobalResourceBundlePaths(
					DebugMode.FORCE_NON_DEBUG_IN_IE, new ConditionalCommentRenderer(out), ctx.getVariants());
			while (resourceBundleIterator.hasNext()) {
				BundlePath globalBundlePath = resourceBundleIterator.nextPath();
				renderIeCssBundleLink(ctx, out, globalBundlePath);
			}
		} else {

			super.performGlobalBundleLinksRendering(ctx, out, debugOn);
		}
	}
11840
public void setDebug(boolean debugF) {
        this.debug = debugF;
        if (this.tarIn != null) {
            this.tarIn.setDebug(debugF);
        } else if (this.tarOut != null) {
            this.tarOut.setDebug(debugF);
        }
    }
339056
public void debug(String msg) {
        if (!logger.isDebugEnabled())
            return;

        if (instanceofLAL) {
            ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, msg, null, null);
        } else {
            logger.debug(msg);
        }
    }
224473
void callXcodeBuild(XCodeContext ctx) throws IOException,
        XCodeException
  {
    final CommandLineBuilder commandLineBuilder = new CommandLineBuilder(ctx);

    //
    //TODO The command line printed into the log is not 100% accurate. We have a problem with
    // quotation marks.
    LOGGER.info("Executing xcode command: '" + commandLineBuilder.toString() + "'.");

    final int returnValue = Forker.forkProcess(ctx.getOut(), ctx.getProjectRootDirectory(),
          commandLineBuilder.createBuildCall());
    if (returnValue != 0) {
      throw new XCodeException("Could not execute xcodebuild for configuration "
            + ctx.getOptions().getAllOptions().get(Options.ManagedOption.CONFIGURATION.getOptionName()));
    }
  }
1151522
@GwtIncompatible("Unnecessary")
  private void outputManifestOrBundle(List<String> outputFiles, boolean isManifest)
      throws IOException {
    if (outputFiles.isEmpty()) {
      return;
    }

    for (String output : outputFiles) {
      if (output.isEmpty()) {
        continue;
      }

      if (shouldGenerateOutputPerModule(output)) {
        // Generate per-module manifests or bundles
        Iterable<JSModule> modules = compiler.getModuleGraph().getAllModules();
        for (JSModule module : modules) {
          try (Writer out = fileNameToOutputWriter2(expandCommandLinePath(output, module))) {
            if (isManifest) {
              printManifestTo(module.getInputs(), out);
            } else {
              printBundleTo(module.getInputs(), out);
            }
          }
        }
      } else {
        // Generate a single file manifest or bundle.
        try (Writer out = fileNameToOutputWriter2(expandCommandLinePath(output, null))) {
          if (config.module.isEmpty()) {
            if (isManifest) {
              printManifestTo(compiler.getInputsInOrder(), out);
            } else {
              printBundleTo(compiler.getInputsInOrder(), out);
            }
          } else {
            printModuleGraphManifestOrBundleTo(compiler.getModuleGraph(), out, isManifest);
          }
        }
      }
    }
  }