repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
weld/core | impl/src/main/java/org/jboss/weld/util/Types.java | Types.getCanonicalType | public static Type getCanonicalType(Class<?> clazz) {
"""
Returns a canonical type for a given class.
If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type
variables) is resolved.
If the class is an array then the component type of the array is can... | java | public static Type getCanonicalType(Class<?> clazz) {
if (clazz.isArray()) {
Class<?> componentType = clazz.getComponentType();
Type resolvedComponentType = getCanonicalType(componentType);
if (componentType != resolvedComponentType) {
// identity check intent... | [
"public",
"static",
"Type",
"getCanonicalType",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
".",
"isArray",
"(",
")",
")",
"{",
"Class",
"<",
"?",
">",
"componentType",
"=",
"clazz",
".",
"getComponentType",
"(",
")",
";",
"Ty... | Returns a canonical type for a given class.
If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type
variables) is resolved.
If the class is an array then the component type of the array is canonicalized
Otherwise, the class is returned.
@return | [
"Returns",
"a",
"canonical",
"type",
"for",
"a",
"given",
"class",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Types.java#L127-L142 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java | CommonHelper.asURI | public static URI asURI(final String s) {
"""
Convert a string into an URI.
@param s the string
@return the URI
"""
try {
return new URI(s);
} catch (final URISyntaxException e) {
throw new TechnicalException("Cannot make an URI from: " + s, e);
}
} | java | public static URI asURI(final String s) {
try {
return new URI(s);
} catch (final URISyntaxException e) {
throw new TechnicalException("Cannot make an URI from: " + s, e);
}
} | [
"public",
"static",
"URI",
"asURI",
"(",
"final",
"String",
"s",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"s",
")",
";",
"}",
"catch",
"(",
"final",
"URISyntaxException",
"e",
")",
"{",
"throw",
"new",
"TechnicalException",
"(",
"\"Cannot make ... | Convert a string into an URI.
@param s the string
@return the URI | [
"Convert",
"a",
"string",
"into",
"an",
"URI",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java#L260-L266 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CciConnCodeGen.java | CciConnCodeGen.writeMetaData | private void writeMetaData(Definition def, Writer out, int indent) throws IOException {
"""
Output MetaData method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent,
... | java | private void writeMetaData(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent,
" * Gets the information on the underlying EIS instance represented through an active connection.\n");
writeWithIndent(out, indent,... | [
"private",
"void",
"writeMetaData",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"inden... | Output MetaData method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"MetaData",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CciConnCodeGen.java#L202-L221 |
structr/structr | structr-core/src/main/java/org/structr/schema/parser/DatePropertyParser.java | DatePropertyParser.parseISO8601DateString | public static Date parseISO8601DateString(String source) {
"""
Try to parse source string as a ISO8601 date.
@param source
@return null if unable to parse
"""
final String[] supportedFormats = new String[] { "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", "yyyy-MM-dd'T'HH:mm:ssXXX", "yyyy-MM-dd'T'HH:mm:ssZ", "yyyy-MM-d... | java | public static Date parseISO8601DateString(String source) {
final String[] supportedFormats = new String[] { "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", "yyyy-MM-dd'T'HH:mm:ssXXX", "yyyy-MM-dd'T'HH:mm:ssZ", "yyyy-MM-dd'T'HH:mm:ss.SSSZ" };
// SimpleDateFormat is not fully ISO8601 compatible, so we replace 'Z' by +0000
if (St... | [
"public",
"static",
"Date",
"parseISO8601DateString",
"(",
"String",
"source",
")",
"{",
"final",
"String",
"[",
"]",
"supportedFormats",
"=",
"new",
"String",
"[",
"]",
"{",
"\"yyyy-MM-dd'T'HH:mm:ss.SSSXXX\"",
",",
"\"yyyy-MM-dd'T'HH:mm:ssXXX\"",
",",
"\"yyyy-MM-dd'T... | Try to parse source string as a ISO8601 date.
@param source
@return null if unable to parse | [
"Try",
"to",
"parse",
"source",
"string",
"as",
"a",
"ISO8601",
"date",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/parser/DatePropertyParser.java#L123-L151 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/Languages.java | Languages.getLanguageForShortCode | public static Language getLanguageForShortCode(String langCode, List<String> noopLanguageCodes) {
"""
Get the Language object for the given language code.
@param langCode e.g. <code>en</code> or <code>en-US</code>
@param noopLanguageCodes list of languages that can be detected but that will not actually find any... | java | public static Language getLanguageForShortCode(String langCode, List<String> noopLanguageCodes) {
Language language = getLanguageForShortCodeOrNull(langCode);
if (language == null) {
if (noopLanguageCodes.contains(langCode)) {
return NOOP_LANGUAGE;
} else {
List<String> codes = new A... | [
"public",
"static",
"Language",
"getLanguageForShortCode",
"(",
"String",
"langCode",
",",
"List",
"<",
"String",
">",
"noopLanguageCodes",
")",
"{",
"Language",
"language",
"=",
"getLanguageForShortCodeOrNull",
"(",
"langCode",
")",
";",
"if",
"(",
"language",
"=... | Get the Language object for the given language code.
@param langCode e.g. <code>en</code> or <code>en-US</code>
@param noopLanguageCodes list of languages that can be detected but that will not actually find any errors
(can be used so non-supported languages are not detected as some other language)
@throws IllegalArgum... | [
"Get",
"the",
"Language",
"object",
"for",
"the",
"given",
"language",
"code",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/Languages.java#L225-L242 |
sahasbhop/formatted-log | formatted-log/src/main/java/com/github/sahasbhop/flog/FLog.java | FLog.setEnableFileLog | public static void setEnableFileLog(boolean enable, String path, String fileName) {
"""
Enable writing debugging log to a target file
@param enable enabling a file log
@param path directory path to create and save a log file
@param fileName target log file name
"""
sEnableFileLog = enable;
... | java | public static void setEnableFileLog(boolean enable, String path, String fileName) {
sEnableFileLog = enable;
if (enable && path != null && fileName != null) {
sLogFilePath = path.trim();
sLogFileName = fileName.trim();
if (!sLogFilePath.endsWith("/")) {
... | [
"public",
"static",
"void",
"setEnableFileLog",
"(",
"boolean",
"enable",
",",
"String",
"path",
",",
"String",
"fileName",
")",
"{",
"sEnableFileLog",
"=",
"enable",
";",
"if",
"(",
"enable",
"&&",
"path",
"!=",
"null",
"&&",
"fileName",
"!=",
"null",
")"... | Enable writing debugging log to a target file
@param enable enabling a file log
@param path directory path to create and save a log file
@param fileName target log file name | [
"Enable",
"writing",
"debugging",
"log",
"to",
"a",
"target",
"file"
] | train | https://github.com/sahasbhop/formatted-log/blob/0a3952df6b68fbfa0bbb2c0ea0a8bf9ea26ea6e3/formatted-log/src/main/java/com/github/sahasbhop/flog/FLog.java#L75-L86 |
BioPAX/Paxtools | sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java | L3ToSBGNPDConverter.createProcessAndConnections | private void createProcessAndConnections(TemplateReaction tr) {
"""
/*
Creates a representation for TemplateReaction.
@param tr template reaction
"""
// create the process for the reaction
Glyph process = factory.createGlyph();
process.setClazz(GlyphClazz.PROCESS.getClazz());
process.setId(convertI... | java | private void createProcessAndConnections(TemplateReaction tr) {
// create the process for the reaction
Glyph process = factory.createGlyph();
process.setClazz(GlyphClazz.PROCESS.getClazz());
process.setId(convertID(tr.getUri()));
glyphMap.put(process.getId(), process);
final Set<PhysicalEntity> products = ... | [
"private",
"void",
"createProcessAndConnections",
"(",
"TemplateReaction",
"tr",
")",
"{",
"// create the process for the reaction",
"Glyph",
"process",
"=",
"factory",
".",
"createGlyph",
"(",
")",
";",
"process",
".",
"setClazz",
"(",
"GlyphClazz",
".",
"PROCESS",
... | /*
Creates a representation for TemplateReaction.
@param tr template reaction | [
"/",
"*",
"Creates",
"a",
"representation",
"for",
"TemplateReaction",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java#L986-L1032 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableModel.java | PathfindableModel.avoidObstacle | private void avoidObstacle(int nextStep, int max) {
"""
Update to avoid obstacle because next step is not free.
@param nextStep The next step.
@param max The maximum steps.
"""
if (nextStep >= max - 1)
{
pathStoppedRequested = true;
}
final Collection<Integer> ci... | java | private void avoidObstacle(int nextStep, int max)
{
if (nextStep >= max - 1)
{
pathStoppedRequested = true;
}
final Collection<Integer> cid = mapPath.getObjectsId(path.getX(nextStep), path.getY(nextStep));
if (sharedPathIds.containsAll(cid))
{
... | [
"private",
"void",
"avoidObstacle",
"(",
"int",
"nextStep",
",",
"int",
"max",
")",
"{",
"if",
"(",
"nextStep",
">=",
"max",
"-",
"1",
")",
"{",
"pathStoppedRequested",
"=",
"true",
";",
"}",
"final",
"Collection",
"<",
"Integer",
">",
"cid",
"=",
"map... | Update to avoid obstacle because next step is not free.
@param nextStep The next step.
@param max The maximum steps. | [
"Update",
"to",
"avoid",
"obstacle",
"because",
"next",
"step",
"is",
"not",
"free",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableModel.java#L247-L265 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java | NumericsUtilities.isBetween | public static boolean isBetween( double value, double... ranges ) {
"""
Check if value is inside a ND interval (bounds included).
@param value the value to check.
@param ranges the bounds (low1, high1, low2, high2, ...)
@return <code>true</code> if value lies inside the interval.
"""
boolean even ... | java | public static boolean isBetween( double value, double... ranges ) {
boolean even = true;
for( int i = 0; i < ranges.length; i++ ) {
if (even) {
// lower bound
if (value < ranges[i]) {
return false;
}
} else {
... | [
"public",
"static",
"boolean",
"isBetween",
"(",
"double",
"value",
",",
"double",
"...",
"ranges",
")",
"{",
"boolean",
"even",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ranges",
".",
"length",
";",
"i",
"++",
")",
"{",
... | Check if value is inside a ND interval (bounds included).
@param value the value to check.
@param ranges the bounds (low1, high1, low2, high2, ...)
@return <code>true</code> if value lies inside the interval. | [
"Check",
"if",
"value",
"is",
"inside",
"a",
"ND",
"interval",
"(",
"bounds",
"included",
")",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/NumericsUtilities.java#L244-L261 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/BosClient.java | BosClient.appendObject | public AppendObjectResponse appendObject(String bucketName, String key, File file) {
"""
Uploads the specified appendable file to Bos under the specified bucket and key name.
@param bucketName The name of an existing bucket, to which you have Write permission.
@param key The key under which to store the specif... | java | public AppendObjectResponse appendObject(String bucketName, String key, File file) {
return this.appendObject(new AppendObjectRequest(bucketName, key, file));
} | [
"public",
"AppendObjectResponse",
"appendObject",
"(",
"String",
"bucketName",
",",
"String",
"key",
",",
"File",
"file",
")",
"{",
"return",
"this",
".",
"appendObject",
"(",
"new",
"AppendObjectRequest",
"(",
"bucketName",
",",
"key",
",",
"file",
")",
")",
... | Uploads the specified appendable file to Bos under the specified bucket and key name.
@param bucketName The name of an existing bucket, to which you have Write permission.
@param key The key under which to store the specified file.
@param file The appendable file containing the data to be uploaded to Bos.
@return An A... | [
"Uploads",
"the",
"specified",
"appendable",
"file",
"to",
"Bos",
"under",
"the",
"specified",
"bucket",
"and",
"key",
"name",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L1673-L1675 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkerFactory.java | WalkerFactory.analyzePredicate | static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
throws javax.xml.transform.TransformerException {
"""
Analyze a step and give information about it's predicates. Right now this
just returns true or false if the step has a predicate.
@param compiler non-null reference to co... | java | static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
throws javax.xml.transform.TransformerException
{
int argLen;
switch (stepType)
{
case OpCodes.OP_VARIABLE :
case OpCodes.OP_EXTFUNCTION :
case OpCodes.OP_FUNCTION :
case OpCodes.OP_GROUP :
argLen... | [
"static",
"boolean",
"analyzePredicate",
"(",
"Compiler",
"compiler",
",",
"int",
"opPos",
",",
"int",
"stepType",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"int",
"argLen",
";",
"switch",
"(",
"stepType",
")",
"... | Analyze a step and give information about it's predicates. Right now this
just returns true or false if the step has a predicate.
@param compiler non-null reference to compiler object that has processed
the XPath operations into an opcode map.
@param opPos The opcode position for the step.
@param stepType The type of... | [
"Analyze",
"a",
"step",
"and",
"give",
"information",
"about",
"it",
"s",
"predicates",
".",
"Right",
"now",
"this",
"just",
"returns",
"true",
"or",
"false",
"if",
"the",
"step",
"has",
"a",
"predicate",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkerFactory.java#L1127-L1149 |
visallo/vertexium | accumulo-iterators/src/main/java/org/vertexium/accumulo/iterator/model/EdgeInfo.java | EdgeInfo.getVertexId | public static String getVertexId(Value value) {
"""
fast access method to avoid creating a new instance of an EdgeInfo
"""
byte[] buffer = value.get();
int offset = 0;
// skip label
int strLen = readInt(buffer, offset);
offset += 4;
if (strLen > 0) {
... | java | public static String getVertexId(Value value) {
byte[] buffer = value.get();
int offset = 0;
// skip label
int strLen = readInt(buffer, offset);
offset += 4;
if (strLen > 0) {
offset += strLen;
}
strLen = readInt(buffer, offset);
retu... | [
"public",
"static",
"String",
"getVertexId",
"(",
"Value",
"value",
")",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"value",
".",
"get",
"(",
")",
";",
"int",
"offset",
"=",
"0",
";",
"// skip label",
"int",
"strLen",
"=",
"readInt",
"(",
"buffer",
",",
"... | fast access method to avoid creating a new instance of an EdgeInfo | [
"fast",
"access",
"method",
"to",
"avoid",
"creating",
"a",
"new",
"instance",
"of",
"an",
"EdgeInfo"
] | train | https://github.com/visallo/vertexium/blob/bb132b5425ac168957667164e1409b78adbea769/accumulo-iterators/src/main/java/org/vertexium/accumulo/iterator/model/EdgeInfo.java#L56-L69 |
jirkapinkas/jsitemapgenerator | src/main/java/cz/jiripinkas/jsitemapgenerator/AbstractGenerator.java | AbstractGenerator.addPages | public <T> I addPages(Collection<T> webPages, Function<T, WebPage> mapper) {
"""
Add collection of pages to sitemap
@param <T> This is the type parameter
@param webPages Collection of pages
@param mapper Mapper function which transforms some object to WebPage
@return this
"""
for (T element : web... | java | public <T> I addPages(Collection<T> webPages, Function<T, WebPage> mapper) {
for (T element : webPages) {
addPage(mapper.apply(element));
}
return getThis();
} | [
"public",
"<",
"T",
">",
"I",
"addPages",
"(",
"Collection",
"<",
"T",
">",
"webPages",
",",
"Function",
"<",
"T",
",",
"WebPage",
">",
"mapper",
")",
"{",
"for",
"(",
"T",
"element",
":",
"webPages",
")",
"{",
"addPage",
"(",
"mapper",
".",
"apply... | Add collection of pages to sitemap
@param <T> This is the type parameter
@param webPages Collection of pages
@param mapper Mapper function which transforms some object to WebPage
@return this | [
"Add",
"collection",
"of",
"pages",
"to",
"sitemap"
] | train | https://github.com/jirkapinkas/jsitemapgenerator/blob/42e1f57bd936e21fe9df642e722726e71f667442/src/main/java/cz/jiripinkas/jsitemapgenerator/AbstractGenerator.java#L136-L141 |
grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.exposeRequestAttributeIfNotPresent | private static void exposeRequestAttributeIfNotPresent(ServletRequest request, String name, Object value) {
"""
Expose the specified request attribute if not already present.
@param request current servlet request
@param name the name of the attribute
@param value the suggested value of the attribute
"""
... | java | private static void exposeRequestAttributeIfNotPresent(ServletRequest request, String name, Object value) {
if (request.getAttribute(name) == null) {
request.setAttribute(name, value);
}
} | [
"private",
"static",
"void",
"exposeRequestAttributeIfNotPresent",
"(",
"ServletRequest",
"request",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"request",
".",
"getAttribute",
"(",
"name",
")",
"==",
"null",
")",
"{",
"request",
".",
... | Expose the specified request attribute if not already present.
@param request current servlet request
@param name the name of the attribute
@param value the suggested value of the attribute | [
"Expose",
"the",
"specified",
"request",
"attribute",
"if",
"not",
"already",
"present",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L277-L281 |
kmi/iserve | iserve-discovery-api/src/main/java/uk/ac/open/kmi/iserve/discovery/api/impl/AbstractMatcher.java | AbstractMatcher.listMatchesAtMostOfType | @Override
public Map<URI, MatchResult> listMatchesAtMostOfType(URI origin, MatchType maxType) {
"""
Obtain all the matching resources that have a MatchTyoe with the URI of {@code origin} of the type provided (inclusive) or less.
@param origin URI to match
@param maxType the maximum MatchType we want to ob... | java | @Override
public Map<URI, MatchResult> listMatchesAtMostOfType(URI origin, MatchType maxType) {
return listMatchesWithinRange(origin, this.matchTypesSupported.getLowest(), maxType);
} | [
"@",
"Override",
"public",
"Map",
"<",
"URI",
",",
"MatchResult",
">",
"listMatchesAtMostOfType",
"(",
"URI",
"origin",
",",
"MatchType",
"maxType",
")",
"{",
"return",
"listMatchesWithinRange",
"(",
"origin",
",",
"this",
".",
"matchTypesSupported",
".",
"getLo... | Obtain all the matching resources that have a MatchTyoe with the URI of {@code origin} of the type provided (inclusive) or less.
@param origin URI to match
@param maxType the maximum MatchType we want to obtain
@return a Map containing indexed by the URI of the matching resource and containing the particular {@code M... | [
"Obtain",
"all",
"the",
"matching",
"resources",
"that",
"have",
"a",
"MatchTyoe",
"with",
"the",
"URI",
"of",
"{",
"@code",
"origin",
"}",
"of",
"the",
"type",
"provided",
"(",
"inclusive",
")",
"or",
"less",
"."
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-discovery-api/src/main/java/uk/ac/open/kmi/iserve/discovery/api/impl/AbstractMatcher.java#L111-L114 |
selenide/selenide | src/main/java/com/codeborne/selenide/Condition.java | Condition.matchText | public static Condition matchText(final String regex) {
"""
Assert that given element's text matches given regular expression
<p>Sample: <code>$("h1").should(matchText("Hello\s*John"))</code></p>
@param regex e.g. Kicked.*Chuck Norris - in this case ".*" can contain any characters including spaces, tabs, CR ... | java | public static Condition matchText(final String regex) {
return new Condition("match text") {
@Override
public boolean apply(Driver driver, WebElement element) {
return Html.text.matches(element.getText(), regex);
}
@Override
public String toString() {
return name + " '... | [
"public",
"static",
"Condition",
"matchText",
"(",
"final",
"String",
"regex",
")",
"{",
"return",
"new",
"Condition",
"(",
"\"match text\"",
")",
"{",
"@",
"Override",
"public",
"boolean",
"apply",
"(",
"Driver",
"driver",
",",
"WebElement",
"element",
")",
... | Assert that given element's text matches given regular expression
<p>Sample: <code>$("h1").should(matchText("Hello\s*John"))</code></p>
@param regex e.g. Kicked.*Chuck Norris - in this case ".*" can contain any characters including spaces, tabs, CR etc. | [
"Assert",
"that",
"given",
"element",
"s",
"text",
"matches",
"given",
"regular",
"expression"
] | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/Condition.java#L231-L243 |
overturetool/overture | core/codegen/platform/src/main/java/org/overture/codegen/ir/CodeGenBase.java | CodeGenBase.emitCode | public static void emitCode(File outputFolder, String fileName, String code,
String encoding) {
"""
Emits generated code to a file.
@param outputFolder
outputFolder The output folder that will store the generated code.
@param fileName
The name of the file that will store the generated code.
@param code
... | java | public static void emitCode(File outputFolder, String fileName, String code,
String encoding)
{
try
{
File javaFile = new File(outputFolder, File.separator + fileName);
javaFile.getParentFile().mkdirs();
javaFile.createNewFile();
PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOu... | [
"public",
"static",
"void",
"emitCode",
"(",
"File",
"outputFolder",
",",
"String",
"fileName",
",",
"String",
"code",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"File",
"javaFile",
"=",
"new",
"File",
"(",
"outputFolder",
",",
"File",
".",
"separato... | Emits generated code to a file.
@param outputFolder
outputFolder The output folder that will store the generated code.
@param fileName
The name of the file that will store the generated code.
@param code
The generated code.
@param encoding
The encoding to use for the generated code. | [
"Emits",
"generated",
"code",
"to",
"a",
"file",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/codegen/platform/src/main/java/org/overture/codegen/ir/CodeGenBase.java#L611-L629 |
att/openstacksdk | openstack-java-sdk/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java | JerseyConnector.getHostnameVerifier | private HostnameVerifier getHostnameVerifier() {
"""
This host name verifier is used if the protocol is HTTPS AND a trusted hosts list has been provided. Otherwise,
the default behavior is used (requiring valid, unexpired certificates).
@return A host-name verifier that verifies the hosts based on the trusted ... | java | private HostnameVerifier getHostnameVerifier() {
return new HostnameVerifier() {
@Override
public boolean verify(String hostName, SSLSession arg1) {
for (Pattern trustedHostPattern : trustedHostPatterns) {
if (trustedHostPattern.matcher(hostName).matc... | [
"private",
"HostnameVerifier",
"getHostnameVerifier",
"(",
")",
"{",
"return",
"new",
"HostnameVerifier",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"verify",
"(",
"String",
"hostName",
",",
"SSLSession",
"arg1",
")",
"{",
"for",
"(",
"Pattern",
"tru... | This host name verifier is used if the protocol is HTTPS AND a trusted hosts list has been provided. Otherwise,
the default behavior is used (requiring valid, unexpired certificates).
@return A host-name verifier that verifies the hosts based on the trusted hosts list. Note, the trusted hosts
list can include wild-car... | [
"This",
"host",
"name",
"verifier",
"is",
"used",
"if",
"the",
"protocol",
"is",
"HTTPS",
"AND",
"a",
"trusted",
"hosts",
"list",
"has",
"been",
"provided",
".",
"Otherwise",
"the",
"default",
"behavior",
"is",
"used",
"(",
"requiring",
"valid",
"unexpired",... | train | https://github.com/att/openstacksdk/blob/16a81c460a7186ebe1ea63b7682486ba147208b9/openstack-java-sdk/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java#L311-L324 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/impl/common/BaseFileCopier.java | BaseFileCopier.appendRemoteFileExtension | public static String appendRemoteFileExtension(final String filepath, final String fileext) {
"""
@return a string with a file extension appended if it is not already on the file path
provided.
@param filepath the file path string
@param fileext the file extension, if it does not start with a "." one will be... | java | public static String appendRemoteFileExtension(final String filepath, final String fileext) {
return util.appendRemoteFileExtension(filepath, fileext);
} | [
"public",
"static",
"String",
"appendRemoteFileExtension",
"(",
"final",
"String",
"filepath",
",",
"final",
"String",
"fileext",
")",
"{",
"return",
"util",
".",
"appendRemoteFileExtension",
"(",
"filepath",
",",
"fileext",
")",
";",
"}"
] | @return a string with a file extension appended if it is not already on the file path
provided.
@param filepath the file path string
@param fileext the file extension, if it does not start with a "." one will be prepended
first. If null, the unmodified filepath will be returned. | [
"@return",
"a",
"string",
"with",
"a",
"file",
"extension",
"appended",
"if",
"it",
"is",
"not",
"already",
"on",
"the",
"file",
"path",
"provided",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/impl/common/BaseFileCopier.java#L80-L82 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java | TreeInfo.diagnosticPositionFor | public static DiagnosticPosition diagnosticPositionFor(final Symbol sym, final JCTree tree) {
"""
Find the position for reporting an error about a symbol, where
that symbol is defined somewhere in the given tree.
"""
JCTree decl = declarationFor(sym, tree);
return ((decl != null) ? decl : tree... | java | public static DiagnosticPosition diagnosticPositionFor(final Symbol sym, final JCTree tree) {
JCTree decl = declarationFor(sym, tree);
return ((decl != null) ? decl : tree).pos();
} | [
"public",
"static",
"DiagnosticPosition",
"diagnosticPositionFor",
"(",
"final",
"Symbol",
"sym",
",",
"final",
"JCTree",
"tree",
")",
"{",
"JCTree",
"decl",
"=",
"declarationFor",
"(",
"sym",
",",
"tree",
")",
";",
"return",
"(",
"(",
"decl",
"!=",
"null",
... | Find the position for reporting an error about a symbol, where
that symbol is defined somewhere in the given tree. | [
"Find",
"the",
"position",
"for",
"reporting",
"an",
"error",
"about",
"a",
"symbol",
"where",
"that",
"symbol",
"is",
"defined",
"somewhere",
"in",
"the",
"given",
"tree",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java#L606-L609 |
shamanland/xdroid | lib-core/src/main/java/xdroid/core/ThreadUtils.java | ThreadUtils.newThread | public static Handler newThread(String name, int priority, Handler.Callback callback) {
"""
Creates new {@link HandlerThread} and returns new {@link Handler} associated with this thread.
@param name name of thread, in case of null - the default name will be generated
@param priority one of constants from {... | java | public static Handler newThread(String name, int priority, Handler.Callback callback) {
HandlerThread thread = new HandlerThread(name != null ? name : newName(), priority);
thread.start();
return new Handler(thread.getLooper(), callback);
} | [
"public",
"static",
"Handler",
"newThread",
"(",
"String",
"name",
",",
"int",
"priority",
",",
"Handler",
".",
"Callback",
"callback",
")",
"{",
"HandlerThread",
"thread",
"=",
"new",
"HandlerThread",
"(",
"name",
"!=",
"null",
"?",
"name",
":",
"newName",
... | Creates new {@link HandlerThread} and returns new {@link Handler} associated with this thread.
@param name name of thread, in case of null - the default name will be generated
@param priority one of constants from {@link android.os.Process}
@param callback message handling callback, may be null
@return new instanc... | [
"Creates",
"new",
"{",
"@link",
"HandlerThread",
"}",
"and",
"returns",
"new",
"{",
"@link",
"Handler",
"}",
"associated",
"with",
"this",
"thread",
"."
] | train | https://github.com/shamanland/xdroid/blob/5330811114afaf6a7b8f9a10f3bbe19d37995d89/lib-core/src/main/java/xdroid/core/ThreadUtils.java#L54-L58 |
JavaMoney/jsr354-api | src/main/java/javax/money/Monetary.java | Monetary.isCurrencyAvailable | public static boolean isCurrencyAvailable(String code, String... providers) {
"""
Allows to check if a {@link CurrencyUnit} instance is defined, i.e.
accessible from {@link Monetary#getCurrency(String, String...)}.
@param code the currency code, not {@code null}.
@param providers the (optional) specifica... | java | public static boolean isCurrencyAvailable(String code, String... providers) {
return Objects.nonNull(MONETARY_CURRENCIES_SINGLETON_SPI()) && MONETARY_CURRENCIES_SINGLETON_SPI().isCurrencyAvailable(code, providers);
} | [
"public",
"static",
"boolean",
"isCurrencyAvailable",
"(",
"String",
"code",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"Objects",
".",
"nonNull",
"(",
"MONETARY_CURRENCIES_SINGLETON_SPI",
"(",
")",
")",
"&&",
"MONETARY_CURRENCIES_SINGLETON_SPI",
"(",
")... | Allows to check if a {@link CurrencyUnit} instance is defined, i.e.
accessible from {@link Monetary#getCurrency(String, String...)}.
@param code the currency code, not {@code null}.
@param providers the (optional) specification of providers to consider.
@return {@code true} if {@link Monetary#getCurrency(String, ... | [
"Allows",
"to",
"check",
"if",
"a",
"{",
"@link",
"CurrencyUnit",
"}",
"instance",
"is",
"defined",
"i",
".",
"e",
".",
"accessible",
"from",
"{",
"@link",
"Monetary#getCurrency",
"(",
"String",
"String",
"...",
")",
"}",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/Monetary.java#L435-L437 |
YahooArchive/samoa | samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java | AMRulesAggregatorProcessor.newResultContentEvent | private ResultContentEvent newResultContentEvent(double[] prediction, InstanceContentEvent inEvent) {
"""
Helper method to generate new ResultContentEvent based on an instance and
its prediction result.
@param prediction The predicted class label from the decision tree model.
@param inEvent The associated insta... | java | private ResultContentEvent newResultContentEvent(double[] prediction, InstanceContentEvent inEvent){
ResultContentEvent rce = new ResultContentEvent(inEvent.getInstanceIndex(), inEvent.getInstance(), inEvent.getClassId(), prediction, inEvent.isLastEvent());
rce.setClassifierIndex(this.processorId);
rce.setEvaluat... | [
"private",
"ResultContentEvent",
"newResultContentEvent",
"(",
"double",
"[",
"]",
"prediction",
",",
"InstanceContentEvent",
"inEvent",
")",
"{",
"ResultContentEvent",
"rce",
"=",
"new",
"ResultContentEvent",
"(",
"inEvent",
".",
"getInstanceIndex",
"(",
")",
",",
... | Helper method to generate new ResultContentEvent based on an instance and
its prediction result.
@param prediction The predicted class label from the decision tree model.
@param inEvent The associated instance content event
@return ResultContentEvent to be sent into Evaluator PI or other destination PI. | [
"Helper",
"method",
"to",
"generate",
"new",
"ResultContentEvent",
"based",
"on",
"an",
"instance",
"and",
"its",
"prediction",
"result",
"."
] | train | https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java#L219-L224 |
trustathsh/ironcommon | src/main/java/de/hshannover/f4/trust/ironcommon/yaml/YamlReader.java | YamlReader.loadAs | @SuppressWarnings("unchecked")
public static synchronized <T> T loadAs(String fileName, Class<T> clazz)
throws IOException {
"""
Tries to load the content of a yml-file as instances of a given
{@link Class}. If the file exists but is empty, the file is newly created
and null is returned.
@param fileName
... | java | @SuppressWarnings("unchecked")
public static synchronized <T> T loadAs(String fileName, Class<T> clazz)
throws IOException {
ObjectChecks.checkForNullReference(fileName, "fileName is null");
ObjectChecks.checkForNullReference(clazz, "clazz is null");
FileReader fileReader = null;
File f = null;
try {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"loadAs",
"(",
"String",
"fileName",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
"{",
"ObjectChecks",
".",
"checkForNullReferenc... | Tries to load the content of a yml-file as instances of a given
{@link Class}. If the file exists but is empty, the file is newly created
and null is returned.
@param fileName
The file name of the yml-file.
@param clazz
The data-type that the content of the yml-file shall be cast
into.
@param <T>
blubb
@return The con... | [
"Tries",
"to",
"load",
"the",
"content",
"of",
"a",
"yml",
"-",
"file",
"as",
"instances",
"of",
"a",
"given",
"{",
"@link",
"Class",
"}",
".",
"If",
"the",
"file",
"exists",
"but",
"is",
"empty",
"the",
"file",
"is",
"newly",
"created",
"and",
"null... | train | https://github.com/trustathsh/ironcommon/blob/fee589a9300ab16744ca12fafae4357dd18c9fcb/src/main/java/de/hshannover/f4/trust/ironcommon/yaml/YamlReader.java#L87-L131 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java | InheritanceHelper.isProxyOrSubTypeOf | public boolean isProxyOrSubTypeOf(LightweightTypeReference candidate, Class<?> jvmSuperType,
Class<? extends XtendTypeDeclaration> sarlSuperType) {
"""
Replies if the type candidate is a proxy (unresolved type) or a subtype of the given super type.
@param candidate the type to test.
@param jvmSuperType the ... | java | public boolean isProxyOrSubTypeOf(LightweightTypeReference candidate, Class<?> jvmSuperType,
Class<? extends XtendTypeDeclaration> sarlSuperType) {
if (!candidate.isResolved()) {
return true;
}
return isSubTypeOf(candidate, jvmSuperType, sarlSuperType);
} | [
"public",
"boolean",
"isProxyOrSubTypeOf",
"(",
"LightweightTypeReference",
"candidate",
",",
"Class",
"<",
"?",
">",
"jvmSuperType",
",",
"Class",
"<",
"?",
"extends",
"XtendTypeDeclaration",
">",
"sarlSuperType",
")",
"{",
"if",
"(",
"!",
"candidate",
".",
"is... | Replies if the type candidate is a proxy (unresolved type) or a subtype of the given super type.
@param candidate the type to test.
@param jvmSuperType the expected JVM super-type.
@param sarlSuperType the expected SARL super-type.
@return <code>true</code> if the candidate is a sub-type of the super-type. | [
"Replies",
"if",
"the",
"type",
"candidate",
"is",
"a",
"proxy",
"(",
"unresolved",
"type",
")",
"or",
"a",
"subtype",
"of",
"the",
"given",
"super",
"type",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java#L198-L204 |
google/flogger | api/src/main/java/com/google/common/flogger/parser/DefaultPrintfMessageParser.java | DefaultPrintfMessageParser.wrapHexParameter | private static Parameter wrapHexParameter(final FormatOptions options, int index) {
"""
Static method so the anonymous synthetic parameter is static, rather than an inner class.
"""
// %h / %H is really just %x / %X on the hashcode.
return new Parameter(options, index) {
@Override
protected... | java | private static Parameter wrapHexParameter(final FormatOptions options, int index) {
// %h / %H is really just %x / %X on the hashcode.
return new Parameter(options, index) {
@Override
protected void accept(ParameterVisitor visitor, Object value) {
visitor.visit(value.hashCode(), FormatChar.H... | [
"private",
"static",
"Parameter",
"wrapHexParameter",
"(",
"final",
"FormatOptions",
"options",
",",
"int",
"index",
")",
"{",
"// %h / %H is really just %x / %X on the hashcode.",
"return",
"new",
"Parameter",
"(",
"options",
",",
"index",
")",
"{",
"@",
"Override",
... | Static method so the anonymous synthetic parameter is static, rather than an inner class. | [
"Static",
"method",
"so",
"the",
"anonymous",
"synthetic",
"parameter",
"is",
"static",
"rather",
"than",
"an",
"inner",
"class",
"."
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/DefaultPrintfMessageParser.java#L103-L116 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the commerce orders where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CommerceOrder commerceOrder : findByUuid_C(uuid, companyId,
QueryUtil.ALL_... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CommerceOrder commerceOrder : findByUuid_C(uuid, companyId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceOrder);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CommerceOrder",
"commerceOrder",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil"... | Removes all the commerce orders where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"commerce",
"orders",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L1400-L1406 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_store/FSSpecStore.java | FSSpecStore.getSpecs | private void getSpecs(Path directory, Collection<Spec> specs) throws Exception {
"""
For multiple {@link FlowSpec}s to be loaded, catch Exceptions when one of them failed to be loaded and
continue with the rest.
The {@link IOException} thrown from standard FileSystem call will be propagated, while the file-spe... | java | private void getSpecs(Path directory, Collection<Spec> specs) throws Exception {
FileStatus[] fileStatuses = fs.listStatus(directory);
for (FileStatus fileStatus : fileStatuses) {
if (fileStatus.isDirectory()) {
getSpecs(fileStatus.getPath(), specs);
} else {
try {
specs.ad... | [
"private",
"void",
"getSpecs",
"(",
"Path",
"directory",
",",
"Collection",
"<",
"Spec",
">",
"specs",
")",
"throws",
"Exception",
"{",
"FileStatus",
"[",
"]",
"fileStatuses",
"=",
"fs",
".",
"listStatus",
"(",
"directory",
")",
";",
"for",
"(",
"FileStatu... | For multiple {@link FlowSpec}s to be loaded, catch Exceptions when one of them failed to be loaded and
continue with the rest.
The {@link IOException} thrown from standard FileSystem call will be propagated, while the file-specific
exception will be caught to ensure other files being able to deserialized.
@param dire... | [
"For",
"multiple",
"{",
"@link",
"FlowSpec",
"}",
"s",
"to",
"be",
"loaded",
"catch",
"Exceptions",
"when",
"one",
"of",
"them",
"failed",
"to",
"be",
"loaded",
"and",
"continue",
"with",
"the",
"rest",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_store/FSSpecStore.java#L281-L294 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java | AsyncMutateInBuilder.arrayAppendAll | public <T> AsyncMutateInBuilder arrayAppendAll(String path, Collection<T> values, SubdocOptionsBuilder optionsBuilder) {
"""
Append multiple values at once in an existing array, pushing all values in the collection's iteration order to
the back/end of the array.
Each item in the collection is inserted as an in... | java | public <T> AsyncMutateInBuilder arrayAppendAll(String path, Collection<T> values, SubdocOptionsBuilder optionsBuilder) {
this.mutationSpecs.add(new MutationSpec(Mutation.ARRAY_PUSH_LAST, path, new MultiValue<T>(values), optionsBuilder));
return this;
} | [
"public",
"<",
"T",
">",
"AsyncMutateInBuilder",
"arrayAppendAll",
"(",
"String",
"path",
",",
"Collection",
"<",
"T",
">",
"values",
",",
"SubdocOptionsBuilder",
"optionsBuilder",
")",
"{",
"this",
".",
"mutationSpecs",
".",
"add",
"(",
"new",
"MutationSpec",
... | Append multiple values at once in an existing array, pushing all values in the collection's iteration order to
the back/end of the array.
Each item in the collection is inserted as an individual element of the array, but a bit of overhead
is saved compared to individual {@link #arrayAppend(String, Object, boolean)} by... | [
"Append",
"multiple",
"values",
"at",
"once",
"in",
"an",
"existing",
"array",
"pushing",
"all",
"values",
"in",
"the",
"collection",
"s",
"iteration",
"order",
"to",
"the",
"back",
"/",
"end",
"of",
"the",
"array",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java#L1041-L1044 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateLocal | public Matrix4d rotateLocal(Quaterniondc quat, Matrix4d dest) {
"""
Pre-multiply the rotation - and possibly scaling - transformation of the given {@link Quaterniondc} to this matrix and store
the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate... | java | public Matrix4d rotateLocal(Quaterniondc quat, Matrix4d dest) {
double w2 = quat.w() * quat.w(), x2 = quat.x() * quat.x();
double y2 = quat.y() * quat.y(), z2 = quat.z() * quat.z();
double zw = quat.z() * quat.w(), dzw = zw + zw, xy = quat.x() * quat.y(), dxy = xy + xy;
double xz = quat.... | [
"public",
"Matrix4d",
"rotateLocal",
"(",
"Quaterniondc",
"quat",
",",
"Matrix4d",
"dest",
")",
"{",
"double",
"w2",
"=",
"quat",
".",
"w",
"(",
")",
"*",
"quat",
".",
"w",
"(",
")",
",",
"x2",
"=",
"quat",
".",
"x",
"(",
")",
"*",
"quat",
".",
... | Pre-multiply the rotation - and possibly scaling - transformation of the given {@link Quaterniondc} to this matrix and store
the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the... | [
"Pre",
"-",
"multiply",
"the",
"rotation",
"-",
"and",
"possibly",
"scaling",
"-",
"transformation",
"of",
"the",
"given",
"{",
"@link",
"Quaterniondc",
"}",
"to",
"this",
"matrix",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
"code",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L8027-L8076 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java | ReflectionUtils.assertVoidReturnType | public static void assertVoidReturnType(final Method method, Class<? extends Annotation> annotation) {
"""
Asserts method return void.
@param method to validate
@param annotation annotation to propagate in exception message
"""
if ((!method.getReturnType().equals(Void.class)) && (!method.getReturnTyp... | java | public static void assertVoidReturnType(final Method method, Class<? extends Annotation> annotation)
{
if ((!method.getReturnType().equals(Void.class)) && (!method.getReturnType().equals(Void.TYPE)))
{
throw annotation == null ? MESSAGES.methodHasToReturnVoid(method) : MESSAGES.methodHasToRetur... | [
"public",
"static",
"void",
"assertVoidReturnType",
"(",
"final",
"Method",
"method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"if",
"(",
"(",
"!",
"method",
".",
"getReturnType",
"(",
")",
".",
"equals",
"(",
"Void",
... | Asserts method return void.
@param method to validate
@param annotation annotation to propagate in exception message | [
"Asserts",
"method",
"return",
"void",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java#L128-L134 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.scale | public static Image scale(Image srcImg, int width, int height) {
"""
缩放图像(按长宽缩放)<br>
注意:目标长宽与原图不成比例会变形
@param srcImg 源图像来源流
@param width 目标宽度
@param height 目标高度
@return {@link Image}
@since 3.1.0
"""
return Img.from(srcImg).scale(width, height).getImg();
} | java | public static Image scale(Image srcImg, int width, int height) {
return Img.from(srcImg).scale(width, height).getImg();
} | [
"public",
"static",
"Image",
"scale",
"(",
"Image",
"srcImg",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"return",
"Img",
".",
"from",
"(",
"srcImg",
")",
".",
"scale",
"(",
"width",
",",
"height",
")",
".",
"getImg",
"(",
")",
";",
"}"
] | 缩放图像(按长宽缩放)<br>
注意:目标长宽与原图不成比例会变形
@param srcImg 源图像来源流
@param width 目标宽度
@param height 目标高度
@return {@link Image}
@since 3.1.0 | [
"缩放图像(按长宽缩放)<br",
">",
"注意:目标长宽与原图不成比例会变形"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L169-L171 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AbstractAlpineQueryManager.java | AbstractAlpineQueryManager.getObjectById | public <T> T getObjectById(Class<T> clazz, Object id) {
"""
Retrieves an object by its ID.
@param <T> A type parameter. This type will be returned
@param clazz the persistence class to retrive the ID for
@param id the object id to retrieve
@return an object of the specified type
@since 1.0.0
"""
r... | java | public <T> T getObjectById(Class<T> clazz, Object id) {
return pm.getObjectById(clazz, id);
} | [
"public",
"<",
"T",
">",
"T",
"getObjectById",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Object",
"id",
")",
"{",
"return",
"pm",
".",
"getObjectById",
"(",
"clazz",
",",
"id",
")",
";",
"}"
] | Retrieves an object by its ID.
@param <T> A type parameter. This type will be returned
@param clazz the persistence class to retrive the ID for
@param id the object id to retrieve
@return an object of the specified type
@since 1.0.0 | [
"Retrieves",
"an",
"object",
"by",
"its",
"ID",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AbstractAlpineQueryManager.java#L503-L505 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.singleStepConference | public void singleStepConference(
String connId,
String destination,
String location,
KeyValueCollection userData,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
"""
Perform a single-step ... | java | public void singleStepConference(
String connId,
String destination,
String location,
KeyValueCollection userData,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
try {
Voi... | [
"public",
"void",
"singleStepConference",
"(",
"String",
"connId",
",",
"String",
"destination",
",",
"String",
"location",
",",
"KeyValueCollection",
"userData",
",",
"KeyValueCollection",
"reasons",
",",
"KeyValueCollection",
"extensions",
")",
"throws",
"WorkspaceApi... | Perform a single-step conference to the specified destination. This adds the destination to the
existing call, creating a conference if necessary.
@param connId The connection ID of the call to conference.
@param destination The number to add to the call.
@param location Name of the remote location in the form of <Swit... | [
"Perform",
"a",
"single",
"-",
"step",
"conference",
"to",
"the",
"specified",
"destination",
".",
"This",
"adds",
"the",
"destination",
"to",
"the",
"existing",
"call",
"creating",
"a",
"conference",
"if",
"necessary",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L1034-L1058 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java | HeadedSyntacticCategory.getSubcategories | public Set<HeadedSyntacticCategory> getSubcategories(Set<String> featureValues) {
"""
Gets all syntactic categories which can be formed by assigning values to the
feature variables of this category. Returned categories may not be in canonical
form.
@param featureValues
@return
"""
Set<HeadedSyntactic... | java | public Set<HeadedSyntacticCategory> getSubcategories(Set<String> featureValues) {
Set<HeadedSyntacticCategory> subcategories = Sets.newHashSet();
for (SyntacticCategory newSyntax : syntacticCategory.getSubcategories(featureValues)) {
subcategories.add(new HeadedSyntacticCategory(newSyntax, semanticVariabl... | [
"public",
"Set",
"<",
"HeadedSyntacticCategory",
">",
"getSubcategories",
"(",
"Set",
"<",
"String",
">",
"featureValues",
")",
"{",
"Set",
"<",
"HeadedSyntacticCategory",
">",
"subcategories",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"for",
"(",
"Syntac... | Gets all syntactic categories which can be formed by assigning values to the
feature variables of this category. Returned categories may not be in canonical
form.
@param featureValues
@return | [
"Gets",
"all",
"syntactic",
"categories",
"which",
"can",
"be",
"formed",
"by",
"assigning",
"values",
"to",
"the",
"feature",
"variables",
"of",
"this",
"category",
".",
"Returned",
"categories",
"may",
"not",
"be",
"in",
"canonical",
"form",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L451-L457 |
JodaOrg/joda-time | src/main/java/org/joda/time/convert/CalendarConverter.java | CalendarConverter.getChronology | public Chronology getChronology(Object object, DateTimeZone zone) {
"""
Gets the chronology, which is the GJChronology if a GregorianCalendar is used,
BuddhistChronology if a BuddhistCalendar is used or ISOChronology otherwise.
The time zone specified is used in preference to that on the calendar.
@param obje... | java | public Chronology getChronology(Object object, DateTimeZone zone) {
if (object.getClass().getName().endsWith(".BuddhistCalendar")) {
return BuddhistChronology.getInstance(zone);
} else if (object instanceof GregorianCalendar) {
GregorianCalendar gc = (GregorianCalendar) object;
... | [
"public",
"Chronology",
"getChronology",
"(",
"Object",
"object",
",",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"object",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
".",
"endsWith",
"(",
"\".BuddhistCalendar\"",
")",
")",
"{",
"return",
"Budd... | Gets the chronology, which is the GJChronology if a GregorianCalendar is used,
BuddhistChronology if a BuddhistCalendar is used or ISOChronology otherwise.
The time zone specified is used in preference to that on the calendar.
@param object the Calendar to convert, must not be null
@param zone the specified zone to ... | [
"Gets",
"the",
"chronology",
"which",
"is",
"the",
"GJChronology",
"if",
"a",
"GregorianCalendar",
"is",
"used",
"BuddhistChronology",
"if",
"a",
"BuddhistCalendar",
"is",
"used",
"or",
"ISOChronology",
"otherwise",
".",
"The",
"time",
"zone",
"specified",
"is",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/CalendarConverter.java#L93-L109 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/http/GitlabHTTPRequestor.java | GitlabHTTPRequestor.withAttachment | public GitlabHTTPRequestor withAttachment(String key, File file) {
"""
Sets the HTTP Form Post parameters for the request
Has a fluent api for method chaining
@param key Form parameter Key
@param file File data
@return this
"""
if (file != null && key != null) {
attachments... | java | public GitlabHTTPRequestor withAttachment(String key, File file) {
if (file != null && key != null) {
attachments.put(key, file);
}
return this;
} | [
"public",
"GitlabHTTPRequestor",
"withAttachment",
"(",
"String",
"key",
",",
"File",
"file",
")",
"{",
"if",
"(",
"file",
"!=",
"null",
"&&",
"key",
"!=",
"null",
")",
"{",
"attachments",
".",
"put",
"(",
"key",
",",
"file",
")",
";",
"}",
"return",
... | Sets the HTTP Form Post parameters for the request
Has a fluent api for method chaining
@param key Form parameter Key
@param file File data
@return this | [
"Sets",
"the",
"HTTP",
"Form",
"Post",
"parameters",
"for",
"the",
"request",
"Has",
"a",
"fluent",
"api",
"for",
"method",
"chaining"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/http/GitlabHTTPRequestor.java#L108-L113 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.beginDelete | public void beginDelete(String scope, String eventSubscriptionName) {
"""
Delete an event subscription.
Delete an existing event subscription.
@param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespa... | java | public void beginDelete(String scope, String eventSubscriptionName) {
beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"scope",
",",
"String",
"eventSubscriptionName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"scope",
",",
"eventSubscriptionName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
... | Delete an event subscription.
Delete an existing event subscription.
@param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for... | [
"Delete",
"an",
"event",
"subscription",
".",
"Delete",
"an",
"existing",
"event",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L475-L477 |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/Persistence.java | Persistence.doReadWrite | public <T, F> T doReadWrite(F facility, Task<T, F> task) {
"""
Executes a task within a read-write transaction. Any exception rolls back the transaction and gets rethrown as a RuntimeException.
"""
return doTransaction(facility, task, null);
} | java | public <T, F> T doReadWrite(F facility, Task<T, F> task) {
return doTransaction(facility, task, null);
} | [
"public",
"<",
"T",
",",
"F",
">",
"T",
"doReadWrite",
"(",
"F",
"facility",
",",
"Task",
"<",
"T",
",",
"F",
">",
"task",
")",
"{",
"return",
"doTransaction",
"(",
"facility",
",",
"task",
",",
"null",
")",
";",
"}"
] | Executes a task within a read-write transaction. Any exception rolls back the transaction and gets rethrown as a RuntimeException. | [
"Executes",
"a",
"task",
"within",
"a",
"read",
"-",
"write",
"transaction",
".",
"Any",
"exception",
"rolls",
"back",
"the",
"transaction",
"and",
"gets",
"rethrown",
"as",
"a",
"RuntimeException",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/Persistence.java#L43-L45 |
TestFX/Monocle | src/main/java/com/sun/glass/ui/monocle/MonocleDnDClipboard.java | MonocleDnDClipboard.pushToSystem | @Override
protected void pushToSystem(HashMap<String, Object> cacheData, int supportedActions) {
"""
Here the magic happens.
When this method is called all input events should be grabbed and
appropriate drag notifications should be sent instead of regular input
events
"""
MouseInput.getInstance... | java | @Override
protected void pushToSystem(HashMap<String, Object> cacheData, int supportedActions) {
MouseInput.getInstance().notifyDragStart();
((MonocleApplication) Application.GetApplication()).enterDnDEventLoop();
actionPerformed(Clipboard.ACTION_COPY_OR_MOVE);
} | [
"@",
"Override",
"protected",
"void",
"pushToSystem",
"(",
"HashMap",
"<",
"String",
",",
"Object",
">",
"cacheData",
",",
"int",
"supportedActions",
")",
"{",
"MouseInput",
".",
"getInstance",
"(",
")",
".",
"notifyDragStart",
"(",
")",
";",
"(",
"(",
"Mo... | Here the magic happens.
When this method is called all input events should be grabbed and
appropriate drag notifications should be sent instead of regular input
events | [
"Here",
"the",
"magic",
"happens",
".",
"When",
"this",
"method",
"is",
"called",
"all",
"input",
"events",
"should",
"be",
"grabbed",
"and",
"appropriate",
"drag",
"notifications",
"should",
"be",
"sent",
"instead",
"of",
"regular",
"input",
"events"
] | train | https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/MonocleDnDClipboard.java#L51-L56 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.splitEachLine | public static <T> T splitEachLine(Reader self, String regex, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
"""
Iterates through the given reader line by line, splitting each line using
the given regex separator. For each line, the given closure is called wi... | java | public static <T> T splitEachLine(Reader self, String regex, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
return splitEachLine(self, Pattern.compile(regex), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"splitEachLine",
"(",
"Reader",
"self",
",",
"String",
"regex",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"\"List<String>\"",
")",
"Closure",
"<",
"T",
">",
"clo... | Iterates through the given reader line by line, splitting each line using
the given regex separator. For each line, the given closure is called with
a single parameter being the list of strings computed by splitting the line
around matches of the given regular expression. The Reader is closed afterwards.
<p>
Here is a... | [
"Iterates",
"through",
"the",
"given",
"reader",
"line",
"by",
"line",
"splitting",
"each",
"line",
"using",
"the",
"given",
"regex",
"separator",
".",
"For",
"each",
"line",
"the",
"given",
"closure",
"is",
"called",
"with",
"a",
"single",
"parameter",
"bei... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L527-L529 |
bwkimmel/java-util | src/main/java/ca/eandb/util/io/FileUtil.java | FileUtil.setFileContents | public static void setFileContents(File file, ByteBuffer contents, boolean createDirectory) throws IOException {
"""
Writes the specified byte array to a file.
@param file The <code>File</code> to write.
@param contents The byte array to write to the file.
@param createDirectory A value indicating whether the d... | java | public static void setFileContents(File file, ByteBuffer contents, boolean createDirectory) throws IOException {
if (createDirectory) {
File directory = file.getParentFile();
if (!directory.exists()) {
directory.mkdirs();
}
}
FileOutputStream stream = new FileOutputStream(file);
... | [
"public",
"static",
"void",
"setFileContents",
"(",
"File",
"file",
",",
"ByteBuffer",
"contents",
",",
"boolean",
"createDirectory",
")",
"throws",
"IOException",
"{",
"if",
"(",
"createDirectory",
")",
"{",
"File",
"directory",
"=",
"file",
".",
"getParentFile... | Writes the specified byte array to a file.
@param file The <code>File</code> to write.
@param contents The byte array to write to the file.
@param createDirectory A value indicating whether the directory
containing the file to be written should be created if it does
not exist.
@throws IOException If the file could not ... | [
"Writes",
"the",
"specified",
"byte",
"array",
"to",
"a",
"file",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/io/FileUtil.java#L142-L153 |
AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Beacon.java | Beacon.writeToParcel | @Deprecated
public void writeToParcel(Parcel out, int flags) {
"""
Required for making object Parcelable. If you override this class, you must override this
method if you add any additional fields.
"""
out.writeInt(mIdentifiers.size());
for (Identifier identifier: mIdentifiers) {
... | java | @Deprecated
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mIdentifiers.size());
for (Identifier identifier: mIdentifiers) {
out.writeString(identifier == null ? null : identifier.toString());
}
out.writeDouble(getDistance());
out.writeInt(mRssi);... | [
"@",
"Deprecated",
"public",
"void",
"writeToParcel",
"(",
"Parcel",
"out",
",",
"int",
"flags",
")",
"{",
"out",
".",
"writeInt",
"(",
"mIdentifiers",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Identifier",
"identifier",
":",
"mIdentifiers",
")",
"{"... | Required for making object Parcelable. If you override this class, you must override this
method if you add any additional fields. | [
"Required",
"for",
"making",
"object",
"Parcelable",
".",
"If",
"you",
"override",
"this",
"class",
"you",
"must",
"override",
"this",
"method",
"if",
"you",
"add",
"any",
"additional",
"fields",
"."
] | train | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Beacon.java#L612-L639 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java | AbstractAttributeDefinitionBuilder.setDeprecated | public BUILDER setDeprecated(ModelVersion since, boolean notificationUseful) {
"""
Marks the attribute as deprecated since the given API version, with the ability to configure that
notifications to the user (e.g. via a log message) about deprecation of the attribute should not be emitted.
Notifying the user shou... | java | public BUILDER setDeprecated(ModelVersion since, boolean notificationUseful) {
//noinspection deprecation
this.deprecated = new DeprecationData(since, notificationUseful);
return (BUILDER) this;
} | [
"public",
"BUILDER",
"setDeprecated",
"(",
"ModelVersion",
"since",
",",
"boolean",
"notificationUseful",
")",
"{",
"//noinspection deprecation",
"this",
".",
"deprecated",
"=",
"new",
"DeprecationData",
"(",
"since",
",",
"notificationUseful",
")",
";",
"return",
"... | Marks the attribute as deprecated since the given API version, with the ability to configure that
notifications to the user (e.g. via a log message) about deprecation of the attribute should not be emitted.
Notifying the user should only be done if the user can take some action in response. Advising that
something will... | [
"Marks",
"the",
"attribute",
"as",
"deprecated",
"since",
"the",
"given",
"API",
"version",
"with",
"the",
"ability",
"to",
"configure",
"that",
"notifications",
"to",
"the",
"user",
"(",
"e",
".",
"g",
".",
"via",
"a",
"log",
"message",
")",
"about",
"d... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java#L713-L717 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java | PlanNode.findAtOrBelow | public PlanNode findAtOrBelow( Type firstTypeToFind,
Type... additionalTypesToFind ) {
"""
Find the first node with one of the specified types that are at or below this node.
@param firstTypeToFind the first type of node to find; may not be null
@param additionalTypesToFind t... | java | public PlanNode findAtOrBelow( Type firstTypeToFind,
Type... additionalTypesToFind ) {
return findAtOrBelow(EnumSet.of(firstTypeToFind, additionalTypesToFind));
} | [
"public",
"PlanNode",
"findAtOrBelow",
"(",
"Type",
"firstTypeToFind",
",",
"Type",
"...",
"additionalTypesToFind",
")",
"{",
"return",
"findAtOrBelow",
"(",
"EnumSet",
".",
"of",
"(",
"firstTypeToFind",
",",
"additionalTypesToFind",
")",
")",
";",
"}"
] | Find the first node with one of the specified types that are at or below this node.
@param firstTypeToFind the first type of node to find; may not be null
@param additionalTypesToFind the additional types of node to find; may not be null
@return the first node that is at or below this node that has one of the supplied... | [
"Find",
"the",
"first",
"node",
"with",
"one",
"of",
"the",
"specified",
"types",
"that",
"are",
"at",
"or",
"below",
"this",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1462-L1465 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java | EmvParser.getGetProcessingOptions | protected byte[] getGetProcessingOptions(final byte[] pPdol) throws CommunicationException {
"""
Method used to create GPO command and execute it
@param pPdol
PDOL raw data
@return return data
@throws CommunicationException communication error
"""
// List Tag and length from PDOL
List<TagAndLength> l... | java | protected byte[] getGetProcessingOptions(final byte[] pPdol) throws CommunicationException {
// List Tag and length from PDOL
List<TagAndLength> list = TlvUtil.parseTagAndLength(pPdol);
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
out.write(EmvTags.COMMAND_TEMPLATE.getTagBytes()); // COMMAN... | [
"protected",
"byte",
"[",
"]",
"getGetProcessingOptions",
"(",
"final",
"byte",
"[",
"]",
"pPdol",
")",
"throws",
"CommunicationException",
"{",
"// List Tag and length from PDOL",
"List",
"<",
"TagAndLength",
">",
"list",
"=",
"TlvUtil",
".",
"parseTagAndLength",
"... | Method used to create GPO command and execute it
@param pPdol
PDOL raw data
@return return data
@throws CommunicationException communication error | [
"Method",
"used",
"to",
"create",
"GPO",
"command",
"and",
"execute",
"it"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L275-L292 |
haifengl/smile | core/src/main/java/smile/feature/GAFeatureSelection.java | GAFeatureSelection.learn | public BitString[] learn(int size, int generation, ClassifierTrainer<double[]> trainer, ClassificationMeasure measure, double[][] x, int[] y, int k) {
"""
Genetic algorithm based feature selection for classification.
@param size the population size of Genetic Algorithm.
@param generation the maximum number of it... | java | public BitString[] learn(int size, int generation, ClassifierTrainer<double[]> trainer, ClassificationMeasure measure, double[][] x, int[] y, int k) {
if (size <= 0) {
throw new IllegalArgumentException("Invalid population size: " + size);
}
if (k < 2) {
throw ne... | [
"public",
"BitString",
"[",
"]",
"learn",
"(",
"int",
"size",
",",
"int",
"generation",
",",
"ClassifierTrainer",
"<",
"double",
"[",
"]",
">",
"trainer",
",",
"ClassificationMeasure",
"measure",
",",
"double",
"[",
"]",
"[",
"]",
"x",
",",
"int",
"[",
... | Genetic algorithm based feature selection for classification.
@param size the population size of Genetic Algorithm.
@param generation the maximum number of iterations.
@param trainer classifier trainer.
@param measure classification measure as the chromosome fitness measure.
@param x training instances.
@param y traini... | [
"Genetic",
"algorithm",
"based",
"feature",
"selection",
"for",
"classification",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/feature/GAFeatureSelection.java#L107-L132 |
kazocsaba/matrix | src/main/java/hu/kazocsaba/math/matrix/MatrixFactory.java | MatrixFactory.createVector | public static Vector4 createVector(double x, double y, double z, double h) {
"""
Creates and initializes a new 4D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@param z the z coordinate of the new vector
@param h the h coordinate of the new vector
@retu... | java | public static Vector4 createVector(double x, double y, double z, double h) {
Vector4 v=new Vector4Impl();
v.setX(x);
v.setY(y);
v.setZ(z);
v.setH(h);
return v;
} | [
"public",
"static",
"Vector4",
"createVector",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
",",
"double",
"h",
")",
"{",
"Vector4",
"v",
"=",
"new",
"Vector4Impl",
"(",
")",
";",
"v",
".",
"setX",
"(",
"x",
")",
";",
"v",
".",
"se... | Creates and initializes a new 4D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@param z the z coordinate of the new vector
@param h the h coordinate of the new vector
@return the new vector | [
"Creates",
"and",
"initializes",
"a",
"new",
"4D",
"column",
"vector",
"."
] | train | https://github.com/kazocsaba/matrix/blob/018570db945fe616b25606fe605fa6e0c180ab5b/src/main/java/hu/kazocsaba/math/matrix/MatrixFactory.java#L58-L65 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.launchSuggestion | private boolean launchSuggestion(int position, int actionKey, String actionMsg) {
"""
Launches an intent based on a suggestion.
@param position The index of the suggestion to create the intent from.
@param actionKey The key code of the action key that was pressed,
or {@link KeyEvent#KEYCODE_UNKNOWN} if none.
... | java | private boolean launchSuggestion(int position, int actionKey, String actionMsg) {
Cursor c = mSuggestionsAdapter.getCursor();
if ((c != null) && c.moveToPosition(position)) {
Intent intent = createIntentFromSuggestion(c, actionKey, actionMsg);
// launch the intent
l... | [
"private",
"boolean",
"launchSuggestion",
"(",
"int",
"position",
",",
"int",
"actionKey",
",",
"String",
"actionMsg",
")",
"{",
"Cursor",
"c",
"=",
"mSuggestionsAdapter",
".",
"getCursor",
"(",
")",
";",
"if",
"(",
"(",
"c",
"!=",
"null",
")",
"&&",
"c"... | Launches an intent based on a suggestion.
@param position The index of the suggestion to create the intent from.
@param actionKey The key code of the action key that was pressed,
or {@link KeyEvent#KEYCODE_UNKNOWN} if none.
@param actionMsg The message for the action key that was pressed,
or <code>null</code> if none.... | [
"Launches",
"an",
"intent",
"based",
"on",
"a",
"suggestion",
"."
] | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1408-L1420 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/MessageAPI.java | MessageAPI.mediaUploadnews | public static Media mediaUploadnews(String access_token, List<Article> articles) {
"""
高级群发 构成 MassMPnewsMessage 对象的前置请求接口
@param access_token access_token
@param articles 图文信息 1-10 个
@return Media
"""
return MediaAPI.mediaUploadnews(access_token, articles);
} | java | public static Media mediaUploadnews(String access_token, List<Article> articles) {
return MediaAPI.mediaUploadnews(access_token, articles);
} | [
"public",
"static",
"Media",
"mediaUploadnews",
"(",
"String",
"access_token",
",",
"List",
"<",
"Article",
">",
"articles",
")",
"{",
"return",
"MediaAPI",
".",
"mediaUploadnews",
"(",
"access_token",
",",
"articles",
")",
";",
"}"
] | 高级群发 构成 MassMPnewsMessage 对象的前置请求接口
@param access_token access_token
@param articles 图文信息 1-10 个
@return Media | [
"高级群发",
"构成",
"MassMPnewsMessage",
"对象的前置请求接口"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MessageAPI.java#L101-L103 |
OpenTSDB/opentsdb | src/tsd/client/RemoteOracle.java | RemoteOracle.newSuggestBox | public static SuggestBox newSuggestBox(final String suggest_type,
final TextBoxBase textbox) {
"""
Factory method to use in order to get a {@link RemoteOracle} instance.
@param suggest_type The type of suggestion wanted.
@param textbox The text box to wrap to provide sugg... | java | public static SuggestBox newSuggestBox(final String suggest_type,
final TextBoxBase textbox) {
final RemoteOracle oracle = new RemoteOracle(suggest_type);
final SuggestBox box = new SuggestBox(oracle, textbox);
oracle.requester = box;
return box;
} | [
"public",
"static",
"SuggestBox",
"newSuggestBox",
"(",
"final",
"String",
"suggest_type",
",",
"final",
"TextBoxBase",
"textbox",
")",
"{",
"final",
"RemoteOracle",
"oracle",
"=",
"new",
"RemoteOracle",
"(",
"suggest_type",
")",
";",
"final",
"SuggestBox",
"box",... | Factory method to use in order to get a {@link RemoteOracle} instance.
@param suggest_type The type of suggestion wanted.
@param textbox The text box to wrap to provide suggestions to. | [
"Factory",
"method",
"to",
"use",
"in",
"order",
"to",
"get",
"a",
"{"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/RemoteOracle.java#L83-L89 |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java | ChangesetsDao.find | public void find(Handler<ChangesetInfo> handler, QueryChangesetsFilters filters) {
"""
Get a number of changesets that match the given filters.
@param handler The handler which is fed the incoming changeset infos
@param filters what to search for. I.e.
new QueryChangesetsFilters().byUser(123).onlyClosed()
... | java | public void find(Handler<ChangesetInfo> handler, QueryChangesetsFilters filters)
{
String query = filters != null ? "?" + filters.toParamString() : "";
try
{
osm.makeAuthenticatedRequest(CHANGESET + "s" + query, null, new ChangesetParser(handler));
}
catch(OsmNotFoundException e)
{
// ok, we... | [
"public",
"void",
"find",
"(",
"Handler",
"<",
"ChangesetInfo",
">",
"handler",
",",
"QueryChangesetsFilters",
"filters",
")",
"{",
"String",
"query",
"=",
"filters",
"!=",
"null",
"?",
"\"?\"",
"+",
"filters",
".",
"toParamString",
"(",
")",
":",
"\"\"",
... | Get a number of changesets that match the given filters.
@param handler The handler which is fed the incoming changeset infos
@param filters what to search for. I.e.
new QueryChangesetsFilters().byUser(123).onlyClosed()
@throws OsmAuthorizationException if not logged in | [
"Get",
"a",
"number",
"of",
"changesets",
"that",
"match",
"the",
"given",
"filters",
"."
] | train | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java#L57-L68 |
danidemi/jlubricant | jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java | DatasourceTemplate.queryForObject | public <T> T queryForObject(String sql, RowMapper<T> rowMapper) throws SQLException {
"""
Execute a query that return a single result obtained allowing the current row to be mapped through
the provided {@link RowMapper}.
@throws SQLException
"""
return (T) query(sql, rowMapper);
} | java | public <T> T queryForObject(String sql, RowMapper<T> rowMapper) throws SQLException {
return (T) query(sql, rowMapper);
} | [
"public",
"<",
"T",
">",
"T",
"queryForObject",
"(",
"String",
"sql",
",",
"RowMapper",
"<",
"T",
">",
"rowMapper",
")",
"throws",
"SQLException",
"{",
"return",
"(",
"T",
")",
"query",
"(",
"sql",
",",
"rowMapper",
")",
";",
"}"
] | Execute a query that return a single result obtained allowing the current row to be mapped through
the provided {@link RowMapper}.
@throws SQLException | [
"Execute",
"a",
"query",
"that",
"return",
"a",
"single",
"result",
"obtained",
"allowing",
"the",
"current",
"row",
"to",
"be",
"mapped",
"through",
"the",
"provided",
"{"
] | train | https://github.com/danidemi/jlubricant/blob/a9937c141c69ec34b768bd603b8093e496329b3a/jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java#L80-L82 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getLastToken | @Nullable
public static String getLastToken (@Nullable final String sStr, final char cSearch) {
"""
Get the last token from (and excluding) the separating character.
@param sStr
The string to search. May be <code>null</code>.
@param cSearch
The search character.
@return The passed string if no such separa... | java | @Nullable
public static String getLastToken (@Nullable final String sStr, final char cSearch)
{
final int nIndex = getLastIndexOf (sStr, cSearch);
return nIndex == StringHelper.STRING_NOT_FOUND ? sStr : sStr.substring (nIndex + 1);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getLastToken",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"final",
"char",
"cSearch",
")",
"{",
"final",
"int",
"nIndex",
"=",
"getLastIndexOf",
"(",
"sStr",
",",
"cSearch",
")",
";",
"return",
"nI... | Get the last token from (and excluding) the separating character.
@param sStr
The string to search. May be <code>null</code>.
@param cSearch
The search character.
@return The passed string if no such separator token was found. | [
"Get",
"the",
"last",
"token",
"from",
"(",
"and",
"excluding",
")",
"the",
"separating",
"character",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5138-L5143 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SessionUtil.java | SessionUtil.isPrefixEqual | static boolean isPrefixEqual(String aUrlStr, String bUrlStr)
throws MalformedURLException {
"""
Verify if two input urls have the same protocol, host, and port.
@param aUrlStr a source URL string
@param bUrlStr a target URL string
@return true if matched otherwise false
@throws MalformedURLException raises... | java | static boolean isPrefixEqual(String aUrlStr, String bUrlStr)
throws MalformedURLException
{
URL aUrl = new URL(aUrlStr);
URL bUrl = new URL(bUrlStr);
int aPort = aUrl.getPort();
int bPort = bUrl.getPort();
if (aPort == -1 && "https".equals(aUrl.getProtocol()))
{
// default port number ... | [
"static",
"boolean",
"isPrefixEqual",
"(",
"String",
"aUrlStr",
",",
"String",
"bUrlStr",
")",
"throws",
"MalformedURLException",
"{",
"URL",
"aUrl",
"=",
"new",
"URL",
"(",
"aUrlStr",
")",
";",
"URL",
"bUrl",
"=",
"new",
"URL",
"(",
"bUrlStr",
")",
";",
... | Verify if two input urls have the same protocol, host, and port.
@param aUrlStr a source URL string
@param bUrlStr a target URL string
@return true if matched otherwise false
@throws MalformedURLException raises if a URL string is not valid. | [
"Verify",
"if",
"two",
"input",
"urls",
"have",
"the",
"same",
"protocol",
"host",
"and",
"port",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SessionUtil.java#L1401-L1422 |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/api/OauthAPI.java | OauthAPI.validToken | public boolean validToken(String token, String openid) {
"""
校验token是否合法有效
@param token token
@param openid 用户openid
@return 是否合法有效
"""
BeanUtil.requireNonNull(token, "token is null");
BeanUtil.requireNonNull(openid, "openid is null");
String url = BASE_API_URL + "sns/auth?access_... | java | public boolean validToken(String token, String openid) {
BeanUtil.requireNonNull(token, "token is null");
BeanUtil.requireNonNull(openid, "openid is null");
String url = BASE_API_URL + "sns/auth?access_token=" + token + "&openid=" + openid;
BaseResponse r = executeGet(url);
retur... | [
"public",
"boolean",
"validToken",
"(",
"String",
"token",
",",
"String",
"openid",
")",
"{",
"BeanUtil",
".",
"requireNonNull",
"(",
"token",
",",
"\"token is null\"",
")",
";",
"BeanUtil",
".",
"requireNonNull",
"(",
"openid",
",",
"\"openid is null\"",
")",
... | 校验token是否合法有效
@param token token
@param openid 用户openid
@return 是否合法有效 | [
"校验token是否合法有效"
] | train | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/api/OauthAPI.java#L115-L121 |
OpenLiberty/open-liberty | dev/com.ibm.ws.mongo/src/com/ibm/ws/mongo/internal/MongoDBService.java | MongoDBService.modified | @Modified
protected void modified(ComponentContext context, Map<String, Object> props) throws Exception {
"""
Modify the DeclarativeService instance that corresponds to an <mongoDB>
configuration element. <p>
This method is only called if the <mogoDB> configuration element changes
and not the <mongo> conf... | java | @Modified
protected void modified(ComponentContext context, Map<String, Object> props) throws Exception {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Dictionary<String, Object> oldProps = cctx.get().getProperties();
Tr.debug(this, tc, "MongoDBService modified: ... | [
"@",
"Modified",
"protected",
"void",
"modified",
"(",
"ComponentContext",
"context",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"throws",
"Exception",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",... | Modify the DeclarativeService instance that corresponds to an <mongoDB>
configuration element. <p>
This method is only called if the <mogoDB> configuration element changes
and not the <mongo> configuration element. MongoDBService is deactivated
if <mongo> is changed, since the MongoService to deactivated.
@param cont... | [
"Modify",
"the",
"DeclarativeService",
"instance",
"that",
"corresponds",
"to",
"an",
"<mongoDB",
">",
"configuration",
"element",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.mongo/src/com/ibm/ws/mongo/internal/MongoDBService.java#L184-L202 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/properties/GUIHierarchyConcatenationProperties.java | GUIHierarchyConcatenationProperties.getPropertyValueAsList | public List<String> getPropertyValueAsList(String key, Object[] parameters) {
"""
Searches over the group of {@code GUIProperties} for a property list
corresponding to the given key.
@param key
key to be found
@param parameters
instances of the {@code String} literal <code>"{n}"</code> in
the retrieved val... | java | public List<String> getPropertyValueAsList(String key, Object[] parameters) {
if (parameters != null && parameters.length > 0) {
String parameters2[] = new String[parameters.length];
for (int i = 0; i < parameters.length; i++) {
Object parameter = parameters[i];
... | [
"public",
"List",
"<",
"String",
">",
"getPropertyValueAsList",
"(",
"String",
"key",
",",
"Object",
"[",
"]",
"parameters",
")",
"{",
"if",
"(",
"parameters",
"!=",
"null",
"&&",
"parameters",
".",
"length",
">",
"0",
")",
"{",
"String",
"parameters2",
... | Searches over the group of {@code GUIProperties} for a property list
corresponding to the given key.
@param key
key to be found
@param parameters
instances of the {@code String} literal <code>"{n}"</code> in
the retrieved value will be replaced by the {@code String}
representation of {@code params[n]}
@return the firs... | [
"Searches",
"over",
"the",
"group",
"of",
"{",
"@code",
"GUIProperties",
"}",
"for",
"a",
"property",
"list",
"corresponding",
"to",
"the",
"given",
"key",
"."
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/properties/GUIHierarchyConcatenationProperties.java#L301-L314 |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.pointerMovedTo | public void pointerMovedTo(double lat, double lon) {
"""
called when the user has moved the pointer (mouse).
@param lat
new latitude value
@param lon
new longitude value
"""
final Coordinate coordinate = new Coordinate(lat, lon);
if (logger.isTraceEnabled()) {
logg... | java | public void pointerMovedTo(double lat, double lon) {
final Coordinate coordinate = new Coordinate(lat, lon);
if (logger.isTraceEnabled()) {
logger.trace("JS reports pointer move {}", coordinate);
}
fireEvent(new MapViewEvent(MapViewEvent.MAP_POINTER_MOVED,... | [
"public",
"void",
"pointerMovedTo",
"(",
"double",
"lat",
",",
"double",
"lon",
")",
"{",
"final",
"Coordinate",
"coordinate",
"=",
"new",
"Coordinate",
"(",
"lat",
",",
"lon",
")",
";",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"... | called when the user has moved the pointer (mouse).
@param lat
new latitude value
@param lon
new longitude value | [
"called",
"when",
"the",
"user",
"has",
"moved",
"the",
"pointer",
"(",
"mouse",
")",
"."
] | train | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1317-L1323 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/report/HHeadingScreen.java | HHeadingScreen.printDataStartForm | public void printDataStartForm(PrintWriter out, int iPrintOptions) {
"""
Output this screen using HTML.
@exception DBException File exception.
"""
if ((iPrintOptions & HtmlConstants.DETAIL_SCREEN) != 0)
out.println("<tr>\n<td colspan=\"20\">");
out.println("<table border=\"0\" cell... | java | public void printDataStartForm(PrintWriter out, int iPrintOptions)
{
if ((iPrintOptions & HtmlConstants.DETAIL_SCREEN) != 0)
out.println("<tr>\n<td colspan=\"20\">");
out.println("<table border=\"0\" cellspacing=\"10\">\n<tr>");
} | [
"public",
"void",
"printDataStartForm",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"if",
"(",
"(",
"iPrintOptions",
"&",
"HtmlConstants",
".",
"DETAIL_SCREEN",
")",
"!=",
"0",
")",
"out",
".",
"println",
"(",
"\"<tr>\\n<td colspan=\\\"20\\... | Output this screen using HTML.
@exception DBException File exception. | [
"Output",
"this",
"screen",
"using",
"HTML",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/report/HHeadingScreen.java#L69-L74 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.moveTo | public void moveTo(float x, float y) {
"""
Move the current point <I>(x, y)</I>, omitting any connecting line segment.
@param x new x-coordinate
@param y new y-coordinate
"""
content.append(x).append(' ').append(y).append(" m").append_i(separator);
} | java | public void moveTo(float x, float y) {
content.append(x).append(' ').append(y).append(" m").append_i(separator);
} | [
"public",
"void",
"moveTo",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"content",
".",
"append",
"(",
"x",
")",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
"(",
"y",
")",
".",
"append",
"(",
"\" m\"",
")",
".",
"append_i",
"(",
"sepa... | Move the current point <I>(x, y)</I>, omitting any connecting line segment.
@param x new x-coordinate
@param y new y-coordinate | [
"Move",
"the",
"current",
"point",
"<I",
">",
"(",
"x",
"y",
")",
"<",
"/",
"I",
">",
"omitting",
"any",
"connecting",
"line",
"segment",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L702-L704 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java | WSRdbManagedConnectionImpl.afterCompletionRRS | @Override
public void afterCompletionRRS() {
"""
Invoked after completion of a z/OS RRS (Resource Recovery Services) global transaction.
"""
stateMgr.setStateNoValidate(WSStateManager.NO_TRANSACTION_ACTIVE);
// now reset the RRA internal flag as its the only place we can set it in the case... | java | @Override
public void afterCompletionRRS() {
stateMgr.setStateNoValidate(WSStateManager.NO_TRANSACTION_ACTIVE);
// now reset the RRA internal flag as its the only place we can set it in the cases of unsharable connections.
// in the cases of shareable conections, the flag will be set to fal... | [
"@",
"Override",
"public",
"void",
"afterCompletionRRS",
"(",
")",
"{",
"stateMgr",
".",
"setStateNoValidate",
"(",
"WSStateManager",
".",
"NO_TRANSACTION_ACTIVE",
")",
";",
"// now reset the RRA internal flag as its the only place we can set it in the cases of unsharable connectio... | Invoked after completion of a z/OS RRS (Resource Recovery Services) global transaction. | [
"Invoked",
"after",
"completion",
"of",
"a",
"z",
"/",
"OS",
"RRS",
"(",
"Resource",
"Recovery",
"Services",
")",
"global",
"transaction",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java#L562-L570 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.findAll | @Override
public List<CommerceNotificationTemplate> findAll() {
"""
Returns all the commerce notification templates.
@return the commerce notification templates
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceNotificationTemplate> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationTemplate",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce notification templates.
@return the commerce notification templates | [
"Returns",
"all",
"the",
"commerce",
"notification",
"templates",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L5161-L5164 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/ImageHelper.java | ImageHelper.getSubImage | public static BufferedImage getSubImage(BufferedImage image, int x, int y, int width, int height) {
"""
A replacement for the standard <code>BufferedImage.getSubimage</code>
method.
@param image
@param x the X coordinate of the upper-left corner of the specified
rectangular region
@param y the Y coordinate ... | java | public static BufferedImage getSubImage(BufferedImage image, int x, int y, int width, int height) {
int type = (image.getTransparency() == Transparency.OPAQUE)
? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
BufferedImage tmp = new BufferedImage(width, height, type);
... | [
"public",
"static",
"BufferedImage",
"getSubImage",
"(",
"BufferedImage",
"image",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"int",
"type",
"=",
"(",
"image",
".",
"getTransparency",
"(",
")",
"==",
"Transpare... | A replacement for the standard <code>BufferedImage.getSubimage</code>
method.
@param image
@param x the X coordinate of the upper-left corner of the specified
rectangular region
@param y the Y coordinate of the upper-left corner of the specified
rectangular region
@param width the width of the specified rectangular re... | [
"A",
"replacement",
"for",
"the",
"standard",
"<code",
">",
"BufferedImage",
".",
"getSubimage<",
"/",
"code",
">",
"method",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageHelper.java#L85-L93 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java | ClusterControllerClient.listClusters | public final ListClustersPagedResponse listClusters(String projectId, String region) {
"""
Lists all regions/{region}/clusters in a project.
<p>Sample code:
<pre><code>
try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
String projectId = "";
String region = "";
fo... | java | public final ListClustersPagedResponse listClusters(String projectId, String region) {
ListClustersRequest request =
ListClustersRequest.newBuilder().setProjectId(projectId).setRegion(region).build();
return listClusters(request);
} | [
"public",
"final",
"ListClustersPagedResponse",
"listClusters",
"(",
"String",
"projectId",
",",
"String",
"region",
")",
"{",
"ListClustersRequest",
"request",
"=",
"ListClustersRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",... | Lists all regions/{region}/clusters in a project.
<p>Sample code:
<pre><code>
try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
String projectId = "";
String region = "";
for (Cluster element : clusterControllerClient.listClusters(projectId, region).iterateAll()) {
// doThings... | [
"Lists",
"all",
"regions",
"/",
"{",
"region",
"}",
"/",
"clusters",
"in",
"a",
"project",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java#L678-L682 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRecordBrowser.java | LogRecordBrowser.restartRecordsInProcess | private OnePidRecordListImpl restartRecordsInProcess(final RepositoryLogRecord after, long max, final IInternalRecordFilter recFilter) {
"""
continue the list of the records after a record from another repository filtered with <code>recFilter</code>
"""
if (!(after instanceof RepositoryLogRecordImpl)) {
t... | java | private OnePidRecordListImpl restartRecordsInProcess(final RepositoryLogRecord after, long max, final IInternalRecordFilter recFilter) {
if (!(after instanceof RepositoryLogRecordImpl)) {
throw new IllegalArgumentException("Specified location does not belong to this repository.");
}
RepositoryLogRecordImpl rea... | [
"private",
"OnePidRecordListImpl",
"restartRecordsInProcess",
"(",
"final",
"RepositoryLogRecord",
"after",
",",
"long",
"max",
",",
"final",
"IInternalRecordFilter",
"recFilter",
")",
"{",
"if",
"(",
"!",
"(",
"after",
"instanceof",
"RepositoryLogRecordImpl",
")",
")... | continue the list of the records after a record from another repository filtered with <code>recFilter</code> | [
"continue",
"the",
"list",
"of",
"the",
"records",
"after",
"a",
"record",
"from",
"another",
"repository",
"filtered",
"with",
"<code",
">",
"recFilter<",
"/",
"code",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRecordBrowser.java#L180-L191 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java | HttpOutboundServiceContextImpl.reConnect | protected void reConnect(VirtualConnection inVC, IOException ioe) {
"""
If an error occurs during an attempted write of an outgoing request
message, this method will either reconnect for another try or pass the
error up the channel chain.
@param inVC
@param ioe
"""
if (getLink().isReconnectAllow... | java | protected void reConnect(VirtualConnection inVC, IOException ioe) {
if (getLink().isReconnectAllowed()) {
// start the reconnect
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Attempting reconnect: " + getLink().getVirtualConnection());
... | [
"protected",
"void",
"reConnect",
"(",
"VirtualConnection",
"inVC",
",",
"IOException",
"ioe",
")",
"{",
"if",
"(",
"getLink",
"(",
")",
".",
"isReconnectAllowed",
"(",
")",
")",
"{",
"// start the reconnect",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabl... | If an error occurs during an attempted write of an outgoing request
message, this method will either reconnect for another try or pass the
error up the channel chain.
@param inVC
@param ioe | [
"If",
"an",
"error",
"occurs",
"during",
"an",
"attempted",
"write",
"of",
"an",
"outgoing",
"request",
"message",
"this",
"method",
"will",
"either",
"reconnect",
"for",
"another",
"try",
"or",
"pass",
"the",
"error",
"up",
"the",
"channel",
"chain",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java#L213-L226 |
nobuoka/android-lib-ZXingCaptureActivity | src/main/java/info/vividcode/android/zxing/CaptureActivityIntents.java | CaptureActivityIntents.setDecodeMode | public static void setDecodeMode(Intent intent, String scanMode) {
"""
Set barcode formats to scan for onto {@code Intent}.
@param intent Target intent.
@param scanMode Mode which specify set of barcode formats to scan for. Use one of
{@link Intents.Scan#PRODUCT_MODE}, {@link Intents.Scan#ONE_D_MODE},
{@link I... | java | public static void setDecodeMode(Intent intent, String scanMode) {
intent.putExtra(Intents.Scan.MODE, scanMode);
} | [
"public",
"static",
"void",
"setDecodeMode",
"(",
"Intent",
"intent",
",",
"String",
"scanMode",
")",
"{",
"intent",
".",
"putExtra",
"(",
"Intents",
".",
"Scan",
".",
"MODE",
",",
"scanMode",
")",
";",
"}"
] | Set barcode formats to scan for onto {@code Intent}.
@param intent Target intent.
@param scanMode Mode which specify set of barcode formats to scan for. Use one of
{@link Intents.Scan#PRODUCT_MODE}, {@link Intents.Scan#ONE_D_MODE},
{@link Intents.Scan#QR_CODE_MODE}, {@link Intents.Scan#DATA_MATRIX_MODE}. | [
"Set",
"barcode",
"formats",
"to",
"scan",
"for",
"onto",
"{"
] | train | https://github.com/nobuoka/android-lib-ZXingCaptureActivity/blob/17aaa7cf75520d3f2e03db9796b7e8c1d1f1b1e6/src/main/java/info/vividcode/android/zxing/CaptureActivityIntents.java#L55-L57 |
beanshell/beanshell | src/main/java/bsh/org/objectweb/asm/MethodWriter.java | MethodWriter.visitFrameStart | int visitFrameStart(final int offset, final int nLocal, final int nStack) {
"""
Starts the visit of a new stack map frame, stored in {@link #currentFrame}.
@param offset the bytecode offset of the instruction to which the frame corresponds.
@param nLocal the number of local variables in the frame.
@param nSta... | java | int visitFrameStart(final int offset, final int nLocal, final int nStack) {
int frameLength = 3 + nLocal + nStack;
if (currentFrame == null || currentFrame.length < frameLength) {
currentFrame = new int[frameLength];
}
currentFrame[0] = offset;
currentFrame[1] = nLocal;
currentFrame[2] = n... | [
"int",
"visitFrameStart",
"(",
"final",
"int",
"offset",
",",
"final",
"int",
"nLocal",
",",
"final",
"int",
"nStack",
")",
"{",
"int",
"frameLength",
"=",
"3",
"+",
"nLocal",
"+",
"nStack",
";",
"if",
"(",
"currentFrame",
"==",
"null",
"||",
"currentFra... | Starts the visit of a new stack map frame, stored in {@link #currentFrame}.
@param offset the bytecode offset of the instruction to which the frame corresponds.
@param nLocal the number of local variables in the frame.
@param nStack the number of stack elements in the frame.
@return the index of the next element to be... | [
"Starts",
"the",
"visit",
"of",
"a",
"new",
"stack",
"map",
"frame",
"stored",
"in",
"{",
"@link",
"#currentFrame",
"}",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/MethodWriter.java#L1607-L1616 |
jenkinsci/jenkins | core/src/main/java/hudson/init/InitStrategy.java | InitStrategy.listPluginArchives | public List<File> listPluginArchives(PluginManager pm) throws IOException {
"""
Returns the list of *.jpi, *.hpi and *.hpl to expand and load.
<p>
Normally we look at {@code $JENKINS_HOME/plugins/*.jpi} and *.hpi and *.hpl.
@return
never null but can be empty. The list can contain different versions of the... | java | public List<File> listPluginArchives(PluginManager pm) throws IOException {
List<File> r = new ArrayList<>();
// the ordering makes sure that during the debugging we get proper precedence among duplicates.
// for example, while doing "mvn jpi:run" or "mvn hpi:run" on a plugin that's bundled wit... | [
"public",
"List",
"<",
"File",
">",
"listPluginArchives",
"(",
"PluginManager",
"pm",
")",
"throws",
"IOException",
"{",
"List",
"<",
"File",
">",
"r",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// the ordering makes sure that during the debugging we get proper ... | Returns the list of *.jpi, *.hpi and *.hpl to expand and load.
<p>
Normally we look at {@code $JENKINS_HOME/plugins/*.jpi} and *.hpi and *.hpl.
@return
never null but can be empty. The list can contain different versions of the same plugin,
and when that happens, Jenkins will ignore all but the first one in the list. | [
"Returns",
"the",
"list",
"of",
"*",
".",
"jpi",
"*",
".",
"hpi",
"and",
"*",
".",
"hpl",
"to",
"expand",
"and",
"load",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/init/InitStrategy.java#L47-L62 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectUpload | public String buildSelectUpload(String htmlAttributes) {
"""
Builds the html for the workplace start site select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace start site select box
"""
List<String> options = new ArrayList<Stri... | java | public String buildSelectUpload(String htmlAttributes) {
List<String> options = new ArrayList<String>();
List<String> values = new ArrayList<String>();
int selectedIndex = 0;
int pos = 0;
UploadVariant currentVariant = getParamTabWpUploadVariant();
for (UploadVariant va... | [
"public",
"String",
"buildSelectUpload",
"(",
"String",
"htmlAttributes",
")",
"{",
"List",
"<",
"String",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"List",
"<",
"String",
">",
"values",
"=",
"new",
"ArrayList",
"<",
"St... | Builds the html for the workplace start site select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace start site select box | [
"Builds",
"the",
"html",
"for",
"the",
"workplace",
"start",
"site",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L962-L981 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java | SpdySessionHandler.issueStreamError | private void issueStreamError(ChannelHandlerContext ctx, int streamId, SpdyStreamStatus status) {
"""
/*
SPDY Stream Error Handling:
Upon a stream error, the endpoint must send a RST_STREAM frame which contains
the Stream-ID for the stream where the error occurred and the error getStatus which
caused the err... | java | private void issueStreamError(ChannelHandlerContext ctx, int streamId, SpdyStreamStatus status) {
boolean fireChannelRead = !spdySession.isRemoteSideClosed(streamId);
ChannelPromise promise = ctx.newPromise();
removeStream(streamId, promise);
SpdyRstStreamFrame spdyRstStreamFrame = new ... | [
"private",
"void",
"issueStreamError",
"(",
"ChannelHandlerContext",
"ctx",
",",
"int",
"streamId",
",",
"SpdyStreamStatus",
"status",
")",
"{",
"boolean",
"fireChannelRead",
"=",
"!",
"spdySession",
".",
"isRemoteSideClosed",
"(",
"streamId",
")",
";",
"ChannelProm... | /*
SPDY Stream Error Handling:
Upon a stream error, the endpoint must send a RST_STREAM frame which contains
the Stream-ID for the stream where the error occurred and the error getStatus which
caused the error.
After sending the RST_STREAM, the stream is closed to the sending endpoint.
Note: this is only called by t... | [
"/",
"*",
"SPDY",
"Stream",
"Error",
"Handling",
":"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java#L677-L687 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ItemRule.java | ItemRule.addValue | public void addValue(Token[] tokens) {
"""
Adds the specified value to this List type item.
@param tokens an array of tokens
"""
if (type == null) {
type = ItemType.LIST;
}
if (!isListableType()) {
throw new IllegalArgumentException("The type of this item must... | java | public void addValue(Token[] tokens) {
if (type == null) {
type = ItemType.LIST;
}
if (!isListableType()) {
throw new IllegalArgumentException("The type of this item must be 'array', 'list' or 'set'");
}
if (tokensList == null) {
tokensList = n... | [
"public",
"void",
"addValue",
"(",
"Token",
"[",
"]",
"tokens",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"ItemType",
".",
"LIST",
";",
"}",
"if",
"(",
"!",
"isListableType",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgum... | Adds the specified value to this List type item.
@param tokens an array of tokens | [
"Adds",
"the",
"specified",
"value",
"to",
"this",
"List",
"type",
"item",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ItemRule.java#L324-L335 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ExperimentsInner.java | ExperimentsInner.createAsync | public Observable<ExperimentInner> createAsync(String resourceGroupName, String workspaceName, String experimentName) {
"""
Creates an Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain ... | java | public Observable<ExperimentInner> createAsync(String resourceGroupName, String workspaceName, String experimentName) {
return createWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).map(new Func1<ServiceResponse<ExperimentInner>, ExperimentInner>() {
@Override
p... | [
"public",
"Observable",
"<",
"ExperimentInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"experimentName",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workspaceName",
... | Creates an Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.... | [
"Creates",
"an",
"Experiment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ExperimentsInner.java#L383-L390 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/KunderaMetadataManager.java | KunderaMetadataManager.getMetamodel | public static MetamodelImpl getMetamodel(final KunderaMetadata kunderaMetadata, String... persistenceUnits) {
"""
Gets the metamodel.
@param persistenceUnits
the persistence units
@return the metamodel
"""
MetamodelImpl metamodel = null;
for (String pu : persistenceUnits)
{
... | java | public static MetamodelImpl getMetamodel(final KunderaMetadata kunderaMetadata, String... persistenceUnits)
{
MetamodelImpl metamodel = null;
for (String pu : persistenceUnits)
{
metamodel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(pu);
... | [
"public",
"static",
"MetamodelImpl",
"getMetamodel",
"(",
"final",
"KunderaMetadata",
"kunderaMetadata",
",",
"String",
"...",
"persistenceUnits",
")",
"{",
"MetamodelImpl",
"metamodel",
"=",
"null",
";",
"for",
"(",
"String",
"pu",
":",
"persistenceUnits",
")",
"... | Gets the metamodel.
@param persistenceUnits
the persistence units
@return the metamodel | [
"Gets",
"the",
"metamodel",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/KunderaMetadataManager.java#L79-L100 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/FileUtils.java | FileUtils.getRelativeUnixPath | @Deprecated
public static String getRelativeUnixPath(final String basePath, final String refPath) {
"""
Resolves a path reference against a base path.
@param basePath base path
@param refPath reference path
@return relative path using {@link Constants#UNIX_SEPARATOR} path separator
"""
return ... | java | @Deprecated
public static String getRelativeUnixPath(final String basePath, final String refPath) {
return getRelativePath(basePath, refPath, UNIX_SEPARATOR);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"getRelativeUnixPath",
"(",
"final",
"String",
"basePath",
",",
"final",
"String",
"refPath",
")",
"{",
"return",
"getRelativePath",
"(",
"basePath",
",",
"refPath",
",",
"UNIX_SEPARATOR",
")",
";",
"}"
] | Resolves a path reference against a base path.
@param basePath base path
@param refPath reference path
@return relative path using {@link Constants#UNIX_SEPARATOR} path separator | [
"Resolves",
"a",
"path",
"reference",
"against",
"a",
"base",
"path",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FileUtils.java#L182-L185 |
Abnaxos/markdown-doclet | doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java | PredefinedArgumentValidators.atLeast | public static ArgumentValidator atLeast(final int expectedMin) {
"""
Creates a {@link ArgumentValidator} which checks for _#arguments >= expectedMin_
@param expectedMin the minimum number of expected arguments
@return the MissingArgumentsValidator
"""
switch (expectedMin) {
case 0:
... | java | public static ArgumentValidator atLeast(final int expectedMin) {
switch (expectedMin) {
case 0:
return ZERO_OR_MORE;
case 1:
return ONE_OR_MORE;
case 2:
return TWO_OR_MORE;
}
return atLeast(expectedMin, MessageFo... | [
"public",
"static",
"ArgumentValidator",
"atLeast",
"(",
"final",
"int",
"expectedMin",
")",
"{",
"switch",
"(",
"expectedMin",
")",
"{",
"case",
"0",
":",
"return",
"ZERO_OR_MORE",
";",
"case",
"1",
":",
"return",
"ONE_OR_MORE",
";",
"case",
"2",
":",
"re... | Creates a {@link ArgumentValidator} which checks for _#arguments >= expectedMin_
@param expectedMin the minimum number of expected arguments
@return the MissingArgumentsValidator | [
"Creates",
"a",
"{",
"@link",
"ArgumentValidator",
"}",
"which",
"checks",
"for",
"_#arguments",
">",
"=",
"expectedMin_"
] | train | https://github.com/Abnaxos/markdown-doclet/blob/e98a9630206fc9c8d813cf2349ff594be8630054/doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java#L135-L145 |
EsotericSoftware/kryo | src/com/esotericsoftware/kryo/Kryo.java | Kryo.writeClass | public Registration writeClass (Output output, Class type) {
"""
Writes a class and returns its registration.
@param type May be null.
@return Will be null if type is null.
@see ClassResolver#writeClass(Output, Class)
"""
if (output == null) throw new IllegalArgumentException("output cannot be null.");
... | java | public Registration writeClass (Output output, Class type) {
if (output == null) throw new IllegalArgumentException("output cannot be null.");
try {
return classResolver.writeClass(output, type);
} finally {
if (depth == 0 && autoReset) reset();
}
} | [
"public",
"Registration",
"writeClass",
"(",
"Output",
"output",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"output cannot be null.\"",
")",
";",
"try",
"{",
"return",
"classResolver... | Writes a class and returns its registration.
@param type May be null.
@return Will be null if type is null.
@see ClassResolver#writeClass(Output, Class) | [
"Writes",
"a",
"class",
"and",
"returns",
"its",
"registration",
"."
] | train | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L529-L536 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlGroupContainerFactory.java | CmsXmlGroupContainerFactory.createDocument | public static CmsXmlGroupContainer createDocument(CmsObject cms, Locale locale, String modelUri)
throws CmsException {
"""
Create a new instance of an group container based on the given default content,
that will have all language nodes of the default content and ensures the presence of the given locale.<p>
... | java | public static CmsXmlGroupContainer createDocument(CmsObject cms, Locale locale, String modelUri)
throws CmsException {
// create the XML content
CmsXmlGroupContainer content = new CmsXmlGroupContainer(cms, locale, modelUri);
// call prepare for use content handler and return the result
... | [
"public",
"static",
"CmsXmlGroupContainer",
"createDocument",
"(",
"CmsObject",
"cms",
",",
"Locale",
"locale",
",",
"String",
"modelUri",
")",
"throws",
"CmsException",
"{",
"// create the XML content",
"CmsXmlGroupContainer",
"content",
"=",
"new",
"CmsXmlGroupContainer... | Create a new instance of an group container based on the given default content,
that will have all language nodes of the default content and ensures the presence of the given locale.<p>
The given encoding is used when marshalling the XML again later.<p>
@param cms the current users OpenCms content
@param locale the l... | [
"Create",
"a",
"new",
"instance",
"of",
"an",
"group",
"container",
"based",
"on",
"the",
"given",
"default",
"content",
"that",
"will",
"have",
"all",
"language",
"nodes",
"of",
"the",
"default",
"content",
"and",
"ensures",
"the",
"presence",
"of",
"the",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlGroupContainerFactory.java#L83-L90 |
rototor/pdfbox-graphics2d | src/main/java/de/rototor/pdfbox/graphics2d/PdfBoxGraphics2DFontTextDrawer.java | PdfBoxGraphics2DFontTextDrawer.registerFont | @SuppressWarnings("WeakerAccess")
public void registerFont(String fontName, InputStream fontStream) throws IOException {
"""
Register a font. If possible, try to use a font file, i.e.
{@link #registerFont(String,File)}. This method will lead to the creation of
a temporary file which stores the font data.
@pa... | java | @SuppressWarnings("WeakerAccess")
public void registerFont(String fontName, InputStream fontStream) throws IOException {
File fontFile = File.createTempFile("pdfboxgfx2dfont", ".ttf");
FileOutputStream out = new FileOutputStream(fontFile);
try {
IOUtils.copy(fontStream, out);
} finally {
out.close();
}... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"void",
"registerFont",
"(",
"String",
"fontName",
",",
"InputStream",
"fontStream",
")",
"throws",
"IOException",
"{",
"File",
"fontFile",
"=",
"File",
".",
"createTempFile",
"(",
"\"pdfboxgfx2dfont\"... | Register a font. If possible, try to use a font file, i.e.
{@link #registerFont(String,File)}. This method will lead to the creation of
a temporary file which stores the font data.
@param fontName
the name of the font to use. If null, the name is taken from the
font.
@param fontStream
the input stream of the font. Thi... | [
"Register",
"a",
"font",
".",
"If",
"possible",
"try",
"to",
"use",
"a",
"font",
"file",
"i",
".",
"e",
".",
"{",
"@link",
"#registerFont",
"(",
"String",
"File",
")",
"}",
".",
"This",
"method",
"will",
"lead",
"to",
"the",
"creation",
"of",
"a",
... | train | https://github.com/rototor/pdfbox-graphics2d/blob/86d53942cf2c137edca59d45766927c077f49230/src/main/java/de/rototor/pdfbox/graphics2d/PdfBoxGraphics2DFontTextDrawer.java#L82-L94 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java | CircularIndex.minusPOffset | public static int minusPOffset(int index, int offset, int size) {
"""
Subtracts a positive offset to index in a circular buffer.
@param index element in circular buffer
@param offset integer which is positive and less than size
@param size size of the circular buffer
@return new index
"""
index -= offset... | java | public static int minusPOffset(int index, int offset, int size) {
index -= offset;
if( index < 0 ) {
return size + index;
} else {
return index;
}
} | [
"public",
"static",
"int",
"minusPOffset",
"(",
"int",
"index",
",",
"int",
"offset",
",",
"int",
"size",
")",
"{",
"index",
"-=",
"offset",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"return",
"size",
"+",
"index",
";",
"}",
"else",
"{",
"return... | Subtracts a positive offset to index in a circular buffer.
@param index element in circular buffer
@param offset integer which is positive and less than size
@param size size of the circular buffer
@return new index | [
"Subtracts",
"a",
"positive",
"offset",
"to",
"index",
"in",
"a",
"circular",
"buffer",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java#L47-L54 |
nightcode/yaranga | core/src/org/nightcode/common/base/Splitter.java | Splitter.trim | public Splitter trim(char c) {
"""
Returns a splitter that removes all leading or trailing characters
matching the given character from each returned key and value.
@param c character
@return a splitter with the desired configuration
"""
Matcher matcher = new CharMatcher(c);
return new Splitter(pa... | java | public Splitter trim(char c) {
Matcher matcher = new CharMatcher(c);
return new Splitter(pairSeparator, keyValueSeparator, matcher, matcher);
} | [
"public",
"Splitter",
"trim",
"(",
"char",
"c",
")",
"{",
"Matcher",
"matcher",
"=",
"new",
"CharMatcher",
"(",
"c",
")",
";",
"return",
"new",
"Splitter",
"(",
"pairSeparator",
",",
"keyValueSeparator",
",",
"matcher",
",",
"matcher",
")",
";",
"}"
] | Returns a splitter that removes all leading or trailing characters
matching the given character from each returned key and value.
@param c character
@return a splitter with the desired configuration | [
"Returns",
"a",
"splitter",
"that",
"removes",
"all",
"leading",
"or",
"trailing",
"characters",
"matching",
"the",
"given",
"character",
"from",
"each",
"returned",
"key",
"and",
"value",
"."
] | train | https://github.com/nightcode/yaranga/blob/f02cf8d8bcd365b6b1d55638938631a00e9ee808/core/src/org/nightcode/common/base/Splitter.java#L140-L143 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.decodeFileToFile | public static void decodeFileToFile (@Nonnull final String aInFile, @Nonnull final File aOutFile) throws IOException {
"""
Reads <code>infile</code> and decodes it to <code>outfile</code>.
@param aInFile
Input file
@param aOutFile
Output file
@throws IOException
if there is an error
@since 2.2
"""
... | java | public static void decodeFileToFile (@Nonnull final String aInFile, @Nonnull final File aOutFile) throws IOException
{
final byte [] decoded = decodeFromFile (aInFile);
try (final OutputStream out = FileHelper.getBufferedOutputStream (aOutFile))
{
out.write (decoded);
}
} | [
"public",
"static",
"void",
"decodeFileToFile",
"(",
"@",
"Nonnull",
"final",
"String",
"aInFile",
",",
"@",
"Nonnull",
"final",
"File",
"aOutFile",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"decoded",
"=",
"decodeFromFile",
"(",
"aInFile",... | Reads <code>infile</code> and decodes it to <code>outfile</code>.
@param aInFile
Input file
@param aOutFile
Output file
@throws IOException
if there is an error
@since 2.2 | [
"Reads",
"<code",
">",
"infile<",
"/",
"code",
">",
"and",
"decodes",
"it",
"to",
"<code",
">",
"outfile<",
"/",
"code",
">",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L2519-L2526 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/slider2/Slider2Renderer.java | Slider2Renderer.decode | @Override
public void decode(FacesContext context, UIComponent component) {
"""
This methods receives and processes input made by the user. More specifically, it ckecks whether the
user has interacted with the current b:slider2. The default implementation simply stores
the input value in the list of submitted v... | java | @Override
public void decode(FacesContext context, UIComponent component) {
Slider2 slider = (Slider2) component;
if (slider.isDisabled() || slider.isReadonly()) {
return;
}
decodeBehaviors(context, slider);
String clientId = slider.getClientId(context);
Number submittedValue = convert(component, Flo... | [
"@",
"Override",
"public",
"void",
"decode",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"{",
"Slider2",
"slider",
"=",
"(",
"Slider2",
")",
"component",
";",
"if",
"(",
"slider",
".",
"isDisabled",
"(",
")",
"||",
"slider",
".",
... | This methods receives and processes input made by the user. More specifically, it ckecks whether the
user has interacted with the current b:slider2. The default implementation simply stores
the input value in the list of submitted values. If the validation checks are passed,
the values in the <code>submittedValues</cod... | [
"This",
"methods",
"receives",
"and",
"processes",
"input",
"made",
"by",
"the",
"user",
".",
"More",
"specifically",
"it",
"ckecks",
"whether",
"the",
"user",
"has",
"interacted",
"with",
"the",
"current",
"b",
":",
"slider2",
".",
"The",
"default",
"implem... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/slider2/Slider2Renderer.java#L48-L65 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java | CassandraDataHandlerBase.prepareCounterColumn | private CounterColumn prepareCounterColumn(String value, byte[] name) {
"""
Prepare counter column.
@param value
the value
@param name
the name
@return the counter column
"""
CounterColumn counterColumn = new CounterColumn();
counterColumn.setName(name);
LongAccessor accessor = n... | java | private CounterColumn prepareCounterColumn(String value, byte[] name)
{
CounterColumn counterColumn = new CounterColumn();
counterColumn.setName(name);
LongAccessor accessor = new LongAccessor();
counterColumn.setValue(accessor.fromString(LongAccessor.class, value));
return c... | [
"private",
"CounterColumn",
"prepareCounterColumn",
"(",
"String",
"value",
",",
"byte",
"[",
"]",
"name",
")",
"{",
"CounterColumn",
"counterColumn",
"=",
"new",
"CounterColumn",
"(",
")",
";",
"counterColumn",
".",
"setName",
"(",
"name",
")",
";",
"LongAcce... | Prepare counter column.
@param value
the value
@param name
the name
@return the counter column | [
"Prepare",
"counter",
"column",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java#L2167-L2174 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/entitylists/ListViewUrl.java | ListViewUrl.getEntityListViewUrl | public static MozuUrl getEntityListViewUrl(String entityListFullName, String responseFields, String viewName) {
"""
Get Resource Url for GetEntityListView
@param entityListFullName The full name of the EntityList including namespace in name@nameSpace format
@param responseFields Filtering syntax appended to an A... | java | public static MozuUrl getEntityListViewUrl(String entityListFullName, String responseFields, String viewName)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}/views/{viewName}?responseFields={responseFields}");
formatter.formatUrl("entityListFullName", entityListFullNa... | [
"public",
"static",
"MozuUrl",
"getEntityListViewUrl",
"(",
"String",
"entityListFullName",
",",
"String",
"responseFields",
",",
"String",
"viewName",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/entitylists/{entityListFullName}/... | Get Resource Url for GetEntityListView
@param entityListFullName The full name of the EntityList including namespace in name@nameSpace format
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to ret... | [
"Get",
"Resource",
"Url",
"for",
"GetEntityListView"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/entitylists/ListViewUrl.java#L103-L110 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/nio2/file/ShrinkWrapPath.java | ShrinkWrapPath.fromString | private Path fromString(final String path) {
"""
Creates a new {@link ShrinkWrapPath} instance from the specified input {@link String}
@param path
@return
"""
if (path == null) {
throw new IllegalArgumentException("path must be specified");
}
// Delegate
return n... | java | private Path fromString(final String path) {
if (path == null) {
throw new IllegalArgumentException("path must be specified");
}
// Delegate
return new ShrinkWrapPath(path, fileSystem);
} | [
"private",
"Path",
"fromString",
"(",
"final",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"path must be specified\"",
")",
";",
"}",
"// Delegate",
"return",
"new",
"ShrinkWrapPath",
... | Creates a new {@link ShrinkWrapPath} instance from the specified input {@link String}
@param path
@return | [
"Creates",
"a",
"new",
"{",
"@link",
"ShrinkWrapPath",
"}",
"instance",
"from",
"the",
"specified",
"input",
"{",
"@link",
"String",
"}"
] | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/nio2/file/ShrinkWrapPath.java#L620-L626 |
ops4j/org.ops4j.base | ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java | Resources.getByte | public byte getByte( String key, byte defaultValue )
throws MissingResourceException {
"""
Retrieve a byte from bundle.
@param key the key of resource
@param defaultValue the default value if key is missing
@return the resource byte
@throws MissingResourceException if the requested key i... | java | public byte getByte( String key, byte defaultValue )
throws MissingResourceException
{
try
{
return getByte( key );
}
catch( MissingResourceException mre )
{
return defaultValue;
}
} | [
"public",
"byte",
"getByte",
"(",
"String",
"key",
",",
"byte",
"defaultValue",
")",
"throws",
"MissingResourceException",
"{",
"try",
"{",
"return",
"getByte",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"MissingResourceException",
"mre",
")",
"{",
"return",
"... | Retrieve a byte from bundle.
@param key the key of resource
@param defaultValue the default value if key is missing
@return the resource byte
@throws MissingResourceException if the requested key is unknown | [
"Retrieve",
"a",
"byte",
"from",
"bundle",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L176-L187 |
dwdyer/watchmaker | examples/src/java/main/org/uncommons/watchmaker/examples/monalisa/ProbabilitiesPanel.java | ProbabilitiesPanel.createEvolutionPipeline | public EvolutionaryOperator<List<ColouredPolygon>> createEvolutionPipeline(PolygonImageFactory factory,
Dimension canvasSize,
Random rng) {
"""
Construct the... | java | public EvolutionaryOperator<List<ColouredPolygon>> createEvolutionPipeline(PolygonImageFactory factory,
Dimension canvasSize,
Random rng)
{
List<Evolu... | [
"public",
"EvolutionaryOperator",
"<",
"List",
"<",
"ColouredPolygon",
">",
">",
"createEvolutionPipeline",
"(",
"PolygonImageFactory",
"factory",
",",
"Dimension",
"canvasSize",
",",
"Random",
"rng",
")",
"{",
"List",
"<",
"EvolutionaryOperator",
"<",
"List",
"<",
... | Construct the combination of evolutionary operators that will be used to evolve the
polygon-based images.
@param factory A source of polygons.
@param canvasSize The size of the target image.
@param rng A source of randomness.
@return A complex evolutionary operator constructed from simpler operators. | [
"Construct",
"the",
"combination",
"of",
"evolutionary",
"operators",
"that",
"will",
"be",
"used",
"to",
"evolve",
"the",
"polygon",
"-",
"based",
"images",
"."
] | train | https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/examples/src/java/main/org/uncommons/watchmaker/examples/monalisa/ProbabilitiesPanel.java#L150-L171 |
yidongnan/grpc-spring-boot-starter | grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/nameresolver/StaticNameResolverProvider.java | StaticNameResolverProvider.of | private NameResolver of(final String targetAuthority, final Helper helper) {
"""
Creates a new {@link NameResolver} for the given authority and attributes.
@param targetAuthority The authority to connect to.
@param helper Optional parameters that customize the resolve process.
@return The newly created name r... | java | private NameResolver of(final String targetAuthority, final Helper helper) {
requireNonNull(targetAuthority, "targetAuthority");
// Determine target ips
final String[] hosts = PATTERN_COMMA.split(targetAuthority);
final List<EquivalentAddressGroup> targets = new ArrayList<>(hosts.length)... | [
"private",
"NameResolver",
"of",
"(",
"final",
"String",
"targetAuthority",
",",
"final",
"Helper",
"helper",
")",
"{",
"requireNonNull",
"(",
"targetAuthority",
",",
"\"targetAuthority\"",
")",
";",
"// Determine target ips",
"final",
"String",
"[",
"]",
"hosts",
... | Creates a new {@link NameResolver} for the given authority and attributes.
@param targetAuthority The authority to connect to.
@param helper Optional parameters that customize the resolve process.
@return The newly created name resolver for the given target. | [
"Creates",
"a",
"new",
"{",
"@link",
"NameResolver",
"}",
"for",
"the",
"given",
"authority",
"and",
"attributes",
"."
] | train | https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/nameresolver/StaticNameResolverProvider.java#L75-L92 |
haifengl/smile | core/src/main/java/smile/neighbor/CoverTree.java | CoverTree.distSplit | private void distSplit(ArrayList<DistanceSet> pointSet, ArrayList<DistanceSet> newPointSet, E newPoint, int maxScale) {
"""
Moves all the points in pointSet covered by (the ball of) newPoint
into newPointSet, based on the given scale/level.
@param pointSet the supplied set of instances from which
all points c... | java | private void distSplit(ArrayList<DistanceSet> pointSet, ArrayList<DistanceSet> newPointSet, E newPoint, int maxScale) {
double fmax = getCoverRadius(maxScale);
ArrayList<DistanceSet> newSet = new ArrayList<>();
for (int i = 0; i < pointSet.size(); i++) {
DistanceSet n = pointSet.get(... | [
"private",
"void",
"distSplit",
"(",
"ArrayList",
"<",
"DistanceSet",
">",
"pointSet",
",",
"ArrayList",
"<",
"DistanceSet",
">",
"newPointSet",
",",
"E",
"newPoint",
",",
"int",
"maxScale",
")",
"{",
"double",
"fmax",
"=",
"getCoverRadius",
"(",
"maxScale",
... | Moves all the points in pointSet covered by (the ball of) newPoint
into newPointSet, based on the given scale/level.
@param pointSet the supplied set of instances from which
all points covered by newPoint will be removed.
@param newPointSet the set in which all points covered by
newPoint will be put into.
@param newPo... | [
"Moves",
"all",
"the",
"points",
"in",
"pointSet",
"covered",
"by",
"(",
"the",
"ball",
"of",
")",
"newPoint",
"into",
"newPointSet",
"based",
"on",
"the",
"given",
"scale",
"/",
"level",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/neighbor/CoverTree.java#L483-L499 |
greese/dasein-util | src/main/java/org/dasein/attributes/DataTypeFactory.java | DataTypeFactory.getDisplayValue | public String getDisplayValue(Locale loc, Object ob) {
"""
Provides a display version of the specified value translated for the target locale.
@param loc the locale for which the display should be translated
@param ob the target value
@return a display version of the specified value
"""
if( ob == nu... | java | public String getDisplayValue(Locale loc, Object ob) {
if( ob == null ) {
return "";
}
if( ob instanceof Translator ) {
@SuppressWarnings("rawtypes") Translation trans = ((Translator)ob).get(loc);
if( trans == null ) {
return null;... | [
"public",
"String",
"getDisplayValue",
"(",
"Locale",
"loc",
",",
"Object",
"ob",
")",
"{",
"if",
"(",
"ob",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"ob",
"instanceof",
"Translator",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"raw... | Provides a display version of the specified value translated for the target locale.
@param loc the locale for which the display should be translated
@param ob the target value
@return a display version of the specified value | [
"Provides",
"a",
"display",
"version",
"of",
"the",
"specified",
"value",
"translated",
"for",
"the",
"target",
"locale",
"."
] | train | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/attributes/DataTypeFactory.java#L362-L377 |
nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/GraphEditorWindow.java | GraphEditorWindow.registerValue | public void registerValue(LinearInterpolator value, String name) {
"""
Register a configurable value with the graph panel
@param value The value to be registered
@param name The name to display for this value
"""
// add to properties combobox
properties.addItem(name);
// add to value map
valu... | java | public void registerValue(LinearInterpolator value, String name) {
// add to properties combobox
properties.addItem(name);
// add to value map
values.put(name, value);
// set as current interpolator
panel.setInterpolator(value);
// enable all input fields
enableControls();
} | [
"public",
"void",
"registerValue",
"(",
"LinearInterpolator",
"value",
",",
"String",
"name",
")",
"{",
"// add to properties combobox\r",
"properties",
".",
"addItem",
"(",
"name",
")",
";",
"// add to value map\r",
"values",
".",
"put",
"(",
"name",
",",
"value"... | Register a configurable value with the graph panel
@param value The value to be registered
@param name The name to display for this value | [
"Register",
"a",
"configurable",
"value",
"with",
"the",
"graph",
"panel"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/GraphEditorWindow.java#L260-L272 |
alkacon/opencms-core | src/org/opencms/util/CmsFileUtil.java | CmsFileUtil.normalizePath | public static String normalizePath(URL url, char separatorChar) {
"""
Returns the normalized file path created from the given URL.<p>
The path part {@link URL#getPath()} is used, unescaped and
normalized using {@link #normalizePath(String, char)}.<p>
@param url the URL to extract the path information from
... | java | public static String normalizePath(URL url, char separatorChar) {
// get the path part from the URL
String path = new File(url.getPath()).getAbsolutePath();
// trick to get the OS default encoding, taken from the official Java i18n FAQ
String systemEncoding = (new OutputStreamWriter(new... | [
"public",
"static",
"String",
"normalizePath",
"(",
"URL",
"url",
",",
"char",
"separatorChar",
")",
"{",
"// get the path part from the URL",
"String",
"path",
"=",
"new",
"File",
"(",
"url",
".",
"getPath",
"(",
")",
")",
".",
"getAbsolutePath",
"(",
")",
... | Returns the normalized file path created from the given URL.<p>
The path part {@link URL#getPath()} is used, unescaped and
normalized using {@link #normalizePath(String, char)}.<p>
@param url the URL to extract the path information from
@param separatorChar the file separator char to use, for example {@link File#sepa... | [
"Returns",
"the",
"normalized",
"file",
"path",
"created",
"from",
"the",
"given",
"URL",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsFileUtil.java#L550-L558 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/BatchUpdateDaemon.java | BatchUpdateDaemon.pushAliasEntry | public synchronized void pushAliasEntry(AliasEntry aliasEntry, DCache cache) {
"""
This allows a cache entry to be added to the BatchUpdateDaemon.
The cache entry will be added to all caches.
@param cacheEntry The cache entry to be added.
"""
BatchUpdateList bul = getUpdateList(cache);
bul.... | java | public synchronized void pushAliasEntry(AliasEntry aliasEntry, DCache cache) {
BatchUpdateList bul = getUpdateList(cache);
bul.aliasEntryEvents.add(aliasEntry);
} | [
"public",
"synchronized",
"void",
"pushAliasEntry",
"(",
"AliasEntry",
"aliasEntry",
",",
"DCache",
"cache",
")",
"{",
"BatchUpdateList",
"bul",
"=",
"getUpdateList",
"(",
"cache",
")",
";",
"bul",
".",
"aliasEntryEvents",
".",
"add",
"(",
"aliasEntry",
")",
"... | This allows a cache entry to be added to the BatchUpdateDaemon.
The cache entry will be added to all caches.
@param cacheEntry The cache entry to be added. | [
"This",
"allows",
"a",
"cache",
"entry",
"to",
"be",
"added",
"to",
"the",
"BatchUpdateDaemon",
".",
"The",
"cache",
"entry",
"will",
"be",
"added",
"to",
"all",
"caches",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/BatchUpdateDaemon.java#L213-L216 |
HeidelTime/heideltime | src/jvntextpro/util/StringUtils.java | StringUtils.isContained | public static boolean isContained( String[] array, String s ) {
"""
Indicates whether the specified array of <tt>String</tt>s contains
a given <tt>String</tt>.
@param array the array
@param s the s
@return otherwise.
"""
for (String string : array)
{
if( string.equals( s ) )
{
return ... | java | public static boolean isContained( String[] array, String s )
{
for (String string : array)
{
if( string.equals( s ) )
{
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isContained",
"(",
"String",
"[",
"]",
"array",
",",
"String",
"s",
")",
"{",
"for",
"(",
"String",
"string",
":",
"array",
")",
"{",
"if",
"(",
"string",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"true",
";"... | Indicates whether the specified array of <tt>String</tt>s contains
a given <tt>String</tt>.
@param array the array
@param s the s
@return otherwise. | [
"Indicates",
"whether",
"the",
"specified",
"array",
"of",
"<tt",
">",
"String<",
"/",
"tt",
">",
"s",
"contains",
"a",
"given",
"<tt",
">",
"String<",
"/",
"tt",
">",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L556-L566 |
Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/operations/ServiceDiscoveryOperation.java | ServiceDiscoveryOperation.timeoutFallbackProcedure | @NonNull
@Override
protected Single<RxBleDeviceServices> timeoutFallbackProcedure(
final BluetoothGatt bluetoothGatt,
final RxBleGattCallback rxBleGattCallback,
final Scheduler timeoutScheduler
) {
"""
Sometimes it happens that the {@link BluetoothGatt} will receive ... | java | @NonNull
@Override
protected Single<RxBleDeviceServices> timeoutFallbackProcedure(
final BluetoothGatt bluetoothGatt,
final RxBleGattCallback rxBleGattCallback,
final Scheduler timeoutScheduler
) {
return Single.defer(new Callable<SingleSource<? extends RxBleDevic... | [
"@",
"NonNull",
"@",
"Override",
"protected",
"Single",
"<",
"RxBleDeviceServices",
">",
"timeoutFallbackProcedure",
"(",
"final",
"BluetoothGatt",
"bluetoothGatt",
",",
"final",
"RxBleGattCallback",
"rxBleGattCallback",
",",
"final",
"Scheduler",
"timeoutScheduler",
")",... | Sometimes it happens that the {@link BluetoothGatt} will receive all {@link BluetoothGattService}'s,
{@link android.bluetooth.BluetoothGattCharacteristic}'s and {@link android.bluetooth.BluetoothGattDescriptor}
but it won't receive the final callback that the service discovery was completed. This is a potential workaro... | [
"Sometimes",
"it",
"happens",
"that",
"the",
"{",
"@link",
"BluetoothGatt",
"}",
"will",
"receive",
"all",
"{",
"@link",
"BluetoothGattService",
"}",
"s",
"{",
"@link",
"android",
".",
"bluetooth",
".",
"BluetoothGattCharacteristic",
"}",
"s",
"and",
"{",
"@li... | train | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/operations/ServiceDiscoveryOperation.java#L70-L106 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java | Grid.addCoords | public void addCoords(Point3d[] iAtoms, Point3d[] jAtoms) {
"""
Adds the i and j coordinates and fills the grid. Their bounds will be computed.
Subsequent call to {@link #getIndicesContacts()} will produce the
contacts, i.e. the set of points within distance cutoff.
Subsequent calls to method {@link #getAtomC... | java | public void addCoords(Point3d[] iAtoms, Point3d[] jAtoms) {
addCoords(iAtoms, null, jAtoms, null);
} | [
"public",
"void",
"addCoords",
"(",
"Point3d",
"[",
"]",
"iAtoms",
",",
"Point3d",
"[",
"]",
"jAtoms",
")",
"{",
"addCoords",
"(",
"iAtoms",
",",
"null",
",",
"jAtoms",
",",
"null",
")",
";",
"}"
] | Adds the i and j coordinates and fills the grid. Their bounds will be computed.
Subsequent call to {@link #getIndicesContacts()} will produce the
contacts, i.e. the set of points within distance cutoff.
Subsequent calls to method {@link #getAtomContacts()} will produce a NullPointerException
since this only adds coord... | [
"Adds",
"the",
"i",
"and",
"j",
"coordinates",
"and",
"fills",
"the",
"grid",
".",
"Their",
"bounds",
"will",
"be",
"computed",
".",
"Subsequent",
"call",
"to",
"{",
"@link",
"#getIndicesContacts",
"()",
"}",
"will",
"produce",
"the",
"contacts",
"i",
".",... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java#L202-L204 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/block/component/ColorComponent.java | ColorComponent.getMapColor | @Override
public MapColor getMapColor(Block block, IBlockState state, IBlockAccess world, BlockPos pos) {
"""
Get the {@link MapColor} for this {@link Block} and the given {@link IBlockState}.
@param block the block
@param state the state
@return the map color
"""
return MapColor.getBlockColor(state.ge... | java | @Override
public MapColor getMapColor(Block block, IBlockState state, IBlockAccess world, BlockPos pos)
{
return MapColor.getBlockColor(state.getValue(getProperty()));
} | [
"@",
"Override",
"public",
"MapColor",
"getMapColor",
"(",
"Block",
"block",
",",
"IBlockState",
"state",
",",
"IBlockAccess",
"world",
",",
"BlockPos",
"pos",
")",
"{",
"return",
"MapColor",
".",
"getBlockColor",
"(",
"state",
".",
"getValue",
"(",
"getProper... | Get the {@link MapColor} for this {@link Block} and the given {@link IBlockState}.
@param block the block
@param state the state
@return the map color | [
"Get",
"the",
"{",
"@link",
"MapColor",
"}",
"for",
"this",
"{",
"@link",
"Block",
"}",
"and",
"the",
"given",
"{",
"@link",
"IBlockState",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/block/component/ColorComponent.java#L163-L167 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsProjectDriver.java | CmsProjectDriver.fixMovedResource | protected CmsResourceState fixMovedResource(
CmsDbContext dbc,
CmsProject onlineProject,
CmsResource offlineResource,
CmsUUID publishHistoryId,
int publishTag)
throws CmsDataAccessException {
"""
Checks if the given resource (by id) is available in the online project,
i... | java | protected CmsResourceState fixMovedResource(
CmsDbContext dbc,
CmsProject onlineProject,
CmsResource offlineResource,
CmsUUID publishHistoryId,
int publishTag)
throws CmsDataAccessException {
CmsResource onlineResource;
// check if the resource has been moved... | [
"protected",
"CmsResourceState",
"fixMovedResource",
"(",
"CmsDbContext",
"dbc",
",",
"CmsProject",
"onlineProject",
",",
"CmsResource",
"offlineResource",
",",
"CmsUUID",
"publishHistoryId",
",",
"int",
"publishTag",
")",
"throws",
"CmsDataAccessException",
"{",
"CmsReso... | Checks if the given resource (by id) is available in the online project,
if there exists a resource with a different path (a moved file), then the
online entry is moved to the right (new) location before publishing.<p>
@param dbc the db context
@param onlineProject the online project
@param offlineResource the offline... | [
"Checks",
"if",
"the",
"given",
"resource",
"(",
"by",
"id",
")",
"is",
"available",
"in",
"the",
"online",
"project",
"if",
"there",
"exists",
"a",
"resource",
"with",
"a",
"different",
"path",
"(",
"a",
"moved",
"file",
")",
"then",
"the",
"online",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsProjectDriver.java#L2993-L3044 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.