code: public synchronized byte[] compile() {
          long start = System.currentTimeMillis();
          try {
              if (null != javaByteCode) {
                  return javaByteCode;
              }
              if (null == javaSource) {
                  throw new IllegalStateException("Cannot find java source when compiling " + getKey());
              }
              engine().classes().compiler.compile(new String[]{name});
              if (logger.isTraceEnabled()) {
                  logger.trace("%sms to compile template: %s", System.currentTimeMillis() - start, getKey());
              }
              return javaByteCode;
          } catch (CompileException.CompilerException e) {
              String cn = e.className;
              TemplateClass tc = S.isEqual(cn, name) ? this : engine().classes().getByClassName(cn);
              if (null == tc) {
                  tc = this;
              }
              CompileException ce = new CompileException(engine(), tc, e.javaLineNumber, e.message); // init ce before reset java source to get template line info
              javaSource = null; // force parser to regenerate source. This helps to reload after fixing the tag file compilation failure
              logger.warn("compile failed for %s at line %d",tc.tagName,e.javaLineNumber);
              for (TemplateClass itc:this.includedTemplateClasses) {
                 logger.info("\tincluded: %s",itc.tagName);
              }
              throw ce;
          } catch (NullPointerException e) {
              String clazzName = name;
              TemplateClass tc = engine().classes().getByClassName(clazzName);
              if (this != tc) {
                  logger.error("tc is not this");
              }
              if (!this.equals(tc)) {
                  logger.error("tc not match this");
              }
              logger.error("NPE encountered when compiling template class:" + name);
              throw e;
          } finally {
              if (logger.isTraceEnabled()) {
                  logger.trace("%sms to compile template class %s", System.currentTimeMillis() - start, getKey());
              }
          }
      }
docs: Compile the class from Java source
  
  @return the bytes that comprise the class file