code: 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).");
    }
docs: Generates the block that creates the {@link NlsBundle} instance lazily via {@link GWT#create(Class)}.
  
  @param sourceWriter is the {@link SourceWriter}.
  @param logger is the {@link TreeLogger}.
  @param context is the {@link GeneratorContext}.