see interface javadoc
174587
@Override
    public Object[] swapParameters(final Object[] emptyReplacement) {
        Object[] result;
        if (varargs == null) {
            result = params;
            if (emptyReplacement.length >= MAX_PARMS) {
                params = emptyReplacement;
            } else {
                // Bad replacement! Too small, may blow up future 10-arg messages.
                if (argCount <= emptyReplacement.length) {
                    // copy params into the specified replacement array and return that
                    System.arraycopy(params, 0, emptyReplacement, 0, argCount);
                    result = emptyReplacement;
                } else {
                    // replacement array is too small for current content and future content: discard it
                    params = new Object[MAX_PARMS];
                }
            }
        } else {
            // The returned array will be reused by the caller in future swapParameter() calls.
            // Therefore we want to avoid returning arrays with less than 10 elements.
            // If the vararg array is less than 10 params we just copy its content into the specified array
            // and return it. This helps the caller to retain a reusable array of at least 10 elements.
            // NOTE: LOG4J2-1688 unearthed the use case that an application array (not a varargs array) is passed
            // as the argument array. This array should not be modified, so it cannot be passed to the caller
            // who will at some point null out the elements in the array).
            if (argCount <= emptyReplacement.length) {
                result = emptyReplacement;
            } else {
                result = new Object[argCount]; // LOG4J2-1688
            }
            // copy params into the specified replacement array and return that
            System.arraycopy(varargs, 0, result, 0, argCount);
        }
        return result;
    }
723254
def inheritdoc(method):
    
    method.__doc__ = getattr(list, method.__name__).__doc__
    return method
962370
def doc(self):
        """"""
        return self._pv.doc or inspect.getdoc(
            getattr(type(self._target), self._pv.property, None)) or ''
233925
def initdoc(request, namespace, docid, mode, template, context=None, configuration=None):
    """"""
    perspective = request.GET.get('perspective','document')
    if context is None: context = {}
    if 'configuration' in request.session:
        configuration = request.session['configuration']
    elif configuration is None:
        return fatalerror(request, "No configuration specified")
    if configuration not in settings.CONFIGURATIONS:
        return fatalerror(request, "Specified configuration does not exist")
    flatargs = {
        'setdefinitions': True,
        'declarations': True, #implies provenance as well
        'metadata': True,
        'toc': True,
        'slices': request.GET.get('slices',settings.CONFIGURATIONS[configuration].get('slices','p:25,s:100')), #overriden either by configuration or by user
        'customslicesize': 0, #disabled for initial probe
        'textclasses': True,
    }
    error = False
    try:
        doc = flat.comm.query(request, "USE " + namespace + "/" + docid + " PROBE", **flatargs) #retrieves only the meta information, not document content
        context.update(getcontext(request,namespace,docid, doc, mode, configuration))
    except Exception as e:
        context.update(docserveerror(e))
        error = True

    if not error:
        dorequiredeclaration = 'requiredeclaration' in settings.CONFIGURATIONS[configuration] and settings.CONFIGURATIONS[configuration]['requiredeclaration']
        if dorequiredeclaration:
            if not 'declarations' in doc:
                return fatalerror(request, "Refusing to load document, missing expected declarations, none declared")
            declarations = doc['declarations']
            for annotationtype, annotationset in settings.CONFIGURATIONS[configuration]['requiredeclaration']:
                found = False
                for d in declarations:
                    if annotationtype == d['annotationtype'] and (not annotationset or annotationset == d['set']):
                        found = True
                        break
                if not found:
                    if annotationset:
                        return fatalerror(request, "Refusing to load document, missing expected declaration for annotation type " + annotationtype + "/" + annotationset)
                    else:
                        return fatalerror(request, "Refusing to load document, missing expected declaration for annotation type " + annotationtype)

        dometadataindex = 'metadataindex' in settings.CONFIGURATIONS[configuration] and settings.CONFIGURATIONS[configuration]['metadataindex']
        if dometadataindex:
            metadata = json.loads(context['metadata'])
            for metakey in settings.CONFIGURATIONS[configuration]['metadataindex']:
                if metakey in metadata:
                    MetadataIndex.objects.update_or_create(namespace=namespace,docid=docid, key=metakey,defaults={'value':metadata[metakey]})
    response = render(request, template, context)
    if 'fatalerror' in context:
        response.status_code = 500
    return response
