id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
5,300
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
ClassReader.sigToTypeParams
List<Type> sigToTypeParams() { List<Type> tvars = List.nil(); if (signature[sigp] == '<') { sigp++; int start = sigp; sigEnterPhase = true; while (signature[sigp] != '>') tvars = tvars.prepend(sigToTypeParam()); sigEnterPhase = false; sigp = start; while (signature[sigp] != '>') sigToTypeParam(); sigp++; } return tvars.reverse(); }
java
List<Type> sigToTypeParams() { List<Type> tvars = List.nil(); if (signature[sigp] == '<') { sigp++; int start = sigp; sigEnterPhase = true; while (signature[sigp] != '>') tvars = tvars.prepend(sigToTypeParam()); sigEnterPhase = false; sigp = start; while (signature[sigp] != '>') sigToTypeParam(); sigp++; } return tvars.reverse(); }
[ "List", "<", "Type", ">", "sigToTypeParams", "(", ")", "{", "List", "<", "Type", ">", "tvars", "=", "List", ".", "nil", "(", ")", ";", "if", "(", "signature", "[", "sigp", "]", "==", "'", "'", ")", "{", "sigp", "++", ";", "int", "start", "=", "sigp", ";", "sigEnterPhase", "=", "true", ";", "while", "(", "signature", "[", "sigp", "]", "!=", "'", "'", ")", "tvars", "=", "tvars", ".", "prepend", "(", "sigToTypeParam", "(", ")", ")", ";", "sigEnterPhase", "=", "false", ";", "sigp", "=", "start", ";", "while", "(", "signature", "[", "sigp", "]", "!=", "'", "'", ")", "sigToTypeParam", "(", ")", ";", "sigp", "++", ";", "}", "return", "tvars", ".", "reverse", "(", ")", ";", "}" ]
Convert signature to type parameters, where signature is implicit.
[ "Convert", "signature", "to", "type", "parameters", "where", "signature", "is", "implicit", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L894-L909
5,301
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
ClassReader.skipMember
void skipMember() { bp = bp + 6; char ac = nextChar(); for (int i = 0; i < ac; i++) { bp = bp + 2; int attrLen = nextInt(); bp = bp + attrLen; } }
java
void skipMember() { bp = bp + 6; char ac = nextChar(); for (int i = 0; i < ac; i++) { bp = bp + 2; int attrLen = nextInt(); bp = bp + attrLen; } }
[ "void", "skipMember", "(", ")", "{", "bp", "=", "bp", "+", "6", ";", "char", "ac", "=", "nextChar", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ac", ";", "i", "++", ")", "{", "bp", "=", "bp", "+", "2", ";", "int", "attrLen", "=", "nextInt", "(", ")", ";", "bp", "=", "bp", "+", "attrLen", ";", "}", "}" ]
Skip a field or method
[ "Skip", "a", "field", "or", "method" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2520-L2528
5,302
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
ClassReader.readClassBuffer
private void readClassBuffer(ClassSymbol c) throws IOException { int magic = nextInt(); if (magic != JAVA_MAGIC) throw badClassFile("illegal.start.of.class.file"); minorVersion = nextChar(); majorVersion = nextChar(); int maxMajor = 53; // Version.MAX().major; //******* TEMPORARY ******* int maxMinor = Version.MAX().minor; if (majorVersion > maxMajor || majorVersion * 1000 + minorVersion < Version.MIN().major * 1000 + Version.MIN().minor) { if (majorVersion == (maxMajor + 1)) log.warning("big.major.version", currentClassFile, majorVersion, maxMajor); else throw badClassFile("wrong.version", Integer.toString(majorVersion), Integer.toString(minorVersion), Integer.toString(maxMajor), Integer.toString(maxMinor)); } indexPool(); if (signatureBuffer.length < bp) { int ns = Integer.highestOneBit(bp) << 1; signatureBuffer = new byte[ns]; } readClass(c); }
java
private void readClassBuffer(ClassSymbol c) throws IOException { int magic = nextInt(); if (magic != JAVA_MAGIC) throw badClassFile("illegal.start.of.class.file"); minorVersion = nextChar(); majorVersion = nextChar(); int maxMajor = 53; // Version.MAX().major; //******* TEMPORARY ******* int maxMinor = Version.MAX().minor; if (majorVersion > maxMajor || majorVersion * 1000 + minorVersion < Version.MIN().major * 1000 + Version.MIN().minor) { if (majorVersion == (maxMajor + 1)) log.warning("big.major.version", currentClassFile, majorVersion, maxMajor); else throw badClassFile("wrong.version", Integer.toString(majorVersion), Integer.toString(minorVersion), Integer.toString(maxMajor), Integer.toString(maxMinor)); } indexPool(); if (signatureBuffer.length < bp) { int ns = Integer.highestOneBit(bp) << 1; signatureBuffer = new byte[ns]; } readClass(c); }
[ "private", "void", "readClassBuffer", "(", "ClassSymbol", "c", ")", "throws", "IOException", "{", "int", "magic", "=", "nextInt", "(", ")", ";", "if", "(", "magic", "!=", "JAVA_MAGIC", ")", "throw", "badClassFile", "(", "\"illegal.start.of.class.file\"", ")", ";", "minorVersion", "=", "nextChar", "(", ")", ";", "majorVersion", "=", "nextChar", "(", ")", ";", "int", "maxMajor", "=", "53", ";", "// Version.MAX().major; //******* TEMPORARY *******", "int", "maxMinor", "=", "Version", ".", "MAX", "(", ")", ".", "minor", ";", "if", "(", "majorVersion", ">", "maxMajor", "||", "majorVersion", "*", "1000", "+", "minorVersion", "<", "Version", ".", "MIN", "(", ")", ".", "major", "*", "1000", "+", "Version", ".", "MIN", "(", ")", ".", "minor", ")", "{", "if", "(", "majorVersion", "==", "(", "maxMajor", "+", "1", ")", ")", "log", ".", "warning", "(", "\"big.major.version\"", ",", "currentClassFile", ",", "majorVersion", ",", "maxMajor", ")", ";", "else", "throw", "badClassFile", "(", "\"wrong.version\"", ",", "Integer", ".", "toString", "(", "majorVersion", ")", ",", "Integer", ".", "toString", "(", "minorVersion", ")", ",", "Integer", ".", "toString", "(", "maxMajor", ")", ",", "Integer", ".", "toString", "(", "maxMinor", ")", ")", ";", "}", "indexPool", "(", ")", ";", "if", "(", "signatureBuffer", ".", "length", "<", "bp", ")", "{", "int", "ns", "=", "Integer", ".", "highestOneBit", "(", "bp", ")", "<<", "1", ";", "signatureBuffer", "=", "new", "byte", "[", "ns", "]", ";", "}", "readClass", "(", "c", ")", ";", "}" ]
Read a class definition from the bytes in buf.
[ "Read", "a", "class", "definition", "from", "the", "bytes", "in", "buf", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2676-L2707
5,303
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java
JavacMessages.instance
public static JavacMessages instance(Context context) { JavacMessages instance = context.get(messagesKey); if (instance == null) instance = new JavacMessages(context); return instance; }
java
public static JavacMessages instance(Context context) { JavacMessages instance = context.get(messagesKey); if (instance == null) instance = new JavacMessages(context); return instance; }
[ "public", "static", "JavacMessages", "instance", "(", "Context", "context", ")", "{", "JavacMessages", "instance", "=", "context", ".", "get", "(", "messagesKey", ")", ";", "if", "(", "instance", "==", "null", ")", "instance", "=", "new", "JavacMessages", "(", "context", ")", ";", "return", "instance", ";", "}" ]
Get the JavacMessages instance for this context.
[ "Get", "the", "JavacMessages", "instance", "for", "this", "context", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java#L50-L55
5,304
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java
JavacMessages.getLocalizedString
public String getLocalizedString(String key, Object... args) { return getLocalizedString(currentLocale, key, args); }
java
public String getLocalizedString(String key, Object... args) { return getLocalizedString(currentLocale, key, args); }
[ "public", "String", "getLocalizedString", "(", "String", "key", ",", "Object", "...", "args", ")", "{", "return", "getLocalizedString", "(", "currentLocale", ",", "key", ",", "args", ")", ";", "}" ]
Gets the localized string corresponding to a key, formatted with a set of args.
[ "Gets", "the", "localized", "string", "corresponding", "to", "a", "key", "formatted", "with", "a", "set", "of", "args", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java#L139-L141
5,305
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java
JavacMessages.getDefaultLocalizedString
static String getDefaultLocalizedString(String key, Object... args) { return getLocalizedString(List.of(getDefaultBundle()), key, args); }
java
static String getDefaultLocalizedString(String key, Object... args) { return getLocalizedString(List.of(getDefaultBundle()), key, args); }
[ "static", "String", "getDefaultLocalizedString", "(", "String", "key", ",", "Object", "...", "args", ")", "{", "return", "getLocalizedString", "(", "List", ".", "of", "(", "getDefaultBundle", "(", ")", ")", ",", "key", ",", "args", ")", ";", "}" ]
used to support legacy Log.getLocalizedString
[ "used", "to", "support", "legacy", "Log", ".", "getLocalizedString" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JavacMessages.java#L165-L167
5,306
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
ClassUseWriter.generateClassUseFile
protected void generateClassUseFile() throws DocFileIOException { HtmlTree body = getClassUseHeader(); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.classUseContainer); if (pkgSet.size() > 0) { addClassUse(div); } else { div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0", utils.getFullyQualifiedName(typeElement))); } if (configuration.allowTag(HtmlTag.MAIN)) { mainTree.addContent(div); body.addContent(mainTree); } else { body.addContent(div); } HtmlTree htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) ? HtmlTree.FOOTER() : body; addNavLinks(false, htmlTree); addBottom(htmlTree); if (configuration.allowTag(HtmlTag.FOOTER)) { body.addContent(htmlTree); } printHtmlDocument(null, true, body); }
java
protected void generateClassUseFile() throws DocFileIOException { HtmlTree body = getClassUseHeader(); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.classUseContainer); if (pkgSet.size() > 0) { addClassUse(div); } else { div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0", utils.getFullyQualifiedName(typeElement))); } if (configuration.allowTag(HtmlTag.MAIN)) { mainTree.addContent(div); body.addContent(mainTree); } else { body.addContent(div); } HtmlTree htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) ? HtmlTree.FOOTER() : body; addNavLinks(false, htmlTree); addBottom(htmlTree); if (configuration.allowTag(HtmlTag.FOOTER)) { body.addContent(htmlTree); } printHtmlDocument(null, true, body); }
[ "protected", "void", "generateClassUseFile", "(", ")", "throws", "DocFileIOException", "{", "HtmlTree", "body", "=", "getClassUseHeader", "(", ")", ";", "HtmlTree", "div", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "DIV", ")", ";", "div", ".", "addStyle", "(", "HtmlStyle", ".", "classUseContainer", ")", ";", "if", "(", "pkgSet", ".", "size", "(", ")", ">", "0", ")", "{", "addClassUse", "(", "div", ")", ";", "}", "else", "{", "div", ".", "addContent", "(", "contents", ".", "getContent", "(", "\"doclet.ClassUse_No.usage.of.0\"", ",", "utils", ".", "getFullyQualifiedName", "(", "typeElement", ")", ")", ")", ";", "}", "if", "(", "configuration", ".", "allowTag", "(", "HtmlTag", ".", "MAIN", ")", ")", "{", "mainTree", ".", "addContent", "(", "div", ")", ";", "body", ".", "addContent", "(", "mainTree", ")", ";", "}", "else", "{", "body", ".", "addContent", "(", "div", ")", ";", "}", "HtmlTree", "htmlTree", "=", "(", "configuration", ".", "allowTag", "(", "HtmlTag", ".", "FOOTER", ")", ")", "?", "HtmlTree", ".", "FOOTER", "(", ")", ":", "body", ";", "addNavLinks", "(", "false", ",", "htmlTree", ")", ";", "addBottom", "(", "htmlTree", ")", ";", "if", "(", "configuration", ".", "allowTag", "(", "HtmlTag", ".", "FOOTER", ")", ")", "{", "body", ".", "addContent", "(", "htmlTree", ")", ";", "}", "printHtmlDocument", "(", "null", ",", "true", ",", "body", ")", ";", "}" ]
Generate the class use elements. @throws DocFileIOException if there is a problem while generating the documentation
[ "Generate", "the", "class", "use", "elements", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java#L238-L263
5,307
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
ClassUseWriter.addPackageList
protected void addPackageList(Content contentTree) { Content caption = getTableCaption(configuration.getContent( "doclet.ClassUse_Packages.that.use.0", getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); Content table = (configuration.isOutputHtml5()) ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption); table.addContent(getSummaryTableHeader(packageTableHeader, "col")); Content tbody = new HtmlTree(HtmlTag.TBODY); boolean altColor = true; for (PackageElement pkg : pkgSet) { HtmlTree tr = new HtmlTree(HtmlTag.TR); tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); altColor = !altColor; addPackageUse(pkg, tr); tbody.addContent(tr); } table.addContent(tbody); Content li = HtmlTree.LI(HtmlStyle.blockList, table); contentTree.addContent(li); }
java
protected void addPackageList(Content contentTree) { Content caption = getTableCaption(configuration.getContent( "doclet.ClassUse_Packages.that.use.0", getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); Content table = (configuration.isOutputHtml5()) ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption); table.addContent(getSummaryTableHeader(packageTableHeader, "col")); Content tbody = new HtmlTree(HtmlTag.TBODY); boolean altColor = true; for (PackageElement pkg : pkgSet) { HtmlTree tr = new HtmlTree(HtmlTag.TR); tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); altColor = !altColor; addPackageUse(pkg, tr); tbody.addContent(tr); } table.addContent(tbody); Content li = HtmlTree.LI(HtmlStyle.blockList, table); contentTree.addContent(li); }
[ "protected", "void", "addPackageList", "(", "Content", "contentTree", ")", "{", "Content", "caption", "=", "getTableCaption", "(", "configuration", ".", "getContent", "(", "\"doclet.ClassUse_Packages.that.use.0\"", ",", "getLink", "(", "new", "LinkInfoImpl", "(", "configuration", ",", "LinkInfoImpl", ".", "Kind", ".", "CLASS_USE_HEADER", ",", "typeElement", ")", ")", ")", ")", ";", "Content", "table", "=", "(", "configuration", ".", "isOutputHtml5", "(", ")", ")", "?", "HtmlTree", ".", "TABLE", "(", "HtmlStyle", ".", "useSummary", ",", "caption", ")", ":", "HtmlTree", ".", "TABLE", "(", "HtmlStyle", ".", "useSummary", ",", "useTableSummary", ",", "caption", ")", ";", "table", ".", "addContent", "(", "getSummaryTableHeader", "(", "packageTableHeader", ",", "\"col\"", ")", ")", ";", "Content", "tbody", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "TBODY", ")", ";", "boolean", "altColor", "=", "true", ";", "for", "(", "PackageElement", "pkg", ":", "pkgSet", ")", "{", "HtmlTree", "tr", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "TR", ")", ";", "tr", ".", "addStyle", "(", "altColor", "?", "HtmlStyle", ".", "altColor", ":", "HtmlStyle", ".", "rowColor", ")", ";", "altColor", "=", "!", "altColor", ";", "addPackageUse", "(", "pkg", ",", "tr", ")", ";", "tbody", ".", "addContent", "(", "tr", ")", ";", "}", "table", ".", "addContent", "(", "tbody", ")", ";", "Content", "li", "=", "HtmlTree", ".", "LI", "(", "HtmlStyle", ".", "blockList", ",", "table", ")", ";", "contentTree", ".", "addContent", "(", "li", ")", ";", "}" ]
Add the packages elements that use the given class. @param contentTree the content tree to which the packages elements will be added
[ "Add", "the", "packages", "elements", "that", "use", "the", "given", "class", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java#L286-L307
5,308
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
ClassUseWriter.addPackageAnnotationList
protected void addPackageAnnotationList(Content contentTree) { if (!utils.isAnnotationType(typeElement) || pkgToPackageAnnotations == null || pkgToPackageAnnotations.isEmpty()) { return; } Content caption = getTableCaption(configuration.getContent( "doclet.ClassUse_PackageAnnotation", getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); Content table = (configuration.isOutputHtml5()) ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption); table.addContent(getSummaryTableHeader(packageTableHeader, "col")); Content tbody = new HtmlTree(HtmlTag.TBODY); boolean altColor = true; for (PackageElement pkg : pkgToPackageAnnotations) { HtmlTree tr = new HtmlTree(HtmlTag.TR); tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); altColor = !altColor; Content thFirst = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, getPackageLink(pkg)); tr.addContent(thFirst); HtmlTree tdLast = new HtmlTree(HtmlTag.TD); tdLast.addStyle(HtmlStyle.colLast); addSummaryComment(pkg, tdLast); tr.addContent(tdLast); tbody.addContent(tr); } table.addContent(tbody); Content li = HtmlTree.LI(HtmlStyle.blockList, table); contentTree.addContent(li); }
java
protected void addPackageAnnotationList(Content contentTree) { if (!utils.isAnnotationType(typeElement) || pkgToPackageAnnotations == null || pkgToPackageAnnotations.isEmpty()) { return; } Content caption = getTableCaption(configuration.getContent( "doclet.ClassUse_PackageAnnotation", getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); Content table = (configuration.isOutputHtml5()) ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption); table.addContent(getSummaryTableHeader(packageTableHeader, "col")); Content tbody = new HtmlTree(HtmlTag.TBODY); boolean altColor = true; for (PackageElement pkg : pkgToPackageAnnotations) { HtmlTree tr = new HtmlTree(HtmlTag.TR); tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); altColor = !altColor; Content thFirst = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, getPackageLink(pkg)); tr.addContent(thFirst); HtmlTree tdLast = new HtmlTree(HtmlTag.TD); tdLast.addStyle(HtmlStyle.colLast); addSummaryComment(pkg, tdLast); tr.addContent(tdLast); tbody.addContent(tr); } table.addContent(tbody); Content li = HtmlTree.LI(HtmlStyle.blockList, table); contentTree.addContent(li); }
[ "protected", "void", "addPackageAnnotationList", "(", "Content", "contentTree", ")", "{", "if", "(", "!", "utils", ".", "isAnnotationType", "(", "typeElement", ")", "||", "pkgToPackageAnnotations", "==", "null", "||", "pkgToPackageAnnotations", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "Content", "caption", "=", "getTableCaption", "(", "configuration", ".", "getContent", "(", "\"doclet.ClassUse_PackageAnnotation\"", ",", "getLink", "(", "new", "LinkInfoImpl", "(", "configuration", ",", "LinkInfoImpl", ".", "Kind", ".", "CLASS_USE_HEADER", ",", "typeElement", ")", ")", ")", ")", ";", "Content", "table", "=", "(", "configuration", ".", "isOutputHtml5", "(", ")", ")", "?", "HtmlTree", ".", "TABLE", "(", "HtmlStyle", ".", "useSummary", ",", "caption", ")", ":", "HtmlTree", ".", "TABLE", "(", "HtmlStyle", ".", "useSummary", ",", "useTableSummary", ",", "caption", ")", ";", "table", ".", "addContent", "(", "getSummaryTableHeader", "(", "packageTableHeader", ",", "\"col\"", ")", ")", ";", "Content", "tbody", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "TBODY", ")", ";", "boolean", "altColor", "=", "true", ";", "for", "(", "PackageElement", "pkg", ":", "pkgToPackageAnnotations", ")", "{", "HtmlTree", "tr", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "TR", ")", ";", "tr", ".", "addStyle", "(", "altColor", "?", "HtmlStyle", ".", "altColor", ":", "HtmlStyle", ".", "rowColor", ")", ";", "altColor", "=", "!", "altColor", ";", "Content", "thFirst", "=", "HtmlTree", ".", "TH_ROW_SCOPE", "(", "HtmlStyle", ".", "colFirst", ",", "getPackageLink", "(", "pkg", ")", ")", ";", "tr", ".", "addContent", "(", "thFirst", ")", ";", "HtmlTree", "tdLast", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "TD", ")", ";", "tdLast", ".", "addStyle", "(", "HtmlStyle", ".", "colLast", ")", ";", "addSummaryComment", "(", "pkg", ",", "tdLast", ")", ";", "tr", ".", "addContent", "(", "tdLast", ")", ";", "tbody", ".", "addContent", "(", "tr", ")", ";", "}", "table", ".", "addContent", "(", "tbody", ")", ";", "Content", "li", "=", "HtmlTree", ".", "LI", "(", "HtmlStyle", ".", "blockList", ",", "table", ")", ";", "contentTree", ".", "addContent", "(", "li", ")", ";", "}" ]
Add the package annotation elements. @param contentTree the content tree to which the package annotation elements will be added
[ "Add", "the", "package", "annotation", "elements", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java#L314-L345
5,309
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
SourceCodeAnalysisImpl.indexForPath
private ClassIndex indexForPath(Path path) { if (isJRTMarkerFile(path)) { FileSystem jrtfs = FileSystems.getFileSystem(URI.create("jrt:/")); Path modules = jrtfs.getPath("modules"); return PATH_TO_INDEX.compute(path, (p, index) -> { try { long lastModified = Files.getLastModifiedTime(modules).toMillis(); if (index == null || index.timestamp != lastModified) { try (DirectoryStream<Path> stream = Files.newDirectoryStream(modules)) { index = doIndex(lastModified, path, stream); } } return index; } catch (IOException ex) { proc.debug(ex, "SourceCodeAnalysisImpl.indexesForPath(" + path.toString() + ")"); return new ClassIndex(-1, path, Collections.emptySet(), Collections.emptyMap()); } }); } else if (!Files.isDirectory(path)) { if (Files.exists(path)) { return PATH_TO_INDEX.compute(path, (p, index) -> { try { long lastModified = Files.getLastModifiedTime(p).toMillis(); if (index == null || index.timestamp != lastModified) { ClassLoader cl = SourceCodeAnalysisImpl.class.getClassLoader(); try (FileSystem zip = FileSystems.newFileSystem(path, cl)) { index = doIndex(lastModified, path, zip.getRootDirectories()); } } return index; } catch (IOException ex) { proc.debug(ex, "SourceCodeAnalysisImpl.indexesForPath(" + path.toString() + ")"); return new ClassIndex(-1, path, Collections.emptySet(), Collections.emptyMap()); } }); } else { return new ClassIndex(-1, path, Collections.emptySet(), Collections.emptyMap()); } } else { return PATH_TO_INDEX.compute(path, (p, index) -> { //no persistence for directories, as we cannot check timestamps: if (index == null) { index = doIndex(-1, path, Arrays.asList(p)); } return index; }); } }
java
private ClassIndex indexForPath(Path path) { if (isJRTMarkerFile(path)) { FileSystem jrtfs = FileSystems.getFileSystem(URI.create("jrt:/")); Path modules = jrtfs.getPath("modules"); return PATH_TO_INDEX.compute(path, (p, index) -> { try { long lastModified = Files.getLastModifiedTime(modules).toMillis(); if (index == null || index.timestamp != lastModified) { try (DirectoryStream<Path> stream = Files.newDirectoryStream(modules)) { index = doIndex(lastModified, path, stream); } } return index; } catch (IOException ex) { proc.debug(ex, "SourceCodeAnalysisImpl.indexesForPath(" + path.toString() + ")"); return new ClassIndex(-1, path, Collections.emptySet(), Collections.emptyMap()); } }); } else if (!Files.isDirectory(path)) { if (Files.exists(path)) { return PATH_TO_INDEX.compute(path, (p, index) -> { try { long lastModified = Files.getLastModifiedTime(p).toMillis(); if (index == null || index.timestamp != lastModified) { ClassLoader cl = SourceCodeAnalysisImpl.class.getClassLoader(); try (FileSystem zip = FileSystems.newFileSystem(path, cl)) { index = doIndex(lastModified, path, zip.getRootDirectories()); } } return index; } catch (IOException ex) { proc.debug(ex, "SourceCodeAnalysisImpl.indexesForPath(" + path.toString() + ")"); return new ClassIndex(-1, path, Collections.emptySet(), Collections.emptyMap()); } }); } else { return new ClassIndex(-1, path, Collections.emptySet(), Collections.emptyMap()); } } else { return PATH_TO_INDEX.compute(path, (p, index) -> { //no persistence for directories, as we cannot check timestamps: if (index == null) { index = doIndex(-1, path, Arrays.asList(p)); } return index; }); } }
[ "private", "ClassIndex", "indexForPath", "(", "Path", "path", ")", "{", "if", "(", "isJRTMarkerFile", "(", "path", ")", ")", "{", "FileSystem", "jrtfs", "=", "FileSystems", ".", "getFileSystem", "(", "URI", ".", "create", "(", "\"jrt:/\"", ")", ")", ";", "Path", "modules", "=", "jrtfs", ".", "getPath", "(", "\"modules\"", ")", ";", "return", "PATH_TO_INDEX", ".", "compute", "(", "path", ",", "(", "p", ",", "index", ")", "->", "{", "try", "{", "long", "lastModified", "=", "Files", ".", "getLastModifiedTime", "(", "modules", ")", ".", "toMillis", "(", ")", ";", "if", "(", "index", "==", "null", "||", "index", ".", "timestamp", "!=", "lastModified", ")", "{", "try", "(", "DirectoryStream", "<", "Path", ">", "stream", "=", "Files", ".", "newDirectoryStream", "(", "modules", ")", ")", "{", "index", "=", "doIndex", "(", "lastModified", ",", "path", ",", "stream", ")", ";", "}", "}", "return", "index", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "proc", ".", "debug", "(", "ex", ",", "\"SourceCodeAnalysisImpl.indexesForPath(\"", "+", "path", ".", "toString", "(", ")", "+", "\")\"", ")", ";", "return", "new", "ClassIndex", "(", "-", "1", ",", "path", ",", "Collections", ".", "emptySet", "(", ")", ",", "Collections", ".", "emptyMap", "(", ")", ")", ";", "}", "}", ")", ";", "}", "else", "if", "(", "!", "Files", ".", "isDirectory", "(", "path", ")", ")", "{", "if", "(", "Files", ".", "exists", "(", "path", ")", ")", "{", "return", "PATH_TO_INDEX", ".", "compute", "(", "path", ",", "(", "p", ",", "index", ")", "->", "{", "try", "{", "long", "lastModified", "=", "Files", ".", "getLastModifiedTime", "(", "p", ")", ".", "toMillis", "(", ")", ";", "if", "(", "index", "==", "null", "||", "index", ".", "timestamp", "!=", "lastModified", ")", "{", "ClassLoader", "cl", "=", "SourceCodeAnalysisImpl", ".", "class", ".", "getClassLoader", "(", ")", ";", "try", "(", "FileSystem", "zip", "=", "FileSystems", ".", "newFileSystem", "(", "path", ",", "cl", ")", ")", "{", "index", "=", "doIndex", "(", "lastModified", ",", "path", ",", "zip", ".", "getRootDirectories", "(", ")", ")", ";", "}", "}", "return", "index", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "proc", ".", "debug", "(", "ex", ",", "\"SourceCodeAnalysisImpl.indexesForPath(\"", "+", "path", ".", "toString", "(", ")", "+", "\")\"", ")", ";", "return", "new", "ClassIndex", "(", "-", "1", ",", "path", ",", "Collections", ".", "emptySet", "(", ")", ",", "Collections", ".", "emptyMap", "(", ")", ")", ";", "}", "}", ")", ";", "}", "else", "{", "return", "new", "ClassIndex", "(", "-", "1", ",", "path", ",", "Collections", ".", "emptySet", "(", ")", ",", "Collections", ".", "emptyMap", "(", ")", ")", ";", "}", "}", "else", "{", "return", "PATH_TO_INDEX", ".", "compute", "(", "path", ",", "(", "p", ",", "index", ")", "->", "{", "//no persistence for directories, as we cannot check timestamps:", "if", "(", "index", "==", "null", ")", "{", "index", "=", "doIndex", "(", "-", "1", ",", "path", ",", "Arrays", ".", "asList", "(", "p", ")", ")", ";", "}", "return", "index", ";", "}", ")", ";", "}", "}" ]
if an index exists for the given entry, the existing index is kept unless the timestamp is modified
[ "if", "an", "index", "exists", "for", "the", "given", "entry", "the", "existing", "index", "is", "kept", "unless", "the", "timestamp", "is", "modified" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java#L1614-L1662
5,310
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
SourceCodeAnalysisImpl.doIndex
private ClassIndex doIndex(long timestamp, Path originalPath, Iterable<? extends Path> dirs) { Set<String> packages = new HashSet<>(); Map<String, Collection<String>> classSimpleName2FQN = new HashMap<>(); for (Path d : dirs) { try { Files.walkFileTree(d, new FileVisitor<Path>() { int depth; @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { waitIndexingNotSuspended(); if (depth++ == 0) return FileVisitResult.CONTINUE; String dirName = dir.getFileName().toString(); String sep = dir.getFileSystem().getSeparator(); dirName = dirName.endsWith(sep) ? dirName.substring(0, dirName.length() - sep.length()) : dirName; if (SourceVersion.isIdentifier(dirName)) return FileVisitResult.CONTINUE; return FileVisitResult.SKIP_SUBTREE; } @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { waitIndexingNotSuspended(); if (file.getFileName().toString().endsWith(".class")) { String relativePath = d.relativize(file).toString(); String binaryName = relativePath.substring(0, relativePath.length() - 6).replace('/', '.'); int packageDot = binaryName.lastIndexOf('.'); if (packageDot > (-1)) { packages.add(binaryName.substring(0, packageDot)); } String typeName = binaryName.replace('$', '.'); addClassName2Map(classSimpleName2FQN, typeName); } return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { depth--; return FileVisitResult.CONTINUE; } }); } catch (IOException ex) { proc.debug(ex, "doIndex(" + d.toString() + ")"); } } return new ClassIndex(timestamp, originalPath, packages, classSimpleName2FQN); }
java
private ClassIndex doIndex(long timestamp, Path originalPath, Iterable<? extends Path> dirs) { Set<String> packages = new HashSet<>(); Map<String, Collection<String>> classSimpleName2FQN = new HashMap<>(); for (Path d : dirs) { try { Files.walkFileTree(d, new FileVisitor<Path>() { int depth; @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { waitIndexingNotSuspended(); if (depth++ == 0) return FileVisitResult.CONTINUE; String dirName = dir.getFileName().toString(); String sep = dir.getFileSystem().getSeparator(); dirName = dirName.endsWith(sep) ? dirName.substring(0, dirName.length() - sep.length()) : dirName; if (SourceVersion.isIdentifier(dirName)) return FileVisitResult.CONTINUE; return FileVisitResult.SKIP_SUBTREE; } @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { waitIndexingNotSuspended(); if (file.getFileName().toString().endsWith(".class")) { String relativePath = d.relativize(file).toString(); String binaryName = relativePath.substring(0, relativePath.length() - 6).replace('/', '.'); int packageDot = binaryName.lastIndexOf('.'); if (packageDot > (-1)) { packages.add(binaryName.substring(0, packageDot)); } String typeName = binaryName.replace('$', '.'); addClassName2Map(classSimpleName2FQN, typeName); } return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { depth--; return FileVisitResult.CONTINUE; } }); } catch (IOException ex) { proc.debug(ex, "doIndex(" + d.toString() + ")"); } } return new ClassIndex(timestamp, originalPath, packages, classSimpleName2FQN); }
[ "private", "ClassIndex", "doIndex", "(", "long", "timestamp", ",", "Path", "originalPath", ",", "Iterable", "<", "?", "extends", "Path", ">", "dirs", ")", "{", "Set", "<", "String", ">", "packages", "=", "new", "HashSet", "<>", "(", ")", ";", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "classSimpleName2FQN", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "Path", "d", ":", "dirs", ")", "{", "try", "{", "Files", ".", "walkFileTree", "(", "d", ",", "new", "FileVisitor", "<", "Path", ">", "(", ")", "{", "int", "depth", ";", "@", "Override", "public", "FileVisitResult", "preVisitDirectory", "(", "Path", "dir", ",", "BasicFileAttributes", "attrs", ")", "throws", "IOException", "{", "waitIndexingNotSuspended", "(", ")", ";", "if", "(", "depth", "++", "==", "0", ")", "return", "FileVisitResult", ".", "CONTINUE", ";", "String", "dirName", "=", "dir", ".", "getFileName", "(", ")", ".", "toString", "(", ")", ";", "String", "sep", "=", "dir", ".", "getFileSystem", "(", ")", ".", "getSeparator", "(", ")", ";", "dirName", "=", "dirName", ".", "endsWith", "(", "sep", ")", "?", "dirName", ".", "substring", "(", "0", ",", "dirName", ".", "length", "(", ")", "-", "sep", ".", "length", "(", ")", ")", ":", "dirName", ";", "if", "(", "SourceVersion", ".", "isIdentifier", "(", "dirName", ")", ")", "return", "FileVisitResult", ".", "CONTINUE", ";", "return", "FileVisitResult", ".", "SKIP_SUBTREE", ";", "}", "@", "Override", "public", "FileVisitResult", "visitFile", "(", "Path", "file", ",", "BasicFileAttributes", "attrs", ")", "throws", "IOException", "{", "waitIndexingNotSuspended", "(", ")", ";", "if", "(", "file", ".", "getFileName", "(", ")", ".", "toString", "(", ")", ".", "endsWith", "(", "\".class\"", ")", ")", "{", "String", "relativePath", "=", "d", ".", "relativize", "(", "file", ")", ".", "toString", "(", ")", ";", "String", "binaryName", "=", "relativePath", ".", "substring", "(", "0", ",", "relativePath", ".", "length", "(", ")", "-", "6", ")", ".", "replace", "(", "'", "'", ",", "'", "'", ")", ";", "int", "packageDot", "=", "binaryName", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "packageDot", ">", "(", "-", "1", ")", ")", "{", "packages", ".", "add", "(", "binaryName", ".", "substring", "(", "0", ",", "packageDot", ")", ")", ";", "}", "String", "typeName", "=", "binaryName", ".", "replace", "(", "'", "'", ",", "'", "'", ")", ";", "addClassName2Map", "(", "classSimpleName2FQN", ",", "typeName", ")", ";", "}", "return", "FileVisitResult", ".", "CONTINUE", ";", "}", "@", "Override", "public", "FileVisitResult", "visitFileFailed", "(", "Path", "file", ",", "IOException", "exc", ")", "throws", "IOException", "{", "return", "FileVisitResult", ".", "CONTINUE", ";", "}", "@", "Override", "public", "FileVisitResult", "postVisitDirectory", "(", "Path", "dir", ",", "IOException", "exc", ")", "throws", "IOException", "{", "depth", "--", ";", "return", "FileVisitResult", ".", "CONTINUE", ";", "}", "}", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "proc", ".", "debug", "(", "ex", ",", "\"doIndex(\"", "+", "d", ".", "toString", "(", ")", "+", "\")\"", ")", ";", "}", "}", "return", "new", "ClassIndex", "(", "timestamp", ",", "originalPath", ",", "packages", ",", "classSimpleName2FQN", ")", ";", "}" ]
create an index based on the content of the given dirs; the original JavaFileManager entry is originalPath.
[ "create", "an", "index", "based", "on", "the", "content", "of", "the", "given", "dirs", ";", "the", "original", "JavaFileManager", "entry", "is", "originalPath", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java#L1669-L1721
5,311
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
HtmlWriter.escapeJavaScriptChars
private static String escapeJavaScriptChars(String s) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); switch (ch) { case '\b': sb.append("\\b"); break; case '\t': sb.append("\\t"); break; case '\n': sb.append("\\n"); break; case '\f': sb.append("\\f"); break; case '\r': sb.append("\\r"); break; case '"': sb.append("\\\""); break; case '\'': sb.append("\\\'"); break; case '\\': sb.append("\\\\"); break; default: if (ch < 32 || ch >= 127) { sb.append(String.format("\\u%04X", (int)ch)); } else { sb.append(ch); } break; } } return sb.toString(); }
java
private static String escapeJavaScriptChars(String s) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); switch (ch) { case '\b': sb.append("\\b"); break; case '\t': sb.append("\\t"); break; case '\n': sb.append("\\n"); break; case '\f': sb.append("\\f"); break; case '\r': sb.append("\\r"); break; case '"': sb.append("\\\""); break; case '\'': sb.append("\\\'"); break; case '\\': sb.append("\\\\"); break; default: if (ch < 32 || ch >= 127) { sb.append(String.format("\\u%04X", (int)ch)); } else { sb.append(ch); } break; } } return sb.toString(); }
[ "private", "static", "String", "escapeJavaScriptChars", "(", "String", "s", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "++", ")", "{", "char", "ch", "=", "s", ".", "charAt", "(", "i", ")", ";", "switch", "(", "ch", ")", "{", "case", "'", "'", ":", "sb", ".", "append", "(", "\"\\\\b\"", ")", ";", "break", ";", "case", "'", "'", ":", "sb", ".", "append", "(", "\"\\\\t\"", ")", ";", "break", ";", "case", "'", "'", ":", "sb", ".", "append", "(", "\"\\\\n\"", ")", ";", "break", ";", "case", "'", "'", ":", "sb", ".", "append", "(", "\"\\\\f\"", ")", ";", "break", ";", "case", "'", "'", ":", "sb", ".", "append", "(", "\"\\\\r\"", ")", ";", "break", ";", "case", "'", "'", ":", "sb", ".", "append", "(", "\"\\\\\\\"\"", ")", ";", "break", ";", "case", "'", "'", ":", "sb", ".", "append", "(", "\"\\\\\\'\"", ")", ";", "break", ";", "case", "'", "'", ":", "sb", ".", "append", "(", "\"\\\\\\\\\"", ")", ";", "break", ";", "default", ":", "if", "(", "ch", "<", "32", "||", "ch", ">=", "127", ")", "{", "sb", ".", "append", "(", "String", ".", "format", "(", "\"\\\\u%04X\"", ",", "(", "int", ")", "ch", ")", ")", ";", "}", "else", "{", "sb", ".", "append", "(", "ch", ")", ";", "}", "break", ";", "}", "}", "return", "sb", ".", "toString", "(", ")", ";", "}" ]
Returns a String with escaped special JavaScript characters. @param s String that needs to be escaped @return a valid escaped JavaScript string
[ "Returns", "a", "String", "with", "escaped", "special", "JavaScript", "characters", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java#L200-L239
5,312
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
HtmlWriter.getBody
public HtmlTree getBody(boolean includeScript, String title) { HtmlTree body = new HtmlTree(HtmlTag.BODY); // Set window title string which is later printed this.winTitle = title; // Don't print windowtitle script for overview-frame, allclasses-frame // and package-frame if (includeScript) { this.script = getWinTitleScript(); body.addContent(script); Content noScript = HtmlTree.NOSCRIPT( HtmlTree.DIV(configuration.getContent("doclet.No_Script_Message"))); body.addContent(noScript); } return body; }
java
public HtmlTree getBody(boolean includeScript, String title) { HtmlTree body = new HtmlTree(HtmlTag.BODY); // Set window title string which is later printed this.winTitle = title; // Don't print windowtitle script for overview-frame, allclasses-frame // and package-frame if (includeScript) { this.script = getWinTitleScript(); body.addContent(script); Content noScript = HtmlTree.NOSCRIPT( HtmlTree.DIV(configuration.getContent("doclet.No_Script_Message"))); body.addContent(noScript); } return body; }
[ "public", "HtmlTree", "getBody", "(", "boolean", "includeScript", ",", "String", "title", ")", "{", "HtmlTree", "body", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "BODY", ")", ";", "// Set window title string which is later printed", "this", ".", "winTitle", "=", "title", ";", "// Don't print windowtitle script for overview-frame, allclasses-frame", "// and package-frame", "if", "(", "includeScript", ")", "{", "this", ".", "script", "=", "getWinTitleScript", "(", ")", ";", "body", ".", "addContent", "(", "script", ")", ";", "Content", "noScript", "=", "HtmlTree", ".", "NOSCRIPT", "(", "HtmlTree", ".", "DIV", "(", "configuration", ".", "getContent", "(", "\"doclet.No_Script_Message\"", ")", ")", ")", ";", "body", ".", "addContent", "(", "noScript", ")", ";", "}", "return", "body", ";", "}" ]
Returns an HtmlTree for the BODY tag. @param includeScript set true if printing windowtitle script @param title title for the window @return an HtmlTree for the BODY tag
[ "Returns", "an", "HtmlTree", "for", "the", "BODY", "tag", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java#L312-L326
5,313
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
HtmlWriter.addStyles
public void addStyles(HtmlStyle style, StringBuilder vars) { vars.append("var ").append(style).append(" = \"").append(style) .append("\";").append(DocletConstants.NL); }
java
public void addStyles(HtmlStyle style, StringBuilder vars) { vars.append("var ").append(style).append(" = \"").append(style) .append("\";").append(DocletConstants.NL); }
[ "public", "void", "addStyles", "(", "HtmlStyle", "style", ",", "StringBuilder", "vars", ")", "{", "vars", ".", "append", "(", "\"var \"", ")", ".", "append", "(", "style", ")", ".", "append", "(", "\" = \\\"\"", ")", ".", "append", "(", "style", ")", ".", "append", "(", "\"\\\";\"", ")", ".", "append", "(", "DocletConstants", ".", "NL", ")", ";", "}" ]
Adds javascript style variables to the document. @param style style to be added as a javascript variable @param vars variable string to which the style variable will be added
[ "Adds", "javascript", "style", "variables", "to", "the", "document", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java#L381-L384
5,314
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java
JdepsTask.dependencyFilter
private JdepsFilter dependencyFilter(JdepsConfiguration config) { // Filter specified by -filter, -package, -regex, and --require options JdepsFilter.Builder builder = new JdepsFilter.Builder(); // source filters builder.includePattern(options.includePattern); // target filters builder.filter(options.filterSamePackage, options.filterSameArchive); builder.findJDKInternals(options.findJDKInternals); // --require if (!options.requires.isEmpty()) { options.requires.stream() .forEach(mn -> { Module m = config.findModule(mn).get(); builder.requires(mn, m.packages()); }); } // -regex if (options.regex != null) builder.regex(options.regex); // -package if (!options.packageNames.isEmpty()) builder.packages(options.packageNames); // -filter if (options.filterRegex != null) builder.filter(options.filterRegex); return builder.build(); }
java
private JdepsFilter dependencyFilter(JdepsConfiguration config) { // Filter specified by -filter, -package, -regex, and --require options JdepsFilter.Builder builder = new JdepsFilter.Builder(); // source filters builder.includePattern(options.includePattern); // target filters builder.filter(options.filterSamePackage, options.filterSameArchive); builder.findJDKInternals(options.findJDKInternals); // --require if (!options.requires.isEmpty()) { options.requires.stream() .forEach(mn -> { Module m = config.findModule(mn).get(); builder.requires(mn, m.packages()); }); } // -regex if (options.regex != null) builder.regex(options.regex); // -package if (!options.packageNames.isEmpty()) builder.packages(options.packageNames); // -filter if (options.filterRegex != null) builder.filter(options.filterRegex); return builder.build(); }
[ "private", "JdepsFilter", "dependencyFilter", "(", "JdepsConfiguration", "config", ")", "{", "// Filter specified by -filter, -package, -regex, and --require options", "JdepsFilter", ".", "Builder", "builder", "=", "new", "JdepsFilter", ".", "Builder", "(", ")", ";", "// source filters", "builder", ".", "includePattern", "(", "options", ".", "includePattern", ")", ";", "// target filters", "builder", ".", "filter", "(", "options", ".", "filterSamePackage", ",", "options", ".", "filterSameArchive", ")", ";", "builder", ".", "findJDKInternals", "(", "options", ".", "findJDKInternals", ")", ";", "// --require", "if", "(", "!", "options", ".", "requires", ".", "isEmpty", "(", ")", ")", "{", "options", ".", "requires", ".", "stream", "(", ")", ".", "forEach", "(", "mn", "->", "{", "Module", "m", "=", "config", ".", "findModule", "(", "mn", ")", ".", "get", "(", ")", ";", "builder", ".", "requires", "(", "mn", ",", "m", ".", "packages", "(", ")", ")", ";", "}", ")", ";", "}", "// -regex", "if", "(", "options", ".", "regex", "!=", "null", ")", "builder", ".", "regex", "(", "options", ".", "regex", ")", ";", "// -package", "if", "(", "!", "options", ".", "packageNames", ".", "isEmpty", "(", ")", ")", "builder", ".", "packages", "(", "options", ".", "packageNames", ")", ";", "// -filter", "if", "(", "options", ".", "filterRegex", "!=", "null", ")", "builder", ".", "filter", "(", "options", ".", "filterRegex", ")", ";", "return", "builder", ".", "build", "(", ")", ";", "}" ]
Returns a filter used during dependency analysis
[ "Returns", "a", "filter", "used", "during", "dependency", "analysis" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java#L1046-L1076
5,315
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java
DocFile.read
private static int read(DocFile inFile, InputStream input, byte[] buf) throws DocFileIOException { try { return input.read(buf); } catch (IOException e) { throw new DocFileIOException(inFile, DocFileIOException.Mode.READ, e); } }
java
private static int read(DocFile inFile, InputStream input, byte[] buf) throws DocFileIOException { try { return input.read(buf); } catch (IOException e) { throw new DocFileIOException(inFile, DocFileIOException.Mode.READ, e); } }
[ "private", "static", "int", "read", "(", "DocFile", "inFile", ",", "InputStream", "input", ",", "byte", "[", "]", "buf", ")", "throws", "DocFileIOException", "{", "try", "{", "return", "input", ".", "read", "(", "buf", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "DocFileIOException", "(", "inFile", ",", "DocFileIOException", ".", "Mode", ".", "READ", ",", "e", ")", ";", "}", "}" ]
Reads from an input stream opened from a given file into a given buffer. If an IOException occurs, it is wrapped in a DocFileIOException. @param inFile the file for the stream @param input the stream @param buf the buffer @return the number of bytes read, or -1 if at end of file @throws DocFileIOException if an exception occurred while reading the stream
[ "Reads", "from", "an", "input", "stream", "opened", "from", "a", "given", "file", "into", "a", "given", "buffer", ".", "If", "an", "IOException", "occurs", "it", "is", "wrapped", "in", "a", "DocFileIOException", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java#L283-L289
5,316
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java
DocFile.write
private static void write(DocFile outFile, OutputStream out, byte[] buf, int len) throws DocFileIOException { try { out.write(buf, 0, len); } catch (IOException e) { throw new DocFileIOException(outFile, DocFileIOException.Mode.WRITE, e); } }
java
private static void write(DocFile outFile, OutputStream out, byte[] buf, int len) throws DocFileIOException { try { out.write(buf, 0, len); } catch (IOException e) { throw new DocFileIOException(outFile, DocFileIOException.Mode.WRITE, e); } }
[ "private", "static", "void", "write", "(", "DocFile", "outFile", ",", "OutputStream", "out", ",", "byte", "[", "]", "buf", ",", "int", "len", ")", "throws", "DocFileIOException", "{", "try", "{", "out", ".", "write", "(", "buf", ",", "0", ",", "len", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "DocFileIOException", "(", "outFile", ",", "DocFileIOException", ".", "Mode", ".", "WRITE", ",", "e", ")", ";", "}", "}" ]
Writes to an output stream for a given file from a given buffer. If an IOException occurs, it is wrapped in a DocFileIOException. @param outFile the file for the stream @param out the stream @param buf the buffer @throws DocFileIOException if an exception occurred while writing the stream
[ "Writes", "to", "an", "output", "stream", "for", "a", "given", "file", "from", "a", "given", "buffer", ".", "If", "an", "IOException", "occurs", "it", "is", "wrapped", "in", "a", "DocFileIOException", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java#L300-L306
5,317
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java
DocFile.write
private static void write(DocFile outFile, Writer out, String text) throws DocFileIOException { try { out.write(text); } catch (IOException e) { throw new DocFileIOException(outFile, DocFileIOException.Mode.WRITE, e); } }
java
private static void write(DocFile outFile, Writer out, String text) throws DocFileIOException { try { out.write(text); } catch (IOException e) { throw new DocFileIOException(outFile, DocFileIOException.Mode.WRITE, e); } }
[ "private", "static", "void", "write", "(", "DocFile", "outFile", ",", "Writer", "out", ",", "String", "text", ")", "throws", "DocFileIOException", "{", "try", "{", "out", ".", "write", "(", "text", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "DocFileIOException", "(", "outFile", ",", "DocFileIOException", ".", "Mode", ".", "WRITE", ",", "e", ")", ";", "}", "}" ]
Writes text to an output stream for a given file from a given buffer. If an IOException occurs, it is wrapped in a DocFileIOException. @param outFile the file for the stream @param out the stream @param text the text to be written @throws DocFileIOException if an exception occurred while writing the stream
[ "Writes", "text", "to", "an", "output", "stream", "for", "a", "given", "file", "from", "a", "given", "buffer", ".", "If", "an", "IOException", "occurs", "it", "is", "wrapped", "in", "a", "DocFileIOException", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java#L317-L323
5,318
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java
DocFile.readResource
private static int readResource(DocPath resource, InputStream in, byte[] buf) throws ResourceIOException { try { return in.read(buf); } catch (IOException e) { throw new ResourceIOException(resource, e); } }
java
private static int readResource(DocPath resource, InputStream in, byte[] buf) throws ResourceIOException { try { return in.read(buf); } catch (IOException e) { throw new ResourceIOException(resource, e); } }
[ "private", "static", "int", "readResource", "(", "DocPath", "resource", ",", "InputStream", "in", ",", "byte", "[", "]", "buf", ")", "throws", "ResourceIOException", "{", "try", "{", "return", "in", ".", "read", "(", "buf", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "ResourceIOException", "(", "resource", ",", "e", ")", ";", "}", "}" ]
Reads from an input stream opened from a given resource into a given buffer. If an IOException occurs, it is wrapped in a ResourceIOException. @param resource the resource for the stream @param in the stream @param buf the buffer @return the number of bytes read, or -1 if at end of file @throws ResourceIOException if an exception occurred while reading the stream
[ "Reads", "from", "an", "input", "stream", "opened", "from", "a", "given", "resource", "into", "a", "given", "buffer", ".", "If", "an", "IOException", "occurs", "it", "is", "wrapped", "in", "a", "ResourceIOException", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java#L335-L341
5,319
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java
DocFile.readResourceLine
private static String readResourceLine(DocPath docPath, BufferedReader in) throws ResourceIOException { try { return in.readLine(); } catch (IOException e) { throw new ResourceIOException(docPath, e); } }
java
private static String readResourceLine(DocPath docPath, BufferedReader in) throws ResourceIOException { try { return in.readLine(); } catch (IOException e) { throw new ResourceIOException(docPath, e); } }
[ "private", "static", "String", "readResourceLine", "(", "DocPath", "docPath", ",", "BufferedReader", "in", ")", "throws", "ResourceIOException", "{", "try", "{", "return", "in", ".", "readLine", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "ResourceIOException", "(", "docPath", ",", "e", ")", ";", "}", "}" ]
Reads a line of characters from an input stream opened from a given resource. If an IOException occurs, it is wrapped in a ResourceIOException. @param resource the resource for the stream @param in the stream @return the line of text, or {@code null} if at end of stream @throws ResourceIOException if an exception occurred while reading the stream
[ "Reads", "a", "line", "of", "characters", "from", "an", "input", "stream", "opened", "from", "a", "given", "resource", ".", "If", "an", "IOException", "occurs", "it", "is", "wrapped", "in", "a", "ResourceIOException", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java#L352-L358
5,320
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java
AnnotationProxyMaker.generateAnnotation
public static <A extends Annotation> A generateAnnotation( Attribute.Compound anno, Class<A> annoType) { AnnotationProxyMaker apm = new AnnotationProxyMaker(anno, annoType); return annoType.cast(apm.generateAnnotation()); }
java
public static <A extends Annotation> A generateAnnotation( Attribute.Compound anno, Class<A> annoType) { AnnotationProxyMaker apm = new AnnotationProxyMaker(anno, annoType); return annoType.cast(apm.generateAnnotation()); }
[ "public", "static", "<", "A", "extends", "Annotation", ">", "A", "generateAnnotation", "(", "Attribute", ".", "Compound", "anno", ",", "Class", "<", "A", ">", "annoType", ")", "{", "AnnotationProxyMaker", "apm", "=", "new", "AnnotationProxyMaker", "(", "anno", ",", "annoType", ")", ";", "return", "annoType", ".", "cast", "(", "apm", ".", "generateAnnotation", "(", ")", ")", ";", "}" ]
Returns a dynamic proxy for an annotation mirror.
[ "Returns", "a", "dynamic", "proxy", "for", "an", "annotation", "mirror", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java#L78-L82
5,321
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java
AnnotationProxyMaker.getAllReflectedValues
private Map<String, Object> getAllReflectedValues() { Map<String, Object> res = new LinkedHashMap<>(); for (Map.Entry<MethodSymbol, Attribute> entry : getAllValues().entrySet()) { MethodSymbol meth = entry.getKey(); Object value = generateValue(meth, entry.getValue()); if (value != null) { res.put(meth.name.toString(), value); } else { // Ignore this element. May (properly) lead to // IncompleteAnnotationException somewhere down the line. } } return res; }
java
private Map<String, Object> getAllReflectedValues() { Map<String, Object> res = new LinkedHashMap<>(); for (Map.Entry<MethodSymbol, Attribute> entry : getAllValues().entrySet()) { MethodSymbol meth = entry.getKey(); Object value = generateValue(meth, entry.getValue()); if (value != null) { res.put(meth.name.toString(), value); } else { // Ignore this element. May (properly) lead to // IncompleteAnnotationException somewhere down the line. } } return res; }
[ "private", "Map", "<", "String", ",", "Object", ">", "getAllReflectedValues", "(", ")", "{", "Map", "<", "String", ",", "Object", ">", "res", "=", "new", "LinkedHashMap", "<>", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "MethodSymbol", ",", "Attribute", ">", "entry", ":", "getAllValues", "(", ")", ".", "entrySet", "(", ")", ")", "{", "MethodSymbol", "meth", "=", "entry", ".", "getKey", "(", ")", ";", "Object", "value", "=", "generateValue", "(", "meth", ",", "entry", ".", "getValue", "(", ")", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "res", ".", "put", "(", "meth", ".", "name", ".", "toString", "(", ")", ",", "value", ")", ";", "}", "else", "{", "// Ignore this element. May (properly) lead to", "// IncompleteAnnotationException somewhere down the line.", "}", "}", "return", "res", ";", "}" ]
Returns a map from element names to their values in "dynamic proxy return form". Includes all elements, whether explicit or defaulted.
[ "Returns", "a", "map", "from", "element", "names", "to", "their", "values", "in", "dynamic", "proxy", "return", "form", ".", "Includes", "all", "elements", "whether", "explicit", "or", "defaulted", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java#L98-L113
5,322
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java
AnnotationProxyMaker.generateValue
private Object generateValue(MethodSymbol meth, Attribute attr) { ValueVisitor vv = new ValueVisitor(meth); return vv.getValue(attr); }
java
private Object generateValue(MethodSymbol meth, Attribute attr) { ValueVisitor vv = new ValueVisitor(meth); return vv.getValue(attr); }
[ "private", "Object", "generateValue", "(", "MethodSymbol", "meth", ",", "Attribute", "attr", ")", "{", "ValueVisitor", "vv", "=", "new", "ValueVisitor", "(", "meth", ")", ";", "return", "vv", ".", "getValue", "(", "attr", ")", ";", "}" ]
Converts an element value to its "dynamic proxy return form". Returns an exception proxy on some errors, but may return null if a useful exception cannot or should not be generated at this point.
[ "Converts", "an", "element", "value", "to", "its", "dynamic", "proxy", "return", "form", ".", "Returns", "an", "exception", "proxy", "on", "some", "errors", "but", "may", "return", "null", "if", "a", "useful", "exception", "cannot", "or", "should", "not", "be", "generated", "at", "this", "point", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java#L143-L146
5,323
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
TagletManager.checkTagName
private void checkTagName(String name) { if (standardTags.contains(name)) { overridenStandardTags.add(name); } else { if (name.indexOf('.') == -1) { potentiallyConflictingTags.add(name); } unseenCustomTags.add(name); } }
java
private void checkTagName(String name) { if (standardTags.contains(name)) { overridenStandardTags.add(name); } else { if (name.indexOf('.') == -1) { potentiallyConflictingTags.add(name); } unseenCustomTags.add(name); } }
[ "private", "void", "checkTagName", "(", "String", "name", ")", "{", "if", "(", "standardTags", ".", "contains", "(", "name", ")", ")", "{", "overridenStandardTags", ".", "add", "(", "name", ")", ";", "}", "else", "{", "if", "(", "name", ".", "indexOf", "(", "'", "'", ")", "==", "-", "1", ")", "{", "potentiallyConflictingTags", ".", "add", "(", "name", ")", ";", "}", "unseenCustomTags", ".", "add", "(", "name", ")", ";", "}", "}" ]
Given a tag name, add it to the set of tags it belongs to.
[ "Given", "a", "tag", "name", "add", "it", "to", "the", "set", "of", "tags", "it", "belongs", "to", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java#L374-L383
5,324
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
TagletManager.initCustomTagletArrays
private void initCustomTagletArrays() { Iterator<Taglet> it = customTags.values().iterator(); ArrayList<Taglet> pTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> tTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> fTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> cTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> mTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> iTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> oTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> sTags = new ArrayList<>(); Taglet current; while (it.hasNext()) { current = it.next(); if (current.inPackage() && !current.isInlineTag()) { pTags.add(current); } if (current.inType() && !current.isInlineTag()) { tTags.add(current); } if (current.inField() && !current.isInlineTag()) { fTags.add(current); } if (current.inConstructor() && !current.isInlineTag()) { cTags.add(current); } if (current.inMethod() && !current.isInlineTag()) { mTags.add(current); } if (current.isInlineTag()) { iTags.add(current); } if (current.inOverview() && !current.isInlineTag()) { oTags.add(current); } } packageTags = pTags.toArray(new Taglet[] {}); typeTags = tTags.toArray(new Taglet[] {}); fieldTags = fTags.toArray(new Taglet[] {}); constructorTags = cTags.toArray(new Taglet[] {}); methodTags = mTags.toArray(new Taglet[] {}); overviewTags = oTags.toArray(new Taglet[] {}); inlineTags = iTags.toArray(new Taglet[] {}); //Init the serialized form tags sTags.add(customTags.get("serialData")); sTags.add(customTags.get("throws")); if (!nosince) sTags.add(customTags.get("since")); sTags.add(customTags.get("see")); serializedFormTags = sTags.toArray(new Taglet[] {}); }
java
private void initCustomTagletArrays() { Iterator<Taglet> it = customTags.values().iterator(); ArrayList<Taglet> pTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> tTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> fTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> cTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> mTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> iTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> oTags = new ArrayList<>(customTags.size()); ArrayList<Taglet> sTags = new ArrayList<>(); Taglet current; while (it.hasNext()) { current = it.next(); if (current.inPackage() && !current.isInlineTag()) { pTags.add(current); } if (current.inType() && !current.isInlineTag()) { tTags.add(current); } if (current.inField() && !current.isInlineTag()) { fTags.add(current); } if (current.inConstructor() && !current.isInlineTag()) { cTags.add(current); } if (current.inMethod() && !current.isInlineTag()) { mTags.add(current); } if (current.isInlineTag()) { iTags.add(current); } if (current.inOverview() && !current.isInlineTag()) { oTags.add(current); } } packageTags = pTags.toArray(new Taglet[] {}); typeTags = tTags.toArray(new Taglet[] {}); fieldTags = fTags.toArray(new Taglet[] {}); constructorTags = cTags.toArray(new Taglet[] {}); methodTags = mTags.toArray(new Taglet[] {}); overviewTags = oTags.toArray(new Taglet[] {}); inlineTags = iTags.toArray(new Taglet[] {}); //Init the serialized form tags sTags.add(customTags.get("serialData")); sTags.add(customTags.get("throws")); if (!nosince) sTags.add(customTags.get("since")); sTags.add(customTags.get("see")); serializedFormTags = sTags.toArray(new Taglet[] {}); }
[ "private", "void", "initCustomTagletArrays", "(", ")", "{", "Iterator", "<", "Taglet", ">", "it", "=", "customTags", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "ArrayList", "<", "Taglet", ">", "pTags", "=", "new", "ArrayList", "<>", "(", "customTags", ".", "size", "(", ")", ")", ";", "ArrayList", "<", "Taglet", ">", "tTags", "=", "new", "ArrayList", "<>", "(", "customTags", ".", "size", "(", ")", ")", ";", "ArrayList", "<", "Taglet", ">", "fTags", "=", "new", "ArrayList", "<>", "(", "customTags", ".", "size", "(", ")", ")", ";", "ArrayList", "<", "Taglet", ">", "cTags", "=", "new", "ArrayList", "<>", "(", "customTags", ".", "size", "(", ")", ")", ";", "ArrayList", "<", "Taglet", ">", "mTags", "=", "new", "ArrayList", "<>", "(", "customTags", ".", "size", "(", ")", ")", ";", "ArrayList", "<", "Taglet", ">", "iTags", "=", "new", "ArrayList", "<>", "(", "customTags", ".", "size", "(", ")", ")", ";", "ArrayList", "<", "Taglet", ">", "oTags", "=", "new", "ArrayList", "<>", "(", "customTags", ".", "size", "(", ")", ")", ";", "ArrayList", "<", "Taglet", ">", "sTags", "=", "new", "ArrayList", "<>", "(", ")", ";", "Taglet", "current", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "current", "=", "it", ".", "next", "(", ")", ";", "if", "(", "current", ".", "inPackage", "(", ")", "&&", "!", "current", ".", "isInlineTag", "(", ")", ")", "{", "pTags", ".", "add", "(", "current", ")", ";", "}", "if", "(", "current", ".", "inType", "(", ")", "&&", "!", "current", ".", "isInlineTag", "(", ")", ")", "{", "tTags", ".", "add", "(", "current", ")", ";", "}", "if", "(", "current", ".", "inField", "(", ")", "&&", "!", "current", ".", "isInlineTag", "(", ")", ")", "{", "fTags", ".", "add", "(", "current", ")", ";", "}", "if", "(", "current", ".", "inConstructor", "(", ")", "&&", "!", "current", ".", "isInlineTag", "(", ")", ")", "{", "cTags", ".", "add", "(", "current", ")", ";", "}", "if", "(", "current", ".", "inMethod", "(", ")", "&&", "!", "current", ".", "isInlineTag", "(", ")", ")", "{", "mTags", ".", "add", "(", "current", ")", ";", "}", "if", "(", "current", ".", "isInlineTag", "(", ")", ")", "{", "iTags", ".", "add", "(", "current", ")", ";", "}", "if", "(", "current", ".", "inOverview", "(", ")", "&&", "!", "current", ".", "isInlineTag", "(", ")", ")", "{", "oTags", ".", "add", "(", "current", ")", ";", "}", "}", "packageTags", "=", "pTags", ".", "toArray", "(", "new", "Taglet", "[", "]", "{", "}", ")", ";", "typeTags", "=", "tTags", ".", "toArray", "(", "new", "Taglet", "[", "]", "{", "}", ")", ";", "fieldTags", "=", "fTags", ".", "toArray", "(", "new", "Taglet", "[", "]", "{", "}", ")", ";", "constructorTags", "=", "cTags", ".", "toArray", "(", "new", "Taglet", "[", "]", "{", "}", ")", ";", "methodTags", "=", "mTags", ".", "toArray", "(", "new", "Taglet", "[", "]", "{", "}", ")", ";", "overviewTags", "=", "oTags", ".", "toArray", "(", "new", "Taglet", "[", "]", "{", "}", ")", ";", "inlineTags", "=", "iTags", ".", "toArray", "(", "new", "Taglet", "[", "]", "{", "}", ")", ";", "//Init the serialized form tags", "sTags", ".", "add", "(", "customTags", ".", "get", "(", "\"serialData\"", ")", ")", ";", "sTags", ".", "add", "(", "customTags", ".", "get", "(", "\"throws\"", ")", ")", ";", "if", "(", "!", "nosince", ")", "sTags", ".", "add", "(", "customTags", ".", "get", "(", "\"since\"", ")", ")", ";", "sTags", ".", "add", "(", "customTags", ".", "get", "(", "\"see\"", ")", ")", ";", "serializedFormTags", "=", "sTags", ".", "toArray", "(", "new", "Taglet", "[", "]", "{", "}", ")", ";", "}" ]
Initialize the custom tag arrays.
[ "Initialize", "the", "custom", "tag", "arrays", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java#L632-L682
5,325
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
TagletManager.initJavaFXTaglets
private void initJavaFXTaglets() { addStandardTaglet(new PropertyGetterTaglet()); addStandardTaglet(new PropertySetterTaglet()); addStandardTaglet(new SimpleTaglet("propertyDescription", message.getText("doclet.PropertyDescription"), SimpleTaglet.FIELD + SimpleTaglet.METHOD)); addStandardTaglet(new SimpleTaglet("defaultValue", message.getText("doclet.DefaultValue"), SimpleTaglet.FIELD + SimpleTaglet.METHOD)); addStandardTaglet(new SimpleTaglet("treatAsPrivate", null, SimpleTaglet.FIELD + SimpleTaglet.METHOD + SimpleTaglet.TYPE)); }
java
private void initJavaFXTaglets() { addStandardTaglet(new PropertyGetterTaglet()); addStandardTaglet(new PropertySetterTaglet()); addStandardTaglet(new SimpleTaglet("propertyDescription", message.getText("doclet.PropertyDescription"), SimpleTaglet.FIELD + SimpleTaglet.METHOD)); addStandardTaglet(new SimpleTaglet("defaultValue", message.getText("doclet.DefaultValue"), SimpleTaglet.FIELD + SimpleTaglet.METHOD)); addStandardTaglet(new SimpleTaglet("treatAsPrivate", null, SimpleTaglet.FIELD + SimpleTaglet.METHOD + SimpleTaglet.TYPE)); }
[ "private", "void", "initJavaFXTaglets", "(", ")", "{", "addStandardTaglet", "(", "new", "PropertyGetterTaglet", "(", ")", ")", ";", "addStandardTaglet", "(", "new", "PropertySetterTaglet", "(", ")", ")", ";", "addStandardTaglet", "(", "new", "SimpleTaglet", "(", "\"propertyDescription\"", ",", "message", ".", "getText", "(", "\"doclet.PropertyDescription\"", ")", ",", "SimpleTaglet", ".", "FIELD", "+", "SimpleTaglet", ".", "METHOD", ")", ")", ";", "addStandardTaglet", "(", "new", "SimpleTaglet", "(", "\"defaultValue\"", ",", "message", ".", "getText", "(", "\"doclet.DefaultValue\"", ")", ",", "SimpleTaglet", ".", "FIELD", "+", "SimpleTaglet", ".", "METHOD", ")", ")", ";", "addStandardTaglet", "(", "new", "SimpleTaglet", "(", "\"treatAsPrivate\"", ",", "null", ",", "SimpleTaglet", ".", "FIELD", "+", "SimpleTaglet", ".", "METHOD", "+", "SimpleTaglet", ".", "TYPE", ")", ")", ";", "}" ]
Initialize JavaFX-related tags.
[ "Initialize", "JavaFX", "-", "related", "tags", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java#L731-L741
5,326
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
TagletManager.getTaglet
public Taglet getTaglet(String name) { if (name.indexOf("@") == 0) { return customTags.get(name.substring(1)); } else { return customTags.get(name); } }
java
public Taglet getTaglet(String name) { if (name.indexOf("@") == 0) { return customTags.get(name.substring(1)); } else { return customTags.get(name); } }
[ "public", "Taglet", "getTaglet", "(", "String", "name", ")", "{", "if", "(", "name", ".", "indexOf", "(", "\"@\"", ")", "==", "0", ")", "{", "return", "customTags", ".", "get", "(", "name", ".", "substring", "(", "1", ")", ")", ";", "}", "else", "{", "return", "customTags", ".", "get", "(", "name", ")", ";", "}", "}" ]
Given the name of a tag, return the corresponding taglet. Return null if the tag is unknown. @param name the name of the taglet to retrieve. @return return the corresponding taglet. Return null if the tag is unknown.
[ "Given", "the", "name", "of", "a", "tag", "return", "the", "corresponding", "taglet", ".", "Return", "null", "if", "the", "tag", "is", "unknown", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java#L802-L809
5,327
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java
HtmlSerialFieldWriter.getFieldsContentHeader
public Content getFieldsContentHeader(boolean isLastContent) { HtmlTree li = new HtmlTree(HtmlTag.LI); if (isLastContent) li.addStyle(HtmlStyle.blockListLast); else li.addStyle(HtmlStyle.blockList); return li; }
java
public Content getFieldsContentHeader(boolean isLastContent) { HtmlTree li = new HtmlTree(HtmlTag.LI); if (isLastContent) li.addStyle(HtmlStyle.blockListLast); else li.addStyle(HtmlStyle.blockList); return li; }
[ "public", "Content", "getFieldsContentHeader", "(", "boolean", "isLastContent", ")", "{", "HtmlTree", "li", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "LI", ")", ";", "if", "(", "isLastContent", ")", "li", ".", "addStyle", "(", "HtmlStyle", ".", "blockListLast", ")", ";", "else", "li", ".", "addStyle", "(", "HtmlStyle", ".", "blockList", ")", ";", "return", "li", ";", "}" ]
Return the header for serializable fields content section. @param isLastContent true if the cotent being documented is the last content. @return a content tree for the header
[ "Return", "the", "header", "for", "serializable", "fields", "content", "section", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java#L79-L86
5,328
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java
HtmlSerialFieldWriter.getSerializableFields
public Content getSerializableFields(String heading, Content serializableFieldsTree) { HtmlTree li = new HtmlTree(HtmlTag.LI); li.addStyle(HtmlStyle.blockList); if (serializableFieldsTree.isValid()) { Content headingContent = new StringContent(heading); Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, headingContent); li.addContent(serialHeading); li.addContent(serializableFieldsTree); } return li; }
java
public Content getSerializableFields(String heading, Content serializableFieldsTree) { HtmlTree li = new HtmlTree(HtmlTag.LI); li.addStyle(HtmlStyle.blockList); if (serializableFieldsTree.isValid()) { Content headingContent = new StringContent(heading); Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, headingContent); li.addContent(serialHeading); li.addContent(serializableFieldsTree); } return li; }
[ "public", "Content", "getSerializableFields", "(", "String", "heading", ",", "Content", "serializableFieldsTree", ")", "{", "HtmlTree", "li", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "LI", ")", ";", "li", ".", "addStyle", "(", "HtmlStyle", ".", "blockList", ")", ";", "if", "(", "serializableFieldsTree", ".", "isValid", "(", ")", ")", "{", "Content", "headingContent", "=", "new", "StringContent", "(", "heading", ")", ";", "Content", "serialHeading", "=", "HtmlTree", ".", "HEADING", "(", "HtmlConstants", ".", "SERIALIZED_MEMBER_HEADING", ",", "headingContent", ")", ";", "li", ".", "addContent", "(", "serialHeading", ")", ";", "li", ".", "addContent", "(", "serializableFieldsTree", ")", ";", "}", "return", "li", ";", "}" ]
Add serializable fields. @param heading the heading for the section @param serializableFieldsTree the tree to be added to the serializable fileds content tree @return a content tree for the serializable fields content
[ "Add", "serializable", "fields", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java#L96-L107
5,329
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellToolProvider.java
JShellToolProvider.getSourceVersions
@Override public Set<SourceVersion> getSourceVersions() { return Collections.unmodifiableSet( EnumSet.range(SourceVersion.RELEASE_9, SourceVersion.latest())); }
java
@Override public Set<SourceVersion> getSourceVersions() { return Collections.unmodifiableSet( EnumSet.range(SourceVersion.RELEASE_9, SourceVersion.latest())); }
[ "@", "Override", "public", "Set", "<", "SourceVersion", ">", "getSourceVersions", "(", ")", "{", "return", "Collections", ".", "unmodifiableSet", "(", "EnumSet", ".", "range", "(", "SourceVersion", ".", "RELEASE_9", ",", "SourceVersion", ".", "latest", "(", ")", ")", ")", ";", "}" ]
Returns the source versions of the jshell tool. @return a set of supported source versions
[ "Returns", "the", "source", "versions", "of", "the", "jshell", "tool", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellToolProvider.java#L105-L109
5,330
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java
TypeVariableImpl.bounds
public com.sun.javadoc.Type[] bounds() { return TypeMaker.getTypes(env, getBounds((TypeVar)type, env)); }
java
public com.sun.javadoc.Type[] bounds() { return TypeMaker.getTypes(env, getBounds((TypeVar)type, env)); }
[ "public", "com", ".", "sun", ".", "javadoc", ".", "Type", "[", "]", "bounds", "(", ")", "{", "return", "TypeMaker", ".", "getTypes", "(", "env", ",", "getBounds", "(", "(", "TypeVar", ")", "type", ",", "env", ")", ")", ";", "}" ]
Return the bounds of this type variable.
[ "Return", "the", "bounds", "of", "this", "type", "variable", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java#L65-L67
5,331
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java
TypeVariableImpl.typeVarToString
static String typeVarToString(DocEnv env, TypeVar v, boolean full) { StringBuilder s = new StringBuilder(v.toString()); List<Type> bounds = getBounds(v, env); if (bounds.nonEmpty()) { boolean first = true; for (Type b : bounds) { s.append(first ? " extends " : " & "); s.append(TypeMaker.getTypeString(env, b, full)); first = false; } } return s.toString(); }
java
static String typeVarToString(DocEnv env, TypeVar v, boolean full) { StringBuilder s = new StringBuilder(v.toString()); List<Type> bounds = getBounds(v, env); if (bounds.nonEmpty()) { boolean first = true; for (Type b : bounds) { s.append(first ? " extends " : " & "); s.append(TypeMaker.getTypeString(env, b, full)); first = false; } } return s.toString(); }
[ "static", "String", "typeVarToString", "(", "DocEnv", "env", ",", "TypeVar", "v", ",", "boolean", "full", ")", "{", "StringBuilder", "s", "=", "new", "StringBuilder", "(", "v", ".", "toString", "(", ")", ")", ";", "List", "<", "Type", ">", "bounds", "=", "getBounds", "(", "v", ",", "env", ")", ";", "if", "(", "bounds", ".", "nonEmpty", "(", ")", ")", "{", "boolean", "first", "=", "true", ";", "for", "(", "Type", "b", ":", "bounds", ")", "{", "s", ".", "append", "(", "first", "?", "\" extends \"", ":", "\" & \"", ")", ";", "s", ".", "append", "(", "TypeMaker", ".", "getTypeString", "(", "env", ",", "b", ",", "full", ")", ")", ";", "first", "=", "false", ";", "}", "}", "return", "s", ".", "toString", "(", ")", ";", "}" ]
Return the string form of a type variable along with any "extends" clause. Class names are qualified if "full" is true.
[ "Return", "the", "string", "form", "of", "a", "type", "variable", "along", "with", "any", "extends", "clause", ".", "Class", "names", "are", "qualified", "if", "full", "is", "true", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java#L109-L121
5,332
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java
TypeVariableImpl.getBounds
private static List<Type> getBounds(TypeVar v, DocEnv env) { final Type upperBound = v.getUpperBound(); Name boundname = upperBound.tsym.getQualifiedName(); if (boundname == boundname.table.names.java_lang_Object && !upperBound.isAnnotated()) { return List.nil(); } else { return env.types.getBounds(v); } }
java
private static List<Type> getBounds(TypeVar v, DocEnv env) { final Type upperBound = v.getUpperBound(); Name boundname = upperBound.tsym.getQualifiedName(); if (boundname == boundname.table.names.java_lang_Object && !upperBound.isAnnotated()) { return List.nil(); } else { return env.types.getBounds(v); } }
[ "private", "static", "List", "<", "Type", ">", "getBounds", "(", "TypeVar", "v", ",", "DocEnv", "env", ")", "{", "final", "Type", "upperBound", "=", "v", ".", "getUpperBound", "(", ")", ";", "Name", "boundname", "=", "upperBound", ".", "tsym", ".", "getQualifiedName", "(", ")", ";", "if", "(", "boundname", "==", "boundname", ".", "table", ".", "names", ".", "java_lang_Object", "&&", "!", "upperBound", ".", "isAnnotated", "(", ")", ")", "{", "return", "List", ".", "nil", "(", ")", ";", "}", "else", "{", "return", "env", ".", "types", ".", "getBounds", "(", "v", ")", ";", "}", "}" ]
Get the bounds of a type variable as listed in the "extends" clause.
[ "Get", "the", "bounds", "of", "a", "type", "variable", "as", "listed", "in", "the", "extends", "clause", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java#L126-L135
5,333
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
Locations.getPathEntries
private Iterable<Path> getPathEntries(String searchPath, Path emptyPathDefault) { ListBuffer<Path> entries = new ListBuffer<>(); for (String s: searchPath.split(Pattern.quote(File.pathSeparator), -1)) { if (s.isEmpty()) { if (emptyPathDefault != null) { entries.add(emptyPathDefault); } } else { try { entries.add(getPath(s)); } catch (IllegalArgumentException e) { if (warn) { log.warning(LintCategory.PATH, "invalid.path", s); } } } } return entries; }
java
private Iterable<Path> getPathEntries(String searchPath, Path emptyPathDefault) { ListBuffer<Path> entries = new ListBuffer<>(); for (String s: searchPath.split(Pattern.quote(File.pathSeparator), -1)) { if (s.isEmpty()) { if (emptyPathDefault != null) { entries.add(emptyPathDefault); } } else { try { entries.add(getPath(s)); } catch (IllegalArgumentException e) { if (warn) { log.warning(LintCategory.PATH, "invalid.path", s); } } } } return entries; }
[ "private", "Iterable", "<", "Path", ">", "getPathEntries", "(", "String", "searchPath", ",", "Path", "emptyPathDefault", ")", "{", "ListBuffer", "<", "Path", ">", "entries", "=", "new", "ListBuffer", "<>", "(", ")", ";", "for", "(", "String", "s", ":", "searchPath", ".", "split", "(", "Pattern", ".", "quote", "(", "File", ".", "pathSeparator", ")", ",", "-", "1", ")", ")", "{", "if", "(", "s", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "emptyPathDefault", "!=", "null", ")", "{", "entries", ".", "add", "(", "emptyPathDefault", ")", ";", "}", "}", "else", "{", "try", "{", "entries", ".", "add", "(", "getPath", "(", "s", ")", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "if", "(", "warn", ")", "{", "log", ".", "warning", "(", "LintCategory", ".", "PATH", ",", "\"invalid.path\"", ",", "s", ")", ";", "}", "}", "}", "}", "return", "entries", ";", "}" ]
Split a search path into its elements. If emptyPathDefault is not null, all empty elements in the path, including empty elements at either end of the path, will be replaced with the value of emptyPathDefault. @param searchPath The search path to be split @param emptyPathDefault The value to substitute for empty path elements, or null, to ignore empty path elements @return The elements of the path
[ "Split", "a", "search", "path", "into", "its", "elements", ".", "If", "emptyPathDefault", "is", "not", "null", "all", "empty", "elements", "in", "the", "path", "including", "empty", "elements", "at", "either", "end", "of", "the", "path", "will", "be", "replaced", "with", "the", "value", "of", "emptyPathDefault", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java#L209-L227
5,334
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
Locations.isArchive
private boolean isArchive(Path file) { String n = StringUtils.toLowerCase(file.getFileName().toString()); return fsInfo.isFile(file) && (n.endsWith(".jar") || n.endsWith(".zip")); }
java
private boolean isArchive(Path file) { String n = StringUtils.toLowerCase(file.getFileName().toString()); return fsInfo.isFile(file) && (n.endsWith(".jar") || n.endsWith(".zip")); }
[ "private", "boolean", "isArchive", "(", "Path", "file", ")", "{", "String", "n", "=", "StringUtils", ".", "toLowerCase", "(", "file", ".", "getFileName", "(", ")", ".", "toString", "(", ")", ")", ";", "return", "fsInfo", ".", "isFile", "(", "file", ")", "&&", "(", "n", ".", "endsWith", "(", "\".jar\"", ")", "||", "n", ".", "endsWith", "(", "\".zip\"", ")", ")", ";", "}" ]
Is this the name of an archive file?
[ "Is", "this", "the", "name", "of", "an", "archive", "file?" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java#L2087-L2091
5,335
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/ClassFinder.java
ClassFinder.addDir
public void addDir(String dirName) { Path dir = Paths.get(dirName); if (Files.isDirectory(dir)) { list.add(new DirPathEntry(dir)); } }
java
public void addDir(String dirName) { Path dir = Paths.get(dirName); if (Files.isDirectory(dir)) { list.add(new DirPathEntry(dir)); } }
[ "public", "void", "addDir", "(", "String", "dirName", ")", "{", "Path", "dir", "=", "Paths", ".", "get", "(", "dirName", ")", ";", "if", "(", "Files", ".", "isDirectory", "(", "dir", ")", ")", "{", "list", ".", "add", "(", "new", "DirPathEntry", "(", "dir", ")", ")", ";", "}", "}" ]
Adds a directory to this finder's search path, ignoring errors. @param dirName the directory to add
[ "Adds", "a", "directory", "to", "this", "finder", "s", "search", "path", "ignoring", "errors", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/ClassFinder.java#L62-L68
5,336
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/ClassFinder.java
ClassFinder.addJar
public void addJar(String jarName) { try { list.add(new JarPathEntry(new JarFile(jarName))); } catch (IOException ignore) { } }
java
public void addJar(String jarName) { try { list.add(new JarPathEntry(new JarFile(jarName))); } catch (IOException ignore) { } }
[ "public", "void", "addJar", "(", "String", "jarName", ")", "{", "try", "{", "list", ".", "add", "(", "new", "JarPathEntry", "(", "new", "JarFile", "(", "jarName", ")", ")", ")", ";", "}", "catch", "(", "IOException", "ignore", ")", "{", "}", "}" ]
Adds a jar file to this finder's search path, ignoring errors. @param jarName the jar file name to add
[ "Adds", "a", "jar", "file", "to", "this", "finder", "s", "search", "path", "ignoring", "errors", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/ClassFinder.java#L75-L79
5,337
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/ClassFinder.java
ClassFinder.find
public ClassFile find(String className) { for (PathEntry pe : list) { ClassFile cf = pe.find(className); if (cf != null) { return cf; } } return null; }
java
public ClassFile find(String className) { for (PathEntry pe : list) { ClassFile cf = pe.find(className); if (cf != null) { return cf; } } return null; }
[ "public", "ClassFile", "find", "(", "String", "className", ")", "{", "for", "(", "PathEntry", "pe", ":", "list", ")", "{", "ClassFile", "cf", "=", "pe", ".", "find", "(", "className", ")", ";", "if", "(", "cf", "!=", "null", ")", "{", "return", "cf", ";", "}", "}", "return", "null", ";", "}" ]
Searches the class path for a class with the given name, returning a ClassFile for it. Returns null if not found. @param className the class to search for @return a ClassFile instance, or null if not found
[ "Searches", "the", "class", "path", "for", "a", "class", "with", "the", "given", "name", "returning", "a", "ClassFile", "for", "it", ".", "Returns", "null", "if", "not", "found", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/ClassFinder.java#L95-L103
5,338
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java
ArgTokenizer.next
String next() { while (true) { nextToken(); if (sval != null && !isQuoted() && sval.startsWith("-")) { // allow POSIX getopt() option format, // to be consistent with command-line String opt = sval.startsWith("--") ? sval.substring(1) : sval; foundOption(opt); } else { break; } } return sval; }
java
String next() { while (true) { nextToken(); if (sval != null && !isQuoted() && sval.startsWith("-")) { // allow POSIX getopt() option format, // to be consistent with command-line String opt = sval.startsWith("--") ? sval.substring(1) : sval; foundOption(opt); } else { break; } } return sval; }
[ "String", "next", "(", ")", "{", "while", "(", "true", ")", "{", "nextToken", "(", ")", ";", "if", "(", "sval", "!=", "null", "&&", "!", "isQuoted", "(", ")", "&&", "sval", ".", "startsWith", "(", "\"-\"", ")", ")", "{", "// allow POSIX getopt() option format,", "// to be consistent with command-line", "String", "opt", "=", "sval", ".", "startsWith", "(", "\"--\"", ")", "?", "sval", ".", "substring", "(", "1", ")", ":", "sval", ";", "foundOption", "(", "opt", ")", ";", "}", "else", "{", "break", ";", "}", "}", "return", "sval", ";", "}" ]
Return the next non-option argument. Encountered options are stored. @return the token string, or null if there are no more tokens
[ "Return", "the", "next", "non", "-", "option", "argument", ".", "Encountered", "options", "are", "stored", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java#L78-L93
5,339
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java
ArgTokenizer.allowedOptions
void allowedOptions(String... opts) { for (String opt : opts) { options.putIfAbsent(opt, false); } }
java
void allowedOptions(String... opts) { for (String opt : opts) { options.putIfAbsent(opt, false); } }
[ "void", "allowedOptions", "(", "String", "...", "opts", ")", "{", "for", "(", "String", "opt", ":", "opts", ")", "{", "options", ".", "putIfAbsent", "(", "opt", ",", "false", ")", ";", "}", "}" ]
Set the allowed options. Must be called before any options would be read and before calling any of the option functionality below.
[ "Set", "the", "allowed", "options", ".", "Must", "be", "called", "before", "any", "options", "would", "be", "read", "and", "before", "calling", "any", "of", "the", "option", "functionality", "below", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java#L117-L121
5,340
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java
ArgTokenizer.hasOption
boolean hasOption(String opt) { Boolean has = options.get(opt); if (has == null) { throw new InternalError("hasOption called before allowedOptions or on bad option"); } return has; }
java
boolean hasOption(String opt) { Boolean has = options.get(opt); if (has == null) { throw new InternalError("hasOption called before allowedOptions or on bad option"); } return has; }
[ "boolean", "hasOption", "(", "String", "opt", ")", "{", "Boolean", "has", "=", "options", ".", "get", "(", "opt", ")", ";", "if", "(", "has", "==", "null", ")", "{", "throw", "new", "InternalError", "(", "\"hasOption called before allowedOptions or on bad option\"", ")", ";", "}", "return", "has", ";", "}" ]
Has the specified option been encountered. @param opt the option to check @return true if the option has been encountered
[ "Has", "the", "specified", "option", "been", "encountered", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java#L129-L135
5,341
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java
ArgTokenizer.remainder
String remainder() { List<String> rem = new ArrayList<>(); while (next() != null) { rem.add(sval); } return String.join(" ", rem); }
java
String remainder() { List<String> rem = new ArrayList<>(); while (next() != null) { rem.add(sval); } return String.join(" ", rem); }
[ "String", "remainder", "(", ")", "{", "List", "<", "String", ">", "rem", "=", "new", "ArrayList", "<>", "(", ")", ";", "while", "(", "next", "(", ")", "!=", "null", ")", "{", "rem", ".", "add", "(", "sval", ")", ";", "}", "return", "String", ".", "join", "(", "\" \"", ",", "rem", ")", ";", "}" ]
Consume the remainder of the input. This is useful to sure all options have been encountered and to check to unexpected additional non-option input. @return the string-separated concatenation of all remaining non-option arguments.
[ "Consume", "the", "remainder", "of", "the", "input", ".", "This", "is", "useful", "to", "sure", "all", "options", "have", "been", "encountered", "and", "to", "check", "to", "unexpected", "additional", "non", "-", "option", "input", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java#L167-L173
5,342
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java
ArgTokenizer.nextToken
public void nextToken() { byte ct[] = ctype; int c; int lctype; sval = null; isQuoted = false; do { c = read(); if (c < 0) { return; } lctype = (c < 256) ? ct[c] : unicode2ctype(c); } while (lctype == CT_WHITESPACE); if (lctype == CT_ALPHA) { int i = 0; do { if (i >= buf.length) { buf = Arrays.copyOf(buf, buf.length * 2); } buf[i++] = (char) c; c = read(); lctype = c < 0 ? CT_WHITESPACE : (c < 256)? ct[c] : unicode2ctype(c); } while (lctype == CT_ALPHA); if (c >= 0) --next; // push last back sval = String.copyValueOf(buf, 0, i); return; } if (lctype == CT_QUOTE) { int quote = c; int i = 0; /* Invariants (because \Octal needs a lookahead): * (i) c contains char value * (ii) d contains the lookahead */ int d = read(); while (d >= 0 && d != quote) { if (d == '\\') { c = read(); int first = c; /* To allow \377, but not \477 */ if (c >= '0' && c <= '7') { c = c - '0'; int c2 = read(); if ('0' <= c2 && c2 <= '7') { c = (c << 3) + (c2 - '0'); c2 = read(); if ('0' <= c2 && c2 <= '7' && first <= '3') { c = (c << 3) + (c2 - '0'); d = read(); } else d = c2; } else d = c2; } else { switch (c) { case 'a': c = 0x7; break; case 'b': c = '\b'; break; case 'f': c = 0xC; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; case 'v': c = 0xB; break; } d = read(); } } else { c = d; d = read(); } if (i >= buf.length) { buf = Arrays.copyOf(buf, buf.length * 2); } buf[i++] = (char)c; } if (d == quote) { isQuoted = true; } sval = String.copyValueOf(buf, 0, i); } }
java
public void nextToken() { byte ct[] = ctype; int c; int lctype; sval = null; isQuoted = false; do { c = read(); if (c < 0) { return; } lctype = (c < 256) ? ct[c] : unicode2ctype(c); } while (lctype == CT_WHITESPACE); if (lctype == CT_ALPHA) { int i = 0; do { if (i >= buf.length) { buf = Arrays.copyOf(buf, buf.length * 2); } buf[i++] = (char) c; c = read(); lctype = c < 0 ? CT_WHITESPACE : (c < 256)? ct[c] : unicode2ctype(c); } while (lctype == CT_ALPHA); if (c >= 0) --next; // push last back sval = String.copyValueOf(buf, 0, i); return; } if (lctype == CT_QUOTE) { int quote = c; int i = 0; /* Invariants (because \Octal needs a lookahead): * (i) c contains char value * (ii) d contains the lookahead */ int d = read(); while (d >= 0 && d != quote) { if (d == '\\') { c = read(); int first = c; /* To allow \377, but not \477 */ if (c >= '0' && c <= '7') { c = c - '0'; int c2 = read(); if ('0' <= c2 && c2 <= '7') { c = (c << 3) + (c2 - '0'); c2 = read(); if ('0' <= c2 && c2 <= '7' && first <= '3') { c = (c << 3) + (c2 - '0'); d = read(); } else d = c2; } else d = c2; } else { switch (c) { case 'a': c = 0x7; break; case 'b': c = '\b'; break; case 'f': c = 0xC; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; case 'v': c = 0xB; break; } d = read(); } } else { c = d; d = read(); } if (i >= buf.length) { buf = Arrays.copyOf(buf, buf.length * 2); } buf[i++] = (char)c; } if (d == quote) { isQuoted = true; } sval = String.copyValueOf(buf, 0, i); } }
[ "public", "void", "nextToken", "(", ")", "{", "byte", "ct", "[", "]", "=", "ctype", ";", "int", "c", ";", "int", "lctype", ";", "sval", "=", "null", ";", "isQuoted", "=", "false", ";", "do", "{", "c", "=", "read", "(", ")", ";", "if", "(", "c", "<", "0", ")", "{", "return", ";", "}", "lctype", "=", "(", "c", "<", "256", ")", "?", "ct", "[", "c", "]", ":", "unicode2ctype", "(", "c", ")", ";", "}", "while", "(", "lctype", "==", "CT_WHITESPACE", ")", ";", "if", "(", "lctype", "==", "CT_ALPHA", ")", "{", "int", "i", "=", "0", ";", "do", "{", "if", "(", "i", ">=", "buf", ".", "length", ")", "{", "buf", "=", "Arrays", ".", "copyOf", "(", "buf", ",", "buf", ".", "length", "*", "2", ")", ";", "}", "buf", "[", "i", "++", "]", "=", "(", "char", ")", "c", ";", "c", "=", "read", "(", ")", ";", "lctype", "=", "c", "<", "0", "?", "CT_WHITESPACE", ":", "(", "c", "<", "256", ")", "?", "ct", "[", "c", "]", ":", "unicode2ctype", "(", "c", ")", ";", "}", "while", "(", "lctype", "==", "CT_ALPHA", ")", ";", "if", "(", "c", ">=", "0", ")", "--", "next", ";", "// push last back", "sval", "=", "String", ".", "copyValueOf", "(", "buf", ",", "0", ",", "i", ")", ";", "return", ";", "}", "if", "(", "lctype", "==", "CT_QUOTE", ")", "{", "int", "quote", "=", "c", ";", "int", "i", "=", "0", ";", "/* Invariants (because \\Octal needs a lookahead):\n * (i) c contains char value\n * (ii) d contains the lookahead\n */", "int", "d", "=", "read", "(", ")", ";", "while", "(", "d", ">=", "0", "&&", "d", "!=", "quote", ")", "{", "if", "(", "d", "==", "'", "'", ")", "{", "c", "=", "read", "(", ")", ";", "int", "first", "=", "c", ";", "/* To allow \\377, but not \\477 */", "if", "(", "c", ">=", "'", "'", "&&", "c", "<=", "'", "'", ")", "{", "c", "=", "c", "-", "'", "'", ";", "int", "c2", "=", "read", "(", ")", ";", "if", "(", "'", "'", "<=", "c2", "&&", "c2", "<=", "'", "'", ")", "{", "c", "=", "(", "c", "<<", "3", ")", "+", "(", "c2", "-", "'", "'", ")", ";", "c2", "=", "read", "(", ")", ";", "if", "(", "'", "'", "<=", "c2", "&&", "c2", "<=", "'", "'", "&&", "first", "<=", "'", "'", ")", "{", "c", "=", "(", "c", "<<", "3", ")", "+", "(", "c2", "-", "'", "'", ")", ";", "d", "=", "read", "(", ")", ";", "}", "else", "d", "=", "c2", ";", "}", "else", "d", "=", "c2", ";", "}", "else", "{", "switch", "(", "c", ")", "{", "case", "'", "'", ":", "c", "=", "0x7", ";", "break", ";", "case", "'", "'", ":", "c", "=", "'", "'", ";", "break", ";", "case", "'", "'", ":", "c", "=", "0xC", ";", "break", ";", "case", "'", "'", ":", "c", "=", "'", "'", ";", "break", ";", "case", "'", "'", ":", "c", "=", "'", "'", ";", "break", ";", "case", "'", "'", ":", "c", "=", "'", "'", ";", "break", ";", "case", "'", "'", ":", "c", "=", "0xB", ";", "break", ";", "}", "d", "=", "read", "(", ")", ";", "}", "}", "else", "{", "c", "=", "d", ";", "d", "=", "read", "(", ")", ";", "}", "if", "(", "i", ">=", "buf", ".", "length", ")", "{", "buf", "=", "Arrays", ".", "copyOf", "(", "buf", ",", "buf", ".", "length", "*", "2", ")", ";", "}", "buf", "[", "i", "++", "]", "=", "(", "char", ")", "c", ";", "}", "if", "(", "d", "==", "quote", ")", "{", "isQuoted", "=", "true", ";", "}", "sval", "=", "String", ".", "copyValueOf", "(", "buf", ",", "0", ",", "i", ")", ";", "}", "}" ]
Parses the next token of this tokenizer.
[ "Parses", "the", "next", "token", "of", "this", "tokenizer", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java#L267-L363
5,343
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java
Printer.createStandardPrinter
public static Printer createStandardPrinter(final Messages messages) { return new Printer() { @Override protected String localize(Locale locale, String key, Object... args) { return messages.getLocalizedString(locale, key, args); } @Override protected String capturedVarId(CapturedType t, Locale locale) { return (t.hashCode() & 0xFFFFFFFFL) % PRIME + ""; }}; }
java
public static Printer createStandardPrinter(final Messages messages) { return new Printer() { @Override protected String localize(Locale locale, String key, Object... args) { return messages.getLocalizedString(locale, key, args); } @Override protected String capturedVarId(CapturedType t, Locale locale) { return (t.hashCode() & 0xFFFFFFFFL) % PRIME + ""; }}; }
[ "public", "static", "Printer", "createStandardPrinter", "(", "final", "Messages", "messages", ")", "{", "return", "new", "Printer", "(", ")", "{", "@", "Override", "protected", "String", "localize", "(", "Locale", "locale", ",", "String", "key", ",", "Object", "...", "args", ")", "{", "return", "messages", ".", "getLocalizedString", "(", "locale", ",", "key", ",", "args", ")", ";", "}", "@", "Override", "protected", "String", "capturedVarId", "(", "CapturedType", "t", ",", "Locale", "locale", ")", "{", "return", "(", "t", ".", "hashCode", "(", ")", "&", "0xFFFFFFFF", "L", ")", "%", "PRIME", "+", "\"\"", ";", "}", "}", ";", "}" ]
Create a printer with default i18n support provided by Messages. By default, captured types ids are generated using hashcode. @param messages Messages class to be used for i18n @return printer visitor instance
[ "Create", "a", "printer", "with", "default", "i18n", "support", "provided", "by", "Messages", ".", "By", "default", "captured", "types", "ids", "are", "generated", "using", "hashcode", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java#L85-L96
5,344
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java
Printer.visitTypes
public String visitTypes(List<Type> ts, Locale locale) { ListBuffer<String> sbuf = new ListBuffer<>(); for (Type t : ts) { sbuf.append(visit(t, locale)); } return sbuf.toList().toString(); }
java
public String visitTypes(List<Type> ts, Locale locale) { ListBuffer<String> sbuf = new ListBuffer<>(); for (Type t : ts) { sbuf.append(visit(t, locale)); } return sbuf.toList().toString(); }
[ "public", "String", "visitTypes", "(", "List", "<", "Type", ">", "ts", ",", "Locale", "locale", ")", "{", "ListBuffer", "<", "String", ">", "sbuf", "=", "new", "ListBuffer", "<>", "(", ")", ";", "for", "(", "Type", "t", ":", "ts", ")", "{", "sbuf", ".", "append", "(", "visit", "(", "t", ",", "locale", ")", ")", ";", "}", "return", "sbuf", ".", "toList", "(", ")", ".", "toString", "(", ")", ";", "}" ]
Get a localized string representation for all the types in the input list. @param ts types to be displayed @param locale the locale in which the string is to be rendered @return localized string representation
[ "Get", "a", "localized", "string", "representation", "for", "all", "the", "types", "in", "the", "input", "list", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java#L105-L111
5,345
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java
Printer.printMethodArgs
protected String printMethodArgs(List<Type> args, boolean varArgs, Locale locale) { if (!varArgs) { return visitTypes(args, locale); } else { StringBuilder buf = new StringBuilder(); while (args.tail.nonEmpty()) { buf.append(visit(args.head, locale)); args = args.tail; buf.append(','); } if (args.head.hasTag(TypeTag.ARRAY)) { buf.append(visit(((ArrayType) args.head).elemtype, locale)); if (args.head.getAnnotationMirrors().nonEmpty()) { buf.append(' '); buf.append(args.head.getAnnotationMirrors()); buf.append(' '); } buf.append("..."); } else { buf.append(visit(args.head, locale)); } return buf.toString(); } }
java
protected String printMethodArgs(List<Type> args, boolean varArgs, Locale locale) { if (!varArgs) { return visitTypes(args, locale); } else { StringBuilder buf = new StringBuilder(); while (args.tail.nonEmpty()) { buf.append(visit(args.head, locale)); args = args.tail; buf.append(','); } if (args.head.hasTag(TypeTag.ARRAY)) { buf.append(visit(((ArrayType) args.head).elemtype, locale)); if (args.head.getAnnotationMirrors().nonEmpty()) { buf.append(' '); buf.append(args.head.getAnnotationMirrors()); buf.append(' '); } buf.append("..."); } else { buf.append(visit(args.head, locale)); } return buf.toString(); } }
[ "protected", "String", "printMethodArgs", "(", "List", "<", "Type", ">", "args", ",", "boolean", "varArgs", ",", "Locale", "locale", ")", "{", "if", "(", "!", "varArgs", ")", "{", "return", "visitTypes", "(", "args", ",", "locale", ")", ";", "}", "else", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "while", "(", "args", ".", "tail", ".", "nonEmpty", "(", ")", ")", "{", "buf", ".", "append", "(", "visit", "(", "args", ".", "head", ",", "locale", ")", ")", ";", "args", "=", "args", ".", "tail", ";", "buf", ".", "append", "(", "'", "'", ")", ";", "}", "if", "(", "args", ".", "head", ".", "hasTag", "(", "TypeTag", ".", "ARRAY", ")", ")", "{", "buf", ".", "append", "(", "visit", "(", "(", "(", "ArrayType", ")", "args", ".", "head", ")", ".", "elemtype", ",", "locale", ")", ")", ";", "if", "(", "args", ".", "head", ".", "getAnnotationMirrors", "(", ")", ".", "nonEmpty", "(", ")", ")", "{", "buf", ".", "append", "(", "'", "'", ")", ";", "buf", ".", "append", "(", "args", ".", "head", ".", "getAnnotationMirrors", "(", ")", ")", ";", "buf", ".", "append", "(", "'", "'", ")", ";", "}", "buf", ".", "append", "(", "\"...\"", ")", ";", "}", "else", "{", "buf", ".", "append", "(", "visit", "(", "args", ".", "head", ",", "locale", ")", ")", ";", "}", "return", "buf", ".", "toString", "(", ")", ";", "}", "}" ]
Converts a set of method argument types into their corresponding localized string representation. @param args arguments to be rendered @param varArgs if true, the last method argument is regarded as a vararg @param locale the locale in which the string is to be rendered @return localized string representation
[ "Converts", "a", "set", "of", "method", "argument", "types", "into", "their", "corresponding", "localized", "string", "representation", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java#L337-L360
5,346
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java
Mode.encode
String encode() { List<String> el = new ArrayList<>(); el.add(name); el.add(String.valueOf(commandFluff)); el.add(prompt); el.add(continuationPrompt); for (Entry<String, List<Setting>> es : cases.entrySet()) { el.add(es.getKey()); el.add("("); for (Setting ing : es.getValue()) { el.add(String.valueOf(ing.enumBits)); el.add(ing.format); } el.add(")"); } el.add("***"); return String.join(RECORD_SEPARATOR, el); }
java
String encode() { List<String> el = new ArrayList<>(); el.add(name); el.add(String.valueOf(commandFluff)); el.add(prompt); el.add(continuationPrompt); for (Entry<String, List<Setting>> es : cases.entrySet()) { el.add(es.getKey()); el.add("("); for (Setting ing : es.getValue()) { el.add(String.valueOf(ing.enumBits)); el.add(ing.format); } el.add(")"); } el.add("***"); return String.join(RECORD_SEPARATOR, el); }
[ "String", "encode", "(", ")", "{", "List", "<", "String", ">", "el", "=", "new", "ArrayList", "<>", "(", ")", ";", "el", ".", "add", "(", "name", ")", ";", "el", ".", "add", "(", "String", ".", "valueOf", "(", "commandFluff", ")", ")", ";", "el", ".", "add", "(", "prompt", ")", ";", "el", ".", "add", "(", "continuationPrompt", ")", ";", "for", "(", "Entry", "<", "String", ",", "List", "<", "Setting", ">", ">", "es", ":", "cases", ".", "entrySet", "(", ")", ")", "{", "el", ".", "add", "(", "es", ".", "getKey", "(", ")", ")", ";", "el", ".", "add", "(", "\"(\"", ")", ";", "for", "(", "Setting", "ing", ":", "es", ".", "getValue", "(", ")", ")", "{", "el", ".", "add", "(", "String", ".", "valueOf", "(", "ing", ".", "enumBits", ")", ")", ";", "el", ".", "add", "(", "ing", ".", "format", ")", ";", "}", "el", ".", "add", "(", "\")\"", ")", ";", "}", "el", ".", "add", "(", "\"***\"", ")", ";", "return", "String", ".", "join", "(", "RECORD_SEPARATOR", ",", "el", ")", ";", "}" ]
Encodes the mode into a String so it can be saved in Preferences. @return the string representation
[ "Encodes", "the", "mode", "into", "a", "String", "so", "it", "can", "be", "saved", "in", "Preferences", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java#L353-L370
5,347
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java
Mode.format
String format(String field, long bits) { List<Setting> settings = cases.get(field); if (settings == null) { return ""; //TODO error? } String format = null; for (int i = settings.size() - 1; i >= 0; --i) { Setting ing = settings.get(i); long mask = ing.enumBits; if ((bits & mask) == bits) { format = ing.format; break; } } if (format == null || format.isEmpty()) { return ""; } Matcher m = FIELD_PATTERN.matcher(format); StringBuffer sb = new StringBuffer(format.length()); while (m.find()) { String fieldName = m.group(1); String sub = format(fieldName, bits); m.appendReplacement(sb, Matcher.quoteReplacement(sub)); } m.appendTail(sb); return sb.toString(); }
java
String format(String field, long bits) { List<Setting> settings = cases.get(field); if (settings == null) { return ""; //TODO error? } String format = null; for (int i = settings.size() - 1; i >= 0; --i) { Setting ing = settings.get(i); long mask = ing.enumBits; if ((bits & mask) == bits) { format = ing.format; break; } } if (format == null || format.isEmpty()) { return ""; } Matcher m = FIELD_PATTERN.matcher(format); StringBuffer sb = new StringBuffer(format.length()); while (m.find()) { String fieldName = m.group(1); String sub = format(fieldName, bits); m.appendReplacement(sb, Matcher.quoteReplacement(sub)); } m.appendTail(sb); return sb.toString(); }
[ "String", "format", "(", "String", "field", ",", "long", "bits", ")", "{", "List", "<", "Setting", ">", "settings", "=", "cases", ".", "get", "(", "field", ")", ";", "if", "(", "settings", "==", "null", ")", "{", "return", "\"\"", ";", "//TODO error?", "}", "String", "format", "=", "null", ";", "for", "(", "int", "i", "=", "settings", ".", "size", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "--", "i", ")", "{", "Setting", "ing", "=", "settings", ".", "get", "(", "i", ")", ";", "long", "mask", "=", "ing", ".", "enumBits", ";", "if", "(", "(", "bits", "&", "mask", ")", "==", "bits", ")", "{", "format", "=", "ing", ".", "format", ";", "break", ";", "}", "}", "if", "(", "format", "==", "null", "||", "format", ".", "isEmpty", "(", ")", ")", "{", "return", "\"\"", ";", "}", "Matcher", "m", "=", "FIELD_PATTERN", ".", "matcher", "(", "format", ")", ";", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "format", ".", "length", "(", ")", ")", ";", "while", "(", "m", ".", "find", "(", ")", ")", "{", "String", "fieldName", "=", "m", ".", "group", "(", "1", ")", ";", "String", "sub", "=", "format", "(", "fieldName", ",", "bits", ")", ";", "m", ".", "appendReplacement", "(", "sb", ",", "Matcher", ".", "quoteReplacement", "(", "sub", ")", ")", ";", "}", "m", ".", "appendTail", "(", "sb", ")", ";", "return", "sb", ".", "toString", "(", ")", ";", "}" ]
Lookup format Replace fields with context specific formats. @return format string
[ "Lookup", "format", "Replace", "fields", "with", "context", "specific", "formats", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java#L402-L428
5,348
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
ElementsTable.getModuleMode
public ModuleMode getModuleMode() { switch(accessFilter.getAccessValue(ElementKind.MODULE)) { case PACKAGE: case PRIVATE: return DocletEnvironment.ModuleMode.ALL; default: return DocletEnvironment.ModuleMode.API; } }
java
public ModuleMode getModuleMode() { switch(accessFilter.getAccessValue(ElementKind.MODULE)) { case PACKAGE: case PRIVATE: return DocletEnvironment.ModuleMode.ALL; default: return DocletEnvironment.ModuleMode.API; } }
[ "public", "ModuleMode", "getModuleMode", "(", ")", "{", "switch", "(", "accessFilter", ".", "getAccessValue", "(", "ElementKind", ".", "MODULE", ")", ")", "{", "case", "PACKAGE", ":", "case", "PRIVATE", ":", "return", "DocletEnvironment", ".", "ModuleMode", ".", "ALL", ";", "default", ":", "return", "DocletEnvironment", ".", "ModuleMode", ".", "API", ";", "}", "}" ]
Returns the module documentation level mode. @return the module documentation level mode
[ "Returns", "the", "module", "documentation", "level", "mode", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java#L240-L247
5,349
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
ElementsTable.getSpecifiedElements
public Set<? extends Element> getSpecifiedElements() { if (specifiedElements == null) { Set<Element> result = new LinkedHashSet<>(); result.addAll(specifiedModuleElements); result.addAll(specifiedPackageElements); result.addAll(specifiedTypeElements); specifiedElements = Collections.unmodifiableSet(result); } return specifiedElements; }
java
public Set<? extends Element> getSpecifiedElements() { if (specifiedElements == null) { Set<Element> result = new LinkedHashSet<>(); result.addAll(specifiedModuleElements); result.addAll(specifiedPackageElements); result.addAll(specifiedTypeElements); specifiedElements = Collections.unmodifiableSet(result); } return specifiedElements; }
[ "public", "Set", "<", "?", "extends", "Element", ">", "getSpecifiedElements", "(", ")", "{", "if", "(", "specifiedElements", "==", "null", ")", "{", "Set", "<", "Element", ">", "result", "=", "new", "LinkedHashSet", "<>", "(", ")", ";", "result", ".", "addAll", "(", "specifiedModuleElements", ")", ";", "result", ".", "addAll", "(", "specifiedPackageElements", ")", ";", "result", ".", "addAll", "(", "specifiedTypeElements", ")", ";", "specifiedElements", "=", "Collections", ".", "unmodifiableSet", "(", "result", ")", ";", "}", "return", "specifiedElements", ";", "}" ]
Returns a set of elements specified on the command line, including any inner classes. @return the set of elements specified on the command line
[ "Returns", "a", "set", "of", "elements", "specified", "on", "the", "command", "line", "including", "any", "inner", "classes", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java#L256-L265
5,350
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
ElementsTable.analyze
void analyze() throws ToolException { // compute the specified element, by expanding module dependencies computeSpecifiedModules(); // compute all specified packages and subpackages computeSpecifiedPackages(); // compute the specified types computeSpecifiedTypes(); // compute the packages belonging to all the specified modules Set<PackageElement> expandedModulePackages = computeModulePackages(); initializeIncludedSets(expandedModulePackages); }
java
void analyze() throws ToolException { // compute the specified element, by expanding module dependencies computeSpecifiedModules(); // compute all specified packages and subpackages computeSpecifiedPackages(); // compute the specified types computeSpecifiedTypes(); // compute the packages belonging to all the specified modules Set<PackageElement> expandedModulePackages = computeModulePackages(); initializeIncludedSets(expandedModulePackages); }
[ "void", "analyze", "(", ")", "throws", "ToolException", "{", "// compute the specified element, by expanding module dependencies", "computeSpecifiedModules", "(", ")", ";", "// compute all specified packages and subpackages", "computeSpecifiedPackages", "(", ")", ";", "// compute the specified types", "computeSpecifiedTypes", "(", ")", ";", "// compute the packages belonging to all the specified modules", "Set", "<", "PackageElement", ">", "expandedModulePackages", "=", "computeModulePackages", "(", ")", ";", "initializeIncludedSets", "(", "expandedModulePackages", ")", ";", "}" ]
Performs the final computation and freezes the collections. This is a terminal operation, thus no further modifications are allowed to the specified data sets. @throws ToolException if an error occurs
[ "Performs", "the", "final", "computation", "and", "freezes", "the", "collections", ".", "This", "is", "a", "terminal", "operation", "thus", "no", "further", "modifications", "are", "allowed", "to", "the", "specified", "data", "sets", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java#L343-L356
5,351
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/MetaKeywords.java
MetaKeywords.getMetaKeywordsForModule
public List<String> getMetaKeywordsForModule(ModuleElement mdle) { if (config.keywords) { return Arrays.asList(mdle.getQualifiedName() + " " + "module"); } else { return Collections.emptyList(); } }
java
public List<String> getMetaKeywordsForModule(ModuleElement mdle) { if (config.keywords) { return Arrays.asList(mdle.getQualifiedName() + " " + "module"); } else { return Collections.emptyList(); } }
[ "public", "List", "<", "String", ">", "getMetaKeywordsForModule", "(", "ModuleElement", "mdle", ")", "{", "if", "(", "config", ".", "keywords", ")", "{", "return", "Arrays", ".", "asList", "(", "mdle", ".", "getQualifiedName", "(", ")", "+", "\" \"", "+", "\"module\"", ")", ";", "}", "else", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "}" ]
Get the module keywords. @param mdle the module being documented
[ "Get", "the", "module", "keywords", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/MetaKeywords.java#L117-L123
5,352
google/error-prone-javac
src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java
AbstractProcessor.getCompletions
public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) { return Collections.emptyList(); }
java
public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) { return Collections.emptyList(); }
[ "public", "Iterable", "<", "?", "extends", "Completion", ">", "getCompletions", "(", "Element", "element", ",", "AnnotationMirror", "annotation", ",", "ExecutableElement", "member", ",", "String", "userText", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}" ]
Returns an empty iterable of completions. @param element {@inheritDoc} @param annotation {@inheritDoc} @param member {@inheritDoc} @param userText {@inheritDoc}
[ "Returns", "an", "empty", "iterable", "of", "completions", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java#L180-L185
5,353
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java
FrameOutputWriter.addAllModulesFrameTag
private void addAllModulesFrameTag(Content contentTree) { HtmlTree frame = HtmlTree.IFRAME(DocPaths.MODULE_OVERVIEW_FRAME.getPath(), "packageListFrame", configuration.getText("doclet.All_Modules")); HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame); contentTree.addContent(leftTop); }
java
private void addAllModulesFrameTag(Content contentTree) { HtmlTree frame = HtmlTree.IFRAME(DocPaths.MODULE_OVERVIEW_FRAME.getPath(), "packageListFrame", configuration.getText("doclet.All_Modules")); HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame); contentTree.addContent(leftTop); }
[ "private", "void", "addAllModulesFrameTag", "(", "Content", "contentTree", ")", "{", "HtmlTree", "frame", "=", "HtmlTree", ".", "IFRAME", "(", "DocPaths", ".", "MODULE_OVERVIEW_FRAME", ".", "getPath", "(", ")", ",", "\"packageListFrame\"", ",", "configuration", ".", "getText", "(", "\"doclet.All_Modules\"", ")", ")", ";", "HtmlTree", "leftTop", "=", "HtmlTree", ".", "DIV", "(", "HtmlStyle", ".", "leftTop", ",", "frame", ")", ";", "contentTree", ".", "addContent", "(", "leftTop", ")", ";", "}" ]
Add the IFRAME tag for the frame that lists all modules. @param contentTree to which the information will be added
[ "Add", "the", "IFRAME", "tag", "for", "the", "frame", "that", "lists", "all", "modules", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java#L148-L153
5,354
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
JavaTokenizer.lexError
protected void lexError(int pos, String key, Object... args) { log.error(pos, key, args); tk = TokenKind.ERROR; errPos = pos; }
java
protected void lexError(int pos, String key, Object... args) { log.error(pos, key, args); tk = TokenKind.ERROR; errPos = pos; }
[ "protected", "void", "lexError", "(", "int", "pos", ",", "String", "key", ",", "Object", "...", "args", ")", "{", "log", ".", "error", "(", "pos", ",", "key", ",", "args", ")", ";", "tk", "=", "TokenKind", ".", "ERROR", ";", "errPos", "=", "pos", ";", "}" ]
Report an error at the given position using the provided arguments.
[ "Report", "an", "error", "at", "the", "given", "position", "using", "the", "provided", "arguments", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L130-L134
5,355
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
JavaTokenizer.scanLitChar
private void scanLitChar(int pos) { if (reader.ch == '\\') { if (reader.peekChar() == '\\' && !reader.isUnicode()) { reader.skipChar(); reader.putChar('\\', true); } else { reader.scanChar(); switch (reader.ch) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': char leadch = reader.ch; int oct = reader.digit(pos, 8); reader.scanChar(); if ('0' <= reader.ch && reader.ch <= '7') { oct = oct * 8 + reader.digit(pos, 8); reader.scanChar(); if (leadch <= '3' && '0' <= reader.ch && reader.ch <= '7') { oct = oct * 8 + reader.digit(pos, 8); reader.scanChar(); } } reader.putChar((char)oct); break; case 'b': reader.putChar('\b', true); break; case 't': reader.putChar('\t', true); break; case 'n': reader.putChar('\n', true); break; case 'f': reader.putChar('\f', true); break; case 'r': reader.putChar('\r', true); break; case '\'': reader.putChar('\'', true); break; case '\"': reader.putChar('\"', true); break; case '\\': reader.putChar('\\', true); break; default: lexError(reader.bp, "illegal.esc.char"); } } } else if (reader.bp != reader.buflen) { reader.putChar(true); } }
java
private void scanLitChar(int pos) { if (reader.ch == '\\') { if (reader.peekChar() == '\\' && !reader.isUnicode()) { reader.skipChar(); reader.putChar('\\', true); } else { reader.scanChar(); switch (reader.ch) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': char leadch = reader.ch; int oct = reader.digit(pos, 8); reader.scanChar(); if ('0' <= reader.ch && reader.ch <= '7') { oct = oct * 8 + reader.digit(pos, 8); reader.scanChar(); if (leadch <= '3' && '0' <= reader.ch && reader.ch <= '7') { oct = oct * 8 + reader.digit(pos, 8); reader.scanChar(); } } reader.putChar((char)oct); break; case 'b': reader.putChar('\b', true); break; case 't': reader.putChar('\t', true); break; case 'n': reader.putChar('\n', true); break; case 'f': reader.putChar('\f', true); break; case 'r': reader.putChar('\r', true); break; case '\'': reader.putChar('\'', true); break; case '\"': reader.putChar('\"', true); break; case '\\': reader.putChar('\\', true); break; default: lexError(reader.bp, "illegal.esc.char"); } } } else if (reader.bp != reader.buflen) { reader.putChar(true); } }
[ "private", "void", "scanLitChar", "(", "int", "pos", ")", "{", "if", "(", "reader", ".", "ch", "==", "'", "'", ")", "{", "if", "(", "reader", ".", "peekChar", "(", ")", "==", "'", "'", "&&", "!", "reader", ".", "isUnicode", "(", ")", ")", "{", "reader", ".", "skipChar", "(", ")", ";", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "}", "else", "{", "reader", ".", "scanChar", "(", ")", ";", "switch", "(", "reader", ".", "ch", ")", "{", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "char", "leadch", "=", "reader", ".", "ch", ";", "int", "oct", "=", "reader", ".", "digit", "(", "pos", ",", "8", ")", ";", "reader", ".", "scanChar", "(", ")", ";", "if", "(", "'", "'", "<=", "reader", ".", "ch", "&&", "reader", ".", "ch", "<=", "'", "'", ")", "{", "oct", "=", "oct", "*", "8", "+", "reader", ".", "digit", "(", "pos", ",", "8", ")", ";", "reader", ".", "scanChar", "(", ")", ";", "if", "(", "leadch", "<=", "'", "'", "&&", "'", "'", "<=", "reader", ".", "ch", "&&", "reader", ".", "ch", "<=", "'", "'", ")", "{", "oct", "=", "oct", "*", "8", "+", "reader", ".", "digit", "(", "pos", ",", "8", ")", ";", "reader", ".", "scanChar", "(", ")", ";", "}", "}", "reader", ".", "putChar", "(", "(", "char", ")", "oct", ")", ";", "break", ";", "case", "'", "'", ":", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "break", ";", "case", "'", "'", ":", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "break", ";", "case", "'", "'", ":", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "break", ";", "case", "'", "'", ":", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "break", ";", "case", "'", "'", ":", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "break", ";", "case", "'", "'", ":", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "break", ";", "case", "'", "'", ":", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "break", ";", "case", "'", "'", ":", "reader", ".", "putChar", "(", "'", "'", ",", "true", ")", ";", "break", ";", "default", ":", "lexError", "(", "reader", ".", "bp", ",", "\"illegal.esc.char\"", ")", ";", "}", "}", "}", "else", "if", "(", "reader", ".", "bp", "!=", "reader", ".", "buflen", ")", "{", "reader", ".", "putChar", "(", "true", ")", ";", "}", "}" ]
Read next character in character or string literal and copy into sbuf.
[ "Read", "next", "character", "in", "character", "or", "string", "literal", "and", "copy", "into", "sbuf", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L138-L184
5,356
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
JavaTokenizer.scanIdent
private void scanIdent() { boolean isJavaIdentifierPart; char high; reader.putChar(true); do { switch (reader.ch) { case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case '$': case '_': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; case '\u0000': case '\u0001': case '\u0002': case '\u0003': case '\u0004': case '\u0005': case '\u0006': case '\u0007': case '\u0008': case '\u000E': case '\u000F': case '\u0010': case '\u0011': case '\u0012': case '\u0013': case '\u0014': case '\u0015': case '\u0016': case '\u0017': case '\u0018': case '\u0019': case '\u001B': case '\u007F': reader.scanChar(); continue; case '\u001A': // EOI is also a legal identifier part if (reader.bp >= reader.buflen) { name = reader.name(); tk = tokens.lookupKind(name); return; } reader.scanChar(); continue; default: if (reader.ch < '\u0080') { // all ASCII range chars already handled, above isJavaIdentifierPart = false; } else { if (Character.isIdentifierIgnorable(reader.ch)) { reader.scanChar(); continue; } else { int codePoint = reader.peekSurrogates(); if (codePoint >= 0) { if (isJavaIdentifierPart = Character.isJavaIdentifierPart(codePoint)) { reader.putChar(true); } } else { isJavaIdentifierPart = Character.isJavaIdentifierPart(reader.ch); } } } if (!isJavaIdentifierPart) { name = reader.name(); tk = tokens.lookupKind(name); return; } } reader.putChar(true); } while (true); }
java
private void scanIdent() { boolean isJavaIdentifierPart; char high; reader.putChar(true); do { switch (reader.ch) { case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case '$': case '_': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; case '\u0000': case '\u0001': case '\u0002': case '\u0003': case '\u0004': case '\u0005': case '\u0006': case '\u0007': case '\u0008': case '\u000E': case '\u000F': case '\u0010': case '\u0011': case '\u0012': case '\u0013': case '\u0014': case '\u0015': case '\u0016': case '\u0017': case '\u0018': case '\u0019': case '\u001B': case '\u007F': reader.scanChar(); continue; case '\u001A': // EOI is also a legal identifier part if (reader.bp >= reader.buflen) { name = reader.name(); tk = tokens.lookupKind(name); return; } reader.scanChar(); continue; default: if (reader.ch < '\u0080') { // all ASCII range chars already handled, above isJavaIdentifierPart = false; } else { if (Character.isIdentifierIgnorable(reader.ch)) { reader.scanChar(); continue; } else { int codePoint = reader.peekSurrogates(); if (codePoint >= 0) { if (isJavaIdentifierPart = Character.isJavaIdentifierPart(codePoint)) { reader.putChar(true); } } else { isJavaIdentifierPart = Character.isJavaIdentifierPart(reader.ch); } } } if (!isJavaIdentifierPart) { name = reader.name(); tk = tokens.lookupKind(name); return; } } reader.putChar(true); } while (true); }
[ "private", "void", "scanIdent", "(", ")", "{", "boolean", "isJavaIdentifierPart", ";", "char", "high", ";", "reader", ".", "putChar", "(", "true", ")", ";", "do", "{", "switch", "(", "reader", ".", "ch", ")", "{", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "break", ";", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "case", "'", "'", ":", "reader", ".", "scanChar", "(", ")", ";", "continue", ";", "case", "'", "'", ":", "// EOI is also a legal identifier part", "if", "(", "reader", ".", "bp", ">=", "reader", ".", "buflen", ")", "{", "name", "=", "reader", ".", "name", "(", ")", ";", "tk", "=", "tokens", ".", "lookupKind", "(", "name", ")", ";", "return", ";", "}", "reader", ".", "scanChar", "(", ")", ";", "continue", ";", "default", ":", "if", "(", "reader", ".", "ch", "<", "'", "'", ")", "{", "// all ASCII range chars already handled, above", "isJavaIdentifierPart", "=", "false", ";", "}", "else", "{", "if", "(", "Character", ".", "isIdentifierIgnorable", "(", "reader", ".", "ch", ")", ")", "{", "reader", ".", "scanChar", "(", ")", ";", "continue", ";", "}", "else", "{", "int", "codePoint", "=", "reader", ".", "peekSurrogates", "(", ")", ";", "if", "(", "codePoint", ">=", "0", ")", "{", "if", "(", "isJavaIdentifierPart", "=", "Character", ".", "isJavaIdentifierPart", "(", "codePoint", ")", ")", "{", "reader", ".", "putChar", "(", "true", ")", ";", "}", "}", "else", "{", "isJavaIdentifierPart", "=", "Character", ".", "isJavaIdentifierPart", "(", "reader", ".", "ch", ")", ";", "}", "}", "}", "if", "(", "!", "isJavaIdentifierPart", ")", "{", "name", "=", "reader", ".", "name", "(", ")", ";", "tk", "=", "tokens", ".", "lookupKind", "(", "name", ")", ";", "return", ";", "}", "}", "reader", ".", "putChar", "(", "true", ")", ";", "}", "while", "(", "true", ")", ";", "}" ]
Read an identifier.
[ "Read", "an", "identifier", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L350-L416
5,357
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
JavaTokenizer.scanOperator
private void scanOperator() { while (true) { reader.putChar(false); Name newname = reader.name(); TokenKind tk1 = tokens.lookupKind(newname); if (tk1 == TokenKind.IDENTIFIER) { reader.sp--; break; } tk = tk1; reader.scanChar(); if (!isSpecial(reader.ch)) break; } }
java
private void scanOperator() { while (true) { reader.putChar(false); Name newname = reader.name(); TokenKind tk1 = tokens.lookupKind(newname); if (tk1 == TokenKind.IDENTIFIER) { reader.sp--; break; } tk = tk1; reader.scanChar(); if (!isSpecial(reader.ch)) break; } }
[ "private", "void", "scanOperator", "(", ")", "{", "while", "(", "true", ")", "{", "reader", ".", "putChar", "(", "false", ")", ";", "Name", "newname", "=", "reader", ".", "name", "(", ")", ";", "TokenKind", "tk1", "=", "tokens", ".", "lookupKind", "(", "newname", ")", ";", "if", "(", "tk1", "==", "TokenKind", ".", "IDENTIFIER", ")", "{", "reader", ".", "sp", "--", ";", "break", ";", "}", "tk", "=", "tk1", ";", "reader", ".", "scanChar", "(", ")", ";", "if", "(", "!", "isSpecial", "(", "reader", ".", "ch", ")", ")", "break", ";", "}", "}" ]
Read longest possible sequence of special characters and convert to token.
[ "Read", "longest", "possible", "sequence", "of", "special", "characters", "and", "convert", "to", "token", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L435-L448
5,358
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
JavaTokenizer.processWhiteSpace
protected void processWhiteSpace(int pos, int endPos) { if (scannerDebug) System.out.println("processWhitespace(" + pos + "," + endPos + ")=|" + new String(reader.getRawCharacters(pos, endPos)) + "|"); }
java
protected void processWhiteSpace(int pos, int endPos) { if (scannerDebug) System.out.println("processWhitespace(" + pos + "," + endPos + ")=|" + new String(reader.getRawCharacters(pos, endPos)) + "|"); }
[ "protected", "void", "processWhiteSpace", "(", "int", "pos", ",", "int", "endPos", ")", "{", "if", "(", "scannerDebug", ")", "System", ".", "out", ".", "println", "(", "\"processWhitespace(\"", "+", "pos", "+", "\",\"", "+", "endPos", "+", "\")=|\"", "+", "new", "String", "(", "reader", ".", "getRawCharacters", "(", "pos", ",", "endPos", ")", ")", "+", "\"|\"", ")", ";", "}" ]
Called when a complete whitespace run has been scanned. pos and endPos will mark the whitespace boundary.
[ "Called", "when", "a", "complete", "whitespace", "run", "has", "been", "scanned", ".", "pos", "and", "endPos", "will", "mark", "the", "whitespace", "boundary", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L741-L747
5,359
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
JavaTokenizer.getLineMap
public Position.LineMap getLineMap() { return Position.makeLineMap(reader.getRawCharacters(), reader.buflen, false); }
java
public Position.LineMap getLineMap() { return Position.makeLineMap(reader.getRawCharacters(), reader.buflen, false); }
[ "public", "Position", ".", "LineMap", "getLineMap", "(", ")", "{", "return", "Position", ".", "makeLineMap", "(", "reader", ".", "getRawCharacters", "(", ")", ",", "reader", ".", "buflen", ",", "false", ")", ";", "}" ]
Build a map for translating between line numbers and positions in the input. @return a LineMap
[ "Build", "a", "map", "for", "translating", "between", "line", "numbers", "and", "positions", "in", "the", "input", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L764-L766
5,360
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java
TypeMaker.getTypes
public static com.sun.javadoc.Type[] getTypes(DocEnv env, List<Type> ts) { return getTypes(env, ts, new com.sun.javadoc.Type[ts.length()]); }
java
public static com.sun.javadoc.Type[] getTypes(DocEnv env, List<Type> ts) { return getTypes(env, ts, new com.sun.javadoc.Type[ts.length()]); }
[ "public", "static", "com", ".", "sun", ".", "javadoc", ".", "Type", "[", "]", "getTypes", "(", "DocEnv", "env", ",", "List", "<", "Type", ">", "ts", ")", "{", "return", "getTypes", "(", "env", ",", "ts", ",", "new", "com", ".", "sun", ".", "javadoc", ".", "Type", "[", "ts", ".", "length", "(", ")", "]", ")", ";", "}" ]
Convert a list of javac types into an array of javadoc types.
[ "Convert", "a", "list", "of", "javac", "types", "into", "an", "array", "of", "javadoc", "types", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java#L118-L120
5,361
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java
TypeMaker.getTypes
public static com.sun.javadoc.Type[] getTypes(DocEnv env, List<Type> ts, com.sun.javadoc.Type res[]) { int i = 0; for (Type t : ts) { res[i++] = getType(env, t); } return res; }
java
public static com.sun.javadoc.Type[] getTypes(DocEnv env, List<Type> ts, com.sun.javadoc.Type res[]) { int i = 0; for (Type t : ts) { res[i++] = getType(env, t); } return res; }
[ "public", "static", "com", ".", "sun", ".", "javadoc", ".", "Type", "[", "]", "getTypes", "(", "DocEnv", "env", ",", "List", "<", "Type", ">", "ts", ",", "com", ".", "sun", ".", "javadoc", ".", "Type", "res", "[", "]", ")", "{", "int", "i", "=", "0", ";", "for", "(", "Type", "t", ":", "ts", ")", "{", "res", "[", "i", "++", "]", "=", "getType", "(", "env", ",", "t", ")", ";", "}", "return", "res", ";", "}" ]
Like the above version, but use and return the array given.
[ "Like", "the", "above", "version", "but", "use", "and", "return", "the", "array", "given", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java#L125-L132
5,362
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java
TypeMaker.typeParametersString
static String typeParametersString(DocEnv env, Symbol sym, boolean full) { if (env.legacyDoclet || sym.type.getTypeArguments().isEmpty()) { return ""; } StringBuilder s = new StringBuilder(); for (Type t : sym.type.getTypeArguments()) { s.append(s.length() == 0 ? "<" : ", "); s.append(TypeVariableImpl.typeVarToString(env, (TypeVar)t, full)); } s.append(">"); return s.toString(); }
java
static String typeParametersString(DocEnv env, Symbol sym, boolean full) { if (env.legacyDoclet || sym.type.getTypeArguments().isEmpty()) { return ""; } StringBuilder s = new StringBuilder(); for (Type t : sym.type.getTypeArguments()) { s.append(s.length() == 0 ? "<" : ", "); s.append(TypeVariableImpl.typeVarToString(env, (TypeVar)t, full)); } s.append(">"); return s.toString(); }
[ "static", "String", "typeParametersString", "(", "DocEnv", "env", ",", "Symbol", "sym", ",", "boolean", "full", ")", "{", "if", "(", "env", ".", "legacyDoclet", "||", "sym", ".", "type", ".", "getTypeArguments", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "\"\"", ";", "}", "StringBuilder", "s", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Type", "t", ":", "sym", ".", "type", ".", "getTypeArguments", "(", ")", ")", "{", "s", ".", "append", "(", "s", ".", "length", "(", ")", "==", "0", "?", "\"<\"", ":", "\", \"", ")", ";", "s", ".", "append", "(", "TypeVariableImpl", ".", "typeVarToString", "(", "env", ",", "(", "TypeVar", ")", "t", ",", "full", ")", ")", ";", "}", "s", ".", "append", "(", "\">\"", ")", ";", "return", "s", ".", "toString", "(", ")", ";", "}" ]
Return the formal type parameters of a class or method as an angle-bracketed string. Each parameter is a type variable with optional bounds. Class names are qualified if "full" is true. Return "" if there are no type parameters or we're hiding generics.
[ "Return", "the", "formal", "type", "parameters", "of", "a", "class", "or", "method", "as", "an", "angle", "-", "bracketed", "string", ".", "Each", "parameter", "is", "a", "type", "variable", "with", "optional", "bounds", ".", "Class", "names", "are", "qualified", "if", "full", "is", "true", ".", "Return", "if", "there", "are", "no", "type", "parameters", "or", "we", "re", "hiding", "generics", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java#L184-L195
5,363
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java
TypeMaker.typeArgumentsString
static String typeArgumentsString(DocEnv env, ClassType cl, boolean full) { if (env.legacyDoclet || cl.getTypeArguments().isEmpty()) { return ""; } StringBuilder s = new StringBuilder(); for (Type t : cl.getTypeArguments()) { s.append(s.length() == 0 ? "<" : ", "); s.append(getTypeString(env, t, full)); } s.append(">"); return s.toString(); }
java
static String typeArgumentsString(DocEnv env, ClassType cl, boolean full) { if (env.legacyDoclet || cl.getTypeArguments().isEmpty()) { return ""; } StringBuilder s = new StringBuilder(); for (Type t : cl.getTypeArguments()) { s.append(s.length() == 0 ? "<" : ", "); s.append(getTypeString(env, t, full)); } s.append(">"); return s.toString(); }
[ "static", "String", "typeArgumentsString", "(", "DocEnv", "env", ",", "ClassType", "cl", ",", "boolean", "full", ")", "{", "if", "(", "env", ".", "legacyDoclet", "||", "cl", ".", "getTypeArguments", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "\"\"", ";", "}", "StringBuilder", "s", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Type", "t", ":", "cl", ".", "getTypeArguments", "(", ")", ")", "{", "s", ".", "append", "(", "s", ".", "length", "(", ")", "==", "0", "?", "\"<\"", ":", "\", \"", ")", ";", "s", ".", "append", "(", "getTypeString", "(", "env", ",", "t", ",", "full", ")", ")", ";", "}", "s", ".", "append", "(", "\">\"", ")", ";", "return", "s", ".", "toString", "(", ")", ";", "}" ]
Return the actual type arguments of a parameterized type as an angle-bracketed string. Class name are qualified if "full" is true. Return "" if there are no type arguments or we're hiding generics.
[ "Return", "the", "actual", "type", "arguments", "of", "a", "parameterized", "type", "as", "an", "angle", "-", "bracketed", "string", ".", "Class", "name", "are", "qualified", "if", "full", "is", "true", ".", "Return", "if", "there", "are", "no", "type", "arguments", "or", "we", "re", "hiding", "generics", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeMaker.java#L202-L213
5,364
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java
ClassBuilder.buildClassInfo
public void buildClassInfo(XMLNode node, Content classContentTree) { Content classInfoTree = writer.getClassInfoTreeHeader(); buildChildren(node, classInfoTree); classContentTree.addContent(writer.getClassInfo(classInfoTree)); }
java
public void buildClassInfo(XMLNode node, Content classContentTree) { Content classInfoTree = writer.getClassInfoTreeHeader(); buildChildren(node, classInfoTree); classContentTree.addContent(writer.getClassInfo(classInfoTree)); }
[ "public", "void", "buildClassInfo", "(", "XMLNode", "node", ",", "Content", "classContentTree", ")", "{", "Content", "classInfoTree", "=", "writer", ".", "getClassInfoTreeHeader", "(", ")", ";", "buildChildren", "(", "node", ",", "classInfoTree", ")", ";", "classContentTree", ".", "addContent", "(", "writer", ".", "getClassInfo", "(", "classInfoTree", ")", ")", ";", "}" ]
Build the class information tree documentation. @param node the XML element that specifies which components to document @param classContentTree the content tree to which the documentation will be added
[ "Build", "the", "class", "information", "tree", "documentation", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java#L171-L175
5,365
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java
ClassBuilder.buildMemberSummary
public void buildMemberSummary(XMLNode node, Content classContentTree) throws Exception { Content memberSummaryTree = writer.getMemberTreeHeader(); configuration.getBuilderFactory(). getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree); classContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); }
java
public void buildMemberSummary(XMLNode node, Content classContentTree) throws Exception { Content memberSummaryTree = writer.getMemberTreeHeader(); configuration.getBuilderFactory(). getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree); classContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); }
[ "public", "void", "buildMemberSummary", "(", "XMLNode", "node", ",", "Content", "classContentTree", ")", "throws", "Exception", "{", "Content", "memberSummaryTree", "=", "writer", ".", "getMemberTreeHeader", "(", ")", ";", "configuration", ".", "getBuilderFactory", "(", ")", ".", "getMemberSummaryBuilder", "(", "writer", ")", ".", "buildChildren", "(", "node", ",", "memberSummaryTree", ")", ";", "classContentTree", ".", "addContent", "(", "writer", ".", "getMemberSummaryTree", "(", "memberSummaryTree", ")", ")", ";", "}" ]
Build the member summary contents of the page. @param node the XML element that specifies which components to document @param classContentTree the content tree to which the documentation will be added
[ "Build", "the", "member", "summary", "contents", "of", "the", "page", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java#L339-L344
5,366
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java
ClassBuilder.buildEnumConstantsDetails
public void buildEnumConstantsDetails(XMLNode node, Content memberDetailsTree) throws Exception { configuration.getBuilderFactory(). getEnumConstantsBuilder(writer).buildChildren(node, memberDetailsTree); }
java
public void buildEnumConstantsDetails(XMLNode node, Content memberDetailsTree) throws Exception { configuration.getBuilderFactory(). getEnumConstantsBuilder(writer).buildChildren(node, memberDetailsTree); }
[ "public", "void", "buildEnumConstantsDetails", "(", "XMLNode", "node", ",", "Content", "memberDetailsTree", ")", "throws", "Exception", "{", "configuration", ".", "getBuilderFactory", "(", ")", ".", "getEnumConstantsBuilder", "(", "writer", ")", ".", "buildChildren", "(", "node", ",", "memberDetailsTree", ")", ";", "}" ]
Build the enum constants documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added
[ "Build", "the", "enum", "constants", "documentation", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java#L364-L368
5,367
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java
ClassUseMapper.subinterfaces
private Collection<ClassDoc> subinterfaces(ClassDoc cd) { Collection<ClassDoc> ret = classToSubinterface.get(cd.qualifiedName()); if (ret == null) { ret = new TreeSet<>(utils.makeComparatorForClassUse()); SortedSet<ClassDoc> subs = classtree.subinterfaces(cd); if (subs != null) { ret.addAll(subs); for (ClassDoc sub : subs) { ret.addAll(subinterfaces(sub)); } } addAll(classToSubinterface, cd, ret); } return ret; }
java
private Collection<ClassDoc> subinterfaces(ClassDoc cd) { Collection<ClassDoc> ret = classToSubinterface.get(cd.qualifiedName()); if (ret == null) { ret = new TreeSet<>(utils.makeComparatorForClassUse()); SortedSet<ClassDoc> subs = classtree.subinterfaces(cd); if (subs != null) { ret.addAll(subs); for (ClassDoc sub : subs) { ret.addAll(subinterfaces(sub)); } } addAll(classToSubinterface, cd, ret); } return ret; }
[ "private", "Collection", "<", "ClassDoc", ">", "subinterfaces", "(", "ClassDoc", "cd", ")", "{", "Collection", "<", "ClassDoc", ">", "ret", "=", "classToSubinterface", ".", "get", "(", "cd", ".", "qualifiedName", "(", ")", ")", ";", "if", "(", "ret", "==", "null", ")", "{", "ret", "=", "new", "TreeSet", "<>", "(", "utils", ".", "makeComparatorForClassUse", "(", ")", ")", ";", "SortedSet", "<", "ClassDoc", ">", "subs", "=", "classtree", ".", "subinterfaces", "(", "cd", ")", ";", "if", "(", "subs", "!=", "null", ")", "{", "ret", ".", "addAll", "(", "subs", ")", ";", "for", "(", "ClassDoc", "sub", ":", "subs", ")", "{", "ret", ".", "addAll", "(", "subinterfaces", "(", "sub", ")", ")", ";", "}", "}", "addAll", "(", "classToSubinterface", ",", "cd", ",", "ret", ")", ";", "}", "return", "ret", ";", "}" ]
Return all subinterfaces of an interface AND fill-in classToSubinterface map.
[ "Return", "all", "subinterfaces", "of", "an", "interface", "AND", "fill", "-", "in", "classToSubinterface", "map", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java#L256-L270
5,368
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/ScannerFactory.java
ScannerFactory.instance
public static ScannerFactory instance(Context context) { ScannerFactory instance = context.get(scannerFactoryKey); if (instance == null) instance = new ScannerFactory(context); return instance; }
java
public static ScannerFactory instance(Context context) { ScannerFactory instance = context.get(scannerFactoryKey); if (instance == null) instance = new ScannerFactory(context); return instance; }
[ "public", "static", "ScannerFactory", "instance", "(", "Context", "context", ")", "{", "ScannerFactory", "instance", "=", "context", ".", "get", "(", "scannerFactoryKey", ")", ";", "if", "(", "instance", "==", "null", ")", "instance", "=", "new", "ScannerFactory", "(", "context", ")", ";", "return", "instance", ";", "}" ]
Get the Factory instance for this context.
[ "Get", "the", "Factory", "instance", "for", "this", "context", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/ScannerFactory.java#L49-L54
5,369
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java
SubWriterHolderWriter.getTableCaption
public Content getTableCaption(Set<MethodTypes> methodTypes) { Content tabbedCaption = new HtmlTree(HtmlTag.CAPTION); for (MethodTypes type : methodTypes) { Content captionSpan; Content span; if (type.tableTabs().isDefaultTab()) { captionSpan = HtmlTree.SPAN(configuration.getContent(type.tableTabs().resourceKey())); span = HtmlTree.SPAN(type.tableTabs().tabId(), HtmlStyle.activeTableTab, captionSpan); } else { captionSpan = HtmlTree.SPAN(getMethodTypeLinks(type)); span = HtmlTree.SPAN(type.tableTabs().tabId(), HtmlStyle.tableTab, captionSpan); } Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, Contents.SPACE); span.addContent(tabSpan); tabbedCaption.addContent(span); } return tabbedCaption; }
java
public Content getTableCaption(Set<MethodTypes> methodTypes) { Content tabbedCaption = new HtmlTree(HtmlTag.CAPTION); for (MethodTypes type : methodTypes) { Content captionSpan; Content span; if (type.tableTabs().isDefaultTab()) { captionSpan = HtmlTree.SPAN(configuration.getContent(type.tableTabs().resourceKey())); span = HtmlTree.SPAN(type.tableTabs().tabId(), HtmlStyle.activeTableTab, captionSpan); } else { captionSpan = HtmlTree.SPAN(getMethodTypeLinks(type)); span = HtmlTree.SPAN(type.tableTabs().tabId(), HtmlStyle.tableTab, captionSpan); } Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, Contents.SPACE); span.addContent(tabSpan); tabbedCaption.addContent(span); } return tabbedCaption; }
[ "public", "Content", "getTableCaption", "(", "Set", "<", "MethodTypes", ">", "methodTypes", ")", "{", "Content", "tabbedCaption", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "CAPTION", ")", ";", "for", "(", "MethodTypes", "type", ":", "methodTypes", ")", "{", "Content", "captionSpan", ";", "Content", "span", ";", "if", "(", "type", ".", "tableTabs", "(", ")", ".", "isDefaultTab", "(", ")", ")", "{", "captionSpan", "=", "HtmlTree", ".", "SPAN", "(", "configuration", ".", "getContent", "(", "type", ".", "tableTabs", "(", ")", ".", "resourceKey", "(", ")", ")", ")", ";", "span", "=", "HtmlTree", ".", "SPAN", "(", "type", ".", "tableTabs", "(", ")", ".", "tabId", "(", ")", ",", "HtmlStyle", ".", "activeTableTab", ",", "captionSpan", ")", ";", "}", "else", "{", "captionSpan", "=", "HtmlTree", ".", "SPAN", "(", "getMethodTypeLinks", "(", "type", ")", ")", ";", "span", "=", "HtmlTree", ".", "SPAN", "(", "type", ".", "tableTabs", "(", ")", ".", "tabId", "(", ")", ",", "HtmlStyle", ".", "tableTab", ",", "captionSpan", ")", ";", "}", "Content", "tabSpan", "=", "HtmlTree", ".", "SPAN", "(", "HtmlStyle", ".", "tabEnd", ",", "Contents", ".", "SPACE", ")", ";", "span", ".", "addContent", "(", "tabSpan", ")", ";", "tabbedCaption", ".", "addContent", "(", "span", ")", ";", "}", "return", "tabbedCaption", ";", "}" ]
Get the summary table caption. @param methodTypes set comprising of method types to show as table caption @return the caption for the summary table
[ "Get", "the", "summary", "table", "caption", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java#L121-L140
5,370
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java
SubWriterHolderWriter.getMethodTypeLinks
public Content getMethodTypeLinks(MethodTypes methodType) { String jsShow = "javascript:show(" + methodType.tableTabs().value() +");"; HtmlTree link = HtmlTree.A(jsShow, configuration.getContent(methodType.tableTabs().resourceKey())); return link; }
java
public Content getMethodTypeLinks(MethodTypes methodType) { String jsShow = "javascript:show(" + methodType.tableTabs().value() +");"; HtmlTree link = HtmlTree.A(jsShow, configuration.getContent(methodType.tableTabs().resourceKey())); return link; }
[ "public", "Content", "getMethodTypeLinks", "(", "MethodTypes", "methodType", ")", "{", "String", "jsShow", "=", "\"javascript:show(\"", "+", "methodType", ".", "tableTabs", "(", ")", ".", "value", "(", ")", "+", "\");\"", ";", "HtmlTree", "link", "=", "HtmlTree", ".", "A", "(", "jsShow", ",", "configuration", ".", "getContent", "(", "methodType", ".", "tableTabs", "(", ")", ".", "resourceKey", "(", ")", ")", ")", ";", "return", "link", ";", "}" ]
Get the method type links for the table caption. @param methodType the method type to be displayed as link @return the content tree for the method type link
[ "Get", "the", "method", "type", "links", "for", "the", "table", "caption", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java#L148-L152
5,371
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java
IndexRedirectWriter.generateIndexFile
void generateIndexFile() throws DocFileIOException { Content htmlDocType = configuration.isOutputHtml5() ? DocType.HTML5 : DocType.TRANSITIONAL; Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); Content head = new HtmlTree(HtmlTag.HEAD); head.addContent(getGeneratedBy(!configuration.notimestamp)); String title = (configuration.windowtitle.length() > 0) ? configuration.windowtitle : configuration.getText("doclet.Generated_Docs_Untitled"); Content windowTitle = HtmlTree.TITLE(new StringContent(title)); head.addContent(windowTitle); Content metaContentType = HtmlTree.META("Content", CONTENT_TYPE, (configuration.charset.length() > 0) ? configuration.charset : HtmlConstants.HTML_DEFAULT_CHARSET); head.addContent(metaContentType); String topFilePath = configuration.topFile.getPath(); String javaScriptRefresh = "window.location.replace('" + topFilePath + "')"; HtmlTree scriptTree = HtmlTree.SCRIPT(); scriptTree.addContent(javaScriptRefresh); head.addContent(scriptTree); HtmlTree metaRefresh = new HtmlTree(HtmlTag.META); metaRefresh.addAttr(HtmlAttr.HTTP_EQUIV, "Refresh"); metaRefresh.addAttr(HtmlAttr.CONTENT, "0;" + topFilePath); if (configuration.isOutputHtml5()) { head.addContent(HtmlTree.NOSCRIPT(metaRefresh)); } else { head.addContent(metaRefresh); } head.addContent(getStyleSheetProperties(configuration)); ContentBuilder bodyContent = new ContentBuilder(); bodyContent.addContent(HtmlTree.NOSCRIPT( HtmlTree.P(configuration.getContent("doclet.No_Script_Message")))); bodyContent.addContent(HtmlTree.P(HtmlTree.A(topFilePath, new StringContent(topFilePath)))); Content body = new HtmlTree(HtmlTag.BODY); if (configuration.allowTag(HtmlTag.MAIN)) { HtmlTree main = HtmlTree.MAIN(bodyContent); body.addContent(main); } else { body.addContent(bodyContent); } Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body); Content htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree); write(htmlDocument); }
java
void generateIndexFile() throws DocFileIOException { Content htmlDocType = configuration.isOutputHtml5() ? DocType.HTML5 : DocType.TRANSITIONAL; Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); Content head = new HtmlTree(HtmlTag.HEAD); head.addContent(getGeneratedBy(!configuration.notimestamp)); String title = (configuration.windowtitle.length() > 0) ? configuration.windowtitle : configuration.getText("doclet.Generated_Docs_Untitled"); Content windowTitle = HtmlTree.TITLE(new StringContent(title)); head.addContent(windowTitle); Content metaContentType = HtmlTree.META("Content", CONTENT_TYPE, (configuration.charset.length() > 0) ? configuration.charset : HtmlConstants.HTML_DEFAULT_CHARSET); head.addContent(metaContentType); String topFilePath = configuration.topFile.getPath(); String javaScriptRefresh = "window.location.replace('" + topFilePath + "')"; HtmlTree scriptTree = HtmlTree.SCRIPT(); scriptTree.addContent(javaScriptRefresh); head.addContent(scriptTree); HtmlTree metaRefresh = new HtmlTree(HtmlTag.META); metaRefresh.addAttr(HtmlAttr.HTTP_EQUIV, "Refresh"); metaRefresh.addAttr(HtmlAttr.CONTENT, "0;" + topFilePath); if (configuration.isOutputHtml5()) { head.addContent(HtmlTree.NOSCRIPT(metaRefresh)); } else { head.addContent(metaRefresh); } head.addContent(getStyleSheetProperties(configuration)); ContentBuilder bodyContent = new ContentBuilder(); bodyContent.addContent(HtmlTree.NOSCRIPT( HtmlTree.P(configuration.getContent("doclet.No_Script_Message")))); bodyContent.addContent(HtmlTree.P(HtmlTree.A(topFilePath, new StringContent(topFilePath)))); Content body = new HtmlTree(HtmlTag.BODY); if (configuration.allowTag(HtmlTag.MAIN)) { HtmlTree main = HtmlTree.MAIN(bodyContent); body.addContent(main); } else { body.addContent(bodyContent); } Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body); Content htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree); write(htmlDocument); }
[ "void", "generateIndexFile", "(", ")", "throws", "DocFileIOException", "{", "Content", "htmlDocType", "=", "configuration", ".", "isOutputHtml5", "(", ")", "?", "DocType", ".", "HTML5", ":", "DocType", ".", "TRANSITIONAL", ";", "Content", "htmlComment", "=", "new", "Comment", "(", "configuration", ".", "getText", "(", "\"doclet.New_Page\"", ")", ")", ";", "Content", "head", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "HEAD", ")", ";", "head", ".", "addContent", "(", "getGeneratedBy", "(", "!", "configuration", ".", "notimestamp", ")", ")", ";", "String", "title", "=", "(", "configuration", ".", "windowtitle", ".", "length", "(", ")", ">", "0", ")", "?", "configuration", ".", "windowtitle", ":", "configuration", ".", "getText", "(", "\"doclet.Generated_Docs_Untitled\"", ")", ";", "Content", "windowTitle", "=", "HtmlTree", ".", "TITLE", "(", "new", "StringContent", "(", "title", ")", ")", ";", "head", ".", "addContent", "(", "windowTitle", ")", ";", "Content", "metaContentType", "=", "HtmlTree", ".", "META", "(", "\"Content\"", ",", "CONTENT_TYPE", ",", "(", "configuration", ".", "charset", ".", "length", "(", ")", ">", "0", ")", "?", "configuration", ".", "charset", ":", "HtmlConstants", ".", "HTML_DEFAULT_CHARSET", ")", ";", "head", ".", "addContent", "(", "metaContentType", ")", ";", "String", "topFilePath", "=", "configuration", ".", "topFile", ".", "getPath", "(", ")", ";", "String", "javaScriptRefresh", "=", "\"window.location.replace('\"", "+", "topFilePath", "+", "\"')\"", ";", "HtmlTree", "scriptTree", "=", "HtmlTree", ".", "SCRIPT", "(", ")", ";", "scriptTree", ".", "addContent", "(", "javaScriptRefresh", ")", ";", "head", ".", "addContent", "(", "scriptTree", ")", ";", "HtmlTree", "metaRefresh", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "META", ")", ";", "metaRefresh", ".", "addAttr", "(", "HtmlAttr", ".", "HTTP_EQUIV", ",", "\"Refresh\"", ")", ";", "metaRefresh", ".", "addAttr", "(", "HtmlAttr", ".", "CONTENT", ",", "\"0;\"", "+", "topFilePath", ")", ";", "if", "(", "configuration", ".", "isOutputHtml5", "(", ")", ")", "{", "head", ".", "addContent", "(", "HtmlTree", ".", "NOSCRIPT", "(", "metaRefresh", ")", ")", ";", "}", "else", "{", "head", ".", "addContent", "(", "metaRefresh", ")", ";", "}", "head", ".", "addContent", "(", "getStyleSheetProperties", "(", "configuration", ")", ")", ";", "ContentBuilder", "bodyContent", "=", "new", "ContentBuilder", "(", ")", ";", "bodyContent", ".", "addContent", "(", "HtmlTree", ".", "NOSCRIPT", "(", "HtmlTree", ".", "P", "(", "configuration", ".", "getContent", "(", "\"doclet.No_Script_Message\"", ")", ")", ")", ")", ";", "bodyContent", ".", "addContent", "(", "HtmlTree", ".", "P", "(", "HtmlTree", ".", "A", "(", "topFilePath", ",", "new", "StringContent", "(", "topFilePath", ")", ")", ")", ")", ";", "Content", "body", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "BODY", ")", ";", "if", "(", "configuration", ".", "allowTag", "(", "HtmlTag", ".", "MAIN", ")", ")", "{", "HtmlTree", "main", "=", "HtmlTree", ".", "MAIN", "(", "bodyContent", ")", ";", "body", ".", "addContent", "(", "main", ")", ";", "}", "else", "{", "body", ".", "addContent", "(", "bodyContent", ")", ";", "}", "Content", "htmlTree", "=", "HtmlTree", ".", "HTML", "(", "configuration", ".", "getLocale", "(", ")", ".", "getLanguage", "(", ")", ",", "head", ",", "body", ")", ";", "Content", "htmlDocument", "=", "new", "HtmlDocument", "(", "htmlDocType", ",", "htmlComment", ",", "htmlTree", ")", ";", "write", "(", "htmlDocument", ")", ";", "}" ]
Generate an index file that redirects to an alternate file. @throws DocFileIOException if there is a problem generating the file
[ "Generate", "an", "index", "file", "that", "redirects", "to", "an", "alternate", "file", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java#L69-L124
5,372
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java
AbstractBuilder.build
protected void build(XMLNode node, Content contentTree) throws DocletException { String component = node.name; try { String methodName = "build" + component; if (DEBUG) { configuration.reporter.print(ERROR, "DEBUG: " + getClass().getName() + "." + methodName); } Method method = getClass().getMethod(methodName, XMLNode.class, Content.class); method.invoke(this, node, contentTree); } catch (NoSuchMethodException e) { // Use SimpleDocletException instead of InternalException because there is nothing // informative about about the place the exception occurred, here in this method. // The problem is either a misconfigured doclet.xml file or a missing method in the // user-supplied(?) doclet String message = resources.getText("doclet.builder.unknown.component", component); throw new SimpleDocletException(message, e); } catch (InvocationTargetException e) { Throwable cause = e.getCause(); if (cause instanceof DocletException) { throw (DocletException) cause; } else if (cause instanceof UncheckedDocletException) { throw (DocletException) cause.getCause(); } else { // use InternalException, so that a stacktrace showing the position of // the internal exception is generated String message = resources.getText("doclet.builder.exception.in.component", component, e.getCause()); throw new InternalException(message, e.getCause()); } } catch (ReflectiveOperationException e) { // Use SimpleDocletException instead of InternalException because there is nothing // informative about about the place the exception occurred, here in this method. // The problem is specific to the method being invoked, such as illegal access // or illegal argument. String message = resources.getText("doclet.builder.exception.in.component", component, e); throw new SimpleDocletException(message, e.getCause()); } }
java
protected void build(XMLNode node, Content contentTree) throws DocletException { String component = node.name; try { String methodName = "build" + component; if (DEBUG) { configuration.reporter.print(ERROR, "DEBUG: " + getClass().getName() + "." + methodName); } Method method = getClass().getMethod(methodName, XMLNode.class, Content.class); method.invoke(this, node, contentTree); } catch (NoSuchMethodException e) { // Use SimpleDocletException instead of InternalException because there is nothing // informative about about the place the exception occurred, here in this method. // The problem is either a misconfigured doclet.xml file or a missing method in the // user-supplied(?) doclet String message = resources.getText("doclet.builder.unknown.component", component); throw new SimpleDocletException(message, e); } catch (InvocationTargetException e) { Throwable cause = e.getCause(); if (cause instanceof DocletException) { throw (DocletException) cause; } else if (cause instanceof UncheckedDocletException) { throw (DocletException) cause.getCause(); } else { // use InternalException, so that a stacktrace showing the position of // the internal exception is generated String message = resources.getText("doclet.builder.exception.in.component", component, e.getCause()); throw new InternalException(message, e.getCause()); } } catch (ReflectiveOperationException e) { // Use SimpleDocletException instead of InternalException because there is nothing // informative about about the place the exception occurred, here in this method. // The problem is specific to the method being invoked, such as illegal access // or illegal argument. String message = resources.getText("doclet.builder.exception.in.component", component, e); throw new SimpleDocletException(message, e.getCause()); } }
[ "protected", "void", "build", "(", "XMLNode", "node", ",", "Content", "contentTree", ")", "throws", "DocletException", "{", "String", "component", "=", "node", ".", "name", ";", "try", "{", "String", "methodName", "=", "\"build\"", "+", "component", ";", "if", "(", "DEBUG", ")", "{", "configuration", ".", "reporter", ".", "print", "(", "ERROR", ",", "\"DEBUG: \"", "+", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\".\"", "+", "methodName", ")", ";", "}", "Method", "method", "=", "getClass", "(", ")", ".", "getMethod", "(", "methodName", ",", "XMLNode", ".", "class", ",", "Content", ".", "class", ")", ";", "method", ".", "invoke", "(", "this", ",", "node", ",", "contentTree", ")", ";", "}", "catch", "(", "NoSuchMethodException", "e", ")", "{", "// Use SimpleDocletException instead of InternalException because there is nothing", "// informative about about the place the exception occurred, here in this method.", "// The problem is either a misconfigured doclet.xml file or a missing method in the", "// user-supplied(?) doclet", "String", "message", "=", "resources", ".", "getText", "(", "\"doclet.builder.unknown.component\"", ",", "component", ")", ";", "throw", "new", "SimpleDocletException", "(", "message", ",", "e", ")", ";", "}", "catch", "(", "InvocationTargetException", "e", ")", "{", "Throwable", "cause", "=", "e", ".", "getCause", "(", ")", ";", "if", "(", "cause", "instanceof", "DocletException", ")", "{", "throw", "(", "DocletException", ")", "cause", ";", "}", "else", "if", "(", "cause", "instanceof", "UncheckedDocletException", ")", "{", "throw", "(", "DocletException", ")", "cause", ".", "getCause", "(", ")", ";", "}", "else", "{", "// use InternalException, so that a stacktrace showing the position of", "// the internal exception is generated", "String", "message", "=", "resources", ".", "getText", "(", "\"doclet.builder.exception.in.component\"", ",", "component", ",", "e", ".", "getCause", "(", ")", ")", ";", "throw", "new", "InternalException", "(", "message", ",", "e", ".", "getCause", "(", ")", ")", ";", "}", "}", "catch", "(", "ReflectiveOperationException", "e", ")", "{", "// Use SimpleDocletException instead of InternalException because there is nothing", "// informative about about the place the exception occurred, here in this method.", "// The problem is specific to the method being invoked, such as illegal access", "// or illegal argument.", "String", "message", "=", "resources", ".", "getText", "(", "\"doclet.builder.exception.in.component\"", ",", "component", ",", "e", ")", ";", "throw", "new", "SimpleDocletException", "(", "message", ",", "e", ".", "getCause", "(", ")", ")", ";", "}", "}" ]
Build the documentation, as specified by the given XML element. @param node the XML element that specifies which component to document. @param contentTree content tree to which the documentation will be added @throws DocletException if there is a problem building the documentation
[ "Build", "the", "documentation", "as", "specified", "by", "the", "given", "XML", "element", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java#L148-L189
5,373
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java
AbstractBuilder.buildChildren
protected void buildChildren(XMLNode node, Content contentTree) throws DocletException { for (XMLNode child : node.children) build(child, contentTree); }
java
protected void buildChildren(XMLNode node, Content contentTree) throws DocletException { for (XMLNode child : node.children) build(child, contentTree); }
[ "protected", "void", "buildChildren", "(", "XMLNode", "node", ",", "Content", "contentTree", ")", "throws", "DocletException", "{", "for", "(", "XMLNode", "child", ":", "node", ".", "children", ")", "build", "(", "child", ",", "contentTree", ")", ";", "}" ]
Build the documentation, as specified by the children of the given XML element. @param node the XML element that specifies which components to document. @param contentTree content tree to which the documentation will be added @throws DocletException if there is a problem while building the children
[ "Build", "the", "documentation", "as", "specified", "by", "the", "children", "of", "the", "given", "XML", "element", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java#L198-L201
5,374
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java
ConstFold.fold
Type fold(int opcode, List<Type> argtypes) { int argCount = argtypes.length(); if (argCount == 1) return fold1(opcode, argtypes.head); else if (argCount == 2) return fold2(opcode, argtypes.head, argtypes.tail.head); else throw new AssertionError(); }
java
Type fold(int opcode, List<Type> argtypes) { int argCount = argtypes.length(); if (argCount == 1) return fold1(opcode, argtypes.head); else if (argCount == 2) return fold2(opcode, argtypes.head, argtypes.tail.head); else throw new AssertionError(); }
[ "Type", "fold", "(", "int", "opcode", ",", "List", "<", "Type", ">", "argtypes", ")", "{", "int", "argCount", "=", "argtypes", ".", "length", "(", ")", ";", "if", "(", "argCount", "==", "1", ")", "return", "fold1", "(", "opcode", ",", "argtypes", ".", "head", ")", ";", "else", "if", "(", "argCount", "==", "2", ")", "return", "fold2", "(", "opcode", ",", "argtypes", ".", "head", ",", "argtypes", ".", "tail", ".", "head", ")", ";", "else", "throw", "new", "AssertionError", "(", ")", ";", "}" ]
Fold binary or unary operation, returning constant type reflecting the operations result. Return null if fold failed due to an arithmetic exception. @param opcode The operation's opcode instruction (usually a byte code), as entered by class Symtab. @param argtypes The operation's argument types (a list of length 1 or 2). Argument types are assumed to have non-null constValue's.
[ "Fold", "binary", "or", "unary", "operation", "returning", "constant", "type", "reflecting", "the", "operations", "result", ".", "Return", "null", "if", "fold", "failed", "due", "to", "an", "arithmetic", "exception", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java#L84-L92
5,375
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java
ConstFold.coerce
Type coerce(Type etype, Type ttype) { // WAS if (etype.baseType() == ttype.baseType()) if (etype.tsym.type == ttype.tsym.type) return etype; if (etype.isNumeric()) { Object n = etype.constValue(); switch (ttype.getTag()) { case BYTE: return syms.byteType.constType(0 + (byte)intValue(n)); case CHAR: return syms.charType.constType(0 + (char)intValue(n)); case SHORT: return syms.shortType.constType(0 + (short)intValue(n)); case INT: return syms.intType.constType(intValue(n)); case LONG: return syms.longType.constType(longValue(n)); case FLOAT: return syms.floatType.constType(floatValue(n)); case DOUBLE: return syms.doubleType.constType(doubleValue(n)); } } return ttype; }
java
Type coerce(Type etype, Type ttype) { // WAS if (etype.baseType() == ttype.baseType()) if (etype.tsym.type == ttype.tsym.type) return etype; if (etype.isNumeric()) { Object n = etype.constValue(); switch (ttype.getTag()) { case BYTE: return syms.byteType.constType(0 + (byte)intValue(n)); case CHAR: return syms.charType.constType(0 + (char)intValue(n)); case SHORT: return syms.shortType.constType(0 + (short)intValue(n)); case INT: return syms.intType.constType(intValue(n)); case LONG: return syms.longType.constType(longValue(n)); case FLOAT: return syms.floatType.constType(floatValue(n)); case DOUBLE: return syms.doubleType.constType(doubleValue(n)); } } return ttype; }
[ "Type", "coerce", "(", "Type", "etype", ",", "Type", "ttype", ")", "{", "// WAS if (etype.baseType() == ttype.baseType())", "if", "(", "etype", ".", "tsym", ".", "type", "==", "ttype", ".", "tsym", ".", "type", ")", "return", "etype", ";", "if", "(", "etype", ".", "isNumeric", "(", ")", ")", "{", "Object", "n", "=", "etype", ".", "constValue", "(", ")", ";", "switch", "(", "ttype", ".", "getTag", "(", ")", ")", "{", "case", "BYTE", ":", "return", "syms", ".", "byteType", ".", "constType", "(", "0", "+", "(", "byte", ")", "intValue", "(", "n", ")", ")", ";", "case", "CHAR", ":", "return", "syms", ".", "charType", ".", "constType", "(", "0", "+", "(", "char", ")", "intValue", "(", "n", ")", ")", ";", "case", "SHORT", ":", "return", "syms", ".", "shortType", ".", "constType", "(", "0", "+", "(", "short", ")", "intValue", "(", "n", ")", ")", ";", "case", "INT", ":", "return", "syms", ".", "intType", ".", "constType", "(", "intValue", "(", "n", ")", ")", ";", "case", "LONG", ":", "return", "syms", ".", "longType", ".", "constType", "(", "longValue", "(", "n", ")", ")", ";", "case", "FLOAT", ":", "return", "syms", ".", "floatType", ".", "constType", "(", "floatValue", "(", "n", ")", ")", ";", "case", "DOUBLE", ":", "return", "syms", ".", "doubleType", ".", "constType", "(", "doubleValue", "(", "n", ")", ")", ";", "}", "}", "return", "ttype", ";", "}" ]
Coerce constant type to target type. @param etype The source type of the coercion, which is assumed to be a constant type compatible with ttype. @param ttype The target type of the coercion.
[ "Coerce", "constant", "type", "to", "target", "type", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java#L331-L355
5,376
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java
DocPretty.print
protected void print(Object s) throws IOException { out.write(Convert.escapeUnicode(s.toString())); }
java
protected void print(Object s) throws IOException { out.write(Convert.escapeUnicode(s.toString())); }
[ "protected", "void", "print", "(", "Object", "s", ")", "throws", "IOException", "{", "out", ".", "write", "(", "Convert", ".", "escapeUnicode", "(", "s", ".", "toString", "(", ")", ")", ")", ";", "}" ]
Print string, replacing all non-ascii character with unicode escapes.
[ "Print", "string", "replacing", "all", "non", "-", "ascii", "character", "with", "unicode", "escapes", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java#L79-L81
5,377
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java
DocPretty.print
public void print(List<? extends DocTree> list) throws IOException { for (DocTree t: list) { print(t); } }
java
public void print(List<? extends DocTree> list) throws IOException { for (DocTree t: list) { print(t); } }
[ "public", "void", "print", "(", "List", "<", "?", "extends", "DocTree", ">", "list", ")", "throws", "IOException", "{", "for", "(", "DocTree", "t", ":", "list", ")", "{", "print", "(", "t", ")", ";", "}", "}" ]
Print list.
[ "Print", "list", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java#L86-L90
5,378
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java
DocPretty.print
protected void print(List<? extends DocTree> list, String sep) throws IOException { if (list.isEmpty()) return; boolean first = true; for (DocTree t: list) { if (!first) print(sep); print(t); first = false; } }
java
protected void print(List<? extends DocTree> list, String sep) throws IOException { if (list.isEmpty()) return; boolean first = true; for (DocTree t: list) { if (!first) print(sep); print(t); first = false; } }
[ "protected", "void", "print", "(", "List", "<", "?", "extends", "DocTree", ">", "list", ",", "String", "sep", ")", "throws", "IOException", "{", "if", "(", "list", ".", "isEmpty", "(", ")", ")", "return", ";", "boolean", "first", "=", "true", ";", "for", "(", "DocTree", "t", ":", "list", ")", "{", "if", "(", "!", "first", ")", "print", "(", "sep", ")", ";", "print", "(", "t", ")", ";", "first", "=", "false", ";", "}", "}" ]
Print list., with separators
[ "Print", "list", ".", "with", "separators" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java#L95-L105
5,379
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java
Lint.instance
public static Lint instance(Context context) { Lint instance = context.get(lintKey); if (instance == null) instance = new Lint(context); return instance; }
java
public static Lint instance(Context context) { Lint instance = context.get(lintKey); if (instance == null) instance = new Lint(context); return instance; }
[ "public", "static", "Lint", "instance", "(", "Context", "context", ")", "{", "Lint", "instance", "=", "context", ".", "get", "(", "lintKey", ")", ";", "if", "(", "instance", "==", "null", ")", "instance", "=", "new", "Lint", "(", "context", ")", ";", "return", "instance", ";", "}" ]
Get the root Lint instance.
[ "Get", "the", "root", "Lint", "instance", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java#L54-L59
5,380
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java
Lint.augment
public Lint augment(Symbol sym) { Lint l = augmentor.augment(this, sym.getDeclarationAttributes()); if (sym.isDeprecated()) { if (l == this) l = new Lint(this); l.values.remove(LintCategory.DEPRECATION); l.suppressedValues.add(LintCategory.DEPRECATION); } return l; }
java
public Lint augment(Symbol sym) { Lint l = augmentor.augment(this, sym.getDeclarationAttributes()); if (sym.isDeprecated()) { if (l == this) l = new Lint(this); l.values.remove(LintCategory.DEPRECATION); l.suppressedValues.add(LintCategory.DEPRECATION); } return l; }
[ "public", "Lint", "augment", "(", "Symbol", "sym", ")", "{", "Lint", "l", "=", "augmentor", ".", "augment", "(", "this", ",", "sym", ".", "getDeclarationAttributes", "(", ")", ")", ";", "if", "(", "sym", ".", "isDeprecated", "(", ")", ")", "{", "if", "(", "l", "==", "this", ")", "l", "=", "new", "Lint", "(", "this", ")", ";", "l", ".", "values", ".", "remove", "(", "LintCategory", ".", "DEPRECATION", ")", ";", "l", ".", "suppressedValues", ".", "add", "(", "LintCategory", ".", "DEPRECATION", ")", ";", "}", "return", "l", ";", "}" ]
Returns the result of combining the values in this object with the metadata on the given symbol.
[ "Returns", "the", "result", "of", "combining", "the", "values", "in", "this", "object", "with", "the", "metadata", "on", "the", "given", "symbol", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java#L74-L83
5,381
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java
Lint.suppress
public Lint suppress(LintCategory... lc) { Lint l = new Lint(this); l.values.removeAll(Arrays.asList(lc)); l.suppressedValues.addAll(Arrays.asList(lc)); return l; }
java
public Lint suppress(LintCategory... lc) { Lint l = new Lint(this); l.values.removeAll(Arrays.asList(lc)); l.suppressedValues.addAll(Arrays.asList(lc)); return l; }
[ "public", "Lint", "suppress", "(", "LintCategory", "...", "lc", ")", "{", "Lint", "l", "=", "new", "Lint", "(", "this", ")", ";", "l", ".", "values", ".", "removeAll", "(", "Arrays", ".", "asList", "(", "lc", ")", ")", ";", "l", ".", "suppressedValues", ".", "addAll", "(", "Arrays", ".", "asList", "(", "lc", ")", ")", ";", "return", "l", ";", "}" ]
Returns a new Lint that has the given LintCategorys suppressed. @param lc one or more categories to be suppressed
[ "Returns", "a", "new", "Lint", "that", "has", "the", "given", "LintCategorys", "suppressed", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java#L89-L94
5,382
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
ModuleWriterImpl.getModuleHeader
@Override public Content getModuleHeader(String heading) { HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString())); HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) ? HtmlTree.HEADER() : bodyTree; addTop(htmlTree); addNavLinks(true, htmlTree); if (configuration.allowTag(HtmlTag.HEADER)) { bodyTree.addContent(htmlTree); } HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.header); Content annotationContent = new HtmlTree(HtmlTag.P); addAnnotationInfo(mdle, annotationContent); div.addContent(annotationContent); Content label = mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL) ? contents.openModuleLabel : contents.moduleLabel; Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, HtmlStyle.title, label); tHeading.addContent(Contents.SPACE); Content moduleHead = new RawHtml(heading); tHeading.addContent(moduleHead); div.addContent(tHeading); if (configuration.allowTag(HtmlTag.MAIN)) { mainTree.addContent(div); } else { bodyTree.addContent(div); } return bodyTree; }
java
@Override public Content getModuleHeader(String heading) { HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString())); HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) ? HtmlTree.HEADER() : bodyTree; addTop(htmlTree); addNavLinks(true, htmlTree); if (configuration.allowTag(HtmlTag.HEADER)) { bodyTree.addContent(htmlTree); } HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.header); Content annotationContent = new HtmlTree(HtmlTag.P); addAnnotationInfo(mdle, annotationContent); div.addContent(annotationContent); Content label = mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL) ? contents.openModuleLabel : contents.moduleLabel; Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, HtmlStyle.title, label); tHeading.addContent(Contents.SPACE); Content moduleHead = new RawHtml(heading); tHeading.addContent(moduleHead); div.addContent(tHeading); if (configuration.allowTag(HtmlTag.MAIN)) { mainTree.addContent(div); } else { bodyTree.addContent(div); } return bodyTree; }
[ "@", "Override", "public", "Content", "getModuleHeader", "(", "String", "heading", ")", "{", "HtmlTree", "bodyTree", "=", "getBody", "(", "true", ",", "getWindowTitle", "(", "mdle", ".", "getQualifiedName", "(", ")", ".", "toString", "(", ")", ")", ")", ";", "HtmlTree", "htmlTree", "=", "(", "configuration", ".", "allowTag", "(", "HtmlTag", ".", "HEADER", ")", ")", "?", "HtmlTree", ".", "HEADER", "(", ")", ":", "bodyTree", ";", "addTop", "(", "htmlTree", ")", ";", "addNavLinks", "(", "true", ",", "htmlTree", ")", ";", "if", "(", "configuration", ".", "allowTag", "(", "HtmlTag", ".", "HEADER", ")", ")", "{", "bodyTree", ".", "addContent", "(", "htmlTree", ")", ";", "}", "HtmlTree", "div", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "DIV", ")", ";", "div", ".", "addStyle", "(", "HtmlStyle", ".", "header", ")", ";", "Content", "annotationContent", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "P", ")", ";", "addAnnotationInfo", "(", "mdle", ",", "annotationContent", ")", ";", "div", ".", "addContent", "(", "annotationContent", ")", ";", "Content", "label", "=", "mdle", ".", "isOpen", "(", ")", "&&", "(", "configuration", ".", "docEnv", ".", "getModuleMode", "(", ")", "==", "ModuleMode", ".", "ALL", ")", "?", "contents", ".", "openModuleLabel", ":", "contents", ".", "moduleLabel", ";", "Content", "tHeading", "=", "HtmlTree", ".", "HEADING", "(", "HtmlConstants", ".", "TITLE_HEADING", ",", "true", ",", "HtmlStyle", ".", "title", ",", "label", ")", ";", "tHeading", ".", "addContent", "(", "Contents", ".", "SPACE", ")", ";", "Content", "moduleHead", "=", "new", "RawHtml", "(", "heading", ")", ";", "tHeading", ".", "addContent", "(", "moduleHead", ")", ";", "div", ".", "addContent", "(", "tHeading", ")", ";", "if", "(", "configuration", ".", "allowTag", "(", "HtmlTag", ".", "MAIN", ")", ")", "{", "mainTree", ".", "addContent", "(", "div", ")", ";", "}", "else", "{", "bodyTree", ".", "addContent", "(", "div", ")", ";", "}", "return", "bodyTree", ";", "}" ]
Get the module header. @param heading the heading for the section
[ "Get", "the", "module", "header", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java#L199-L229
5,383
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
ModuleWriterImpl.getSummaryTree
@Override public Content getSummaryTree(Content summaryContentTree) { HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree); return ul; }
java
@Override public Content getSummaryTree(Content summaryContentTree) { HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree); return ul; }
[ "@", "Override", "public", "Content", "getSummaryTree", "(", "Content", "summaryContentTree", ")", "{", "HtmlTree", "ul", "=", "HtmlTree", ".", "UL", "(", "HtmlStyle", ".", "blockList", ",", "summaryContentTree", ")", ";", "return", "ul", ";", "}" ]
Get the summary tree. @param summaryContentTree the content tree to be added to the summary tree.
[ "Get", "the", "summary", "tree", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java#L256-L260
5,384
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
Module.toNormalModule
public Module toNormalModule(Map<String, Boolean> requires) { if (!isAutomatic()) { throw new IllegalArgumentException(name() + " not an automatic module"); } return new NormalModule(this, requires); }
java
public Module toNormalModule(Map<String, Boolean> requires) { if (!isAutomatic()) { throw new IllegalArgumentException(name() + " not an automatic module"); } return new NormalModule(this, requires); }
[ "public", "Module", "toNormalModule", "(", "Map", "<", "String", ",", "Boolean", ">", "requires", ")", "{", "if", "(", "!", "isAutomatic", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "name", "(", ")", "+", "\" not an automatic module\"", ")", ";", "}", "return", "new", "NormalModule", "(", "this", ",", "requires", ")", ";", "}" ]
Converts this module to a normal module with the given dependences @throws IllegalArgumentException if this module is not an automatic module
[ "Converts", "this", "module", "to", "a", "normal", "module", "with", "the", "given", "dependences" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java#L138-L143
5,385
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
Module.isExported
public boolean isExported(String pn) { return exports.containsKey(pn) && exports.get(pn).isEmpty(); }
java
public boolean isExported(String pn) { return exports.containsKey(pn) && exports.get(pn).isEmpty(); }
[ "public", "boolean", "isExported", "(", "String", "pn", ")", "{", "return", "exports", ".", "containsKey", "(", "pn", ")", "&&", "exports", ".", "get", "(", "pn", ")", ".", "isEmpty", "(", ")", ";", "}" ]
Tests if the package of the given name is exported.
[ "Tests", "if", "the", "package", "of", "the", "given", "name", "is", "exported", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java#L148-L150
5,386
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
Module.isExported
public boolean isExported(String pn, String target) { return isExported(pn) || exports.containsKey(pn) && exports.get(pn).contains(target); }
java
public boolean isExported(String pn, String target) { return isExported(pn) || exports.containsKey(pn) && exports.get(pn).contains(target); }
[ "public", "boolean", "isExported", "(", "String", "pn", ",", "String", "target", ")", "{", "return", "isExported", "(", "pn", ")", "||", "exports", ".", "containsKey", "(", "pn", ")", "&&", "exports", ".", "get", "(", "pn", ")", ".", "contains", "(", "target", ")", ";", "}" ]
Tests if the package of the given name is exported to the target in a qualified fashion.
[ "Tests", "if", "the", "package", "of", "the", "given", "name", "is", "exported", "to", "the", "target", "in", "a", "qualified", "fashion", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java#L156-L159
5,387
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
Module.isOpen
public boolean isOpen(String pn) { return opens.containsKey(pn) && opens.get(pn).isEmpty(); }
java
public boolean isOpen(String pn) { return opens.containsKey(pn) && opens.get(pn).isEmpty(); }
[ "public", "boolean", "isOpen", "(", "String", "pn", ")", "{", "return", "opens", ".", "containsKey", "(", "pn", ")", "&&", "opens", ".", "get", "(", "pn", ")", ".", "isEmpty", "(", ")", ";", "}" ]
Tests if the package of the given name is open.
[ "Tests", "if", "the", "package", "of", "the", "given", "name", "is", "open", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java#L164-L166
5,388
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
Module.isOpen
public boolean isOpen(String pn, String target) { return isOpen(pn) || opens.containsKey(pn) && opens.get(pn).contains(target); }
java
public boolean isOpen(String pn, String target) { return isOpen(pn) || opens.containsKey(pn) && opens.get(pn).contains(target); }
[ "public", "boolean", "isOpen", "(", "String", "pn", ",", "String", "target", ")", "{", "return", "isOpen", "(", "pn", ")", "||", "opens", ".", "containsKey", "(", "pn", ")", "&&", "opens", ".", "get", "(", "pn", ")", ".", "contains", "(", "target", ")", ";", "}" ]
Tests if the package of the given name is open to the target in a qualified fashion.
[ "Tests", "if", "the", "package", "of", "the", "given", "name", "is", "open", "to", "the", "target", "in", "a", "qualified", "fashion", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java#L172-L175
5,389
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
Type.map
public <Z> Type map(TypeMapping<Z> mapping, Z arg) { return mapping.visit(this, arg); }
java
public <Z> Type map(TypeMapping<Z> mapping, Z arg) { return mapping.visit(this, arg); }
[ "public", "<", "Z", ">", "Type", "map", "(", "TypeMapping", "<", "Z", ">", "mapping", ",", "Z", "arg", ")", "{", "return", "mapping", ".", "visit", "(", "this", ",", "arg", ")", ";", "}" ]
map a type function over all immediate descendants of this type
[ "map", "a", "type", "function", "over", "all", "immediate", "descendants", "of", "this", "type" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java#L303-L305
5,390
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
Type.baseTypes
public static List<Type> baseTypes(List<Type> ts) { if (ts.nonEmpty()) { Type t = ts.head.baseType(); List<Type> baseTypes = baseTypes(ts.tail); if (t != ts.head || baseTypes != ts.tail) return baseTypes.prepend(t); } return ts; }
java
public static List<Type> baseTypes(List<Type> ts) { if (ts.nonEmpty()) { Type t = ts.head.baseType(); List<Type> baseTypes = baseTypes(ts.tail); if (t != ts.head || baseTypes != ts.tail) return baseTypes.prepend(t); } return ts; }
[ "public", "static", "List", "<", "Type", ">", "baseTypes", "(", "List", "<", "Type", ">", "ts", ")", "{", "if", "(", "ts", ".", "nonEmpty", "(", ")", ")", "{", "Type", "t", "=", "ts", ".", "head", ".", "baseType", "(", ")", ";", "List", "<", "Type", ">", "baseTypes", "=", "baseTypes", "(", "ts", ".", "tail", ")", ";", "if", "(", "t", "!=", "ts", ".", "head", "||", "baseTypes", "!=", "ts", ".", "tail", ")", "return", "baseTypes", ".", "prepend", "(", "t", ")", ";", "}", "return", "ts", ";", "}" ]
Return the base types of a list of types.
[ "Return", "the", "base", "types", "of", "a", "list", "of", "types", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java#L423-L431
5,391
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
HtmlWriter.getNonBreakResource
public Content getNonBreakResource(String key) { String text = configuration.getText(key); Content c = configuration.newContent(); int start = 0; int p; while ((p = text.indexOf(" ", start)) != -1) { c.addContent(text.substring(start, p)); c.addContent(RawHtml.nbsp); start = p + 1; } c.addContent(text.substring(start)); return c; }
java
public Content getNonBreakResource(String key) { String text = configuration.getText(key); Content c = configuration.newContent(); int start = 0; int p; while ((p = text.indexOf(" ", start)) != -1) { c.addContent(text.substring(start, p)); c.addContent(RawHtml.nbsp); start = p + 1; } c.addContent(text.substring(start)); return c; }
[ "public", "Content", "getNonBreakResource", "(", "String", "key", ")", "{", "String", "text", "=", "configuration", ".", "getText", "(", "key", ")", ";", "Content", "c", "=", "configuration", ".", "newContent", "(", ")", ";", "int", "start", "=", "0", ";", "int", "p", ";", "while", "(", "(", "p", "=", "text", ".", "indexOf", "(", "\" \"", ",", "start", ")", ")", "!=", "-", "1", ")", "{", "c", ".", "addContent", "(", "text", ".", "substring", "(", "start", ",", "p", ")", ")", ";", "c", ".", "addContent", "(", "RawHtml", ".", "nbsp", ")", ";", "start", "=", "p", "+", "1", ";", "}", "c", ".", "addContent", "(", "text", ".", "substring", "(", "start", ")", ")", ";", "return", "c", ";", "}" ]
Get the configuration string as a content, replacing spaces with non-breaking spaces. @param key the key to look for in the configuration file @return a content tree for the text
[ "Get", "the", "configuration", "string", "as", "a", "content", "replacing", "spaces", "with", "non", "-", "breaking", "spaces", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java#L244-L256
5,392
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Symbol.attribute
public Attribute.Compound attribute(Symbol anno) { for (Attribute.Compound a : getRawAttributes()) { if (a.type.tsym == anno) return a; } return null; }
java
public Attribute.Compound attribute(Symbol anno) { for (Attribute.Compound a : getRawAttributes()) { if (a.type.tsym == anno) return a; } return null; }
[ "public", "Attribute", ".", "Compound", "attribute", "(", "Symbol", "anno", ")", "{", "for", "(", "Attribute", ".", "Compound", "a", ":", "getRawAttributes", "(", ")", ")", "{", "if", "(", "a", ".", "type", ".", "tsym", "==", "anno", ")", "return", "a", ";", "}", "return", "null", ";", "}" ]
Fetch a particular annotation from a symbol.
[ "Fetch", "a", "particular", "annotation", "from", "a", "symbol", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L158-L163
5,393
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Symbol.location
public Symbol location() { if (owner.name == null || (owner.name.isEmpty() && (owner.flags() & BLOCK) == 0 && owner.kind != PCK && owner.kind != TYP)) { return null; } return owner; }
java
public Symbol location() { if (owner.name == null || (owner.name.isEmpty() && (owner.flags() & BLOCK) == 0 && owner.kind != PCK && owner.kind != TYP)) { return null; } return owner; }
[ "public", "Symbol", "location", "(", ")", "{", "if", "(", "owner", ".", "name", "==", "null", "||", "(", "owner", ".", "name", ".", "isEmpty", "(", ")", "&&", "(", "owner", ".", "flags", "(", ")", "&", "BLOCK", ")", "==", "0", "&&", "owner", ".", "kind", "!=", "PCK", "&&", "owner", ".", "kind", "!=", "TYP", ")", ")", "{", "return", "null", ";", "}", "return", "owner", ";", "}" ]
A Java source description of the location of this symbol; used for error reporting. @return null if the symbol is a package or a toplevel class defined in the default package; otherwise, the owner symbol is returned
[ "A", "Java", "source", "description", "of", "the", "location", "of", "this", "symbol", ";", "used", "for", "error", "reporting", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L310-L318
5,394
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Symbol.erasure
public Type erasure(Types types) { if (erasure_field == null) erasure_field = types.erasure(type); return erasure_field; }
java
public Type erasure(Types types) { if (erasure_field == null) erasure_field = types.erasure(type); return erasure_field; }
[ "public", "Type", "erasure", "(", "Types", "types", ")", "{", "if", "(", "erasure_field", "==", "null", ")", "erasure_field", "=", "types", ".", "erasure", "(", "type", ")", ";", "return", "erasure_field", ";", "}" ]
The symbol's erased type.
[ "The", "symbol", "s", "erased", "type", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L337-L341
5,395
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Symbol.externalType
public Type externalType(Types types) { Type t = erasure(types); if (name == name.table.names.init && owner.hasOuterInstance()) { Type outerThisType = types.erasure(owner.type.getEnclosingType()); return new MethodType(t.getParameterTypes().prepend(outerThisType), t.getReturnType(), t.getThrownTypes(), t.tsym); } else { return t; } }
java
public Type externalType(Types types) { Type t = erasure(types); if (name == name.table.names.init && owner.hasOuterInstance()) { Type outerThisType = types.erasure(owner.type.getEnclosingType()); return new MethodType(t.getParameterTypes().prepend(outerThisType), t.getReturnType(), t.getThrownTypes(), t.tsym); } else { return t; } }
[ "public", "Type", "externalType", "(", "Types", "types", ")", "{", "Type", "t", "=", "erasure", "(", "types", ")", ";", "if", "(", "name", "==", "name", ".", "table", ".", "names", ".", "init", "&&", "owner", ".", "hasOuterInstance", "(", ")", ")", "{", "Type", "outerThisType", "=", "types", ".", "erasure", "(", "owner", ".", "type", ".", "getEnclosingType", "(", ")", ")", ";", "return", "new", "MethodType", "(", "t", ".", "getParameterTypes", "(", ")", ".", "prepend", "(", "outerThisType", ")", ",", "t", ".", "getReturnType", "(", ")", ",", "t", ".", "getThrownTypes", "(", ")", ",", "t", ".", "tsym", ")", ";", "}", "else", "{", "return", "t", ";", "}", "}" ]
The external type of a symbol. This is the symbol's erased type except for constructors of inner classes which get the enclosing instance class added as first argument.
[ "The", "external", "type", "of", "a", "symbol", ".", "This", "is", "the", "symbol", "s", "erased", "type", "except", "for", "constructors", "of", "inner", "classes", "which", "get", "the", "enclosing", "instance", "class", "added", "as", "first", "argument", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L347-L358
5,396
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Symbol.outermostClass
public ClassSymbol outermostClass() { Symbol sym = this; Symbol prev = null; while (sym.kind != PCK) { prev = sym; sym = sym.owner; } return (ClassSymbol) prev; }
java
public ClassSymbol outermostClass() { Symbol sym = this; Symbol prev = null; while (sym.kind != PCK) { prev = sym; sym = sym.owner; } return (ClassSymbol) prev; }
[ "public", "ClassSymbol", "outermostClass", "(", ")", "{", "Symbol", "sym", "=", "this", ";", "Symbol", "prev", "=", "null", ";", "while", "(", "sym", ".", "kind", "!=", "PCK", ")", "{", "prev", "=", "sym", ";", "sym", "=", "sym", ".", "owner", ";", "}", "return", "(", "ClassSymbol", ")", "prev", ";", "}" ]
The outermost class which indirectly owns this symbol.
[ "The", "outermost", "class", "which", "indirectly", "owns", "this", "symbol", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L485-L493
5,397
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Symbol.packge
public PackageSymbol packge() { Symbol sym = this; while (sym.kind != PCK) { sym = sym.owner; } return (PackageSymbol) sym; }
java
public PackageSymbol packge() { Symbol sym = this; while (sym.kind != PCK) { sym = sym.owner; } return (PackageSymbol) sym; }
[ "public", "PackageSymbol", "packge", "(", ")", "{", "Symbol", "sym", "=", "this", ";", "while", "(", "sym", ".", "kind", "!=", "PCK", ")", "{", "sym", "=", "sym", ".", "owner", ";", "}", "return", "(", "PackageSymbol", ")", "sym", ";", "}" ]
The package which indirectly owns this symbol.
[ "The", "package", "which", "indirectly", "owns", "this", "symbol", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L497-L503
5,398
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
Symbol.isEnclosedBy
public boolean isEnclosedBy(ClassSymbol clazz) { for (Symbol sym = this; sym.kind != PCK; sym = sym.owner) if (sym == clazz) return true; return false; }
java
public boolean isEnclosedBy(ClassSymbol clazz) { for (Symbol sym = this; sym.kind != PCK; sym = sym.owner) if (sym == clazz) return true; return false; }
[ "public", "boolean", "isEnclosedBy", "(", "ClassSymbol", "clazz", ")", "{", "for", "(", "Symbol", "sym", "=", "this", ";", "sym", ".", "kind", "!=", "PCK", ";", "sym", "=", "sym", ".", "owner", ")", "if", "(", "sym", "==", "clazz", ")", "return", "true", ";", "return", "false", ";", "}" ]
Is this symbol the same as or enclosed by the given class?
[ "Is", "this", "symbol", "the", "same", "as", "or", "enclosed", "by", "the", "given", "class?" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L523-L527
5,399
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocImpl.java
DocImpl.comment
Comment comment() { if (comment == null) { String d = documentation(); if (env.javaScriptScanner != null) { env.javaScriptScanner.parse(d, new JavaScriptScanner.Reporter() { @Override public void report() { env.error(DocImpl.this, "javadoc.JavaScript_in_comment"); throw new FatalError(); } }); } if (env.doclint != null && treePath != null && env.shouldCheck(treePath.getCompilationUnit()) && d.equals(getCommentText(treePath))) { env.doclint.scan(treePath); } comment = new Comment(this, d); } return comment; }
java
Comment comment() { if (comment == null) { String d = documentation(); if (env.javaScriptScanner != null) { env.javaScriptScanner.parse(d, new JavaScriptScanner.Reporter() { @Override public void report() { env.error(DocImpl.this, "javadoc.JavaScript_in_comment"); throw new FatalError(); } }); } if (env.doclint != null && treePath != null && env.shouldCheck(treePath.getCompilationUnit()) && d.equals(getCommentText(treePath))) { env.doclint.scan(treePath); } comment = new Comment(this, d); } return comment; }
[ "Comment", "comment", "(", ")", "{", "if", "(", "comment", "==", "null", ")", "{", "String", "d", "=", "documentation", "(", ")", ";", "if", "(", "env", ".", "javaScriptScanner", "!=", "null", ")", "{", "env", ".", "javaScriptScanner", ".", "parse", "(", "d", ",", "new", "JavaScriptScanner", ".", "Reporter", "(", ")", "{", "@", "Override", "public", "void", "report", "(", ")", "{", "env", ".", "error", "(", "DocImpl", ".", "this", ",", "\"javadoc.JavaScript_in_comment\"", ")", ";", "throw", "new", "FatalError", "(", ")", ";", "}", "}", ")", ";", "}", "if", "(", "env", ".", "doclint", "!=", "null", "&&", "treePath", "!=", "null", "&&", "env", ".", "shouldCheck", "(", "treePath", ".", "getCompilationUnit", "(", ")", ")", "&&", "d", ".", "equals", "(", "getCommentText", "(", "treePath", ")", ")", ")", "{", "env", ".", "doclint", ".", "scan", "(", "treePath", ")", ";", "}", "comment", "=", "new", "Comment", "(", "this", ",", "d", ")", ";", "}", "return", "comment", ";", "}" ]
For lazy initialization of comment.
[ "For", "lazy", "initialization", "of", "comment", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocImpl.java#L130-L151