Implement abstract method which have either one parameter and returning something or
void type not returning anything.
@throws IOException
189629
private void overrideAbstractMethods() throws IOException
    {
        for (final ExecutableElement method : El.getEffectiveMethods(superClass))
        {
            if (method.getModifiers().contains(Modifier.ABSTRACT))
            {
                if (
                        method.getAnnotation(Terminal.class) != null || 
                        method.getAnnotation(Rule.class) != null || 
                        method.getAnnotation(Rules.class) != null )
                {
                    implementedAbstractMethods.add(method);
                    MethodCompiler mc = new MethodCompiler()
                    {
                        @Override
                        protected void implement() throws IOException
                        {
                            TypeMirror returnType = method.getReturnType();
                            List<? extends VariableElement> params = method.getParameters();
                            if (returnType.getKind() != TypeKind.VOID && params.size() == 1)
                            {
                                nameArgument(ARG, 1);
                                try
                                {
                                    convert(ARG, returnType);
                                }
                                catch (IllegalConversionException ex)
                                {
                                    throw new IOException("bad conversion with "+method, ex);
                                }
                                treturn();
                            }
                            else
                            {
                                if (returnType.getKind() == TypeKind.VOID && params.size() == 0)
                                {
                                    treturn();
                                }
                                else
                                {
                                    throw new IllegalArgumentException("cannot implement abstract method "+method);
                                }
                            }
                        }
                    };
                    subClass.overrideMethod(mc, method, Modifier.PROTECTED);
                }
            }
        }
    }
156724
@SuppressWarnings("all")
    public static Method findMethodOrThrowException(Class<?> type, String methodName, Class<?>... parameterTypes) {
        Method methodToMock = findMethod(type, methodName, parameterTypes);
        throwExceptionIfMethodWasNotFound(type, methodName, methodToMock, (Object[]) parameterTypes);
        return methodToMock;
    }
1118523
private boolean methodIsAbstractGetter(TypeElement valueType, ExecutableElement method) {
    Set<Modifier> modifiers = method.getModifiers();
    if (!modifiers.contains(Modifier.ABSTRACT)) {
      return false;
    }
    boolean declaredOnValueType = method.getEnclosingElement().equals(valueType);
    TypeMirror returnType = getReturnType(valueType, method, types);
    if (returnType.getKind() == TypeKind.VOID || !method.getParameters().isEmpty()) {
      if (declaredOnValueType) {
        messager.printMessage(
            ERROR,
            "Only getter methods may be declared abstract on FreeBuilder types",
            method);
      } else {
        printNoImplementationMessage(valueType, method);
      }
      return false;
    }
    return true;
  }
131346
public void finish() throws IOException {
        //Map<String,Set<TypeLibInfo>> byPackage = new HashMap<String,Set<TypeLibInfo>>();
        //for( TypeLibInfo tli : generatedTypeLibs ) {
        //    Set<TypeLibInfo> s = byPackage.get(tli.packageName);
        //    if(s==null)
        //        byPackage.put(tli.packageName,s=new HashSet<TypeLibInfo>());
        //    s.add(tli);
        //}

        // for( Map.Entry<String,Set<TypeLibInfo>> e : byPackage.entrySet() ) {
        for( Package pkg : packages.values() ) {
            LibBinder lib1 = pkg.typeLibs.iterator().next();

            if(referenceResolver.suppress(lib1.lib))
                continue;

            // generate ClassFactory
            IndentingWriter o = pkg.createWriter(lib1,"ClassFactory.java");
            lib1.generateHeader(o);

            o.printJavadoc("Defines methods to create COM objects");
            o.println("public abstract class ClassFactory {");
            o.in();

            o.println("private ClassFactory() {} // instanciation is not allowed");
            o.println();

            for( LibBinder lib : pkg.typeLibs ) {
                int len = lib.lib.count();
                for( int i=0; i<len; i++ ) {
                    ICoClassDecl t = lib.lib.getType(i).queryInterface(ICoClassDecl.class);
                    if(t==null)     continue;
                    if(!t.isCreatable())    continue;

                    declareFactoryMethod(o, t);
                    t.dispose();
                }
            }

            o.out();
            o.println("}");
            o.close();
        }
    }