1277171
private void postProcessClassDocs() {
        for (GroovyClassDoc groovyClassDoc : classDocs.values()) {
            SimpleGroovyClassDoc classDoc = (SimpleGroovyClassDoc) groovyClassDoc;

            // potentially add default constructor to class docs (but not interfaces)
            if (classDoc.isClass()) {
                GroovyConstructorDoc[] constructors = classDoc.constructors();
                if (constructors != null && constructors.length == 0) { // add default constructor to doc
                    // name of class for the constructor
                    GroovyConstructorDoc constructorDoc = new SimpleGroovyConstructorDoc(classDoc.name(), classDoc);
                    // don't forget to tell the class about this default constructor.
                    classDoc.add(constructorDoc);
                }
            }
        }
    }
1264374
function(id) {
      var that = this;

      return this._dbApi.read(id).then(function(doc) {
        return that._readDoc(doc);
      });
    }
419484
public void processJavadoc() {
    for (Options.OptionInfo oi : options.getOptions()) {
      ClassDoc optDoc = root.classNamed(oi.getDeclaringClass().getName());
      if (optDoc != null) {
        String nameWithUnderscores = oi.longName.replace('-', '_');
        for (FieldDoc fd : optDoc.fields()) {
          if (fd.name().equals(nameWithUnderscores)) {
            // If Javadoc for field is unavailable, then use the @Option
            // description in the documentation.
            if (fd.getRawCommentText().length() == 0) {
              // Input is a string rather than a Javadoc (HTML) comment so we
              // must escape it.
              oi.jdoc = StringEscapeUtils.escapeHtml4(oi.description);
            } else if (formatJavadoc) {
              oi.jdoc = fd.commentText();
            } else {
              oi.jdoc = javadocToHtml(fd);
            }
            break;
          }
        }
      }
      if (oi.baseType.isEnum()) {
        processEnumJavadoc(oi);
      }
    }
  }
500108
function decorateMethodDoc(methodDoc) {
    normalizeMethodParameters(methodDoc);

    // Mark methods with a `void` return type so we can omit show the return type in the docs.
    methodDoc.showReturns = methodDoc.returnType && methodDoc.returnType != 'void';
  }
1179792
@RequiresNonNull("docFile")
  private String newDocFileText() throws Exception {
    StringJoiner b = new StringJoiner(lineSep);
    BufferedReader doc = Files.newBufferedReader(docFile.toPath(), UTF_8);
    String docline;
    boolean replacing = false;
    boolean replacedOnce = false;
    String prefix = null;

    while ((docline = doc.readLine()) != null) {
      if (replacing) {
        if (docline.trim().equals(endDelim)) {
          replacing = false;
        } else {
          continue;
        }
      }

      b.add(docline);

      if (!replacedOnce && docline.trim().equals(startDelim)) {
        if (formatJavadoc) {
          int starIndex = docline.indexOf('*');
          b.add(docline.substring(0, starIndex + 1));
          String jdoc = optionsToJavadoc(starIndex, 100);
          b.add(jdoc);
          if (jdoc.endsWith("</ul>")) {
            b.add(docline.substring(0, starIndex + 1));
          }
        } else {
          b.add(optionsToHtml(0));
        }
        replacedOnce = true;
        replacing = true;
      }
    }

    doc.close();
    return b.toString();
  }
1209225
private String getClassToolTip(ClassDoc classDoc, boolean isTypeLink) {
        Configuration configuration = m_writer.configuration;
        Utils utils = configuration.utils;
        if (isTypeLink) {
            return configuration.getText("doclet.Href_Type_Param_Title",
                classDoc.name());
        } else if (classDoc.isInterface()){
            return configuration.getText("doclet.Href_Interface_Title",
                utils.getPackageName(classDoc.containingPackage()));
        } else if (classDoc.isAnnotationType()) {
            return configuration.getText("doclet.Href_Annotation_Title",
                utils.getPackageName(classDoc.containingPackage()));
        } else if (classDoc.isEnum()) {
            return configuration.getText("doclet.Href_Enum_Title",
                utils.getPackageName(classDoc.containingPackage()));
        } else {
            return configuration.getText("doclet.Href_Class_Title",
                utils.getPackageName(classDoc.containingPackage()));
        }
    }
