for (PRUint8 i = 0; i < paramCount; i++) { const nsXPTParamInfo &paramInfo = aMethodInfo->GetParam(i);
for (PRUint8 j = 0; j < paramCount; j++) { const nsXPTParamInfo &paramInfo = aMethodInfo->GetParam(j);
  nsresult WriteOneMethod(nsIOutputStream* out, nsIInterfaceInfo* aIInfo,                          const nsXPTMethodInfo* aMethodInfo,                          PRUint16 aMethodIndex)  {    static const char kMethodDecl1[] = "  public ";    static const char kVoidReturn[] = "void";    static const char kParamSeparator[] = ", ";    static const char kMethodDecl2[] = ");\n\n";    PRUint32 count;    nsresult rv = out->Write(kMethodDecl1, sizeof(kMethodDecl1) - 1, &count);    NS_ENSURE_SUCCESS(rv, rv);    // write return type    PRUint8 paramCount = aMethodInfo->GetParamCount();    const nsXPTParamInfo* resultInfo = nsnull;    for (PRUint8 i = 0; i < paramCount; i++) {      const nsXPTParamInfo &paramInfo = aMethodInfo->GetParam(i);      if (paramInfo.IsRetval()) {        resultInfo = &paramInfo;        break;      }    }    if (resultInfo) {      rv = WriteParam(out, aIInfo, aMethodIndex, resultInfo, 0);    } else {      rv = out->Write(kVoidReturn, sizeof(kVoidReturn) - 1, &count);    }    NS_ENSURE_SUCCESS(rv, rv);    // write method name string    nsCAutoString method_name;    const char* name = aMethodInfo->GetName();    if (aMethodInfo->IsGetter() || aMethodInfo->IsSetter()) {      if (aMethodInfo->IsGetter())        method_name.AppendLiteral("get");      else        method_name.AppendLiteral("set");      method_name.Append(toupper(name[0]));      method_name.AppendASCII(name + 1);    } else {      method_name.Append(tolower(name[0]));      method_name.AppendASCII(name + 1);      // don't use Java keywords as method names      if (mJavaKeywords.Contains(method_name))        method_name.Append('_');    }    rv = out->Write(" ", 1, &count);    NS_ENSURE_SUCCESS(rv, rv);    rv = out->Write(method_name.get(), method_name.Length(), &count);    NS_ENSURE_SUCCESS(rv, rv);    rv = out->Write("(", 1, &count);    NS_ENSURE_SUCCESS(rv, rv);    // write parameters    for (PRUint8 i = 0; i < paramCount; i++) {      const nsXPTParamInfo &paramInfo = aMethodInfo->GetParam(i);      if (paramInfo.IsRetval())        continue;      if (i != 0) {        rv = out->Write(kParamSeparator, sizeof(kParamSeparator) - 1, &count);        NS_ENSURE_SUCCESS(rv, rv);      }      rv = WriteParam(out, aIInfo, aMethodIndex, &paramInfo, i + 1);      NS_ENSURE_SUCCESS(rv, rv);    }    rv = out->Write(kMethodDecl2, sizeof(kMethodDecl2) - 1, &count);    return rv;  }