1354552
public static Function<Object,Integer> i(final String methodName, final Object... optionalParameters) {
        return methodForInteger(methodName, optionalParameters);
    }
866051
public boolean primitive(Object arg0) throws ParseException, IOException {
		if (arg0 == null)
			return true;
		this.processValue(arg0.toString());
		return true;
	}
563889
final public void MethodParameters() throws ParseException {
                                             /*@bgen(jjtree) MethodParameters */
  AstMethodParameters jjtn000 = new AstMethodParameters(JJTMETHODPARAMETERS);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      jj_consume_token(LPAREN);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case START_SET_OR_MAP:
      case INTEGER_LITERAL:
      case FLOATING_POINT_LITERAL:
      case STRING_LITERAL:
      case TRUE:
      case FALSE:
      case NULL:
      case LPAREN:
      case LBRACK:
      case NOT0:
      case NOT1:
      case EMPTY:
      case MINUS:
      case IDENTIFIER:
        Expression();
        label_15:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
            ;
            break;
          default:
            jj_la1[37] = jj_gen;
            break label_15;
          }
          jj_consume_token(COMMA);
          Expression();
        }
        break;
      default:
        jj_la1[38] = jj_gen;
        ;
      }
      jj_consume_token(RPAREN);
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }
669005
public void call(String method, Object[] args)
        throws IOException
    {
        int length = args != null ? args.length : 0;

        startCall(method, length);

        for (int i = 0; i < length; i++)
            writeObject(args[i]);

        completeCall();
    }

    /**
     * Starts the method call.  Clients would use <code>startCall</code>
     * instead of <code>call</code> if they wanted finer control over
     * writing the arguments, or needed to write headers.
     *
     * <code><pre>
     * c major minor
     * m b16 b8 method-name
     * </pre></code>
     *
     * @param method the method name to call.
     */
    public void startCall(String method, int length)
        throws IOException
    {
        os.write('c');
        os.write(_version);
        os.write(0);

        os.write('m');
        int len = method.length();
        os.write(len >> 8);
        os.write(len);
        printString(method, 0, len);
    }

    /**
     * Writes the call tag.  This would be followed by the
     * headers and the method tag.
     *
     * <code><pre>
     * c major minor
     * </pre></code>
     *
     * @param method the method name to call.
     */
    public void startCall()
        throws IOException
    {
        os.write('c');
        os.write(0);
        os.write(1);
    }

    /**
     * Writes the method tag.
     *
     * <code><pre>
     * m b16 b8 method-name
     * </pre></code>
     *
     * @param method the method name to call.
     */
    public void writeMethod(String method)
        throws IOException
    {
        os.write('m');
        int len = method.length();
        os.write(len >> 8);
        os.write(len);
        printString(method, 0, len);
    }

    /**
     * Completes.
     *
     * <code><pre>
     * z
     * </pre></code>
     */
    public void completeCall()
        throws IOException
    {
        os.write('z');
    }

    /**
     * Starts the reply
     *
     * <p>A successful completion will have a single value:
     *
     * <pre>
     * r
     * </pre>
     */
    public void startReply()
        throws IOException
    {
        os.write('r');
        os.write(1);
        os.write(0);
    }

    /**
     * Completes reading the reply
     *
     * <p>A successful completion will have a single value:
     *
     * <pre>
     * z
     * </pre>
     */
    public void completeReply()
        throws IOException
    {
        os.write('z');
    }

    /**
     * Writes a header name.  The header value must immediately follow.
     *
     * <code><pre>
     * H b16 b8 foo <em>value</em>
     * </pre></code>
     */
    public void writeHeader(String name)
        throws IOException
    {
        int len = name.length();

        os.write('H');
        os.write(len >> 8);
        os.write(len);

        printString(name);
    }

    /**
     * Writes a fault.  The fault will be written
     * as a descriptive string followed by an object:
     *
     * <code><pre>
     * f
     * &lt;string>code
     * &lt;string>the fault code
     *
     * &lt;string>message
     * &lt;string>the fault mesage
     *
     * &lt;string>detail
     * mt\x00\xnnjavax.ejb.FinderException
     *     ...
     * z
     * z
     * </pre></code>
     *
     * @param code the fault code, a three digit
     */
    public void writeFault(String code, String message, Object detail)
        throws IOException
    {
        // hessian/3525
        os.write('r');
        os.write(1);
        os.write(0);

        os.write('f');
        writeString("code");
        writeString(code);

        writeString("message");
        writeString(message);

        if (detail != null) {
            writeString("detail");
            writeObject(detail);
        }
        os.write('z');

        os.write('z');
    }