475545
function getMethodReturnDoc(methodPath) {
  const functionExpression = methodPath.get('value');

  if (functionExpression.node.returnType) {
    const returnType = getTypeAnnotation(functionExpression.get('returnType'));
    if (returnType && t.Flow.check(returnType.node)) {
      return { type: getFlowType(returnType) };
    } else if (returnType) {
      return { type: getTSType(returnType) };
    }
  }

  return null;
}
1356411
int toMatchDoc() throws IOException {
    while (true) {
      if (findMatches()) {
        return docID();
      }
      resetQueue();
      if (spans.nextDoc() == NO_MORE_DOCS) {
        return NO_MORE_DOCS;
      }
    }
  }
1211540
@Override
  public MethodVisitor visitMethod(int access, final String name, String desc,
                                   String signature, String[] exceptions) {
    MethodVisitor mv = cv.visitMethod(access | Opcodes.ACC_SYNTHETIC,
                                      name, desc, signature, exceptions);
    return new LineNumberingMethodAdapter(mv, access | Opcodes.ACC_SYNTHETIC,
                                          name, desc) {
      @Override
      protected void onMethodEnter() {
        this.lineNumbers = LineNumberingClassAdapter.this.lineNumbers;
        super.onMethodEnter();
      }
    };
  }
303063
@Override
  public MethodVisitor visitMethod(
      int access, String base, String desc, String signature, String[] exceptions) {
    MethodVisitor mv = cv.visitMethod(access, base, desc, signature, exceptions);

    if (mv != null) {
      // We need to compute stackmaps (see
      // AllocationInstrumenter#instrument).  This can't really be
      // done for old bytecode that contains JSR and RET instructions.
      // So, we remove JSRs and RETs.
      JSRInlinerAdapter jsria =
          new JSRInlinerAdapter(mv, access, base, desc, signature, exceptions);
      AllocationMethodAdapter aimv =
          new AllocationMethodAdapter(jsria, recorderClass, recorderMethod);
      LocalVariablesSorter lvs = new LocalVariablesSorter(access, desc, aimv);
      aimv.lvs = lvs;
      mv = lvs;
    }
    return mv;
  }
317100
public ClassDoc[] interfaces() {
        ListBuffer<ClassDocImpl> ta = new ListBuffer<>();
        for (Type t : env.types.interfaces(type)) {
            ta.append(env.getClassDoc((ClassSymbol)t.tsym));
        }
        //### Cache ta here?
        return ta.toArray(new ClassDocImpl[ta.length()]);
    }
640057
public void viewDocument(DocumentEntry entry)
   {
      InputStream is = null;

      try
      {
         is = new DocumentInputStream(entry);
         byte[] data = new byte[is.available()];
         is.read(data);
         m_model.setData(data);
         updateTables();
      }

      catch (IOException ex)
      {
         throw new RuntimeException(ex);
      }

      finally
      {
         StreamHelper.closeQuietly(is);
      }

   }
969995
function showInterfaceJavaMethod(intf, method, html) {
    var line = ""

    line += "\n    /**"
    line += "\n     * "
    line += "\n     */"
    line += "\n    <span class='methodName'>public void " + method.name + "</span>(" + getJavaParameterListSimple(method.parameters, method.returns) + ") throws IOException {"
    line += "\n        Main.warn(getClass().getName() + \"." + method.name + "() not implemented\");"
    line += "\n"
    line += "\n        channel.sendCallback(\"" + intf.name + "\", callbackId" + getJavaCallbackParameterListSimple(method.callbackParameters) + ");"
    line += "\n    }"
    line += "\n"
    html.push(line)
}