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 |
|---|---|---|---|---|---|---|---|---|---|---|
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1, T2, T3, T4, T5, R> Func5<T1, T2, T3, T4, T5, Observable<R>> toAsync(Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> func) {
"""
Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.git... | java | public static <T1, T2, T3, T4, T5, R> Func5<T1, T2, T3, T4, T5, Observable<R>> toAsync(Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> func) {
return toAsync(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"R",
">",
"Func5",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"Observable",
"<",
"R",
">",
">",
"toAsync",
"(",
"Func5",
"<",
"?",
"super",
"T1... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
@... | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L421-L423 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_detail_vlan.java | ns_detail_vlan.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_detail_vlan_responses result = (ns_detail_vlan_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_detail_vlan_responses result = (ns_detail_vlan_responses) service.get_payload_formatter().string_to_resource(ns_detail_vlan_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_detail_vlan_responses",
"result",
"=",
"(",
"ns_detail_vlan_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_detail_vlan.java#L268-L285 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.isText | public static boolean isText(ByteBuf buf, int index, int length, Charset charset) {
"""
Returns {@code true} if the specified {@link ByteBuf} starting at {@code index} with {@code length} is valid
text using the given {@link Charset}, otherwise return {@code false}.
@param buf The given {@link ByteBuf}.
@para... | java | public static boolean isText(ByteBuf buf, int index, int length, Charset charset) {
checkNotNull(buf, "buf");
checkNotNull(charset, "charset");
final int maxIndex = buf.readerIndex() + buf.readableBytes();
if (index < 0 || length < 0 || index > maxIndex - length) {
throw new ... | [
"public",
"static",
"boolean",
"isText",
"(",
"ByteBuf",
"buf",
",",
"int",
"index",
",",
"int",
"length",
",",
"Charset",
"charset",
")",
"{",
"checkNotNull",
"(",
"buf",
",",
"\"buf\"",
")",
";",
"checkNotNull",
"(",
"charset",
",",
"\"charset\"",
")",
... | Returns {@code true} if the specified {@link ByteBuf} starting at {@code index} with {@code length} is valid
text using the given {@link Charset}, otherwise return {@code false}.
@param buf The given {@link ByteBuf}.
@param index The start index of the specified buffer.
@param length The length of the specified buffer... | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"specified",
"{",
"@link",
"ByteBuf",
"}",
"starting",
"at",
"{",
"@code",
"index",
"}",
"with",
"{",
"@code",
"length",
"}",
"is",
"valid",
"text",
"using",
"the",
"given",
"{",
"@link",
"Charset",
"}... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L1219-L1249 |
bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.getUncachedAuthenticationInfoForKey | private AuthenticationInfo getUncachedAuthenticationInfoForKey(String authenicationId) {
"""
Gets the authentication info for an API key from the source (not from cache).
"""
ApiKey apiKey = _authIdentityReader.getIdentityByAuthenticationId(authenicationId);
if (apiKey == null) {
re... | java | private AuthenticationInfo getUncachedAuthenticationInfoForKey(String authenicationId) {
ApiKey apiKey = _authIdentityReader.getIdentityByAuthenticationId(authenicationId);
if (apiKey == null) {
return null;
}
return createAuthenticationInfo(authenicationId, apiKey);
} | [
"private",
"AuthenticationInfo",
"getUncachedAuthenticationInfoForKey",
"(",
"String",
"authenicationId",
")",
"{",
"ApiKey",
"apiKey",
"=",
"_authIdentityReader",
".",
"getIdentityByAuthenticationId",
"(",
"authenicationId",
")",
";",
"if",
"(",
"apiKey",
"==",
"null",
... | Gets the authentication info for an API key from the source (not from cache). | [
"Gets",
"the",
"authentication",
"info",
"for",
"an",
"API",
"key",
"from",
"the",
"source",
"(",
"not",
"from",
"cache",
")",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L213-L220 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.undeleteResource | public void undeleteResource(String resourcename, boolean recursive) throws CmsException {
"""
Undeletes a resource.<p>
Only resources that have already been published once can be undeleted,
if a "new" resource is deleted it can not be undeleted.<p>
@param resourcename the name of the resource to undelete
... | java | public void undeleteResource(String resourcename, boolean recursive) throws CmsException {
CmsResource resource = readResource(resourcename, CmsResourceFilter.ALL);
getResourceType(resource).undelete(this, m_securityManager, resource, recursive);
} | [
"public",
"void",
"undeleteResource",
"(",
"String",
"resourcename",
",",
"boolean",
"recursive",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"resource",
"=",
"readResource",
"(",
"resourcename",
",",
"CmsResourceFilter",
".",
"ALL",
")",
";",
"getResourceTyp... | Undeletes a resource.<p>
Only resources that have already been published once can be undeleted,
if a "new" resource is deleted it can not be undeleted.<p>
@param resourcename the name of the resource to undelete
@param recursive if this operation is to be applied recursively to all resources in a folder
@throws CmsE... | [
"Undeletes",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3872-L3876 |
radkovo/Pdf2Dom | src/main/java/org/fit/pdfdom/PDFDomTree.java | PDFDomTree.createTextElement | protected Element createTextElement(String data, float width) {
"""
Creates an element that represents a single positioned box containing the specified text string.
@param data the text string to be contained in the created box.
@return the resulting DOM element
"""
Element el = createTextElement(wid... | java | protected Element createTextElement(String data, float width)
{
Element el = createTextElement(width);
Text text = doc.createTextNode(data);
el.appendChild(text);
return el;
} | [
"protected",
"Element",
"createTextElement",
"(",
"String",
"data",
",",
"float",
"width",
")",
"{",
"Element",
"el",
"=",
"createTextElement",
"(",
"width",
")",
";",
"Text",
"text",
"=",
"doc",
".",
"createTextNode",
"(",
"data",
")",
";",
"el",
".",
"... | Creates an element that represents a single positioned box containing the specified text string.
@param data the text string to be contained in the created box.
@return the resulting DOM element | [
"Creates",
"an",
"element",
"that",
"represents",
"a",
"single",
"positioned",
"box",
"containing",
"the",
"specified",
"text",
"string",
"."
] | train | https://github.com/radkovo/Pdf2Dom/blob/12e52b80eca7f57fc41e6ed895bf1db72c38da53/src/main/java/org/fit/pdfdom/PDFDomTree.java#L320-L326 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java | ResourceBundlesHandlerImpl.getBundleIterator | private ResourceBundlePathsIterator getBundleIterator(DebugMode debugMode, List<JoinableResourceBundle> bundles,
ConditionalCommentCallbackHandler commentCallbackHandler, Map<String, String> variants) {
"""
Returns the bundle iterator
@param debugMode
the flag indicating if we are in debug mode or not
@par... | java | private ResourceBundlePathsIterator getBundleIterator(DebugMode debugMode, List<JoinableResourceBundle> bundles,
ConditionalCommentCallbackHandler commentCallbackHandler, Map<String, String> variants) {
ResourceBundlePathsIterator bundlesIterator;
if (debugMode.equals(DebugMode.DEBUG)) {
bundlesIterator = new... | [
"private",
"ResourceBundlePathsIterator",
"getBundleIterator",
"(",
"DebugMode",
"debugMode",
",",
"List",
"<",
"JoinableResourceBundle",
">",
"bundles",
",",
"ConditionalCommentCallbackHandler",
"commentCallbackHandler",
",",
"Map",
"<",
"String",
",",
"String",
">",
"va... | Returns the bundle iterator
@param debugMode
the flag indicating if we are in debug mode or not
@param commentCallbackHandler
the comment callback handler
@param variants
the variant map
@return the bundle iterator | [
"Returns",
"the",
"bundle",
"iterator"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java#L508-L520 |
ehcache/ehcache3 | clustered/server/src/main/java/org/ehcache/clustered/server/ServerStoreCompatibility.java | ServerStoreCompatibility.verify | public void verify(ServerStoreConfiguration serverConfiguration, ServerStoreConfiguration clientConfiguration)
throws InvalidServerStoreConfigurationException {
"""
Ensure compatibility of a client {@link ServerStoreConfiguration} with an existing
server-side {@code ServerStoreConfiguration}.
@param serv... | java | public void verify(ServerStoreConfiguration serverConfiguration, ServerStoreConfiguration clientConfiguration)
throws InvalidServerStoreConfigurationException {
StringBuilder sb = new StringBuilder("Existing ServerStore configuration is not compatible with the desired configuration: ");
if (!serverConfig... | [
"public",
"void",
"verify",
"(",
"ServerStoreConfiguration",
"serverConfiguration",
",",
"ServerStoreConfiguration",
"clientConfiguration",
")",
"throws",
"InvalidServerStoreConfigurationException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"Existing Serve... | Ensure compatibility of a client {@link ServerStoreConfiguration} with an existing
server-side {@code ServerStoreConfiguration}.
@param serverConfiguration the existing server-side {@code ServerStoreConfiguration}
@param clientConfiguration the desired client-side {@code ServerStoreConfiguration}
@throws InvalidServe... | [
"Ensure",
"compatibility",
"of",
"a",
"client",
"{",
"@link",
"ServerStoreConfiguration",
"}",
"with",
"an",
"existing",
"server",
"-",
"side",
"{",
"@code",
"ServerStoreConfiguration",
"}",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/server/src/main/java/org/ehcache/clustered/server/ServerStoreCompatibility.java#L38-L45 |
Hygieia/Hygieia | hygieia-jenkins-plugin/src/main/java/hygieia/builder/SonarBuilder.java | SonarBuilder.getSonarTaskStatus | private String getSonarTaskStatus(String ceTaskResponse) throws org.json.simple.parser.ParseException {
"""
*
Parses the task status as returned from Sonar's CE API
@param ceTaskResponse String
@return value of status element in the CE API Response
@throws ParseException org.json.simple.parser.ParseException
... | java | private String getSonarTaskStatus(String ceTaskResponse) throws org.json.simple.parser.ParseException {
JSONObject ceTaskResponseObject = (JSONObject) new org.json.simple.parser.JSONParser().parse(ceTaskResponse);
JSONObject task = (JSONObject) ceTaskResponseObject.get("task");
return str(task, ... | [
"private",
"String",
"getSonarTaskStatus",
"(",
"String",
"ceTaskResponse",
")",
"throws",
"org",
".",
"json",
".",
"simple",
".",
"parser",
".",
"ParseException",
"{",
"JSONObject",
"ceTaskResponseObject",
"=",
"(",
"JSONObject",
")",
"new",
"org",
".",
"json",... | *
Parses the task status as returned from Sonar's CE API
@param ceTaskResponse String
@return value of status element in the CE API Response
@throws ParseException org.json.simple.parser.ParseException | [
"*",
"Parses",
"the",
"task",
"status",
"as",
"returned",
"from",
"Sonar",
"s",
"CE",
"API"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/hygieia-jenkins-plugin/src/main/java/hygieia/builder/SonarBuilder.java#L176-L180 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/StringUtil.java | StringUtil.toByteArray | public static byte[] toByteArray(String string) {
"""
Gets the bytes from a string using the current process engine's default charset
@param string the string to get the bytes form
@return the byte array
"""
EnsureUtil.ensureActiveCommandContext("StringUtil.toByteArray");
ProcessEngineConfiguration... | java | public static byte[] toByteArray(String string) {
EnsureUtil.ensureActiveCommandContext("StringUtil.toByteArray");
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
return toByteArray(string, processEngineConfiguration.getProcessEngine());
} | [
"public",
"static",
"byte",
"[",
"]",
"toByteArray",
"(",
"String",
"string",
")",
"{",
"EnsureUtil",
".",
"ensureActiveCommandContext",
"(",
"\"StringUtil.toByteArray\"",
")",
";",
"ProcessEngineConfigurationImpl",
"processEngineConfiguration",
"=",
"Context",
".",
"ge... | Gets the bytes from a string using the current process engine's default charset
@param string the string to get the bytes form
@return the byte array | [
"Gets",
"the",
"bytes",
"from",
"a",
"string",
"using",
"the",
"current",
"process",
"engine",
"s",
"default",
"charset"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/StringUtil.java#L151-L155 |
infinispan/infinispan | lucene/directory-provider/src/main/java/org/infinispan/hibernate/search/util/configuration/impl/ConfigurationParseHelper.java | ConfigurationParseHelper.parseInt | public static final int parseInt(String value, int defValue, String errorMsgOnParseFailure) {
"""
In case value is null or an empty string the defValue is returned
@param value
@param defValue
@param errorMsgOnParseFailure
@return the converted int.
@throws SearchException if value can't be parsed.
"""
... | java | public static final int parseInt(String value, int defValue, String errorMsgOnParseFailure) {
if (StringHelper.isEmpty(value)) {
return defValue;
} else {
return parseInt(value, errorMsgOnParseFailure);
}
} | [
"public",
"static",
"final",
"int",
"parseInt",
"(",
"String",
"value",
",",
"int",
"defValue",
",",
"String",
"errorMsgOnParseFailure",
")",
"{",
"if",
"(",
"StringHelper",
".",
"isEmpty",
"(",
"value",
")",
")",
"{",
"return",
"defValue",
";",
"}",
"else... | In case value is null or an empty string the defValue is returned
@param value
@param defValue
@param errorMsgOnParseFailure
@return the converted int.
@throws SearchException if value can't be parsed. | [
"In",
"case",
"value",
"is",
"null",
"or",
"an",
"empty",
"string",
"the",
"defValue",
"is",
"returned"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/directory-provider/src/main/java/org/infinispan/hibernate/search/util/configuration/impl/ConfigurationParseHelper.java#L56-L62 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/QueryBuilder.java | QueryBuilder.orderBy | public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) {
"""
Add "ORDER BY" clause to the SQL query statement. This can be called multiple times to add additional "ORDER BY"
clauses. Ones earlier are applied first.
"""
FieldType fieldType = verifyColumnName(columnName);
if (fieldType.isF... | java | public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) {
FieldType fieldType = verifyColumnName(columnName);
if (fieldType.isForeignCollection()) {
throw new IllegalArgumentException("Can't orderBy foreign collection field: " + columnName);
}
addOrderBy(new OrderBy(columnName, ascending));
... | [
"public",
"QueryBuilder",
"<",
"T",
",",
"ID",
">",
"orderBy",
"(",
"String",
"columnName",
",",
"boolean",
"ascending",
")",
"{",
"FieldType",
"fieldType",
"=",
"verifyColumnName",
"(",
"columnName",
")",
";",
"if",
"(",
"fieldType",
".",
"isForeignCollection... | Add "ORDER BY" clause to the SQL query statement. This can be called multiple times to add additional "ORDER BY"
clauses. Ones earlier are applied first. | [
"Add",
"ORDER",
"BY",
"clause",
"to",
"the",
"SQL",
"query",
"statement",
".",
"This",
"can",
"be",
"called",
"multiple",
"times",
"to",
"add",
"additional",
"ORDER",
"BY",
"clauses",
".",
"Ones",
"earlier",
"are",
"applied",
"first",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L175-L182 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/entry/sequence/AbstractSequence.java | AbstractSequence.getSequence | public String getSequence(Long beginPosition, Long endPosition) {
"""
Returns a subsequence string or null if the location
is not valid.
@param beginPosition the sequence begin position.
@param endPosition the sequence end position.
@return a subsequence string or null if the location is not valid.
"""
b... | java | public String getSequence(Long beginPosition, Long endPosition)
{
byte[] sequenceByte = getSequenceByte(beginPosition, endPosition);
if (sequenceByte != null)
return new String(sequenceByte);
return null;
} | [
"public",
"String",
"getSequence",
"(",
"Long",
"beginPosition",
",",
"Long",
"endPosition",
")",
"{",
"byte",
"[",
"]",
"sequenceByte",
"=",
"getSequenceByte",
"(",
"beginPosition",
",",
"endPosition",
")",
";",
"if",
"(",
"sequenceByte",
"!=",
"null",
")",
... | Returns a subsequence string or null if the location
is not valid.
@param beginPosition the sequence begin position.
@param endPosition the sequence end position.
@return a subsequence string or null if the location is not valid. | [
"Returns",
"a",
"subsequence",
"string",
"or",
"null",
"if",
"the",
"location",
"is",
"not",
"valid",
"."
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/entry/sequence/AbstractSequence.java#L36-L42 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/encodings/Encoding.java | Encoding.addQuaternaryClause | private void addQuaternaryClause(final MiniSatStyleSolver s, int a, int b, int c, int d, int blocking) {
"""
Adds a quaterary clause to the given SAT solver.
@param s the sat solver
@param a the first literal
@param b the second literal
@param c the third literal
@param d th... | java | private void addQuaternaryClause(final MiniSatStyleSolver s, int a, int b, int c, int d, int blocking) {
assert this.clause.size() == 0;
assert a != LIT_UNDEF && b != LIT_UNDEF && c != LIT_UNDEF && d != LIT_UNDEF;
assert var(a) < s.nVars() && var(b) < s.nVars() && var(c) < s.nVars() && var(d) < s.nVars();
... | [
"private",
"void",
"addQuaternaryClause",
"(",
"final",
"MiniSatStyleSolver",
"s",
",",
"int",
"a",
",",
"int",
"b",
",",
"int",
"c",
",",
"int",
"d",
",",
"int",
"blocking",
")",
"{",
"assert",
"this",
".",
"clause",
".",
"size",
"(",
")",
"==",
"0"... | Adds a quaterary clause to the given SAT solver.
@param s the sat solver
@param a the first literal
@param b the second literal
@param c the third literal
@param d the fourth literal
@param blocking the blocking literal | [
"Adds",
"a",
"quaterary",
"clause",
"to",
"the",
"given",
"SAT",
"solver",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/encodings/Encoding.java#L183-L195 |
scireum/server-sass | src/main/java/org/serversass/Functions.java | Functions.saturate | public static Expression saturate(Generator generator, FunctionCall input) {
"""
Increases the saturation of the given color by N percent.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation
"""
Color color = input.getExpec... | java | public static Expression saturate(Generator generator, FunctionCall input) {
Color color = input.getExpectedColorParam(0);
int increase = input.getExpectedIntParam(1);
return changeSaturation(color, increase);
} | [
"public",
"static",
"Expression",
"saturate",
"(",
"Generator",
"generator",
",",
"FunctionCall",
"input",
")",
"{",
"Color",
"color",
"=",
"input",
".",
"getExpectedColorParam",
"(",
"0",
")",
";",
"int",
"increase",
"=",
"input",
".",
"getExpectedIntParam",
... | Increases the saturation of the given color by N percent.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation | [
"Increases",
"the",
"saturation",
"of",
"the",
"given",
"color",
"by",
"N",
"percent",
"."
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Functions.java#L143-L147 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/text/TextUtils.java | TextUtils.dumpSpans | public static void dumpSpans(CharSequence cs, Printer printer, String prefix) {
"""
Debugging tool to print the spans in a CharSequence. The output will
be printed one span per line. If the CharSequence is not a Spanned,
then the entire string will be printed on a single line.
"""
if (cs instanceof... | java | public static void dumpSpans(CharSequence cs, Printer printer, String prefix) {
if (cs instanceof Spanned) {
Spanned sp = (Spanned) cs;
Object[] os = sp.getSpans(0, cs.length(), Object.class);
for (int i = 0; i < os.length; i++) {
Object o = os[i];
... | [
"public",
"static",
"void",
"dumpSpans",
"(",
"CharSequence",
"cs",
",",
"Printer",
"printer",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"cs",
"instanceof",
"Spanned",
")",
"{",
"Spanned",
"sp",
"=",
"(",
"Spanned",
")",
"cs",
";",
"Object",
"[",
"... | Debugging tool to print the spans in a CharSequence. The output will
be printed one span per line. If the CharSequence is not a Spanned,
then the entire string will be printed on a single line. | [
"Debugging",
"tool",
"to",
"print",
"the",
"spans",
"in",
"a",
"CharSequence",
".",
"The",
"output",
"will",
"be",
"printed",
"one",
"span",
"per",
"line",
".",
"If",
"the",
"CharSequence",
"is",
"not",
"a",
"Spanned",
"then",
"the",
"entire",
"string",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/text/TextUtils.java#L776-L793 |
osmdroid/osmdroid | osmdroid-wms/src/main/java/org/osmdroid/wms/WMSParser.java | WMSParser.parse | public static WMSEndpoint parse(InputStream inputStream) throws Exception {
"""
note, the input stream remains open after calling this method, closing it is the caller's problem
@param inputStream
@return
@throws Exception
"""
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
... | java | public static WMSEndpoint parse(InputStream inputStream) throws Exception {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
dBuilder.setEntityResolver(new EntityResolver() {
@Override
pub... | [
"public",
"static",
"WMSEndpoint",
"parse",
"(",
"InputStream",
"inputStream",
")",
"throws",
"Exception",
"{",
"DocumentBuilderFactory",
"dbFactory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"DocumentBuilder",
"dBuilder",
"=",
"dbFactory",
".... | note, the input stream remains open after calling this method, closing it is the caller's problem
@param inputStream
@return
@throws Exception | [
"note",
"the",
"input",
"stream",
"remains",
"open",
"after",
"calling",
"this",
"method",
"closing",
"it",
"is",
"the",
"caller",
"s",
"problem"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-wms/src/main/java/org/osmdroid/wms/WMSParser.java#L52-L78 |
opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/tools/Reflection.java | Reflection.methodHandle | public static MethodHandle methodHandle( MethodHandles.Lookup lookup, Serializable lambda ) {
"""
Get a method handle to the underlying method that implements a given ({@linkplain Serializable serializable})
lambda.
@param lookup a context that has access to looking up the target method.
@param lambda the ({@... | java | public static MethodHandle methodHandle( MethodHandles.Lookup lookup, Serializable lambda )
{
try
{
SerializedLambda serialized = serializedLambda( lambda );
Class<?> impl = lambdaClass( serialized );
switch ( serialized.getImplMethodKind() )
{
... | [
"public",
"static",
"MethodHandle",
"methodHandle",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"Serializable",
"lambda",
")",
"{",
"try",
"{",
"SerializedLambda",
"serialized",
"=",
"serializedLambda",
"(",
"lambda",
")",
";",
"Class",
"<",
"?",
">",
... | Get a method handle to the underlying method that implements a given ({@linkplain Serializable serializable})
lambda.
@param lookup a context that has access to looking up the target method.
@param lambda the ({@linkplain Serializable serializable}) lambda to find the implementing method of.
@return a method handle to... | [
"Get",
"a",
"method",
"handle",
"to",
"the",
"underlying",
"method",
"that",
"implements",
"a",
"given",
"(",
"{",
"@linkplain",
"Serializable",
"serializable",
"}",
")",
"lambda",
"."
] | train | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/tools/Reflection.java#L282-L310 |
DDTH/ddth-redis | src/main/java/com/github/ddth/redis/RedisClientFactory.java | RedisClientFactory.getRedisClient | public IRedisClient getRedisClient(final String host, final int port, final String username,
final String password, final PoolConfig poolConfig) {
"""
Gets or Creates a {@link IRedisClient} object.
@param host
@param port
@param username
@param password
@param poolConfig
@return
"""
... | java | public IRedisClient getRedisClient(final String host, final int port, final String username,
final String password, final PoolConfig poolConfig) {
String poolName = calcRedisPoolName(host, port, username, password, poolConfig);
try {
JedisClientPool redisClientPool = cacheRedisC... | [
"public",
"IRedisClient",
"getRedisClient",
"(",
"final",
"String",
"host",
",",
"final",
"int",
"port",
",",
"final",
"String",
"username",
",",
"final",
"String",
"password",
",",
"final",
"PoolConfig",
"poolConfig",
")",
"{",
"String",
"poolName",
"=",
"cal... | Gets or Creates a {@link IRedisClient} object.
@param host
@param port
@param username
@param password
@param poolConfig
@return | [
"Gets",
"or",
"Creates",
"a",
"{",
"@link",
"IRedisClient",
"}",
"object",
"."
] | train | https://github.com/DDTH/ddth-redis/blob/7e6abc3e43c9efe7e9c293d421c94227253ded87/src/main/java/com/github/ddth/redis/RedisClientFactory.java#L189-L206 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/preprocessors/DefaultContextPreprocessor.java | DefaultContextPreprocessor.extendedIndexOf | private int extendedIndexOf(List<String> vec, String str, int init_pos) throws ContextPreprocessorException {
"""
An extension of the list indexOf method which uses approximate comparison of the words as
elements of the List.
@param vec list of strings
@param str string to search
@param init_pos st... | java | private int extendedIndexOf(List<String> vec, String str, int init_pos) throws ContextPreprocessorException {
try {
// for all words in the input list starting from init_pos
for (int i = init_pos; i < vec.size(); i++) {
String vel = vec.get(i);
// try... | [
"private",
"int",
"extendedIndexOf",
"(",
"List",
"<",
"String",
">",
"vec",
",",
"String",
"str",
",",
"int",
"init_pos",
")",
"throws",
"ContextPreprocessorException",
"{",
"try",
"{",
"// for all words in the input list starting from init_pos\r",
"for",
"(",
"int",... | An extension of the list indexOf method which uses approximate comparison of the words as
elements of the List.
@param vec list of strings
@param str string to search
@param init_pos start position
@return position
@throws ContextPreprocessorException ContextPreprocessorException | [
"An",
"extension",
"of",
"the",
"list",
"indexOf",
"method",
"which",
"uses",
"approximate",
"comparison",
"of",
"the",
"words",
"as",
"elements",
"of",
"the",
"List",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/preprocessors/DefaultContextPreprocessor.java#L754-L777 |
abel533/Mapper | core/src/main/java/tk/mybatis/mapper/util/OGNL.java | OGNL.notAllNullParameterCheck | public static boolean notAllNullParameterCheck(Object parameter, String fields) {
"""
检查 paremeter 对象中指定的 fields 是否全是 null,如果是则抛出异常
@param parameter
@param fields
@return
"""
if (parameter != null) {
try {
Set<EntityColumn> columns = EntityHelper.getColumns(parameter.ge... | java | public static boolean notAllNullParameterCheck(Object parameter, String fields) {
if (parameter != null) {
try {
Set<EntityColumn> columns = EntityHelper.getColumns(parameter.getClass());
Set<String> fieldSet = new HashSet<String>(Arrays.asList(fields.split(",")));
... | [
"public",
"static",
"boolean",
"notAllNullParameterCheck",
"(",
"Object",
"parameter",
",",
"String",
"fields",
")",
"{",
"if",
"(",
"parameter",
"!=",
"null",
")",
"{",
"try",
"{",
"Set",
"<",
"EntityColumn",
">",
"columns",
"=",
"EntityHelper",
".",
"getCo... | 检查 paremeter 对象中指定的 fields 是否全是 null,如果是则抛出异常
@param parameter
@param fields
@return | [
"检查",
"paremeter",
"对象中指定的",
"fields",
"是否全是",
"null,如果是则抛出异常"
] | train | https://github.com/abel533/Mapper/blob/45c3d716583cba3680e03f1f6790fab5e1f4f668/core/src/main/java/tk/mybatis/mapper/util/OGNL.java#L73-L91 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java | SarlCompiler._toJavaExpression | protected void _toJavaExpression(SarlAssertExpression assertExpression, ITreeAppendable appendable) {
"""
Generate the Java code related to the expression for the assert keyword.
@param assertExpression the expression.
@param appendable the output.
"""
if (!assertExpression.isIsStatic() && isAtLeastJava8... | java | protected void _toJavaExpression(SarlAssertExpression assertExpression, ITreeAppendable appendable) {
if (!assertExpression.isIsStatic() && isAtLeastJava8(assertExpression)) {
appendable.append("/* error - couldn't compile nested assert */"); //$NON-NLS-1$
}
} | [
"protected",
"void",
"_toJavaExpression",
"(",
"SarlAssertExpression",
"assertExpression",
",",
"ITreeAppendable",
"appendable",
")",
"{",
"if",
"(",
"!",
"assertExpression",
".",
"isIsStatic",
"(",
")",
"&&",
"isAtLeastJava8",
"(",
"assertExpression",
")",
")",
"{"... | Generate the Java code related to the expression for the assert keyword.
@param assertExpression the expression.
@param appendable the output. | [
"Generate",
"the",
"Java",
"code",
"related",
"to",
"the",
"expression",
"for",
"the",
"assert",
"keyword",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java#L705-L709 |
joniles/mpxj | src/main/java/net/sf/mpxj/ResourceAssignment.java | ResourceAssignment.getTimephasedCostMultipleRates | private List<TimephasedCost> getTimephasedCostMultipleRates(List<TimephasedWork> standardWorkList, List<TimephasedWork> overtimeWorkList) {
"""
Generates timephased costs from timephased work where multiple cost rates
apply to the assignment.
@param standardWorkList timephased work
@param overtimeWorkList tim... | java | private List<TimephasedCost> getTimephasedCostMultipleRates(List<TimephasedWork> standardWorkList, List<TimephasedWork> overtimeWorkList)
{
List<TimephasedWork> standardWorkResult = new LinkedList<TimephasedWork>();
List<TimephasedWork> overtimeWorkResult = new LinkedList<TimephasedWork>();
CostRat... | [
"private",
"List",
"<",
"TimephasedCost",
">",
"getTimephasedCostMultipleRates",
"(",
"List",
"<",
"TimephasedWork",
">",
"standardWorkList",
",",
"List",
"<",
"TimephasedWork",
">",
"overtimeWorkList",
")",
"{",
"List",
"<",
"TimephasedWork",
">",
"standardWorkResult... | Generates timephased costs from timephased work where multiple cost rates
apply to the assignment.
@param standardWorkList timephased work
@param overtimeWorkList timephased work
@return timephased cost | [
"Generates",
"timephased",
"costs",
"from",
"timephased",
"work",
"where",
"multiple",
"cost",
"rates",
"apply",
"to",
"the",
"assignment",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L805-L839 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_item_itemId_configuration_configurationId_DELETE | public void cart_cartId_item_itemId_configuration_configurationId_DELETE(String cartId, Long itemId, Long configurationId) throws IOException {
"""
Delete configuration item
REST: DELETE /order/cart/{cartId}/item/{itemId}/configuration/{configurationId}
@param cartId [required] Cart identifier
@param itemId [... | java | public void cart_cartId_item_itemId_configuration_configurationId_DELETE(String cartId, Long itemId, Long configurationId) throws IOException {
String qPath = "/order/cart/{cartId}/item/{itemId}/configuration/{configurationId}";
StringBuilder sb = path(qPath, cartId, itemId, configurationId);
execN(qPath, "DELETE... | [
"public",
"void",
"cart_cartId_item_itemId_configuration_configurationId_DELETE",
"(",
"String",
"cartId",
",",
"Long",
"itemId",
",",
"Long",
"configurationId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/item/{itemId}/configuration/{conf... | Delete configuration item
REST: DELETE /order/cart/{cartId}/item/{itemId}/configuration/{configurationId}
@param cartId [required] Cart identifier
@param itemId [required] Product item identifier
@param configurationId [required] Configuration item identifier | [
"Delete",
"configuration",
"item"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L8103-L8107 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/tools/RuleMatchAsXmlSerializer.java | RuleMatchAsXmlSerializer.ruleMatchesToXml | public String ruleMatchesToXml(List<RuleMatch> ruleMatches, String text, int contextSize,
Language lang, Language motherTongue) {
"""
Get an XML representation of the given rule matches.
@param text the original text that was checked, used to get the context of the matches
@param... | java | public String ruleMatchesToXml(List<RuleMatch> ruleMatches, String text, int contextSize,
Language lang, Language motherTongue) {
return getXmlStart(lang, motherTongue) + ruleMatchesToXmlSnippet(ruleMatches, text, contextSize) + getXmlEnd();
} | [
"public",
"String",
"ruleMatchesToXml",
"(",
"List",
"<",
"RuleMatch",
">",
"ruleMatches",
",",
"String",
"text",
",",
"int",
"contextSize",
",",
"Language",
"lang",
",",
"Language",
"motherTongue",
")",
"{",
"return",
"getXmlStart",
"(",
"lang",
",",
"motherT... | Get an XML representation of the given rule matches.
@param text the original text that was checked, used to get the context of the matches
@param contextSize the desired context size in characters | [
"Get",
"an",
"XML",
"representation",
"of",
"the",
"given",
"rule",
"matches",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/tools/RuleMatchAsXmlSerializer.java#L152-L155 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java | P2sVpnGatewaysInner.beginUpdateTags | public P2SVpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName) {
"""
Updates virtual wan p2s vpn gateway tags.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fail ... | java | public P2SVpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body();
} | [
"public",
"P2SVpnGatewayInner",
"beginUpdateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"gatewayName",
")",
".",
"toBlocking",
"(",
")",
".",
"sing... | Updates virtual wan p2s vpn gateway tags.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorException thrown if the request is rejected by server
@throws RuntimeExcept... | [
"Updates",
"virtual",
"wan",
"p2s",
"vpn",
"gateway",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java#L533-L535 |
btc-ag/redg | redg-runtime/src/main/java/com/btc/redg/runtime/dummy/DefaultDummyFactory.java | DefaultDummyFactory.getDummy | @Override
public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) {
"""
Returns a dummy entity for the requested type.
All this method guarantees is that the returned entity is a valid entity with all non null foreign key relations filled in,
it does not guarantee useful... | java | @Override
public <T extends RedGEntity> T getDummy(final AbstractRedG redG, final Class<T> dummyClass) {
// check if a dummy for this type already exists in cache
if (this.dummyCache.containsKey(dummyClass)) {
return dummyClass.cast(this.dummyCache.get(dummyClass));
}
... | [
"@",
"Override",
"public",
"<",
"T",
"extends",
"RedGEntity",
">",
"T",
"getDummy",
"(",
"final",
"AbstractRedG",
"redG",
",",
"final",
"Class",
"<",
"T",
">",
"dummyClass",
")",
"{",
"// check if a dummy for this type already exists in cache\r",
"if",
"(",
"this"... | Returns a dummy entity for the requested type.
All this method guarantees is that the returned entity is a valid entity with all non null foreign key relations filled in,
it does not guarantee useful or even semantically correct data.
The dummy objects get taken either from the list of objects to insert from the redG o... | [
"Returns",
"a",
"dummy",
"entity",
"for",
"the",
"requested",
"type",
".",
"All",
"this",
"method",
"guarantees",
"is",
"that",
"the",
"returned",
"entity",
"is",
"a",
"valid",
"entity",
"with",
"all",
"non",
"null",
"foreign",
"key",
"relations",
"filled",
... | train | https://github.com/btc-ag/redg/blob/416a68639d002512cabfebff09afd2e1909e27df/redg-runtime/src/main/java/com/btc/redg/runtime/dummy/DefaultDummyFactory.java#L47-L56 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java | StorageAccountsInner.listByAccountAsync | public Observable<Page<StorageAccountInformationInner>> listByAccountAsync(final String resourceGroupName, final String accountName) {
"""
Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any.
@param res... | java | public Observable<Page<StorageAccountInformationInner>> listByAccountAsync(final String resourceGroupName, final String accountName) {
return listByAccountWithServiceResponseAsync(resourceGroupName, accountName)
.map(new Func1<ServiceResponse<Page<StorageAccountInformationInner>>, Page<StorageAccoun... | [
"public",
"Observable",
"<",
"Page",
"<",
"StorageAccountInformationInner",
">",
">",
"listByAccountAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
")",
"{",
"return",
"listByAccountWithServiceResponseAsync",
"(",
"resourceGroup... | Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Analytics account.
@throws IllegalArgumentExcept... | [
"Gets",
"the",
"first",
"page",
"of",
"Azure",
"Storage",
"accounts",
"if",
"any",
"linked",
"to",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java#L163-L171 |
molgenis/molgenis | molgenis-core-ui/src/main/java/org/molgenis/core/ui/MolgenisWebAppConfig.java | MolgenisWebAppConfig.freeMarkerConfigurer | @Bean
public FreeMarkerConfigurer freeMarkerConfigurer() {
"""
Configure freemarker. All freemarker templates should be on the classpath in a package called
'freemarker'
"""
FreeMarkerConfigurer result =
new FreeMarkerConfigurer() {
@Override
protected void postProcessConfigu... | java | @Bean
public FreeMarkerConfigurer freeMarkerConfigurer() {
FreeMarkerConfigurer result =
new FreeMarkerConfigurer() {
@Override
protected void postProcessConfiguration(Configuration config) {
config.setObjectWrapper(new MolgenisFreemarkerObjectWrapper(VERSION_2_3_23));
... | [
"@",
"Bean",
"public",
"FreeMarkerConfigurer",
"freeMarkerConfigurer",
"(",
")",
"{",
"FreeMarkerConfigurer",
"result",
"=",
"new",
"FreeMarkerConfigurer",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"postProcessConfiguration",
"(",
"Configuration",
"config",
... | Configure freemarker. All freemarker templates should be on the classpath in a package called
'freemarker' | [
"Configure",
"freemarker",
".",
"All",
"freemarker",
"templates",
"should",
"be",
"on",
"the",
"classpath",
"in",
"a",
"package",
"called",
"freemarker"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-core-ui/src/main/java/org/molgenis/core/ui/MolgenisWebAppConfig.java#L303-L332 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.listUsageMetrics | public PagedList<PoolUsageMetrics> listUsageMetrics(final PoolListUsageMetricsOptions poolListUsageMetricsOptions) {
"""
Lists the usage metrics, aggregated by pool across individual time intervals, for the specified account.
If you do not specify a $filter clause including a poolId, the response includes all poo... | java | public PagedList<PoolUsageMetrics> listUsageMetrics(final PoolListUsageMetricsOptions poolListUsageMetricsOptions) {
ServiceResponseWithHeaders<Page<PoolUsageMetrics>, PoolListUsageMetricsHeaders> response = listUsageMetricsSinglePageAsync(poolListUsageMetricsOptions).toBlocking().single();
return new P... | [
"public",
"PagedList",
"<",
"PoolUsageMetrics",
">",
"listUsageMetrics",
"(",
"final",
"PoolListUsageMetricsOptions",
"poolListUsageMetricsOptions",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"PoolUsageMetrics",
">",
",",
"PoolListUsageMetricsHeaders",
">",
"... | Lists the usage metrics, aggregated by pool across individual time intervals, for the specified account.
If you do not specify a $filter clause including a poolId, the response includes all pools that existed in the account in the time range of the returned aggregation intervals. If you do not specify a $filter clause ... | [
"Lists",
"the",
"usage",
"metrics",
"aggregated",
"by",
"pool",
"across",
"individual",
"time",
"intervals",
"for",
"the",
"specified",
"account",
".",
"If",
"you",
"do",
"not",
"specify",
"a",
"$filter",
"clause",
"including",
"a",
"poolId",
"the",
"response"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L310-L325 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipeline.java | ImagePipeline.getEncodedImageDataSourceSupplier | public Supplier<DataSource<CloseableReference<PooledByteBuffer>>>
getEncodedImageDataSourceSupplier(
final ImageRequest imageRequest,
final Object callerContext) {
"""
Returns a DataSource supplier that will on get submit the request for execution and return a
DataSource representing the pending res... | java | public Supplier<DataSource<CloseableReference<PooledByteBuffer>>>
getEncodedImageDataSourceSupplier(
final ImageRequest imageRequest,
final Object callerContext) {
return new Supplier<DataSource<CloseableReference<PooledByteBuffer>>>() {
@Override
public DataSource<CloseableReference<Poole... | [
"public",
"Supplier",
"<",
"DataSource",
"<",
"CloseableReference",
"<",
"PooledByteBuffer",
">",
">",
">",
"getEncodedImageDataSourceSupplier",
"(",
"final",
"ImageRequest",
"imageRequest",
",",
"final",
"Object",
"callerContext",
")",
"{",
"return",
"new",
"Supplier... | Returns a DataSource supplier that will on get submit the request for execution and return a
DataSource representing the pending results of the task.
@param imageRequest the request to submit (what to execute).
@return a DataSource representing pending results and completion of the request | [
"Returns",
"a",
"DataSource",
"supplier",
"that",
"will",
"on",
"get",
"submit",
"the",
"request",
"for",
"execution",
"and",
"return",
"a",
"DataSource",
"representing",
"the",
"pending",
"results",
"of",
"the",
"task",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipeline.java#L169-L186 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java | DfuBaseService.openInputStream | private InputStream openInputStream(@NonNull final Uri stream, final String mimeType, final int mbrSize, final int types)
throws IOException {
"""
Opens the binary input stream. A Uri to the stream is given.
@param stream the Uri to the stream.
@param mimeType the file type.
@param mbrSize the size of M... | java | private InputStream openInputStream(@NonNull final Uri stream, final String mimeType, final int mbrSize, final int types)
throws IOException {
final InputStream is = getContentResolver().openInputStream(stream);
if (MIME_TYPE_ZIP.equals(mimeType))
return new ArchiveInputStream(is, mbrSize, types);
final St... | [
"private",
"InputStream",
"openInputStream",
"(",
"@",
"NonNull",
"final",
"Uri",
"stream",
",",
"final",
"String",
"mimeType",
",",
"final",
"int",
"mbrSize",
",",
"final",
"int",
"types",
")",
"throws",
"IOException",
"{",
"final",
"InputStream",
"is",
"=",
... | Opens the binary input stream. A Uri to the stream is given.
@param stream the Uri to the stream.
@param mimeType the file type.
@param mbrSize the size of MBR, by default 0x1000.
@param types the content files types in ZIP.
@return The input stream with binary image content. | [
"Opens",
"the",
"binary",
"input",
"stream",
".",
"A",
"Uri",
"to",
"the",
"stream",
"is",
"given",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java#L1435-L1454 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.setBoolean | @PublicEvolving
public void setBoolean(ConfigOption<Boolean> key, boolean value) {
"""
Adds the given value to the configuration object.
The main key of the config option will be used to map the value.
@param key
the option specifying the key to be added
@param value
the value of the key/value pair to be a... | java | @PublicEvolving
public void setBoolean(ConfigOption<Boolean> key, boolean value) {
setValueInternal(key.key(), value);
} | [
"@",
"PublicEvolving",
"public",
"void",
"setBoolean",
"(",
"ConfigOption",
"<",
"Boolean",
">",
"key",
",",
"boolean",
"value",
")",
"{",
"setValueInternal",
"(",
"key",
".",
"key",
"(",
")",
",",
"value",
")",
";",
"}"
] | Adds the given value to the configuration object.
The main key of the config option will be used to map the value.
@param key
the option specifying the key to be added
@param value
the value of the key/value pair to be added | [
"Adds",
"the",
"given",
"value",
"to",
"the",
"configuration",
"object",
".",
"The",
"main",
"key",
"of",
"the",
"config",
"option",
"will",
"be",
"used",
"to",
"map",
"the",
"value",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L412-L415 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/PathHandler.java | PathHandler.addPath | @Deprecated
public synchronized PathHandler addPath(final String path, final HttpHandler handler) {
"""
Adds a path prefix and a handler for that path. If the path does not start
with a / then one will be prepended.
<p>
The match is done on a prefix bases, so registering /foo will also match /bar. Exact
pa... | java | @Deprecated
public synchronized PathHandler addPath(final String path, final HttpHandler handler) {
return addPrefixPath(path, handler);
} | [
"@",
"Deprecated",
"public",
"synchronized",
"PathHandler",
"addPath",
"(",
"final",
"String",
"path",
",",
"final",
"HttpHandler",
"handler",
")",
"{",
"return",
"addPrefixPath",
"(",
"path",
",",
"handler",
")",
";",
"}"
] | Adds a path prefix and a handler for that path. If the path does not start
with a / then one will be prepended.
<p>
The match is done on a prefix bases, so registering /foo will also match /bar. Exact
path matches are taken into account first.
<p>
If / is specified as the path then it will replace the default handler.
... | [
"Adds",
"a",
"path",
"prefix",
"and",
"a",
"handler",
"for",
"that",
"path",
".",
"If",
"the",
"path",
"does",
"not",
"start",
"with",
"a",
"/",
"then",
"one",
"will",
"be",
"prepended",
".",
"<p",
">",
"The",
"match",
"is",
"done",
"on",
"a",
"pre... | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/PathHandler.java#L108-L111 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.appendArray | public static String appendArray(final String value, final String[] appends) {
"""
Append an array of String to value
@param value initial String
@param appends an array of strings to append
@return full String
"""
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
if (app... | java | public static String appendArray(final String value, final String[] appends) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
if (appends == null || appends.length == 0) {
return value;
}
StringJoiner joiner = new StringJoiner("");
for (String appen... | [
"public",
"static",
"String",
"appendArray",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"[",
"]",
"appends",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")",
";",
"if",
"(",
"appends",
"==",
... | Append an array of String to value
@param value initial String
@param appends an array of strings to append
@return full String | [
"Append",
"an",
"array",
"of",
"String",
"to",
"value"
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L71-L81 |
jbossws/jbossws-spi | src/main/java/org/jboss/wsf/spi/util/StAXUtils.java | StAXUtils.createXMLInputFactory | public static XMLInputFactory createXMLInputFactory(boolean nsAware) {
"""
Return a new factory so that the caller can set sticky parameters.
@param nsAware true is nsAware
@return XMLInputFactory
"""
XMLInputFactory factory = XMLInputFactory.newInstance();
factory.setProperty(XMLInputFactory.I... | java | public static XMLInputFactory createXMLInputFactory(boolean nsAware)
{
XMLInputFactory factory = XMLInputFactory.newInstance();
factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, nsAware);
factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
factory.setProperty(XMLInputFactor... | [
"public",
"static",
"XMLInputFactory",
"createXMLInputFactory",
"(",
"boolean",
"nsAware",
")",
"{",
"XMLInputFactory",
"factory",
"=",
"XMLInputFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setProperty",
"(",
"XMLInputFactory",
".",
"IS_NAMESPACE_AWAR... | Return a new factory so that the caller can set sticky parameters.
@param nsAware true is nsAware
@return XMLInputFactory | [
"Return",
"a",
"new",
"factory",
"so",
"that",
"the",
"caller",
"can",
"set",
"sticky",
"parameters",
"."
] | train | https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java#L70-L86 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.findAllGroup1 | public static List<String> findAllGroup1(Pattern pattern, CharSequence content) {
"""
取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组1的内容
@param pattern 编译后的正则模式
@param content 被查找的内容
@return 结果列表
@since 3.1.2
"""
return findAll(pattern, content, 1);
} | java | public static List<String> findAllGroup1(Pattern pattern, CharSequence content) {
return findAll(pattern, content, 1);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"findAllGroup1",
"(",
"Pattern",
"pattern",
",",
"CharSequence",
"content",
")",
"{",
"return",
"findAll",
"(",
"pattern",
",",
"content",
",",
"1",
")",
";",
"}"
] | 取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组1的内容
@param pattern 编译后的正则模式
@param content 被查找的内容
@return 结果列表
@since 3.1.2 | [
"取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组1的内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L430-L432 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java | FieldBuilder.buildDeprecationInfo | public void buildDeprecationInfo(XMLNode node, Content fieldDocTree) {
"""
Build the deprecation information.
@param node the XML element that specifies which components to document
@param fieldDocTree the content tree to which the documentation will be added
"""
writer.addDeprecated(
... | java | public void buildDeprecationInfo(XMLNode node, Content fieldDocTree) {
writer.addDeprecated(
(FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
} | [
"public",
"void",
"buildDeprecationInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"fieldDocTree",
")",
"{",
"writer",
".",
"addDeprecated",
"(",
"(",
"FieldDoc",
")",
"fields",
".",
"get",
"(",
"currentFieldIndex",
")",
",",
"fieldDocTree",
")",
";",
"}"
] | Build the deprecation information.
@param node the XML element that specifies which components to document
@param fieldDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"deprecation",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java#L192-L195 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAuthenticatorProxy.java | WebAuthenticatorProxy.createFormLoginAuthenticator | protected FormLoginAuthenticator createFormLoginAuthenticator(WebRequest webRequest) {
"""
Create an instance of the FormLoginAuthenticator.
<p>
Protected so it can be overridden in unit tests.
"""
WebAuthenticator ssoAuthenticator = providerAuthenticatorProxy.getSSOAuthenticator(webRequest, null);
... | java | protected FormLoginAuthenticator createFormLoginAuthenticator(WebRequest webRequest) {
WebAuthenticator ssoAuthenticator = providerAuthenticatorProxy.getSSOAuthenticator(webRequest, null);
return new FormLoginAuthenticator(ssoAuthenticator, webAppSecurityConfig, providerAuthenticatorProxy);
} | [
"protected",
"FormLoginAuthenticator",
"createFormLoginAuthenticator",
"(",
"WebRequest",
"webRequest",
")",
"{",
"WebAuthenticator",
"ssoAuthenticator",
"=",
"providerAuthenticatorProxy",
".",
"getSSOAuthenticator",
"(",
"webRequest",
",",
"null",
")",
";",
"return",
"new"... | Create an instance of the FormLoginAuthenticator.
<p>
Protected so it can be overridden in unit tests. | [
"Create",
"an",
"instance",
"of",
"the",
"FormLoginAuthenticator",
".",
"<p",
">",
"Protected",
"so",
"it",
"can",
"be",
"overridden",
"in",
"unit",
"tests",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAuthenticatorProxy.java#L247-L250 |
Alluxio/alluxio | core/base/src/main/java/alluxio/collections/IndexedSet.java | IndexedSet.removeByField | public <V> int removeByField(IndexDefinition<T, V> indexDefinition, V value) {
"""
Removes the subset of objects with the specified index field value.
@param indexDefinition the field index
@param value the field value
@param <V> the field type
@return the number of objects removed
"""
Set<T> toRemov... | java | public <V> int removeByField(IndexDefinition<T, V> indexDefinition, V value) {
Set<T> toRemove = getByField(indexDefinition, value);
int removed = 0;
for (T o : toRemove) {
if (remove(o)) {
removed++;
}
}
return removed;
} | [
"public",
"<",
"V",
">",
"int",
"removeByField",
"(",
"IndexDefinition",
"<",
"T",
",",
"V",
">",
"indexDefinition",
",",
"V",
"value",
")",
"{",
"Set",
"<",
"T",
">",
"toRemove",
"=",
"getByField",
"(",
"indexDefinition",
",",
"value",
")",
";",
"int"... | Removes the subset of objects with the specified index field value.
@param indexDefinition the field index
@param value the field value
@param <V> the field type
@return the number of objects removed | [
"Removes",
"the",
"subset",
"of",
"objects",
"with",
"the",
"specified",
"index",
"field",
"value",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/IndexedSet.java#L335-L345 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownOptionsExample.java | WDropdownOptionsExample.buildSubordinatePanel | private void buildSubordinatePanel(final WDropdown dropdown, final String value,
final WComponentGroup<SubordinateTarget> group,
final WSubordinateControl control) {
"""
Builds a panel for the subordinate control, including the rule for that particular option.
@param dropdown the subordinate trigger.
@pa... | java | private void buildSubordinatePanel(final WDropdown dropdown, final String value,
final WComponentGroup<SubordinateTarget> group,
final WSubordinateControl control) {
// create the panel.
WPanel panel = new WPanel();
WStyledText subordinateInfo = new WStyledText();
subordinateInfo.setWhitespaceMode(Whitesp... | [
"private",
"void",
"buildSubordinatePanel",
"(",
"final",
"WDropdown",
"dropdown",
",",
"final",
"String",
"value",
",",
"final",
"WComponentGroup",
"<",
"SubordinateTarget",
">",
"group",
",",
"final",
"WSubordinateControl",
"control",
")",
"{",
"// create the panel.... | Builds a panel for the subordinate control, including the rule for that particular option.
@param dropdown the subordinate trigger.
@param value the dropdown option to be added
@param group the group
@param control the subordinate control | [
"Builds",
"a",
"panel",
"for",
"the",
"subordinate",
"control",
"including",
"the",
"rule",
"for",
"that",
"particular",
"option",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownOptionsExample.java#L334-L353 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java | Task.triggerCheckpointBarrier | public void triggerCheckpointBarrier(
final long checkpointID,
final long checkpointTimestamp,
final CheckpointOptions checkpointOptions,
final boolean advanceToEndOfEventTime) {
"""
Calls the invokable to trigger a checkpoint.
@param checkpointID The ID identifying the checkpoint.
@param checkpoin... | java | public void triggerCheckpointBarrier(
final long checkpointID,
final long checkpointTimestamp,
final CheckpointOptions checkpointOptions,
final boolean advanceToEndOfEventTime) {
final AbstractInvokable invokable = this.invokable;
final CheckpointMetaData checkpointMetaData = new CheckpointMetaData(che... | [
"public",
"void",
"triggerCheckpointBarrier",
"(",
"final",
"long",
"checkpointID",
",",
"final",
"long",
"checkpointTimestamp",
",",
"final",
"CheckpointOptions",
"checkpointOptions",
",",
"final",
"boolean",
"advanceToEndOfEventTime",
")",
"{",
"final",
"AbstractInvokab... | Calls the invokable to trigger a checkpoint.
@param checkpointID The ID identifying the checkpoint.
@param checkpointTimestamp The timestamp associated with the checkpoint.
@param checkpointOptions Options for performing this checkpoint.
@param advanceToEndOfEventTime Flag indicating if the source should inject a {@co... | [
"Calls",
"the",
"invokable",
"to",
"trigger",
"a",
"checkpoint",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java#L1161-L1219 |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/markdown/MarkdownParser.java | MarkdownParser.validateEntities | private void validateEntities(JsonNode data) throws InvalidInputException {
"""
Verify that JSON entities contain the required fields and that entity indices are correct.
"""
for (JsonNode node : data.findParents(INDEX_START)) {
for (String key : new String[] {INDEX_START, INDEX_END, ID, TYPE}) {
... | java | private void validateEntities(JsonNode data) throws InvalidInputException {
for (JsonNode node : data.findParents(INDEX_START)) {
for (String key : new String[] {INDEX_START, INDEX_END, ID, TYPE}) {
if (node.path(key).isMissingNode()) {
throw new InvalidInputException("Required field \"" + ... | [
"private",
"void",
"validateEntities",
"(",
"JsonNode",
"data",
")",
"throws",
"InvalidInputException",
"{",
"for",
"(",
"JsonNode",
"node",
":",
"data",
".",
"findParents",
"(",
"INDEX_START",
")",
")",
"{",
"for",
"(",
"String",
"key",
":",
"new",
"String"... | Verify that JSON entities contain the required fields and that entity indices are correct. | [
"Verify",
"that",
"JSON",
"entities",
"contain",
"the",
"required",
"fields",
"and",
"that",
"entity",
"indices",
"are",
"correct",
"."
] | train | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/markdown/MarkdownParser.java#L351-L369 |
pierre/serialization | thrift/src/main/java/com/ning/metrics/serialization/event/ThriftToThriftEnvelopeEvent.java | ThriftToThriftEnvelopeEvent.extractEvent | public static ThriftEnvelopeEvent extractEvent(final String type, final DateTime eventDateTime, final byte[] payload) throws TException {
"""
Given a serialized Thrift, generate a ThrifTEnvelopeEvent
@param type Thrift schema name
@param eventDateTime the event timestamp
@param payload serializ... | java | public static ThriftEnvelopeEvent extractEvent(final String type, final DateTime eventDateTime, final byte[] payload) throws TException
{
final List<ThriftField> list = new ThriftFieldListDeserializer().readPayload(payload);
final ThriftEnvelope envelope = new ThriftEnvelope(type, list);
re... | [
"public",
"static",
"ThriftEnvelopeEvent",
"extractEvent",
"(",
"final",
"String",
"type",
",",
"final",
"DateTime",
"eventDateTime",
",",
"final",
"byte",
"[",
"]",
"payload",
")",
"throws",
"TException",
"{",
"final",
"List",
"<",
"ThriftField",
">",
"list",
... | Given a serialized Thrift, generate a ThrifTEnvelopeEvent
@param type Thrift schema name
@param eventDateTime the event timestamp
@param payload serialized Thrift
@return ThriftEnvelopeEvent representing the Thrift
@throws TException if the payload is not a valid Thrift | [
"Given",
"a",
"serialized",
"Thrift",
"generate",
"a",
"ThrifTEnvelopeEvent"
] | train | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/thrift/src/main/java/com/ning/metrics/serialization/event/ThriftToThriftEnvelopeEvent.java#L100-L106 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/system_settings.java | system_settings.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
system_settings_responses result = (system_settings_responses) service.... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
system_settings_responses result = (system_settings_responses) service.get_payload_formatter().string_to_resource(system_settings_responses.class, response);
if(result.errorcode != 0)
{
if (result... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"system_settings_responses",
"result",
"=",
"(",
"system_settings_responses",
")",
"service",
".",
"get_payloa... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/system_settings.java#L329-L346 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/util/ReflectionUtils.java | ReflectionUtils.declaresException | public static boolean declaresException(Method method, Class<?> exceptionType) {
"""
Determine whether the given method explicitly declares the given
exception or one of its superclasses, which means that an exception of
that type can be propagated as-is within a reflective invocation.
@param method the declari... | java | public static boolean declaresException(Method method, Class<?> exceptionType) {
Assert.notNull(method, "Method must not be null");
Class<?>[] declaredExceptions = method.getExceptionTypes();
for (Class<?> declaredException : declaredExceptions) {
if (declaredException.isAssignableFrom(exceptionType)) {
re... | [
"public",
"static",
"boolean",
"declaresException",
"(",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"exceptionType",
")",
"{",
"Assert",
".",
"notNull",
"(",
"method",
",",
"\"Method must not be null\"",
")",
";",
"Class",
"<",
"?",
">",
"[",
"]",
"d... | Determine whether the given method explicitly declares the given
exception or one of its superclasses, which means that an exception of
that type can be propagated as-is within a reflective invocation.
@param method the declaring method
@param exceptionType the exception to throw
@return {@code true} if the exception c... | [
"Determine",
"whether",
"the",
"given",
"method",
"explicitly",
"declares",
"the",
"given",
"exception",
"or",
"one",
"of",
"its",
"superclasses",
"which",
"means",
"that",
"an",
"exception",
"of",
"that",
"type",
"can",
"be",
"propagated",
"as",
"-",
"is",
... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/ReflectionUtils.java#L330-L339 |
apache/incubator-gobblin | gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleAnalyticsUnsampledExtractor.java | GoogleAnalyticsUnsampledExtractor.prepareUnsampledReport | @VisibleForTesting
UnsampledReport prepareUnsampledReport(UnsampledReport request, final GoogleDriveFsHelper fsHelper, boolean isDeleteTempReport) throws IOException {
"""
Create unsampled report in Google drive and add google drive file id into state so that Google drive extractor
can extract record from it. A... | java | @VisibleForTesting
UnsampledReport prepareUnsampledReport(UnsampledReport request, final GoogleDriveFsHelper fsHelper, boolean isDeleteTempReport) throws IOException {
UnsampledReport createdReport = createUnsampledReports(request);
final String fileId = createdReport.getDriveDownloadDetails().getDocumentId(... | [
"@",
"VisibleForTesting",
"UnsampledReport",
"prepareUnsampledReport",
"(",
"UnsampledReport",
"request",
",",
"final",
"GoogleDriveFsHelper",
"fsHelper",
",",
"boolean",
"isDeleteTempReport",
")",
"throws",
"IOException",
"{",
"UnsampledReport",
"createdReport",
"=",
"crea... | Create unsampled report in Google drive and add google drive file id into state so that Google drive extractor
can extract record from it. Also, update the state to use CsvFileDownloader unless other downloader is defined.
It also register closer to delete the file from Google Drive unless explicitly requested to not ... | [
"Create",
"unsampled",
"report",
"in",
"Google",
"drive",
"and",
"add",
"google",
"drive",
"file",
"id",
"into",
"state",
"so",
"that",
"Google",
"drive",
"extractor",
"can",
"extract",
"record",
"from",
"it",
".",
"Also",
"update",
"the",
"state",
"to",
"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleAnalyticsUnsampledExtractor.java#L210-L235 |
weld/core | impl/src/main/java/org/jboss/weld/event/ObserverFactory.java | ObserverFactory.getTransactionalPhase | public static TransactionPhase getTransactionalPhase(EnhancedAnnotatedMethod<?, ?> observer) {
"""
Tests an observer method to see if it is transactional.
@param observer The observer method
@return true if the observer method is annotated as transactional
"""
EnhancedAnnotatedParameter<?, ?> param... | java | public static TransactionPhase getTransactionalPhase(EnhancedAnnotatedMethod<?, ?> observer) {
EnhancedAnnotatedParameter<?, ?> parameter = observer.getEnhancedParameters(Observes.class).iterator().next();
return parameter.getAnnotation(Observes.class).during();
} | [
"public",
"static",
"TransactionPhase",
"getTransactionalPhase",
"(",
"EnhancedAnnotatedMethod",
"<",
"?",
",",
"?",
">",
"observer",
")",
"{",
"EnhancedAnnotatedParameter",
"<",
"?",
",",
"?",
">",
"parameter",
"=",
"observer",
".",
"getEnhancedParameters",
"(",
... | Tests an observer method to see if it is transactional.
@param observer The observer method
@return true if the observer method is annotated as transactional | [
"Tests",
"an",
"observer",
"method",
"to",
"see",
"if",
"it",
"is",
"transactional",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java#L59-L62 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.createAndStripZerosToMatchScale | private static BigDecimal createAndStripZerosToMatchScale(BigInteger intVal, int scale, long preferredScale) {
"""
Remove insignificant trailing zeros from this
{@code BigInteger} value until the preferred scale is reached or no
more zeros can be removed. If the preferred scale is less than
Integer.MIN_VALUE, ... | java | private static BigDecimal createAndStripZerosToMatchScale(BigInteger intVal, int scale, long preferredScale) {
BigInteger qr[]; // quotient-remainder pair
while (intVal.compareMagnitude(BigInteger.TEN) >= 0
&& scale > preferredScale) {
if (intVal.testBit(0))
br... | [
"private",
"static",
"BigDecimal",
"createAndStripZerosToMatchScale",
"(",
"BigInteger",
"intVal",
",",
"int",
"scale",
",",
"long",
"preferredScale",
")",
"{",
"BigInteger",
"qr",
"[",
"]",
";",
"// quotient-remainder pair",
"while",
"(",
"intVal",
".",
"compareMag... | Remove insignificant trailing zeros from this
{@code BigInteger} value until the preferred scale is reached or no
more zeros can be removed. If the preferred scale is less than
Integer.MIN_VALUE, all the trailing zeros will be removed.
@return new {@code BigDecimal} with a scale possibly reduced
to be closed to the p... | [
"Remove",
"insignificant",
"trailing",
"zeros",
"from",
"this",
"{",
"@code",
"BigInteger",
"}",
"value",
"until",
"the",
"preferred",
"scale",
"is",
"reached",
"or",
"no",
"more",
"zeros",
"can",
"be",
"removed",
".",
"If",
"the",
"preferred",
"scale",
"is"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4369-L4382 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/PdfBoxUtilities.java | PdfBoxUtilities.mergePdf | public static void mergePdf(File[] inputPdfFiles, File outputPdfFile) {
"""
Merges PDF files.
@param inputPdfFiles array of input files
@param outputPdfFile output file
"""
try {
PDFMergerUtility mergerUtility = new PDFMergerUtility();
mergerUtility.setDestinationFileName(ou... | java | public static void mergePdf(File[] inputPdfFiles, File outputPdfFile) {
try {
PDFMergerUtility mergerUtility = new PDFMergerUtility();
mergerUtility.setDestinationFileName(outputPdfFile.getPath());
for (File inputPdfFile : inputPdfFiles) {
mergerUtility.addSou... | [
"public",
"static",
"void",
"mergePdf",
"(",
"File",
"[",
"]",
"inputPdfFiles",
",",
"File",
"outputPdfFile",
")",
"{",
"try",
"{",
"PDFMergerUtility",
"mergerUtility",
"=",
"new",
"PDFMergerUtility",
"(",
")",
";",
"mergerUtility",
".",
"setDestinationFileName",
... | Merges PDF files.
@param inputPdfFiles array of input files
@param outputPdfFile output file | [
"Merges",
"PDF",
"files",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/PdfBoxUtilities.java#L203-L214 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java | CommandExecutionSpec.assertCommandExistsOnTimeOut | @Then("^in less than '(\\d+?)' seconds, checking each '(\\d+?)' seconds, the command output '(.+?)' contains '(.+?)'( with exit status '(.+?)')?$")
public void assertCommandExistsOnTimeOut(Integer timeout, Integer wait, String command, String search, String foo, Integer exitStatus) throws Exception {
"""
Check... | java | @Then("^in less than '(\\d+?)' seconds, checking each '(\\d+?)' seconds, the command output '(.+?)' contains '(.+?)'( with exit status '(.+?)')?$")
public void assertCommandExistsOnTimeOut(Integer timeout, Integer wait, String command, String search, String foo, Integer exitStatus) throws Exception {
Boolea... | [
"@",
"Then",
"(",
"\"^in less than '(\\\\d+?)' seconds, checking each '(\\\\d+?)' seconds, the command output '(.+?)' contains '(.+?)'( with exit status '(.+?)')?$\"",
")",
"public",
"void",
"assertCommandExistsOnTimeOut",
"(",
"Integer",
"timeout",
",",
"Integer",
"wait",
",",
"String... | Checks if {@code expectedCount} text is found, whithin a {@code timeout} in the output of command {@code command}
and the exit status is the specified in {@code exitStatus}.
Each negative lookup is followed by a wait of {@code wait} seconds.
@param timeout
@param wait
@param command
@param search
@throws InterruptedEx... | [
"Checks",
"if",
"{",
"@code",
"expectedCount",
"}",
"text",
"is",
"found",
"whithin",
"a",
"{",
"@code",
"timeout",
"}",
"in",
"the",
"output",
"of",
"command",
"{",
"@code",
"command",
"}",
"and",
"the",
"exit",
"status",
"is",
"the",
"specified",
"in",... | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java#L151-L180 |
maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/TooltipHelper.java | TooltipHelper.setup | public static void setup(View view, final CharSequence text) {
"""
Sets up a cheat sheet (tooltip) for the given view by setting its {@link android.view.View.OnLongClickListener}.
When the view is long-pressed, a {@link Toast} with the given text will be shown either above (default) or below
the view (if there i... | java | public static void setup(View view, final CharSequence text) {
view.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
return showCheatSheet(view, text);
}
});
} | [
"public",
"static",
"void",
"setup",
"(",
"View",
"view",
",",
"final",
"CharSequence",
"text",
")",
"{",
"view",
".",
"setOnLongClickListener",
"(",
"new",
"View",
".",
"OnLongClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onLongClick",... | Sets up a cheat sheet (tooltip) for the given view by setting its {@link android.view.View.OnLongClickListener}.
When the view is long-pressed, a {@link Toast} with the given text will be shown either above (default) or below
the view (if there isn't room above it).
@param view The view to add a cheat sheet for.
@para... | [
"Sets",
"up",
"a",
"cheat",
"sheet",
"(",
"tooltip",
")",
"for",
"the",
"given",
"view",
"by",
"setting",
"its",
"{",
"@link",
"android",
".",
"view",
".",
"View",
".",
"OnLongClickListener",
"}",
".",
"When",
"the",
"view",
"is",
"long",
"-",
"pressed... | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/TooltipHelper.java#L71-L79 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/data/SparkDataValidation.java | SparkDataValidation.deleteInvalidMultiDataSets | public static ValidationResult deleteInvalidMultiDataSets(JavaSparkContext sc, String path, List<int[]> featuresShape,
List<int[]> labelsShape) {
"""
Validate MultiDataSet objects - <b>and delete any invalid MultiDataSets</b> - that have been previously saved
... | java | public static ValidationResult deleteInvalidMultiDataSets(JavaSparkContext sc, String path, List<int[]> featuresShape,
List<int[]> labelsShape) {
return validateMultiDataSets(sc, path, true, true, (featuresShape == null ? -1 : featuresShape.size()),
... | [
"public",
"static",
"ValidationResult",
"deleteInvalidMultiDataSets",
"(",
"JavaSparkContext",
"sc",
",",
"String",
"path",
",",
"List",
"<",
"int",
"[",
"]",
">",
"featuresShape",
",",
"List",
"<",
"int",
"[",
"]",
">",
"labelsShape",
")",
"{",
"return",
"v... | Validate MultiDataSet objects - <b>and delete any invalid MultiDataSets</b> - that have been previously saved
to the specified directory on HDFS by attempting to load them and checking their contents. Assumes MultiDataSets
were saved using {@link org.nd4j.linalg.dataset.MultiDataSet#save(OutputStream)}.<br>
This method... | [
"Validate",
"MultiDataSet",
"objects",
"-",
"<b",
">",
"and",
"delete",
"any",
"invalid",
"MultiDataSets<",
"/",
"b",
">",
"-",
"that",
"have",
"been",
"previously",
"saved",
"to",
"the",
"specified",
"directory",
"on",
"HDFS",
"by",
"attempting",
"to",
"loa... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/data/SparkDataValidation.java#L207-L211 |
mangstadt/biweekly | src/main/java/biweekly/io/ParseContext.java | ParseContext.addWarning | public void addWarning(int code, Object... args) {
"""
Adds a parse warning.
@param code the warning code
@param args the warning message arguments
"""
//@formatter:off
warnings.add(new ParseWarning.Builder(this)
.message(code, args)
.build());
//@formatter:on
} | java | public void addWarning(int code, Object... args) {
//@formatter:off
warnings.add(new ParseWarning.Builder(this)
.message(code, args)
.build());
//@formatter:on
} | [
"public",
"void",
"addWarning",
"(",
"int",
"code",
",",
"Object",
"...",
"args",
")",
"{",
"//@formatter:off",
"warnings",
".",
"add",
"(",
"new",
"ParseWarning",
".",
"Builder",
"(",
"this",
")",
".",
"message",
"(",
"code",
",",
"args",
")",
".",
"b... | Adds a parse warning.
@param code the warning code
@param args the warning message arguments | [
"Adds",
"a",
"parse",
"warning",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/ParseContext.java#L171-L177 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java | TasksImpl.addCollection | public TaskAddCollectionResult addCollection(String jobId, List<TaskAddParameter> value) {
"""
Adds a collection of tasks to the specified job.
Note that each task must have a unique ID. The Batch service may not return the results for each task in the same order the tasks were submitted in this request. If the s... | java | public TaskAddCollectionResult addCollection(String jobId, List<TaskAddParameter> value) {
return addCollectionWithServiceResponseAsync(jobId, value).toBlocking().single().body();
} | [
"public",
"TaskAddCollectionResult",
"addCollection",
"(",
"String",
"jobId",
",",
"List",
"<",
"TaskAddParameter",
">",
"value",
")",
"{",
"return",
"addCollectionWithServiceResponseAsync",
"(",
"jobId",
",",
"value",
")",
".",
"toBlocking",
"(",
")",
".",
"singl... | Adds a collection of tasks to the specified job.
Note that each task must have a unique ID. The Batch service may not return the results for each task in the same order the tasks were submitted in this request. If the server times out or the connection is closed during the request, the request may have been partially o... | [
"Adds",
"a",
"collection",
"of",
"tasks",
"to",
"the",
"specified",
"job",
".",
"Note",
"that",
"each",
"task",
"must",
"have",
"a",
"unique",
"ID",
".",
"The",
"Batch",
"service",
"may",
"not",
"return",
"the",
"results",
"for",
"each",
"task",
"in",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java#L666-L668 |
igniterealtime/Smack | smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java | OXInstantMessagingManager.decryptAndVerify | public OpenPgpMessage decryptAndVerify(OpenPgpElement element, OpenPgpContact sender)
throws SmackException.NotLoggedInException, PGPException, IOException, XmlPullParserException {
"""
Manually decrypt and verify an {@link OpenPgpElement}.
@param element encrypted, signed {@link OpenPgpElement}.
@... | java | public OpenPgpMessage decryptAndVerify(OpenPgpElement element, OpenPgpContact sender)
throws SmackException.NotLoggedInException, PGPException, IOException, XmlPullParserException {
OpenPgpMessage decrypted = openPgpManager.decryptOpenPgpElement(element, sender);
if (decrypted.getState() !=... | [
"public",
"OpenPgpMessage",
"decryptAndVerify",
"(",
"OpenPgpElement",
"element",
",",
"OpenPgpContact",
"sender",
")",
"throws",
"SmackException",
".",
"NotLoggedInException",
",",
"PGPException",
",",
"IOException",
",",
"XmlPullParserException",
"{",
"OpenPgpMessage",
... | Manually decrypt and verify an {@link OpenPgpElement}.
@param element encrypted, signed {@link OpenPgpElement}.
@param sender sender of the message.
@return decrypted, verified message
@throws SmackException.NotLoggedInException In case we are not logged in (we need our jid to access our keys)
@throws PGPException i... | [
"Manually",
"decrypt",
"and",
"verify",
"an",
"{",
"@link",
"OpenPgpElement",
"}",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java#L335-L344 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java | StringSupport.insert | public static String insert(String haystack, String needle, int index) {
"""
replaces the first occurrence of needle in haystack with newNeedle
@param haystack input string
@param needle string to place
@param index position to place
"""
StringBuffer val = new StringBuffer(haystack);
val.insert(inde... | java | public static String insert(String haystack, String needle, int index) {
StringBuffer val = new StringBuffer(haystack);
val.insert(index, needle);
return val.toString();
} | [
"public",
"static",
"String",
"insert",
"(",
"String",
"haystack",
",",
"String",
"needle",
",",
"int",
"index",
")",
"{",
"StringBuffer",
"val",
"=",
"new",
"StringBuffer",
"(",
"haystack",
")",
";",
"val",
".",
"insert",
"(",
"index",
",",
"needle",
")... | replaces the first occurrence of needle in haystack with newNeedle
@param haystack input string
@param needle string to place
@param index position to place | [
"replaces",
"the",
"first",
"occurrence",
"of",
"needle",
"in",
"haystack",
"with",
"newNeedle"
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L40-L44 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Security.java | Security.validatePassword | public static boolean validatePassword(BrokerSession session, String password) {
"""
Validates the current user's password.
@param session Broker session.
@param password Password.
@return True if the password is valid.
"""
password = encrypt(password, session.getServerCaps().getCipherKey());
... | java | public static boolean validatePassword(BrokerSession session, String password) {
password = encrypt(password, session.getServerCaps().getCipherKey());
return session.callRPCBool("RGCWFUSR VALIDPSW", password);
} | [
"public",
"static",
"boolean",
"validatePassword",
"(",
"BrokerSession",
"session",
",",
"String",
"password",
")",
"{",
"password",
"=",
"encrypt",
"(",
"password",
",",
"session",
".",
"getServerCaps",
"(",
")",
".",
"getCipherKey",
"(",
")",
")",
";",
"re... | Validates the current user's password.
@param session Broker session.
@param password Password.
@return True if the password is valid. | [
"Validates",
"the",
"current",
"user",
"s",
"password",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Security.java#L69-L72 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/Services.java | Services.deploymentUnitName | public static ServiceName deploymentUnitName(String parent, String name) {
"""
Get the service name of a subdeployment.
@param parent the parent deployment name
@param name the subdeployment name
@return the service name
"""
return JBOSS_DEPLOYMENT_SUB_UNIT.append(parent, name);
} | java | public static ServiceName deploymentUnitName(String parent, String name) {
return JBOSS_DEPLOYMENT_SUB_UNIT.append(parent, name);
} | [
"public",
"static",
"ServiceName",
"deploymentUnitName",
"(",
"String",
"parent",
",",
"String",
"name",
")",
"{",
"return",
"JBOSS_DEPLOYMENT_SUB_UNIT",
".",
"append",
"(",
"parent",
",",
"name",
")",
";",
"}"
] | Get the service name of a subdeployment.
@param parent the parent deployment name
@param name the subdeployment name
@return the service name | [
"Get",
"the",
"service",
"name",
"of",
"a",
"subdeployment",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/Services.java#L72-L74 |
janvanbesien/java-ipv6 | src/main/java/com/googlecode/ipv6/IPv6Address.java | IPv6Address.setBit | public IPv6Address setBit(final int bit) {
"""
Set a bit in the address.
@param bit to set (in the range [0, 127])
@return an address with the given bit set
"""
if (bit < 0 || bit > 127)
throw new IllegalArgumentException("can only set bits in the interval [0, 127]");
if (bit <... | java | public IPv6Address setBit(final int bit)
{
if (bit < 0 || bit > 127)
throw new IllegalArgumentException("can only set bits in the interval [0, 127]");
if (bit < 64)
{
return new IPv6Address(this.highBits, this.lowBits | (1L << bit));
}
else
{
... | [
"public",
"IPv6Address",
"setBit",
"(",
"final",
"int",
"bit",
")",
"{",
"if",
"(",
"bit",
"<",
"0",
"||",
"bit",
">",
"127",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"can only set bits in the interval [0, 127]\"",
")",
";",
"if",
"(",
"bit",
... | Set a bit in the address.
@param bit to set (in the range [0, 127])
@return an address with the given bit set | [
"Set",
"a",
"bit",
"in",
"the",
"address",
"."
] | train | https://github.com/janvanbesien/java-ipv6/blob/9af15b4a6c0074f9fa23dfa030027c631b9c2f78/src/main/java/com/googlecode/ipv6/IPv6Address.java#L334-L347 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java | Path3d.getPathIterator | @Pure
public PathIterator3f getPathIterator(Transform3D transform, double flatness) {
"""
Replies an iterator on the path elements.
<p>
Only {@link PathElementType#MOVE_TO},
{@link PathElementType#LINE_TO}, and
{@link PathElementType#CLOSE} types are returned by the iterator.
<p>
The amount of subdivision o... | java | @Pure
public PathIterator3f getPathIterator(Transform3D transform, double flatness) {
return new Path3f.FlatteningPathIterator3f(getWindingRule(), getPathIterator(transform), flatness, 10);
} | [
"@",
"Pure",
"public",
"PathIterator3f",
"getPathIterator",
"(",
"Transform3D",
"transform",
",",
"double",
"flatness",
")",
"{",
"return",
"new",
"Path3f",
".",
"FlatteningPathIterator3f",
"(",
"getWindingRule",
"(",
")",
",",
"getPathIterator",
"(",
"transform",
... | Replies an iterator on the path elements.
<p>
Only {@link PathElementType#MOVE_TO},
{@link PathElementType#LINE_TO}, and
{@link PathElementType#CLOSE} types are returned by the iterator.
<p>
The amount of subdivision of the curved segments is controlled by the
flatness parameter, which specifies the maximum distance th... | [
"Replies",
"an",
"iterator",
"on",
"the",
"path",
"elements",
".",
"<p",
">",
"Only",
"{",
"@link",
"PathElementType#MOVE_TO",
"}",
"{",
"@link",
"PathElementType#LINE_TO",
"}",
"and",
"{",
"@link",
"PathElementType#CLOSE",
"}",
"types",
"are",
"returned",
"by",... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java#L1789-L1792 |
keyboardsurfer/Crouton | library/src/main/java/de/keyboardsurfer/android/widget/crouton/Crouton.java | Crouton.showText | public static void showText(Activity activity, CharSequence text, Style style) {
"""
Creates a {@link Crouton} with provided text and style for a given activity
and displays it directly.
@param activity
The {@link android.app.Activity} that the {@link Crouton} should
be attached to.
@param text
The text yo... | java | public static void showText(Activity activity, CharSequence text, Style style) {
makeText(activity, text, style).show();
} | [
"public",
"static",
"void",
"showText",
"(",
"Activity",
"activity",
",",
"CharSequence",
"text",
",",
"Style",
"style",
")",
"{",
"makeText",
"(",
"activity",
",",
"text",
",",
"style",
")",
".",
"show",
"(",
")",
";",
"}"
] | Creates a {@link Crouton} with provided text and style for a given activity
and displays it directly.
@param activity
The {@link android.app.Activity} that the {@link Crouton} should
be attached to.
@param text
The text you want to display.
@param style
The style that this {@link Crouton} should be created with. | [
"Creates",
"a",
"{",
"@link",
"Crouton",
"}",
"with",
"provided",
"text",
"and",
"style",
"for",
"a",
"given",
"activity",
"and",
"displays",
"it",
"directly",
"."
] | train | https://github.com/keyboardsurfer/Crouton/blob/7806b15e4d52793e1f5aeaa4a55b1e220289e619/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Crouton.java#L377-L379 |
morimekta/providence | providence-reflect/src/main/java/net/morimekta/providence/reflect/util/RecursiveTypeRegistry.java | RecursiveTypeRegistry.registerInclude | public void registerInclude(String programName, RecursiveTypeRegistry registry) {
"""
Register a recursive included registry.
@param programName The program to be included.
@param registry The registry for the given program.
"""
if (registry == this) {
throw new IllegalArgumentException... | java | public void registerInclude(String programName, RecursiveTypeRegistry registry) {
if (registry == this) {
throw new IllegalArgumentException("Registering include back to itself: " + programName);
}
if (includes.containsKey(programName)) {
return;
}
include... | [
"public",
"void",
"registerInclude",
"(",
"String",
"programName",
",",
"RecursiveTypeRegistry",
"registry",
")",
"{",
"if",
"(",
"registry",
"==",
"this",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Registering include back to itself: \"",
"+",
"pro... | Register a recursive included registry.
@param programName The program to be included.
@param registry The registry for the given program. | [
"Register",
"a",
"recursive",
"included",
"registry",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-reflect/src/main/java/net/morimekta/providence/reflect/util/RecursiveTypeRegistry.java#L67-L75 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/CommonIronJacamarParser.java | CommonIronJacamarParser.storeValidation | protected void storeValidation(Validation v, XMLStreamWriter writer) throws Exception {
"""
Store validation
@param v The validation
@param writer The writer
@exception Exception Thrown if an error occurs
"""
writer.writeStartElement(CommonXML.ELEMENT_VALIDATION);
if (v.isValidateOnMatch() != n... | java | protected void storeValidation(Validation v, XMLStreamWriter writer) throws Exception
{
writer.writeStartElement(CommonXML.ELEMENT_VALIDATION);
if (v.isValidateOnMatch() != null)
{
writer.writeStartElement(CommonXML.ELEMENT_VALIDATE_ON_MATCH);
writer.writeCharacters(v.getValue(Co... | [
"protected",
"void",
"storeValidation",
"(",
"Validation",
"v",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"writer",
".",
"writeStartElement",
"(",
"CommonXML",
".",
"ELEMENT_VALIDATION",
")",
";",
"if",
"(",
"v",
".",
"isValidateOnMatch",
... | Store validation
@param v The validation
@param writer The writer
@exception Exception Thrown if an error occurs | [
"Store",
"validation"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/CommonIronJacamarParser.java#L1002-L1037 |
LevelFourAB/commons | commons-serialization/src/main/java/se/l4/commons/serialization/AbstractSerializerCollection.java | AbstractSerializerCollection.registerIfNamed | protected void registerIfNamed(Class<?> from, Serializer<?> serializer) {
"""
Register the given serializer if it has a name.
@param from
@param serializer
"""
if(from.isAnnotationPresent(Named.class))
{
Named named = from.getAnnotation(Named.class);
QualifiedName key = new QualifiedName(named.na... | java | protected void registerIfNamed(Class<?> from, Serializer<?> serializer)
{
if(from.isAnnotationPresent(Named.class))
{
Named named = from.getAnnotation(Named.class);
QualifiedName key = new QualifiedName(named.namespace(), named.name());
nameToSerializer.put(key, serializer);
serializerToName.put(serial... | [
"protected",
"void",
"registerIfNamed",
"(",
"Class",
"<",
"?",
">",
"from",
",",
"Serializer",
"<",
"?",
">",
"serializer",
")",
"{",
"if",
"(",
"from",
".",
"isAnnotationPresent",
"(",
"Named",
".",
"class",
")",
")",
"{",
"Named",
"named",
"=",
"fro... | Register the given serializer if it has a name.
@param from
@param serializer | [
"Register",
"the",
"given",
"serializer",
"if",
"it",
"has",
"a",
"name",
"."
] | train | https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-serialization/src/main/java/se/l4/commons/serialization/AbstractSerializerCollection.java#L248-L257 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java | CreateBuilderImpl.findNode | static String findNode(final List<String> children, final String path, final String protectedId) {
"""
Attempt to find the znode that matches the given path and protected id
@param children a list of candidates znodes
@param path the path
@param protectedId the protected id
@return the absolute pat... | java | static String findNode(final List<String> children, final String path, final String protectedId)
{
final String protectedPrefix = getProtectedPrefix(protectedId);
String foundNode = Iterables.find
(
children,
new Predicate<String>()
{
... | [
"static",
"String",
"findNode",
"(",
"final",
"List",
"<",
"String",
">",
"children",
",",
"final",
"String",
"path",
",",
"final",
"String",
"protectedId",
")",
"{",
"final",
"String",
"protectedPrefix",
"=",
"getProtectedPrefix",
"(",
"protectedId",
")",
";"... | Attempt to find the znode that matches the given path and protected id
@param children a list of candidates znodes
@param path the path
@param protectedId the protected id
@return the absolute path of the znode or <code>null</code> if it is not found | [
"Attempt",
"to",
"find",
"the",
"znode",
"that",
"matches",
"the",
"given",
"path",
"and",
"protected",
"id"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java#L823-L844 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/java/MdwJavaFileManager.java | MdwJavaFileManager.getJavaFileForOutput | public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling)
throws IOException {
"""
Create a new Java file object which will be used by the compiler to
store the generated byte code. Also add a reference to the object to the
cache so it can be accessed by o... | java | public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling)
throws IOException {
if (logger.isMdwDebugEnabled())
logger.mdwDebug("Loading Dynamic Java byte code from: " + (sibling == null ? null : sibling.toUri()));
try {
Jav... | [
"public",
"JavaFileObject",
"getJavaFileForOutput",
"(",
"Location",
"location",
",",
"String",
"className",
",",
"Kind",
"kind",
",",
"FileObject",
"sibling",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logger",
".",
"isMdwDebugEnabled",
"(",
")",
")",
"logg... | Create a new Java file object which will be used by the compiler to
store the generated byte code. Also add a reference to the object to the
cache so it can be accessed by other parts of the application. | [
"Create",
"a",
"new",
"Java",
"file",
"object",
"which",
"will",
"be",
"used",
"by",
"the",
"compiler",
"to",
"store",
"the",
"generated",
"byte",
"code",
".",
"Also",
"add",
"a",
"reference",
"to",
"the",
"object",
"to",
"the",
"cache",
"so",
"it",
"c... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/java/MdwJavaFileManager.java#L55-L68 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraDataTranslator.java | CassandraDataTranslator.marshalCollection | public static Collection marshalCollection(Class cassandraTypeClazz, Collection result, Class clazz, Class resultTypeClass) {
"""
Marshal collection.
@param cassandraTypeClazz
the cassandra type clazz
@param result
the result
@param clazz
the clazz
@return the collection
"""
Collection mappedC... | java | public static Collection marshalCollection(Class cassandraTypeClazz, Collection result, Class clazz, Class resultTypeClass)
{
Collection mappedCollection = result;
if (cassandraTypeClazz.isAssignableFrom(BytesType.class))
{
mappedCollection = (Collection) PropertyAccessorHelper.... | [
"public",
"static",
"Collection",
"marshalCollection",
"(",
"Class",
"cassandraTypeClazz",
",",
"Collection",
"result",
",",
"Class",
"clazz",
",",
"Class",
"resultTypeClass",
")",
"{",
"Collection",
"mappedCollection",
"=",
"result",
";",
"if",
"(",
"cassandraTypeC... | Marshal collection.
@param cassandraTypeClazz
the cassandra type clazz
@param result
the result
@param clazz
the clazz
@return the collection | [
"Marshal",
"collection",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraDataTranslator.java#L605-L620 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java | FilterTable.writeTagNoClear | void writeTagNoClear(long bucketIndex, int posInBucket, long tag) {
"""
Writes a tag to a bucket position. Faster than regular write because it
assumes tag starts with all zeros, but doesn't work properly if the
position wasn't empty.
"""
long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
// BI... | java | void writeTagNoClear(long bucketIndex, int posInBucket, long tag) {
long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
// BIT BANGIN YEAAAARRHHHGGGHHH
for (int i = 0; i < bitsPerTag; i++) {
// second arg just does bit test in tag
if ((tag & (1L << i)) != 0) {
memBlock.set(tagStartIdx + i);... | [
"void",
"writeTagNoClear",
"(",
"long",
"bucketIndex",
",",
"int",
"posInBucket",
",",
"long",
"tag",
")",
"{",
"long",
"tagStartIdx",
"=",
"getTagOffset",
"(",
"bucketIndex",
",",
"posInBucket",
")",
";",
"// BIT BANGIN YEAAAARRHHHGGGHHH\r",
"for",
"(",
"int",
... | Writes a tag to a bucket position. Faster than regular write because it
assumes tag starts with all zeros, but doesn't work properly if the
position wasn't empty. | [
"Writes",
"a",
"tag",
"to",
"a",
"bucket",
"position",
".",
"Faster",
"than",
"regular",
"write",
"because",
"it",
"assumes",
"tag",
"starts",
"with",
"all",
"zeros",
"but",
"doesn",
"t",
"work",
"properly",
"if",
"the",
"position",
"wasn",
"t",
"empty",
... | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java#L237-L246 |
performancecopilot/parfait | parfait-core/src/main/java/io/pcp/parfait/timing/ThreadContext.java | ThreadContext.put | public void put(String key, Object value) {
"""
Adds the given key/value pair to the current thread's context, and updates {@link MdcBridge} with
same.
"""
PER_THREAD_CONTEXTS.getUnchecked(Thread.currentThread()).put(key, value);
mdcBridge.put(key, value);
} | java | public void put(String key, Object value) {
PER_THREAD_CONTEXTS.getUnchecked(Thread.currentThread()).put(key, value);
mdcBridge.put(key, value);
} | [
"public",
"void",
"put",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"PER_THREAD_CONTEXTS",
".",
"getUnchecked",
"(",
"Thread",
".",
"currentThread",
"(",
")",
")",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"mdcBridge",
".",
"put",
"(... | Adds the given key/value pair to the current thread's context, and updates {@link MdcBridge} with
same. | [
"Adds",
"the",
"given",
"key",
"/",
"value",
"pair",
"to",
"the",
"current",
"thread",
"s",
"context",
"and",
"updates",
"{"
] | train | https://github.com/performancecopilot/parfait/blob/33ed3aaa96ee3e0ab4c45791a7bd3e5cd443e94b/parfait-core/src/main/java/io/pcp/parfait/timing/ThreadContext.java#L73-L76 |
threerings/narya | core/src/main/java/com/threerings/io/ObjectOutputStream.java | ObjectOutputStream.writeBareObject | protected void writeBareObject (Object obj, Streamer streamer, boolean useWriter)
throws IOException {
"""
Write a {@link Streamable} instance without associated class metadata.
"""
_current = obj;
_streamer = streamer;
try {
_streamer.writeObject(obj, this, useWrite... | java | protected void writeBareObject (Object obj, Streamer streamer, boolean useWriter)
throws IOException
{
_current = obj;
_streamer = streamer;
try {
_streamer.writeObject(obj, this, useWriter);
} finally {
_current = null;
_streamer = null;
... | [
"protected",
"void",
"writeBareObject",
"(",
"Object",
"obj",
",",
"Streamer",
"streamer",
",",
"boolean",
"useWriter",
")",
"throws",
"IOException",
"{",
"_current",
"=",
"obj",
";",
"_streamer",
"=",
"streamer",
";",
"try",
"{",
"_streamer",
".",
"writeObjec... | Write a {@link Streamable} instance without associated class metadata. | [
"Write",
"a",
"{"
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectOutputStream.java#L268-L279 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ArrayUtils.java | ArrayUtils.scaleArray | public static void scaleArray(final double[] array, final double factor) {
"""
Multiplies elements of array by specified factor
@param array of elements to scale
@param factor to scale by
"""
for(int i = 0; i < array.length; i++){
array[i] *= factor;
}
} | java | public static void scaleArray(final double[] array, final double factor){
for(int i = 0; i < array.length; i++){
array[i] *= factor;
}
} | [
"public",
"static",
"void",
"scaleArray",
"(",
"final",
"double",
"[",
"]",
"array",
",",
"final",
"double",
"factor",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"array",
"[",
"i",... | Multiplies elements of array by specified factor
@param array of elements to scale
@param factor to scale by | [
"Multiplies",
"elements",
"of",
"array",
"by",
"specified",
"factor"
] | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ArrayUtils.java#L119-L123 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createMessageReceiverFromEntityPath | public static IMessageReceiver createMessageReceiverFromEntityPath(MessagingFactory messagingFactory, String entityPath, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException {
"""
Creates a message receiver to the entity.
@param messagingFactory messaging factory (which represents a connectio... | java | public static IMessageReceiver createMessageReceiverFromEntityPath(MessagingFactory messagingFactory, String entityPath, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException {
return Utils.completeFuture(createMessageReceiverFromEntityPathAsync(messagingFactory, entityPath, receiveMode));
... | [
"public",
"static",
"IMessageReceiver",
"createMessageReceiverFromEntityPath",
"(",
"MessagingFactory",
"messagingFactory",
",",
"String",
"entityPath",
",",
"ReceiveMode",
"receiveMode",
")",
"throws",
"InterruptedException",
",",
"ServiceBusException",
"{",
"return",
"Utils... | Creates a message receiver to the entity.
@param messagingFactory messaging factory (which represents a connection) on which receiver needs to be created
@param entityPath path of the entity
@param receiveMode PeekLock or ReceiveAndDelete
@return IMessageReceiver instance
@throws InterruptedException if the current thr... | [
"Creates",
"a",
"message",
"receiver",
"to",
"the",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L347-L349 |
Wikidata/Wikidata-Toolkit | wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java | Datamodel.makeQuantityValue | public static QuantityValue makeQuantityValue(BigDecimal numericValue, String unit) {
"""
Creates a {@link QuantityValue} without bounds.
@param numericValue
the numeric value of this quantity
@param unit
the unit identifier to use for this quantity
@return a {@link QuantityValue} corresponding to the input... | java | public static QuantityValue makeQuantityValue(BigDecimal numericValue, String unit) {
return factory.getQuantityValue(numericValue, unit);
} | [
"public",
"static",
"QuantityValue",
"makeQuantityValue",
"(",
"BigDecimal",
"numericValue",
",",
"String",
"unit",
")",
"{",
"return",
"factory",
".",
"getQuantityValue",
"(",
"numericValue",
",",
"unit",
")",
";",
"}"
] | Creates a {@link QuantityValue} without bounds.
@param numericValue
the numeric value of this quantity
@param unit
the unit identifier to use for this quantity
@return a {@link QuantityValue} corresponding to the input | [
"Creates",
"a",
"{",
"@link",
"QuantityValue",
"}",
"without",
"bounds",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java#L366-L368 |
JodaOrg/joda-money | src/main/java/org/joda/money/CurrencyUnit.java | CurrencyUnit.registerCurrency | public static synchronized CurrencyUnit registerCurrency(
String currencyCode, int numericCurrencyCode, int decimalPlaces, List<String> countryCodes) {
"""
Registers a currency and associated countries allowing it to be used.
<p>
This class only permits known currencies to be returned.
To achieve t... | java | public static synchronized CurrencyUnit registerCurrency(
String currencyCode, int numericCurrencyCode, int decimalPlaces, List<String> countryCodes) {
return registerCurrency(currencyCode, numericCurrencyCode, decimalPlaces, countryCodes, false);
} | [
"public",
"static",
"synchronized",
"CurrencyUnit",
"registerCurrency",
"(",
"String",
"currencyCode",
",",
"int",
"numericCurrencyCode",
",",
"int",
"decimalPlaces",
",",
"List",
"<",
"String",
">",
"countryCodes",
")",
"{",
"return",
"registerCurrency",
"(",
"curr... | Registers a currency and associated countries allowing it to be used.
<p>
This class only permits known currencies to be returned.
To achieve this, all currencies have to be registered in advance.
<p>
Since this method is public, it is possible to add currencies in
application code. It is recommended to do this only at... | [
"Registers",
"a",
"currency",
"and",
"associated",
"countries",
"allowing",
"it",
"to",
"be",
"used",
".",
"<p",
">",
"This",
"class",
"only",
"permits",
"known",
"currencies",
"to",
"be",
"returned",
".",
"To",
"achieve",
"this",
"all",
"currencies",
"have"... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/CurrencyUnit.java#L161-L164 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java | AbstractMessageHandler.writeErrorResponse | protected static void writeErrorResponse(final Channel channel, final ManagementRequestHeader header, final Throwable error) throws IOException {
"""
Write an error response.
@param channel the channel
@param header the request
@param error the error
@throws IOException
"""
final ManagementRespon... | java | protected static void writeErrorResponse(final Channel channel, final ManagementRequestHeader header, final Throwable error) throws IOException {
final ManagementResponseHeader response = ManagementResponseHeader.create(header, error);
final MessageOutputStream output = channel.writeMessage();
t... | [
"protected",
"static",
"void",
"writeErrorResponse",
"(",
"final",
"Channel",
"channel",
",",
"final",
"ManagementRequestHeader",
"header",
",",
"final",
"Throwable",
"error",
")",
"throws",
"IOException",
"{",
"final",
"ManagementResponseHeader",
"response",
"=",
"Ma... | Write an error response.
@param channel the channel
@param header the request
@param error the error
@throws IOException | [
"Write",
"an",
"error",
"response",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L507-L516 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java | PrimaveraReader.processCalendarDays | private void processCalendarDays(ProjectCalendar calendar, Record root) {
"""
Process calendar days of the week.
@param calendar project calendar
@param root calendar data
"""
// Retrieve working hours ...
Record daysOfWeek = root.getChild("DaysOfWeek");
if (daysOfWeek != null)
{
... | java | private void processCalendarDays(ProjectCalendar calendar, Record root)
{
// Retrieve working hours ...
Record daysOfWeek = root.getChild("DaysOfWeek");
if (daysOfWeek != null)
{
for (Record dayRecord : daysOfWeek.getChildren())
{
processCalendarHours(calendar, d... | [
"private",
"void",
"processCalendarDays",
"(",
"ProjectCalendar",
"calendar",
",",
"Record",
"root",
")",
"{",
"// Retrieve working hours ...",
"Record",
"daysOfWeek",
"=",
"root",
".",
"getChild",
"(",
"\"DaysOfWeek\"",
")",
";",
"if",
"(",
"daysOfWeek",
"!=",
"n... | Process calendar days of the week.
@param calendar project calendar
@param root calendar data | [
"Process",
"calendar",
"days",
"of",
"the",
"week",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L362-L373 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixOverriddenFinal | @Fix(IssueCodes.OVERRIDDEN_FINAL)
public void fixOverriddenFinal(Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Override final operation".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
final MultiModification modifications = new MultiModification(
this, iss... | java | @Fix(IssueCodes.OVERRIDDEN_FINAL)
public void fixOverriddenFinal(Issue issue, IssueResolutionAcceptor acceptor) {
final MultiModification modifications = new MultiModification(
this, issue, acceptor,
Messages.SARLQuickfixProvider_0,
Messages.SARLQuickfixProvider_1);
modifications.bind(XtendTypeDeclarat... | [
"@",
"Fix",
"(",
"IssueCodes",
".",
"OVERRIDDEN_FINAL",
")",
"public",
"void",
"fixOverriddenFinal",
"(",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"final",
"MultiModification",
"modifications",
"=",
"new",
"MultiModification",
"(",
"th... | Quick fix for "Override final operation".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Override",
"final",
"operation",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L750-L758 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java | OracleNoSQLClient.addOps | private void addOps(Map<Key, List<TableOperation>> operations, Table schemaTable, Row row) {
"""
Adds the ops.
@param operations
the operations
@param schemaTable
the schema table
@param row
the row
"""
Key key = ((TableImpl) schemaTable).createKey(row, false);
TableOperation ops = tab... | java | private void addOps(Map<Key, List<TableOperation>> operations, Table schemaTable, Row row)
{
Key key = ((TableImpl) schemaTable).createKey(row, false);
TableOperation ops = tableAPI.getTableOperationFactory().createPut(row, Choice.NONE, true);
if (operations.containsKey(key))
{
... | [
"private",
"void",
"addOps",
"(",
"Map",
"<",
"Key",
",",
"List",
"<",
"TableOperation",
">",
">",
"operations",
",",
"Table",
"schemaTable",
",",
"Row",
"row",
")",
"{",
"Key",
"key",
"=",
"(",
"(",
"TableImpl",
")",
"schemaTable",
")",
".",
"createKe... | Adds the ops.
@param operations
the operations
@param schemaTable
the schema table
@param row
the row | [
"Adds",
"the",
"ops",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java#L429-L446 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.containsValueForMethodArgument | @Internal
@UsedByGeneratedCode
protected final boolean containsValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex) {
"""
Obtains a value for the given method argument.
@param resolutionContext The resolution context
@param context ... | java | @Internal
@UsedByGeneratedCode
protected final boolean containsValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex) {
if (context instanceof ApplicationContext) {
MethodInjectionPoint injectionPoint = methodInjectionPoints.get(me... | [
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"final",
"boolean",
"containsValueForMethodArgument",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"int",
"methodIndex",
",",
"int",
"argIndex",
")",
"{",
"if",
"(",
"c... | Obtains a value for the given method argument.
@param resolutionContext The resolution context
@param context The bean context
@param methodIndex The method index
@param argIndex The argument index
@return The value | [
"Obtains",
"a",
"value",
"for",
"the",
"given",
"method",
"argument",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L796-L826 |
neo4j/neo4j-java-driver | driver/src/main/java/org/neo4j/driver/GraphDatabase.java | GraphDatabase.routingDriver | public static Driver routingDriver( Iterable<URI> routingUris, AuthToken authToken, Config config ) {
"""
Try to create a neo4j driver from the <b>first</b> available address.
This is wrapper for the {@link #driver} method that finds the <b>first</b>
server to respond positively.
@param routingUris an {@link ... | java | public static Driver routingDriver( Iterable<URI> routingUris, AuthToken authToken, Config config )
{
assertRoutingUris( routingUris );
Logger log = createLogger( config );
for ( URI uri : routingUris )
{
try
{
return driver( uri, authToken, c... | [
"public",
"static",
"Driver",
"routingDriver",
"(",
"Iterable",
"<",
"URI",
">",
"routingUris",
",",
"AuthToken",
"authToken",
",",
"Config",
"config",
")",
"{",
"assertRoutingUris",
"(",
"routingUris",
")",
";",
"Logger",
"log",
"=",
"createLogger",
"(",
"con... | Try to create a neo4j driver from the <b>first</b> available address.
This is wrapper for the {@link #driver} method that finds the <b>first</b>
server to respond positively.
@param routingUris an {@link Iterable} of server {@link URI}s for Neo4j instances. All given URIs should
have 'neo4j' scheme.
@param authToken a... | [
"Try",
"to",
"create",
"a",
"neo4j",
"driver",
"from",
"the",
"<b",
">",
"first<",
"/",
"b",
">",
"available",
"address",
".",
"This",
"is",
"wrapper",
"for",
"the",
"{",
"@link",
"#driver",
"}",
"method",
"that",
"finds",
"the",
"<b",
">",
"first<",
... | train | https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/GraphDatabase.java#L150-L168 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java | LayoutParser.parseXML | public XMLNode parseXML(String root) throws DocFileIOException, SimpleDocletException {
"""
Parse the XML specifying the layout of the documentation.
@param root the name of the desired node
@return the list of XML elements parsed.
@throws DocFileIOException if there is a problem reading a user-supplied build... | java | public XMLNode parseXML(String root) throws DocFileIOException, SimpleDocletException {
if (!xmlElementsMap.containsKey(root)) {
try {
currentRoot = root;
isParsing = false;
SAXParserFactory factory = SAXParserFactory.newInstance();
SAX... | [
"public",
"XMLNode",
"parseXML",
"(",
"String",
"root",
")",
"throws",
"DocFileIOException",
",",
"SimpleDocletException",
"{",
"if",
"(",
"!",
"xmlElementsMap",
".",
"containsKey",
"(",
"root",
")",
")",
"{",
"try",
"{",
"currentRoot",
"=",
"root",
";",
"is... | Parse the XML specifying the layout of the documentation.
@param root the name of the desired node
@return the list of XML elements parsed.
@throws DocFileIOException if there is a problem reading a user-supplied build file
@throws SimpleDocletException if there is a problem reading the system build file | [
"Parse",
"the",
"XML",
"specifying",
"the",
"layout",
"of",
"the",
"documentation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java#L86-L105 |
code4everything/util | src/main/java/com/zhazhapan/util/Formatter.java | Formatter.stringToCustomDateTime | public static Date stringToCustomDateTime(SimpleDateFormat sdf, String datetime) throws ParseException {
"""
将字符串转换成自定义格式的日期
@param datetime 日期格式的字符串
@param sdf 自定义的格式
@return 自定义格式的日期
@throws ParseException 异常
"""
return sdf.parse(datetime.trim());
} | java | public static Date stringToCustomDateTime(SimpleDateFormat sdf, String datetime) throws ParseException {
return sdf.parse(datetime.trim());
} | [
"public",
"static",
"Date",
"stringToCustomDateTime",
"(",
"SimpleDateFormat",
"sdf",
",",
"String",
"datetime",
")",
"throws",
"ParseException",
"{",
"return",
"sdf",
".",
"parse",
"(",
"datetime",
".",
"trim",
"(",
")",
")",
";",
"}"
] | 将字符串转换成自定义格式的日期
@param datetime 日期格式的字符串
@param sdf 自定义的格式
@return 自定义格式的日期
@throws ParseException 异常 | [
"将字符串转换成自定义格式的日期"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Formatter.java#L552-L554 |
SonarSource/sonarqube | server/sonar-server-common/src/main/java/org/sonar/server/rule/index/RuleIndexer.java | RuleIndexer.commitAndIndex | public void commitAndIndex(DbSession dbSession, int ruleId, OrganizationDto organization) {
"""
Commit a change on a rule and its extension on the given organization
"""
List<EsQueueDto> items = asList(createQueueDtoForRule(ruleId), createQueueDtoForRuleExtension(ruleId, organization));
dbClient.esQueu... | java | public void commitAndIndex(DbSession dbSession, int ruleId, OrganizationDto organization) {
List<EsQueueDto> items = asList(createQueueDtoForRule(ruleId), createQueueDtoForRuleExtension(ruleId, organization));
dbClient.esQueueDao().insert(dbSession, items);
dbSession.commit();
postCommit(dbSession, item... | [
"public",
"void",
"commitAndIndex",
"(",
"DbSession",
"dbSession",
",",
"int",
"ruleId",
",",
"OrganizationDto",
"organization",
")",
"{",
"List",
"<",
"EsQueueDto",
">",
"items",
"=",
"asList",
"(",
"createQueueDtoForRule",
"(",
"ruleId",
")",
",",
"createQueue... | Commit a change on a rule and its extension on the given organization | [
"Commit",
"a",
"change",
"on",
"a",
"rule",
"and",
"its",
"extension",
"on",
"the",
"given",
"organization"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server-common/src/main/java/org/sonar/server/rule/index/RuleIndexer.java#L105-L110 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java | ContainerGroupsInner.beginRestart | public void beginRestart(String resourceGroupName, String containerGroupName) {
"""
Restarts all containers in a container group.
Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.
@param resourceGroupName The name of the resource group.
@param... | java | public void beginRestart(String resourceGroupName, String containerGroupName) {
beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body();
} | [
"public",
"void",
"beginRestart",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
")",
"{",
"beginRestartWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerGroupName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",... | Restarts all containers in a container group.
Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@throws IllegalArgumentException thrown ... | [
"Restarts",
"all",
"containers",
"in",
"a",
"container",
"group",
".",
"Restarts",
"all",
"containers",
"in",
"a",
"container",
"group",
"in",
"place",
".",
"If",
"container",
"image",
"has",
"updates",
"new",
"image",
"will",
"be",
"downloaded",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java#L893-L895 |
JOML-CI/JOML | src/org/joml/sampling/StratifiedSampling.java | StratifiedSampling.generateCentered | public void generateCentered(int n, float centering, Callback2d callback) {
"""
Generate <code>n * n</code> random sample positions in the unit square of <code>x, y = [-1..+1]</code>.
<p>
Each sample within its stratum is confined to be within <code>[-centering/2..1-centering]</code> of its stratum.
@param n
... | java | public void generateCentered(int n, float centering, Callback2d callback) {
float start = centering * 0.5f;
float end = 1.0f - centering;
for (int y = 0; y < n; y++) {
for (int x = 0; x < n; x++) {
float sampleX = ((start + rnd.nextFloat() * end) / n + (float) x / n) ... | [
"public",
"void",
"generateCentered",
"(",
"int",
"n",
",",
"float",
"centering",
",",
"Callback2d",
"callback",
")",
"{",
"float",
"start",
"=",
"centering",
"*",
"0.5f",
";",
"float",
"end",
"=",
"1.0f",
"-",
"centering",
";",
"for",
"(",
"int",
"y",
... | Generate <code>n * n</code> random sample positions in the unit square of <code>x, y = [-1..+1]</code>.
<p>
Each sample within its stratum is confined to be within <code>[-centering/2..1-centering]</code> of its stratum.
@param n
the number of strata in each dimension
@param centering
determines how much the random sa... | [
"Generate",
"<code",
">",
"n",
"*",
"n<",
"/",
"code",
">",
"random",
"sample",
"positions",
"in",
"the",
"unit",
"square",
"of",
"<code",
">",
"x",
"y",
"=",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
">",
".",
"<p",
">",
"Each",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/sampling/StratifiedSampling.java#L81-L91 |
aws/aws-sdk-java | aws-java-sdk-events/src/main/java/com/amazonaws/services/cloudwatchevents/model/InputTransformer.java | InputTransformer.withInputPathsMap | public InputTransformer withInputPathsMap(java.util.Map<String, String> inputPathsMap) {
"""
<p>
Map of JSON paths to be extracted from the event. You can then insert these in the template in
<code>InputTemplate</code> to produce the output you want to be sent to the target.
</p>
<p>
<code>InputPathsMap</code... | java | public InputTransformer withInputPathsMap(java.util.Map<String, String> inputPathsMap) {
setInputPathsMap(inputPathsMap);
return this;
} | [
"public",
"InputTransformer",
"withInputPathsMap",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"inputPathsMap",
")",
"{",
"setInputPathsMap",
"(",
"inputPathsMap",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Map of JSON paths to be extracted from the event. You can then insert these in the template in
<code>InputTemplate</code> to produce the output you want to be sent to the target.
</p>
<p>
<code>InputPathsMap</code> is an array key-value pairs, where each value is a valid JSON path. You can have as
many as 10 key-va... | [
"<p",
">",
"Map",
"of",
"JSON",
"paths",
"to",
"be",
"extracted",
"from",
"the",
"event",
".",
"You",
"can",
"then",
"insert",
"these",
"in",
"the",
"template",
"in",
"<code",
">",
"InputTemplate<",
"/",
"code",
">",
"to",
"produce",
"the",
"output",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-events/src/main/java/com/amazonaws/services/cloudwatchevents/model/InputTransformer.java#L187-L190 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsHistoryDriver.java | CmsHistoryDriver.internalCountProperties | protected int internalCountProperties(CmsDbContext dbc, CmsPropertyDefinition metadef, CmsUUID projectId)
throws CmsDataAccessException {
"""
Returns the amount of properties for a propertydefinition.<p>
@param dbc the current database context
@param metadef the propertydefinition to test
@param projectId... | java | protected int internalCountProperties(CmsDbContext dbc, CmsPropertyDefinition metadef, CmsUUID projectId)
throws CmsDataAccessException {
ResultSet res = null;
PreparedStatement stmt = null;
Connection conn = null;
int returnValue;
try {
// create statement
... | [
"protected",
"int",
"internalCountProperties",
"(",
"CmsDbContext",
"dbc",
",",
"CmsPropertyDefinition",
"metadef",
",",
"CmsUUID",
"projectId",
")",
"throws",
"CmsDataAccessException",
"{",
"ResultSet",
"res",
"=",
"null",
";",
"PreparedStatement",
"stmt",
"=",
"null... | Returns the amount of properties for a propertydefinition.<p>
@param dbc the current database context
@param metadef the propertydefinition to test
@param projectId the ID of the current project
@return the amount of properties for a propertydefinition
@throws CmsDataAccessException if something goes wrong | [
"Returns",
"the",
"amount",
"of",
"properties",
"for",
"a",
"propertydefinition",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsHistoryDriver.java#L1655-L1687 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeBoolean | public void writeBoolean(OutputStream out, boolean value) throws IOException {
"""
Encode a boolean value as JSON. An array is used to wrap the value:
[ true | false ]
@param out The stream to write JSON to
@param value The boolean value to encode
@throws IOException If an I/O error occurs
@see #readBoolean... | java | public void writeBoolean(OutputStream out, boolean value) throws IOException {
writeStartArray(out);
writeBooleanInternal(out, value);
writeEndArray(out);
} | [
"public",
"void",
"writeBoolean",
"(",
"OutputStream",
"out",
",",
"boolean",
"value",
")",
"throws",
"IOException",
"{",
"writeStartArray",
"(",
"out",
")",
";",
"writeBooleanInternal",
"(",
"out",
",",
"value",
")",
";",
"writeEndArray",
"(",
"out",
")",
"... | Encode a boolean value as JSON. An array is used to wrap the value:
[ true | false ]
@param out The stream to write JSON to
@param value The boolean value to encode
@throws IOException If an I/O error occurs
@see #readBoolean(InputStream) | [
"Encode",
"a",
"boolean",
"value",
"as",
"JSON",
".",
"An",
"array",
"is",
"used",
"to",
"wrap",
"the",
"value",
":",
"[",
"true",
"|",
"false",
"]"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L714-L718 |
overturetool/overture | core/interpreter/src/main/java/org/overture/interpreter/assistant/expression/PExpAssistantInterpreter.java | PExpAssistantInterpreter.findExpression | public PExp findExpression(PExp exp, int lineno) {
"""
Find an expression starting on the given line. Single expressions just compare their location to lineno, but
expressions with sub-expressions iterate over their branches.
@param exp
@param lineno
The line number to locate.
@return An expression starting... | java | public PExp findExpression(PExp exp, int lineno)
{
try
{
return exp.apply(af.getExpExpressionFinder(), lineno);// FIXME: should we handle exceptions like this
} catch (AnalysisException e)
{
return null; // Most have none
}
} | [
"public",
"PExp",
"findExpression",
"(",
"PExp",
"exp",
",",
"int",
"lineno",
")",
"{",
"try",
"{",
"return",
"exp",
".",
"apply",
"(",
"af",
".",
"getExpExpressionFinder",
"(",
")",
",",
"lineno",
")",
";",
"// FIXME: should we handle exceptions like this",
"... | Find an expression starting on the given line. Single expressions just compare their location to lineno, but
expressions with sub-expressions iterate over their branches.
@param exp
@param lineno
The line number to locate.
@return An expression starting on the line, or null. | [
"Find",
"an",
"expression",
"starting",
"on",
"the",
"given",
"line",
".",
"Single",
"expressions",
"just",
"compare",
"their",
"location",
"to",
"lineno",
"but",
"expressions",
"with",
"sub",
"-",
"expressions",
"iterate",
"over",
"their",
"branches",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/interpreter/src/main/java/org/overture/interpreter/assistant/expression/PExpAssistantInterpreter.java#L55-L64 |
dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java | Category.of | public static Category of(String description, Setting... settings) {
"""
Creates a new category from settings, if the settings shouldn't be individually grouped.
@param description Category name, for display in {@link CategoryView}
@param settings {@link Setting} to be shown in the {@link CategoryView}
@re... | java | public static Category of(String description, Setting... settings) {
return new Category(description, Group.of(settings));
} | [
"public",
"static",
"Category",
"of",
"(",
"String",
"description",
",",
"Setting",
"...",
"settings",
")",
"{",
"return",
"new",
"Category",
"(",
"description",
",",
"Group",
".",
"of",
"(",
"settings",
")",
")",
";",
"}"
] | Creates a new category from settings, if the settings shouldn't be individually grouped.
@param description Category name, for display in {@link CategoryView}
@param settings {@link Setting} to be shown in the {@link CategoryView}
@return initialized Category object | [
"Creates",
"a",
"new",
"category",
"from",
"settings",
"if",
"the",
"settings",
"shouldn",
"t",
"be",
"individually",
"grouped",
"."
] | train | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java#L92-L94 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.getValue | @Override
public Object getValue(Object id, String template, boolean askPermission, boolean ignoreCounting) {
"""
Returns the value to which this map maps the specified cache id. Returns
<tt>null</tt> if the map contains no mapping for this key.
@param id cache id whose associated value is to be returned.
... | java | @Override
public Object getValue(Object id, String template, boolean askPermission, boolean ignoreCounting) {
final String methodName = "getValue()";
Object value = null;
com.ibm.websphere.cache.CacheEntry ce = this.coreCache.get(id);
if (ce != null) {
value = ce.getValue... | [
"@",
"Override",
"public",
"Object",
"getValue",
"(",
"Object",
"id",
",",
"String",
"template",
",",
"boolean",
"askPermission",
",",
"boolean",
"ignoreCounting",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"getValue()\"",
";",
"Object",
"value",
"=",
"... | Returns the value to which this map maps the specified cache id. Returns
<tt>null</tt> if the map contains no mapping for this key.
@param id cache id whose associated value is to be returned.
@param template template name associated with cache id (No effect on CoreCache)
@param askPermission True implies that executi... | [
"Returns",
"the",
"value",
"to",
"which",
"this",
"map",
"maps",
"the",
"specified",
"cache",
"id",
".",
"Returns",
"<tt",
">",
"null<",
"/",
"tt",
">",
"if",
"the",
"map",
"contains",
"no",
"mapping",
"for",
"this",
"key",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L415-L427 |
adamfisk/littleshoot-commons-id | src/main/java/org/apache/commons/id/uuid/UUID.java | UUID.nameUUIDFromString | public static UUID nameUUIDFromString(String name, UUID namespace, String encoding) {
"""
<p>Returns a new version three (MD5) or five (SHA-1) UUID, using the specified encoding
given a name and the namespace's UUID.</p>
@param name String the name to calculate the UUID for.
@param namespace UUID assigned to ... | java | public static UUID nameUUIDFromString(String name, UUID namespace, String encoding) {
byte[] nameAsBytes = name.getBytes();
byte[] concat = new byte[UUID_BYTE_LENGTH + nameAsBytes.length];
System.arraycopy(namespace.getRawBytes(), 0, concat, 0, UUID_BYTE_LENGTH);
System.arraycopy(nameAsBytes, 0, concat, UUID_BY... | [
"public",
"static",
"UUID",
"nameUUIDFromString",
"(",
"String",
"name",
",",
"UUID",
"namespace",
",",
"String",
"encoding",
")",
"{",
"byte",
"[",
"]",
"nameAsBytes",
"=",
"name",
".",
"getBytes",
"(",
")",
";",
"byte",
"[",
"]",
"concat",
"=",
"new",
... | <p>Returns a new version three (MD5) or five (SHA-1) UUID, using the specified encoding
given a name and the namespace's UUID.</p>
@param name String the name to calculate the UUID for.
@param namespace UUID assigned to this namespace.
@param encoding The encoding to use, either #{link UUID.MD5_ENCODING} or #{link UUI... | [
"<p",
">",
"Returns",
"a",
"new",
"version",
"three",
"(",
"MD5",
")",
"or",
"five",
"(",
"SHA",
"-",
"1",
")",
"UUID",
"using",
"the",
"specified",
"encoding",
"given",
"a",
"name",
"and",
"the",
"namespace",
"s",
"UUID",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/adamfisk/littleshoot-commons-id/blob/49a8f5f2b10831c509876ca463bf1a87e1e49ae9/src/main/java/org/apache/commons/id/uuid/UUID.java#L429-L461 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/search/PathFinder.java | PathFinder.getRelativePath | public static File getRelativePath(final File parent, final String... folders) {
"""
Gets the file or directory from the given parent File object and the relative path given over
the list as String objects.
@param parent
The parent directory.
@param folders
The list with the directories and optional a filen... | java | public static File getRelativePath(final File parent, final String... folders)
{
return getRelativePathTo(parent, Arrays.asList(folders));
} | [
"public",
"static",
"File",
"getRelativePath",
"(",
"final",
"File",
"parent",
",",
"final",
"String",
"...",
"folders",
")",
"{",
"return",
"getRelativePathTo",
"(",
"parent",
",",
"Arrays",
".",
"asList",
"(",
"folders",
")",
")",
";",
"}"
] | Gets the file or directory from the given parent File object and the relative path given over
the list as String objects.
@param parent
The parent directory.
@param folders
The list with the directories and optional a filename.
@return the resulted file or directory from the given arguments. | [
"Gets",
"the",
"file",
"or",
"directory",
"from",
"the",
"given",
"parent",
"File",
"object",
"and",
"the",
"relative",
"path",
"given",
"over",
"the",
"list",
"as",
"String",
"objects",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/search/PathFinder.java#L123-L126 |
spring-projects/spring-boot | spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthStatusHttpMapper.java | HealthStatusHttpMapper.setStatusMapping | public void setStatusMapping(Map<String, Integer> statusMapping) {
"""
Set specific status mappings.
@param statusMapping a map of health status code to HTTP status code
"""
Assert.notNull(statusMapping, "StatusMapping must not be null");
this.statusMapping = new HashMap<>(statusMapping);
} | java | public void setStatusMapping(Map<String, Integer> statusMapping) {
Assert.notNull(statusMapping, "StatusMapping must not be null");
this.statusMapping = new HashMap<>(statusMapping);
} | [
"public",
"void",
"setStatusMapping",
"(",
"Map",
"<",
"String",
",",
"Integer",
">",
"statusMapping",
")",
"{",
"Assert",
".",
"notNull",
"(",
"statusMapping",
",",
"\"StatusMapping must not be null\"",
")",
";",
"this",
".",
"statusMapping",
"=",
"new",
"HashM... | Set specific status mappings.
@param statusMapping a map of health status code to HTTP status code | [
"Set",
"specific",
"status",
"mappings",
"."
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthStatusHttpMapper.java#L53-L56 |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/runtime/WrapperTypeConversionUtil.java | WrapperTypeConversionUtil.getCompatibleType | protected static int getCompatibleType(Number left, Number right) {
"""
Get the type most compatible between the two values that would be the
most safe to compare against. This is generally the highest degree of
the number type. For example, a {@link #TYPE_INT} compared to a
{@link #TYPE_LONG} would compare ag... | java | protected static int getCompatibleType(Number left, Number right) {
return Math.max(getNumberType(left), getNumberType(right));
} | [
"protected",
"static",
"int",
"getCompatibleType",
"(",
"Number",
"left",
",",
"Number",
"right",
")",
"{",
"return",
"Math",
".",
"max",
"(",
"getNumberType",
"(",
"left",
")",
",",
"getNumberType",
"(",
"right",
")",
")",
";",
"}"
] | Get the type most compatible between the two values that would be the
most safe to compare against. This is generally the highest degree of
the number type. For example, a {@link #TYPE_INT} compared to a
{@link #TYPE_LONG} would compare against the long data type to avoid
losing data from a long to an int.
@param lef... | [
"Get",
"the",
"type",
"most",
"compatible",
"between",
"the",
"two",
"values",
"that",
"would",
"be",
"the",
"most",
"safe",
"to",
"compare",
"against",
".",
"This",
"is",
"generally",
"the",
"highest",
"degree",
"of",
"the",
"number",
"type",
".",
"For",
... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/runtime/WrapperTypeConversionUtil.java#L410-L412 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/MultipartFormData.java | MultipartFormData.parseRequestStream | public void parseRequestStream(InputStream inputStream, String charset) throws IOException {
"""
提取上传的文件和表单数据
@param inputStream HttpRequest流
@param charset 编码
@throws IOException IO异常
"""
setLoaded();
MultipartRequestInputStream input = new MultipartRequestInputStream(inputStream);
input.readB... | java | public void parseRequestStream(InputStream inputStream, String charset) throws IOException {
setLoaded();
MultipartRequestInputStream input = new MultipartRequestInputStream(inputStream);
input.readBoundary();
while (true) {
UploadFileHeader header = input.readDataHeader(charset);
if (header == nu... | [
"public",
"void",
"parseRequestStream",
"(",
"InputStream",
"inputStream",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"setLoaded",
"(",
")",
";",
"MultipartRequestInputStream",
"input",
"=",
"new",
"MultipartRequestInputStream",
"(",
"inputStream",
"... | 提取上传的文件和表单数据
@param inputStream HttpRequest流
@param charset 编码
@throws IOException IO异常 | [
"提取上传的文件和表单数据"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/MultipartFormData.java#L68-L108 |
Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.encodeOutcome | Object encodeOutcome(T t, Throwable x) {
"""
Returns the encoding of the given arguments: if the exception is non-null, encodes as
AltResult. Otherwise uses the given value, boxed as NIL if null.
"""
return (x == null) ? (t == null) ? NIL : t : encodeThrowable(x);
} | java | Object encodeOutcome(T t, Throwable x) {
return (x == null) ? (t == null) ? NIL : t : encodeThrowable(x);
} | [
"Object",
"encodeOutcome",
"(",
"T",
"t",
",",
"Throwable",
"x",
")",
"{",
"return",
"(",
"x",
"==",
"null",
")",
"?",
"(",
"t",
"==",
"null",
")",
"?",
"NIL",
":",
"t",
":",
"encodeThrowable",
"(",
"x",
")",
";",
"}"
] | Returns the encoding of the given arguments: if the exception is non-null, encodes as
AltResult. Otherwise uses the given value, boxed as NIL if null. | [
"Returns",
"the",
"encoding",
"of",
"the",
"given",
"arguments",
":",
"if",
"the",
"exception",
"is",
"non",
"-",
"null",
"encodes",
"as",
"AltResult",
".",
"Otherwise",
"uses",
"the",
"given",
"value",
"boxed",
"as",
"NIL",
"if",
"null",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L634-L636 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/sw/BufferingXmlWriter.java | BufferingXmlWriter.writeRawAscii | @Override
public final void writeRawAscii(char[] cbuf, int offset, int len)
throws IOException {
"""
Method called to output typed values (int, long, double, float etc)
that are known not to contain any escapable characters, or anything
else beyond 7-bit ascii range.
"""
// Can't optimize... | java | @Override
public final void writeRawAscii(char[] cbuf, int offset, int len)
throws IOException
{
// Can't optimize any further with buffering writer, so:
writeRaw(cbuf, offset, len);
} | [
"@",
"Override",
"public",
"final",
"void",
"writeRawAscii",
"(",
"char",
"[",
"]",
"cbuf",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"// Can't optimize any further with buffering writer, so:",
"writeRaw",
"(",
"cbuf",
",",
"offse... | Method called to output typed values (int, long, double, float etc)
that are known not to contain any escapable characters, or anything
else beyond 7-bit ascii range. | [
"Method",
"called",
"to",
"output",
"typed",
"values",
"(",
"int",
"long",
"double",
"float",
"etc",
")",
"that",
"are",
"known",
"not",
"to",
"contain",
"any",
"escapable",
"characters",
"or",
"anything",
"else",
"beyond",
"7",
"-",
"bit",
"ascii",
"range... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sw/BufferingXmlWriter.java#L294-L300 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/mapping/DefaultEntityHandler.java | DefaultEntityHandler.buildInsertSQL | protected String buildInsertSQL(final TableMetadata metadata, final Class<? extends Object> type,
final SqlConfig sqlConfig) {
"""
INSERT SQL生成
@param metadata エンティティメタ情報
@param type エイティティタイプ
@param sqlConfig SQLコンフィグ
@return INSERT SQL
"""
return buildInsertSQL(metadata, type, sqlConfig, true);
} | java | protected String buildInsertSQL(final TableMetadata metadata, final Class<? extends Object> type,
final SqlConfig sqlConfig) {
return buildInsertSQL(metadata, type, sqlConfig, true);
} | [
"protected",
"String",
"buildInsertSQL",
"(",
"final",
"TableMetadata",
"metadata",
",",
"final",
"Class",
"<",
"?",
"extends",
"Object",
">",
"type",
",",
"final",
"SqlConfig",
"sqlConfig",
")",
"{",
"return",
"buildInsertSQL",
"(",
"metadata",
",",
"type",
"... | INSERT SQL生成
@param metadata エンティティメタ情報
@param type エイティティタイプ
@param sqlConfig SQLコンフィグ
@return INSERT SQL | [
"INSERT",
"SQL生成"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/mapping/DefaultEntityHandler.java#L360-L363 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.