1090446
private void writeType(String type)
        throws IOException
    {
        flushIfFull();

        int len = type.length();
        if (len == 0) {
            throw new IllegalArgumentException("empty type is not allowed");
        }

        if (_typeRefs == null)
            _typeRefs = new HashMap<String, Integer>();

        Integer typeRefV = (Integer) _typeRefs.get(type);

        if (typeRefV != null) {
            int typeRef = typeRefV.intValue();

            writeInt(typeRef);
        }
        else {
            _typeRefs.put(type, Integer.valueOf(_typeRefs.size()));

            writeString(type);
        }
    }
1300668
function(object, method) {
      if (object == null) return void 0;
      var func = object[method];
      var args = slice.call(arguments, 2);
      return _.isFunction(func) ? func.apply(object, args) : void 0;
    }
849009
private Optional<SoyType> soyTypeForProtoOrEnum(Class<?> type, Method method) {
    // Message isn't supported because we can't get a descriptor from it.
    if (type == Message.class) {
      reporter.invalidReturnType(Message.class, method);
      return Optional.absent();
    }
    Optional<String> fullName = nameFromDescriptor(type);
    if (!fullName.isPresent()) {
      reporter.incompatibleReturnType(type, method);
      return Optional.absent();
    }
    SoyType returnType = registry.getType(fullName.get());
    if (returnType == null) {
      reporter.incompatibleReturnType(type, method);
      return Optional.absent();
    }
    return Optional.of(returnType);
  }
1136444
private static boolean validateReturnType(Method method, Class<?> expected) {
    Class<?> returnType = method.getReturnType();
    if (returnType == void.class) {
      return false;
    }
    if (returnType != expected) {
      String expectedType = "'" + expected.getName() + "'";
      if (expected != void.class) {
        expectedType = "'void' or " + expectedType;
      }
      throw new IllegalStateException(method.getDeclaringClass().getName()
          + "."
          + method.getName()
          + " must have return type of "
          + expectedType);
    }
    return true;
  }
1187594
private static void formalTypeParameter(Result sb, TypeParameterElement typeParameter) throws IOException
    {
        sb.append(typeParameter.getSimpleName());
        List<? extends TypeMirror> bounds = typeParameter.getBounds();
        if (!bounds.isEmpty())
        {
            TypeMirror tm = bounds.get(0);
            if (TypeKind.DECLARED == tm.getKind())
            {
                DeclaredType dt = (DeclaredType) tm;
                if (ElementKind.CLASS != dt.asElement().getKind())
                {
                    sb.append(':');
                }
            }
        }
        for (TypeMirror bound : bounds)
        {
            sb.append(':');
            fieldTypeSignature(sb, bound);
        }
    }
1184700
public void checkcast(TypeElement objectref) throws IOException
    {
        int index = subClass.resolveClassIndex(objectref);
        checkcast(index);
    }
762171
protected void addReturnType(MethodDoc method, Content htmltree) {
        Type type = method.returnType();
        if (type != null) {
            Content linkContent = writer.getLink(
                    new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type));
            htmltree.addContent(linkContent);
            htmltree.addContent(writer.getSpace());
        }
    }
60134
public static Throwable throwIfIOE(Throwable t) throws IOException {
        if (t instanceof IOException) {
            throw (IOException)t;
        }
        return t;
    }
388016
synchronized int id(Class<?> type) {
    Integer id = ids.get(type);
    if (id != null)
      return id;

    // If no ID was found for the given type, determine whether the type is an abstract type.
    Class<?> baseType = findBaseType(type, abstractFactories);
    if (baseType != null) {
      id = ids.get(baseType);
      if (id != null) {
        return id;
      }
    }
    return 0;
  }