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 |
|---|---|---|---|---|---|---|---|---|---|---|
threerings/narya | core/src/main/java/com/threerings/presents/client/Client.java | Client.moveToServer | public void moveToServer (
String hostname, int[] ports, int[] datagramPorts, InvocationService.ConfirmListener obs) {
"""
Transitions a logged on client from its current server to the specified new server.
Currently this simply logs the client off of its current server (if it is logged on) and
logs it o... | java | public void moveToServer (
String hostname, int[] ports, int[] datagramPorts, InvocationService.ConfirmListener obs)
{
// the server switcher will take care of everything for us
new ServerSwitcher(hostname, ports, datagramPorts, obs).switchServers();
} | [
"public",
"void",
"moveToServer",
"(",
"String",
"hostname",
",",
"int",
"[",
"]",
"ports",
",",
"int",
"[",
"]",
"datagramPorts",
",",
"InvocationService",
".",
"ConfirmListener",
"obs",
")",
"{",
"// the server switcher will take care of everything for us",
"new",
... | Transitions a logged on client from its current server to the specified new server.
Currently this simply logs the client off of its current server (if it is logged on) and
logs it onto the new server, but in the future we may aim to do something fancier.
<p> If we fail to connect to the new server, the client <em>wil... | [
"Transitions",
"a",
"logged",
"on",
"client",
"from",
"its",
"current",
"server",
"to",
"the",
"specified",
"new",
"server",
".",
"Currently",
"this",
"simply",
"logs",
"the",
"client",
"off",
"of",
"its",
"current",
"server",
"(",
"if",
"it",
"is",
"logge... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L572-L577 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Call.java | Call.create | public static Call create(final String to, final String from) throws Exception {
"""
Convenience factory method to make an outbound call
@param to the to number
@param from the from number
@return the call
@throws Exception error.
"""
return create(to, from, "none", null);
} | java | public static Call create(final String to, final String from) throws Exception {
return create(to, from, "none", null);
} | [
"public",
"static",
"Call",
"create",
"(",
"final",
"String",
"to",
",",
"final",
"String",
"from",
")",
"throws",
"Exception",
"{",
"return",
"create",
"(",
"to",
",",
"from",
",",
"\"none\"",
",",
"null",
")",
";",
"}"
] | Convenience factory method to make an outbound call
@param to the to number
@param from the from number
@return the call
@throws Exception error. | [
"Convenience",
"factory",
"method",
"to",
"make",
"an",
"outbound",
"call"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Call.java#L105-L107 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java | ResponseCacheImpl.getPayLoad | private String getPayLoad(Key key, Application app) {
"""
Generate pay load with both JSON and XML formats for a given application.
"""
if (app == null) {
return EMPTY_PAYLOAD;
}
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
... | java | private String getPayLoad(Key key, Application app) {
if (app == null) {
return EMPTY_PAYLOAD;
}
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
try {
return encoderWrapper.encode(app);
} catch (Exception e) ... | [
"private",
"String",
"getPayLoad",
"(",
"Key",
"key",
",",
"Application",
"app",
")",
"{",
"if",
"(",
"app",
"==",
"null",
")",
"{",
"return",
"EMPTY_PAYLOAD",
";",
"}",
"EncoderWrapper",
"encoderWrapper",
"=",
"serverCodecs",
".",
"getEncoder",
"(",
"key",
... | Generate pay load with both JSON and XML formats for a given application. | [
"Generate",
"pay",
"load",
"with",
"both",
"JSON",
"and",
"XML",
"formats",
"for",
"a",
"given",
"application",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java#L385-L397 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitInterval | public T visitInterval(Interval elm, C context) {
"""
Visit a Interval. This method will be called for
every node in the tree that is a Interval.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
if (elm.getLow() != null) {
vis... | java | public T visitInterval(Interval elm, C context) {
if (elm.getLow() != null) {
visitElement(elm.getLow(), context);
}
if (elm.getLowClosedExpression() != null) {
visitElement(elm.getLowClosedExpression(), context);
}
if (elm.getHigh() != null) {
... | [
"public",
"T",
"visitInterval",
"(",
"Interval",
"elm",
",",
"C",
"context",
")",
"{",
"if",
"(",
"elm",
".",
"getLow",
"(",
")",
"!=",
"null",
")",
"{",
"visitElement",
"(",
"elm",
".",
"getLow",
"(",
")",
",",
"context",
")",
";",
"}",
"if",
"(... | Visit a Interval. This method will be called for
every node in the tree that is a Interval.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"Interval",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"Interval",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L511-L525 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_disable.java | br_disable.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>
"""
br_disable_responses result = (br_disable_responses) service.get_payloa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
br_disable_responses result = (br_disable_responses) service.get_payload_formatter().string_to_resource(br_disable_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == S... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"br_disable_responses",
"result",
"=",
"(",
"br_disable_responses",
")",
"service",
".",
"get_payload_formatte... | <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/br/br_disable.java#L136-L153 |
wigforss/Ka-Commons-Reflection | src/main/java/org/kasource/commons/util/StringUtils.java | StringUtils.replaceVariables | public static String replaceVariables(String input, Map<String, Object> variables, boolean systemOverrideMode) {
"""
Returns a string where maven-style variables ${variableName} are replaced with variables from
the variable map, system variable or environment variables.
<p>
Will resolve variable values differen... | java | public static String replaceVariables(String input, Map<String, Object> variables, boolean systemOverrideMode) {
Matcher matcher = VARIABLE_PATTERN.matcher(input);
String result = input;
while(matcher.find()) {
String variableName = matcher.group();
variableName = variabl... | [
"public",
"static",
"String",
"replaceVariables",
"(",
"String",
"input",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"variables",
",",
"boolean",
"systemOverrideMode",
")",
"{",
"Matcher",
"matcher",
"=",
"VARIABLE_PATTERN",
".",
"matcher",
"(",
"input",
"... | Returns a string where maven-style variables ${variableName} are replaced with variables from
the variable map, system variable or environment variables.
<p>
Will resolve variable values differently depending on the systemOverrideMode flag, where true = override and false = fall back.
See the list below in which order ... | [
"Returns",
"a",
"string",
"where",
"maven",
"-",
"style",
"variables",
"$",
"{",
"variableName",
"}",
"are",
"replaced",
"with",
"variables",
"from",
"the",
"variable",
"map",
"system",
"variable",
"or",
"environment",
"variables",
".",
"<p",
">",
"Will",
"r... | train | https://github.com/wigforss/Ka-Commons-Reflection/blob/a80f7a164cd800089e4f4dd948ca6f0e7badcf33/src/main/java/org/kasource/commons/util/StringUtils.java#L45-L57 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java | SocketBindingJBossASClient.setPortOffset | public void setPortOffset(String socketBindingGroupName, String sysPropName, int offset) throws Exception {
"""
Sets the port offset for the socket bindings found in the named socket binding group.
If sysPropName is null, this simply sets the offset explicitly to the given offset.
If sysPropName is not null, thi... | java | public void setPortOffset(String socketBindingGroupName, String sysPropName, int offset) throws Exception {
String offsetValue;
if (sysPropName != null) {
offsetValue = "${" + sysPropName + ":" + offset + "}";
} else {
offsetValue = String.valueOf(offset);
}
... | [
"public",
"void",
"setPortOffset",
"(",
"String",
"socketBindingGroupName",
",",
"String",
"sysPropName",
",",
"int",
"offset",
")",
"throws",
"Exception",
"{",
"String",
"offsetValue",
";",
"if",
"(",
"sysPropName",
"!=",
"null",
")",
"{",
"offsetValue",
"=",
... | Sets the port offset for the socket bindings found in the named socket binding group.
If sysPropName is null, this simply sets the offset explicitly to the given offset.
If sysPropName is not null, this sets the offset to the expression "${sysPropName:offset}".
You typically will want to use the standard {@link #JBOSS_... | [
"Sets",
"the",
"port",
"offset",
"for",
"the",
"socket",
"bindings",
"found",
"in",
"the",
"named",
"socket",
"binding",
"group",
".",
"If",
"sysPropName",
"is",
"null",
"this",
"simply",
"sets",
"the",
"offset",
"explicitly",
"to",
"the",
"given",
"offset",... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java#L185-L200 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/system/exec/Exec.java | Exec.utilityAs | public static Execed utilityAs(String as, Iterable<String> command) throws IOException {
"""
Runs a command in "utility" mode: redirecting stderr to stdout and optionally executing as a different user (eg root)
@param as
@param command
@return
@throws IOException
"""
Exec e = new Exec(command);
i... | java | public static Execed utilityAs(String as, Iterable<String> command) throws IOException
{
Exec e = new Exec(command);
if (as != null)
e.runAs(as);
e.setRedirectError(true);
return e.start();
} | [
"public",
"static",
"Execed",
"utilityAs",
"(",
"String",
"as",
",",
"Iterable",
"<",
"String",
">",
"command",
")",
"throws",
"IOException",
"{",
"Exec",
"e",
"=",
"new",
"Exec",
"(",
"command",
")",
";",
"if",
"(",
"as",
"!=",
"null",
")",
"e",
"."... | Runs a command in "utility" mode: redirecting stderr to stdout and optionally executing as a different user (eg root)
@param as
@param command
@return
@throws IOException | [
"Runs",
"a",
"command",
"in",
"utility",
"mode",
":",
"redirecting",
"stderr",
"to",
"stdout",
"and",
"optionally",
"executing",
"as",
"a",
"different",
"user",
"(",
"eg",
"root",
")"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/system/exec/Exec.java#L368-L376 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.getPathItemId | public static String getPathItemId(Container cnt, String path) {
"""
Gives item id from path.<p>
@param cnt to be used
@param path to obtain item id from
@return item id
"""
for (String id : Arrays.asList(path, CmsFileUtil.toggleTrailingSeparator(path))) {
if (cnt.containsId(id)) {
... | java | public static String getPathItemId(Container cnt, String path) {
for (String id : Arrays.asList(path, CmsFileUtil.toggleTrailingSeparator(path))) {
if (cnt.containsId(id)) {
return id;
}
}
return null;
} | [
"public",
"static",
"String",
"getPathItemId",
"(",
"Container",
"cnt",
",",
"String",
"path",
")",
"{",
"for",
"(",
"String",
"id",
":",
"Arrays",
".",
"asList",
"(",
"path",
",",
"CmsFileUtil",
".",
"toggleTrailingSeparator",
"(",
"path",
")",
")",
")",
... | Gives item id from path.<p>
@param cnt to be used
@param path to obtain item id from
@return item id | [
"Gives",
"item",
"id",
"from",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L717-L725 |
Abnaxos/markdown-doclet | doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentPredicates.java | PredefinedArgumentPredicates.inRange | public static ArgumentPredicate inRange(final int min, final int max, Radix radix) {
"""
# Creates an {@link ArgumentPredicate} which checks, if the argument is a positive or negative integer
in {@link Radix} notation.
@param min the min value
@param max the max value
@param radix the radix
@return the ... | java | public static ArgumentPredicate inRange(final int min, final int max, Radix radix) {
return new IntegerPredicate(min, max, radix);
} | [
"public",
"static",
"ArgumentPredicate",
"inRange",
"(",
"final",
"int",
"min",
",",
"final",
"int",
"max",
",",
"Radix",
"radix",
")",
"{",
"return",
"new",
"IntegerPredicate",
"(",
"min",
",",
"max",
",",
"radix",
")",
";",
"}"
] | # Creates an {@link ArgumentPredicate} which checks, if the argument is a positive or negative integer
in {@link Radix} notation.
@param min the min value
@param max the max value
@param radix the radix
@return the {@link ArgumentPredicate}
@see Integer#parseInt(String, int) | [
"#",
"Creates",
"an",
"{",
"@link",
"ArgumentPredicate",
"}",
"which",
"checks",
"if",
"the",
"argument",
"is",
"a",
"positive",
"or",
"negative",
"integer",
"in",
"{",
"@link",
"Radix",
"}",
"notation",
"."
] | train | https://github.com/Abnaxos/markdown-doclet/blob/e98a9630206fc9c8d813cf2349ff594be8630054/doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentPredicates.java#L157-L159 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetsInner.java | SubnetsInner.beginDelete | public void beginDelete(String resourceGroupName, String virtualNetworkName, String subnetName) {
"""
Deletes the specified subnet.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@param subnetName The name of the subnet.
@throws IllegalArgu... | java | public void beginDelete(String resourceGroupName, String virtualNetworkName, String subnetName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkName",
",",
"String",
"subnetName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkName",
",",
"subnetName",
")",
".",
"toB... | Deletes the specified subnet.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@param subnetName The name of the subnet.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected ... | [
"Deletes",
"the",
"specified",
"subnet",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetsInner.java#L177-L179 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java | ImapRequestLineReader.nextChar | public char nextChar() throws ProtocolException {
"""
Reads the next character in the current line. This method will continue to return
the same character until the {@link #consume()} method is called.
@return The next character.
@throws ProtocolException If the end-of-stream is reached.
"""
if (... | java | public char nextChar() throws ProtocolException {
if (!nextSeen) {
try {
final int read = input.read();
final char c = (char) read;
buf.append(c);
if(read == -1) {
dumpLine();
throw new Pr... | [
"public",
"char",
"nextChar",
"(",
")",
"throws",
"ProtocolException",
"{",
"if",
"(",
"!",
"nextSeen",
")",
"{",
"try",
"{",
"final",
"int",
"read",
"=",
"input",
".",
"read",
"(",
")",
";",
"final",
"char",
"c",
"=",
"(",
"char",
")",
"read",
";"... | Reads the next character in the current line. This method will continue to return
the same character until the {@link #consume()} method is called.
@return The next character.
@throws ProtocolException If the end-of-stream is reached. | [
"Reads",
"the",
"next",
"character",
"in",
"the",
"current",
"line",
".",
"This",
"method",
"will",
"continue",
"to",
"return",
"the",
"same",
"character",
"until",
"the",
"{",
"@link",
"#consume",
"()",
"}",
"method",
"is",
"called",
"."
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java#L70-L87 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java | DialogFragmentUtils.showOnLoaderCallback | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void showOnLoaderCallback(final android.app.FragmentManager manager, final android.app.DialogFragment fragment, final String tag) {
"""
Show {@link android.app.DialogFragment} with the specified tag on the loader callbacks.
@param manager the manager.
@... | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void showOnLoaderCallback(final android.app.FragmentManager manager, final android.app.DialogFragment fragment, final String tag) {
showOnLoaderCallback(HandlerUtils.getMainHandler(), manager, fragment, tag);
} | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"static",
"void",
"showOnLoaderCallback",
"(",
"final",
"android",
".",
"app",
".",
"FragmentManager",
"manager",
",",
"final",
"android",
".",
"app",
".",
"DialogFragment",
... | Show {@link android.app.DialogFragment} with the specified tag on the loader callbacks.
@param manager the manager.
@param fragment the fragment.
@param tag the tag string that is related to the {@link android.app.DialogFragment}. | [
"Show",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java#L122-L125 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/filecache/DistributedCache.java | DistributedCache.addFileToClassPath | public static void addFileToClassPath(Path file, Configuration conf)
throws IOException {
"""
Add an file path to the current set of classpath entries It adds the file
to cache as well.
@param file Path of the file to be added
@param conf Configuration that contains the classpath setting
"""
Strin... | java | public static void addFileToClassPath(Path file, Configuration conf)
throws IOException {
String classpath = conf.get("mapred.job.classpath.files");
conf.set("mapred.job.classpath.files", classpath == null ? file.toString()
: classpath + System.getProperty("path.separator") + file.toString());
... | [
"public",
"static",
"void",
"addFileToClassPath",
"(",
"Path",
"file",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"String",
"classpath",
"=",
"conf",
".",
"get",
"(",
"\"mapred.job.classpath.files\"",
")",
";",
"conf",
".",
"set",
"(",
"\... | Add an file path to the current set of classpath entries It adds the file
to cache as well.
@param file Path of the file to be added
@param conf Configuration that contains the classpath setting | [
"Add",
"an",
"file",
"path",
"to",
"the",
"current",
"set",
"of",
"classpath",
"entries",
"It",
"adds",
"the",
"file",
"to",
"cache",
"as",
"well",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/filecache/DistributedCache.java#L969-L977 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.generateMediaPlayerCode | public GenerateMediaPlayerCodeResponse generateMediaPlayerCode(GenerateMediaPlayerCodeRequest request) {
"""
Get the HTML5 code snippet (encoded in Base64) to play the specific media resource.
@param request The request object containing all the options on how to
@return The Flash and HTML5 code snippet
""... | java | public GenerateMediaPlayerCodeResponse generateMediaPlayerCode(GenerateMediaPlayerCodeRequest request) {
checkStringNotEmpty(request.getMediaId(), "Media ID should not be null or empty!");
checkIsTrue(request.getHeight() > 0, "Height of playback view should be positive!");
checkIsTrue(request.g... | [
"public",
"GenerateMediaPlayerCodeResponse",
"generateMediaPlayerCode",
"(",
"GenerateMediaPlayerCodeRequest",
"request",
")",
"{",
"checkStringNotEmpty",
"(",
"request",
".",
"getMediaId",
"(",
")",
",",
"\"Media ID should not be null or empty!\"",
")",
";",
"checkIsTrue",
"... | Get the HTML5 code snippet (encoded in Base64) to play the specific media resource.
@param request The request object containing all the options on how to
@return The Flash and HTML5 code snippet | [
"Get",
"the",
"HTML5",
"code",
"snippet",
"(",
"encoded",
"in",
"Base64",
")",
"to",
"play",
"the",
"specific",
"media",
"resource",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L803-L818 |
pravega/pravega | common/src/main/java/io/pravega/common/util/btree/BTreeIndex.java | BTreeIndex.locatePage | private CompletableFuture<PageWrapper> locatePage(Function<BTreePage, PagePointer> getChildPointer, Predicate<PageWrapper> found,
PageCollection pageCollection, TimeoutTimer timer) {
"""
Locates the BTreePage according to the given criteria.
@param getChildP... | java | private CompletableFuture<PageWrapper> locatePage(Function<BTreePage, PagePointer> getChildPointer, Predicate<PageWrapper> found,
PageCollection pageCollection, TimeoutTimer timer) {
AtomicReference<PagePointer> pagePointer = new AtomicReference<>(new PagePo... | [
"private",
"CompletableFuture",
"<",
"PageWrapper",
">",
"locatePage",
"(",
"Function",
"<",
"BTreePage",
",",
"PagePointer",
">",
"getChildPointer",
",",
"Predicate",
"<",
"PageWrapper",
">",
"found",
",",
"PageCollection",
"pageCollection",
",",
"TimeoutTimer",
"t... | Locates the BTreePage according to the given criteria.
@param getChildPointer A Function that, when applied to a BTreePage, will return a PagePointer which can be used
to load up the next page.
@param found A Predicate that, when applied to a PageWrapper, will indicate if this is the sought page.
@param page... | [
"Locates",
"the",
"BTreePage",
"according",
"to",
"the",
"given",
"criteria",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/BTreeIndex.java#L614-L639 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/reference/AtomicSharedReference.java | AtomicSharedReference.mapWithCopyQuietly | public @Nullable <Z> Z mapWithCopyQuietly(Function<T, Z> function) {
"""
Just like mapWithCopy() except that this silently swallows any exception
that calling close() on the copy might throw.
@param function The function to apply to the value of the local reference.
@param <Z> The type of object produced by t... | java | public @Nullable <Z> Z mapWithCopyQuietly(Function<T, Z> function) {
final @Nullable SharedReference<T> localRef = getCopy();
try {
if (localRef == null) {
return function.apply(null);
} else {
return function.apply(localRef.get());
}
... | [
"public",
"@",
"Nullable",
"<",
"Z",
">",
"Z",
"mapWithCopyQuietly",
"(",
"Function",
"<",
"T",
",",
"Z",
">",
"function",
")",
"{",
"final",
"@",
"Nullable",
"SharedReference",
"<",
"T",
">",
"localRef",
"=",
"getCopy",
"(",
")",
";",
"try",
"{",
"i... | Just like mapWithCopy() except that this silently swallows any exception
that calling close() on the copy might throw.
@param function The function to apply to the value of the local reference.
@param <Z> The type of object produced by the function.
@return The value that was produced by the supplied {@code function}. | [
"Just",
"like",
"mapWithCopy",
"()",
"except",
"that",
"this",
"silently",
"swallows",
"any",
"exception",
"that",
"calling",
"close",
"()",
"on",
"the",
"copy",
"might",
"throw",
"."
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/reference/AtomicSharedReference.java#L170-L181 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/LegacySpy.java | LegacySpy.verifyAtMost | @Deprecated
public C verifyAtMost(int allowedStatements, Threads threadMatcher) throws WrongNumberOfQueriesError {
"""
Alias for {@link #verifyBetween(int, int, Threads, Query)} with arguments 0, {@code allowedStatements}, {@code threads}, {@link Query#ANY}
@since 2.0
"""
return verify(SqlQueries.... | java | @Deprecated
public C verifyAtMost(int allowedStatements, Threads threadMatcher) throws WrongNumberOfQueriesError {
return verify(SqlQueries.maxQueries(allowedStatements).threads(threadMatcher));
} | [
"@",
"Deprecated",
"public",
"C",
"verifyAtMost",
"(",
"int",
"allowedStatements",
",",
"Threads",
"threadMatcher",
")",
"throws",
"WrongNumberOfQueriesError",
"{",
"return",
"verify",
"(",
"SqlQueries",
".",
"maxQueries",
"(",
"allowedStatements",
")",
".",
"thread... | Alias for {@link #verifyBetween(int, int, Threads, Query)} with arguments 0, {@code allowedStatements}, {@code threads}, {@link Query#ANY}
@since 2.0 | [
"Alias",
"for",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/LegacySpy.java#L364-L367 |
hgoebl/DavidWebb | src/main/java/com/goebl/david/WebbUtils.java | WebbUtils.toJsonArray | public static JSONArray toJsonArray(byte[] bytes) {
"""
Convert a byte array to a JSONArray.
@param bytes a UTF-8 encoded string representing a JSON array.
@return the parsed JSON array
@throws WebbException in case of error (usually a parsing error due to invalid JSON)
"""
String json;
try ... | java | public static JSONArray toJsonArray(byte[] bytes) {
String json;
try {
json = new String(bytes, Const.UTF8);
return new JSONArray(json);
} catch (UnsupportedEncodingException e) {
throw new WebbException(e);
} catch (JSONException e) {
thro... | [
"public",
"static",
"JSONArray",
"toJsonArray",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"String",
"json",
";",
"try",
"{",
"json",
"=",
"new",
"String",
"(",
"bytes",
",",
"Const",
".",
"UTF8",
")",
";",
"return",
"new",
"JSONArray",
"(",
"json",
"... | Convert a byte array to a JSONArray.
@param bytes a UTF-8 encoded string representing a JSON array.
@return the parsed JSON array
@throws WebbException in case of error (usually a parsing error due to invalid JSON) | [
"Convert",
"a",
"byte",
"array",
"to",
"a",
"JSONArray",
"."
] | train | https://github.com/hgoebl/DavidWebb/blob/4f1532fbc3d817886d38de24eacc02b44b910b42/src/main/java/com/goebl/david/WebbUtils.java#L100-L110 |
apache/incubator-heron | heron/packing/src/java/org/apache/heron/packing/utils/PackingUtils.java | PackingUtils.getComponentResourceMap | public static Map<String, Resource> getComponentResourceMap(
Set<String> components,
Map<String, ByteAmount> componentRamMap,
Map<String, Double> componentCpuMap,
Map<String, ByteAmount> componentDiskMap,
Resource defaultInstanceResource) {
"""
Compose the component resource map by re... | java | public static Map<String, Resource> getComponentResourceMap(
Set<String> components,
Map<String, ByteAmount> componentRamMap,
Map<String, Double> componentCpuMap,
Map<String, ByteAmount> componentDiskMap,
Resource defaultInstanceResource) {
Map<String, Resource> componentResourceMap = ... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Resource",
">",
"getComponentResourceMap",
"(",
"Set",
"<",
"String",
">",
"components",
",",
"Map",
"<",
"String",
",",
"ByteAmount",
">",
"componentRamMap",
",",
"Map",
"<",
"String",
",",
"Double",
">",
"c... | Compose the component resource map by reading from user configs or default
@param components component names
@param componentRamMap user configured component ram map
@param componentCpuMap user configured component cpu map
@param componentDiskMap user configured component disk map
@param defaultInstanceResource defaul... | [
"Compose",
"the",
"component",
"resource",
"map",
"by",
"reading",
"from",
"user",
"configs",
"or",
"default"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/packing/src/java/org/apache/heron/packing/utils/PackingUtils.java#L58-L76 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/BasicAuthAuthenticator.java | BasicAuthAuthenticator.handleBasicAuth | private AuthenticationResult handleBasicAuth(String inRealm, HttpServletRequest req, HttpServletResponse res) {
"""
handleBasicAuth generates AuthenticationResult
This routine invokes basicAuthenticate which also generates AuthenticationResult.
"""
AuthenticationResult result = null;
String h... | java | private AuthenticationResult handleBasicAuth(String inRealm, HttpServletRequest req, HttpServletResponse res) {
AuthenticationResult result = null;
String hdrValue = req.getHeader(BASIC_AUTH_HEADER_NAME);
if (hdrValue == null || !hdrValue.startsWith("Basic ")) {
result = new Authent... | [
"private",
"AuthenticationResult",
"handleBasicAuth",
"(",
"String",
"inRealm",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"{",
"AuthenticationResult",
"result",
"=",
"null",
";",
"String",
"hdrValue",
"=",
"req",
".",
"getHeader",
"("... | handleBasicAuth generates AuthenticationResult
This routine invokes basicAuthenticate which also generates AuthenticationResult. | [
"handleBasicAuth",
"generates",
"AuthenticationResult",
"This",
"routine",
"invokes",
"basicAuthenticate",
"which",
"also",
"generates",
"AuthenticationResult",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/BasicAuthAuthenticator.java#L95-L118 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/DateBuilder.java | DateBuilder.tomorrowAt | public static Date tomorrowAt (final int hour, final int minute, final int second) {
"""
<p>
Get a <code>Date</code> object that represents the given time, on
tomorrow's date.
</p>
@param second
The value (0-59) to give the seconds field of the date
@param minute
The value (0-59) to give the minutes field... | java | public static Date tomorrowAt (final int hour, final int minute, final int second)
{
validateSecond (second);
validateMinute (minute);
validateHour (hour);
final Date date = new Date ();
final Calendar c = PDTFactory.createCalendar ();
c.setTime (date);
c.setLenient (true);
// advan... | [
"public",
"static",
"Date",
"tomorrowAt",
"(",
"final",
"int",
"hour",
",",
"final",
"int",
"minute",
",",
"final",
"int",
"second",
")",
"{",
"validateSecond",
"(",
"second",
")",
";",
"validateMinute",
"(",
"minute",
")",
";",
"validateHour",
"(",
"hour"... | <p>
Get a <code>Date</code> object that represents the given time, on
tomorrow's date.
</p>
@param second
The value (0-59) to give the seconds field of the date
@param minute
The value (0-59) to give the minutes field of the date
@param hour
The value (0-23) to give the hours field of the date
@return the new date | [
"<p",
">",
"Get",
"a",
"<code",
">",
"Date<",
"/",
"code",
">",
"object",
"that",
"represents",
"the",
"given",
"time",
"on",
"tomorrow",
"s",
"date",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/DateBuilder.java#L345-L366 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.ofIndices | public static <T> IntStreamEx ofIndices(T[] array, Predicate<T> predicate) {
"""
Returns a sequential ordered {@code IntStreamEx} containing all the
indices of the supplied array elements which match given predicate.
@param <T> array element type
@param array array to get the stream of its indices
@param pre... | java | public static <T> IntStreamEx ofIndices(T[] array, Predicate<T> predicate) {
return seq(IntStream.range(0, array.length).filter(i -> predicate.test(array[i])));
} | [
"public",
"static",
"<",
"T",
">",
"IntStreamEx",
"ofIndices",
"(",
"T",
"[",
"]",
"array",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"return",
"seq",
"(",
"IntStream",
".",
"range",
"(",
"0",
",",
"array",
".",
"length",
")",
".",
"f... | Returns a sequential ordered {@code IntStreamEx} containing all the
indices of the supplied array elements which match given predicate.
@param <T> array element type
@param array array to get the stream of its indices
@param predicate a predicate to test array elements
@return a sequential {@code IntStreamEx} of the m... | [
"Returns",
"a",
"sequential",
"ordered",
"{",
"@code",
"IntStreamEx",
"}",
"containing",
"all",
"the",
"indices",
"of",
"the",
"supplied",
"array",
"elements",
"which",
"match",
"given",
"predicate",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L2057-L2059 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/cfg/Settings.java | Settings.getClusterInfoOrNull | public ClusterInfo getClusterInfoOrNull() {
"""
Get the internal cluster name and version or null if not present in the settings
@return the {@link ClusterInfo} extracted from the properties or null if not present
"""
String clusterName = getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_NA... | java | public ClusterInfo getClusterInfoOrNull() {
String clusterName = getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_NAME);
if (clusterName == null) {
return null;
}
String clusterUUID = getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_UUID);
EsMa... | [
"public",
"ClusterInfo",
"getClusterInfoOrNull",
"(",
")",
"{",
"String",
"clusterName",
"=",
"getProperty",
"(",
"InternalConfigurationOptions",
".",
"INTERNAL_ES_CLUSTER_NAME",
")",
";",
"if",
"(",
"clusterName",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}... | Get the internal cluster name and version or null if not present in the settings
@return the {@link ClusterInfo} extracted from the properties or null if not present | [
"Get",
"the",
"internal",
"cluster",
"name",
"and",
"version",
"or",
"null",
"if",
"not",
"present",
"in",
"the",
"settings"
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/cfg/Settings.java#L93-L101 |
Appendium/objectlabkit | datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/ccy/DefaultCurrencyCalculatorConfig.java | DefaultCurrencyCalculatorConfig.setWorkingWeeks | public void setWorkingWeeks(final Map<String, WorkingWeek> workingWeeks) {
"""
Will take a copy of a non null map but doing so by replacing the internal one in one go for consistency.
"""
final Map<String, WorkingWeek> ww = new HashMap<>();
ww.putAll(workingWeeks);
this.workingWeeks = w... | java | public void setWorkingWeeks(final Map<String, WorkingWeek> workingWeeks) {
final Map<String, WorkingWeek> ww = new HashMap<>();
ww.putAll(workingWeeks);
this.workingWeeks = ww;
} | [
"public",
"void",
"setWorkingWeeks",
"(",
"final",
"Map",
"<",
"String",
",",
"WorkingWeek",
">",
"workingWeeks",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"WorkingWeek",
">",
"ww",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"ww",
".",
"putAll",
"... | Will take a copy of a non null map but doing so by replacing the internal one in one go for consistency. | [
"Will",
"take",
"a",
"copy",
"of",
"a",
"non",
"null",
"map",
"but",
"doing",
"so",
"by",
"replacing",
"the",
"internal",
"one",
"in",
"one",
"go",
"for",
"consistency",
"."
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/ccy/DefaultCurrencyCalculatorConfig.java#L57-L61 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/core/jackson/JAXBAnnotationsHelper.java | JAXBAnnotationsHelper.setName | private static boolean setName(String ns, String name, Schema property) {
"""
Puts name space and name for XML node or attribute.
@param ns name space
@param name name
@param property property instance to be updated
@return <code>true</code> if name space and name have been set
"""
boolean apply ... | java | private static boolean setName(String ns, String name, Schema property) {
boolean apply = false;
final String cleanName = StringUtils.trimToNull(name);
final String useName;
if (!isEmpty(cleanName) && !cleanName.equals(((SchemaImpl) property).getName())) {
useName = cleanName... | [
"private",
"static",
"boolean",
"setName",
"(",
"String",
"ns",
",",
"String",
"name",
",",
"Schema",
"property",
")",
"{",
"boolean",
"apply",
"=",
"false",
";",
"final",
"String",
"cleanName",
"=",
"StringUtils",
".",
"trimToNull",
"(",
"name",
")",
";",... | Puts name space and name for XML node or attribute.
@param ns name space
@param name name
@param property property instance to be updated
@return <code>true</code> if name space and name have been set | [
"Puts",
"name",
"space",
"and",
"name",
"for",
"XML",
"node",
"or",
"attribute",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/core/jackson/JAXBAnnotationsHelper.java#L105-L128 |
google/closure-compiler | src/com/google/javascript/jscomp/ChangeVerifier.java | ChangeVerifier.associateClones | private void associateClones(Node n, Node snapshot) {
"""
Given an AST and its copy, map the root node of each scope of main to the
corresponding root node of clone
"""
// TODO(johnlenz): determine if MODULE_BODY is useful here.
if (n.isRoot() || NodeUtil.isChangeScopeRoot(n)) {
clonesByCurrent.... | java | private void associateClones(Node n, Node snapshot) {
// TODO(johnlenz): determine if MODULE_BODY is useful here.
if (n.isRoot() || NodeUtil.isChangeScopeRoot(n)) {
clonesByCurrent.put(n, snapshot);
}
Node child = n.getFirstChild();
Node snapshotChild = snapshot.getFirstChild();
while (ch... | [
"private",
"void",
"associateClones",
"(",
"Node",
"n",
",",
"Node",
"snapshot",
")",
"{",
"// TODO(johnlenz): determine if MODULE_BODY is useful here.",
"if",
"(",
"n",
".",
"isRoot",
"(",
")",
"||",
"NodeUtil",
".",
"isChangeScopeRoot",
"(",
"n",
")",
")",
"{"... | Given an AST and its copy, map the root node of each scope of main to the
corresponding root node of clone | [
"Given",
"an",
"AST",
"and",
"its",
"copy",
"map",
"the",
"root",
"node",
"of",
"each",
"scope",
"of",
"main",
"to",
"the",
"corresponding",
"root",
"node",
"of",
"clone"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ChangeVerifier.java#L62-L75 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.EL2_L2 | @Pure
public static Point2d EL2_L2(double x, double y) {
"""
This function convert extended France Lambert II coordinate to
France Lambert II coordinate.
@param x is the coordinate in extended France Lambert II
@param y is the coordinate in extended France Lambert II
@return the France Lambert II coordinate... | java | @Pure
public static Point2d EL2_L2(double x, double y) {
return new Point2d(x, y + (LAMBERT_2E_YS - LAMBERT_2_YS));
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"EL2_L2",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"new",
"Point2d",
"(",
"x",
",",
"y",
"+",
"(",
"LAMBERT_2E_YS",
"-",
"LAMBERT_2_YS",
")",
")",
";",
"}"
] | This function convert extended France Lambert II coordinate to
France Lambert II coordinate.
@param x is the coordinate in extended France Lambert II
@param y is the coordinate in extended France Lambert II
@return the France Lambert II coordinate. | [
"This",
"function",
"convert",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"II",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L206-L209 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceTypeUtil.java | AnnotatedHttpServiceTypeUtil.stringToType | @SuppressWarnings("unchecked")
static <T> T stringToType(String str, Class<T> clazz) {
"""
Converts the given {@code str} to {@code T} type object. e.g., "42" -> 42.
@throws IllegalArgumentException if {@code str} can't be deserialized to {@code T} type object.
"""
try {
final Functi... | java | @SuppressWarnings("unchecked")
static <T> T stringToType(String str, Class<T> clazz) {
try {
final Function<String, ?> func = supportedElementTypes.get(clazz);
if (func != null) {
return (T) func.apply(str);
}
} catch (NumberFormatException e) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"T",
">",
"T",
"stringToType",
"(",
"String",
"str",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"try",
"{",
"final",
"Function",
"<",
"String",
",",
"?",
">",
"func",
"=",
"suppo... | Converts the given {@code str} to {@code T} type object. e.g., "42" -> 42.
@throws IllegalArgumentException if {@code str} can't be deserialized to {@code T} type object. | [
"Converts",
"the",
"given",
"{",
"@code",
"str",
"}",
"to",
"{",
"@code",
"T",
"}",
"type",
"object",
".",
"e",
".",
"g",
".",
"42",
"-",
">",
"42",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceTypeUtil.java#L98-L114 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FileUtil.java | FileUtil.writeFile | public static File writeFile(String filename, String content) {
"""
Writes content to file, in UTF-8 encoding.
@param filename file to create or overwrite.
@param content content to write.
@return file reference to file.
"""
PrintWriter pw = null;
try {
pw = new PrintWriter(fi... | java | public static File writeFile(String filename, String content) {
PrintWriter pw = null;
try {
pw = new PrintWriter(filename, FILE_ENCODING);
pw.write(content);
pw.flush();
} catch (FileNotFoundException e) {
throw new IllegalArgumentException("Unabl... | [
"public",
"static",
"File",
"writeFile",
"(",
"String",
"filename",
",",
"String",
"content",
")",
"{",
"PrintWriter",
"pw",
"=",
"null",
";",
"try",
"{",
"pw",
"=",
"new",
"PrintWriter",
"(",
"filename",
",",
"FILE_ENCODING",
")",
";",
"pw",
".",
"write... | Writes content to file, in UTF-8 encoding.
@param filename file to create or overwrite.
@param content content to write.
@return file reference to file. | [
"Writes",
"content",
"to",
"file",
"in",
"UTF",
"-",
"8",
"encoding",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FileUtil.java#L173-L189 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/TargetsApi.java | TargetsApi.getTarget | public Target getTarget(long id, TargetType type) throws WorkspaceApiException {
"""
Get a specific target by type and ID. Targets can be agents, agent groups, queues, route points, skills, and custom contacts.
@param id The ID of the target.
@param type The type of target to retrieve. The possible values are AG... | java | public Target getTarget(long id, TargetType type) throws WorkspaceApiException {
try {
TargetsResponse resp = targetsApi.getTarget(new BigDecimal(id), type.getValue());
Util.throwIfNotOk(resp.getStatus());
Target target = null;
if(resp.getData()... | [
"public",
"Target",
"getTarget",
"(",
"long",
"id",
",",
"TargetType",
"type",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"TargetsResponse",
"resp",
"=",
"targetsApi",
".",
"getTarget",
"(",
"new",
"BigDecimal",
"(",
"id",
")",
",",
"type",
"."... | Get a specific target by type and ID. Targets can be agents, agent groups, queues, route points, skills, and custom contacts.
@param id The ID of the target.
@param type The type of target to retrieve. The possible values are AGENT, AGENT_GROUP, ACD_QUEUE, ROUTE_POINT, SKILL, and CUSTOM_CONTACT.
@return Target | [
"Get",
"a",
"specific",
"target",
"by",
"type",
"and",
"ID",
".",
"Targets",
"can",
"be",
"agents",
"agent",
"groups",
"queues",
"route",
"points",
"skills",
"and",
"custom",
"contacts",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/TargetsApi.java#L188-L207 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java | CPOptionValuePersistenceImpl.findByC_K | @Override
public CPOptionValue findByC_K(long CPOptionId, String key)
throws NoSuchCPOptionValueException {
"""
Returns the cp option value where CPOptionId = ? and key = ? or throws a {@link NoSuchCPOptionValueException} if it could not be found.
@param CPOptionId the cp option ID
@param key the ke... | java | @Override
public CPOptionValue findByC_K(long CPOptionId, String key)
throws NoSuchCPOptionValueException {
CPOptionValue cpOptionValue = fetchByC_K(CPOptionId, key);
if (cpOptionValue == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("CPOptionId=")... | [
"@",
"Override",
"public",
"CPOptionValue",
"findByC_K",
"(",
"long",
"CPOptionId",
",",
"String",
"key",
")",
"throws",
"NoSuchCPOptionValueException",
"{",
"CPOptionValue",
"cpOptionValue",
"=",
"fetchByC_K",
"(",
"CPOptionId",
",",
"key",
")",
";",
"if",
"(",
... | Returns the cp option value where CPOptionId = ? and key = ? or throws a {@link NoSuchCPOptionValueException} if it could not be found.
@param CPOptionId the cp option ID
@param key the key
@return the matching cp option value
@throws NoSuchCPOptionValueException if a matching cp option value could not be foun... | [
"Returns",
"the",
"cp",
"option",
"value",
"where",
"CPOptionId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPOptionValueException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java#L3025-L3051 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/map/JodaBeanSimpleMapReader.java | JodaBeanSimpleMapReader.parseRoot | private <T> T parseRoot(Map<String, Object> input, Class<T> declaredType) throws Exception {
"""
Parses the root bean.
@param input the map input, not null
@param declaredType the declared type, not null
@return the bean, not null
@throws Exception if an error occurs
"""
Object parsed = parseBe... | java | private <T> T parseRoot(Map<String, Object> input, Class<T> declaredType) throws Exception {
Object parsed = parseBean(input, declaredType);
return declaredType.cast(parsed);
} | [
"private",
"<",
"T",
">",
"T",
"parseRoot",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"input",
",",
"Class",
"<",
"T",
">",
"declaredType",
")",
"throws",
"Exception",
"{",
"Object",
"parsed",
"=",
"parseBean",
"(",
"input",
",",
"declaredType",
"... | Parses the root bean.
@param input the map input, not null
@param declaredType the declared type, not null
@return the bean, not null
@throws Exception if an error occurs | [
"Parses",
"the",
"root",
"bean",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/map/JodaBeanSimpleMapReader.java#L90-L93 |
mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemRangeRemoved | public final void notifyFooterItemRangeRemoved(int positionStart, int itemCount) {
"""
Notifies that multiple footer items are removed.
@param positionStart the position.
@param itemCount the item count.
"""
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) ... | java | public final void notifyFooterItemRangeRemoved(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount... | [
"public",
"final",
"void",
"notifyFooterItemRangeRemoved",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"footerItemCount",
")",
... | Notifies that multiple footer items are removed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"footer",
"items",
"are",
"removed",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L404-L411 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java | PersistenceBrokerImpl.deleteReferences | private void deleteReferences(ClassDescriptor cld, Object obj, Identity oid, boolean ignoreReferences) throws PersistenceBrokerException {
"""
Deletes references that <b>obj</b> points to.
All objects which we have a FK poiting to (Via ReferenceDescriptors)
will be deleted if auto-delete is true <b>AND</b>
the ... | java | private void deleteReferences(ClassDescriptor cld, Object obj, Identity oid, boolean ignoreReferences) throws PersistenceBrokerException
{
List listRds = cld.getObjectReferenceDescriptors();
// get all members of obj that are references and delete them
Iterator i = listRds.iterator();
w... | [
"private",
"void",
"deleteReferences",
"(",
"ClassDescriptor",
"cld",
",",
"Object",
"obj",
",",
"Identity",
"oid",
",",
"boolean",
"ignoreReferences",
")",
"throws",
"PersistenceBrokerException",
"{",
"List",
"listRds",
"=",
"cld",
".",
"getObjectReferenceDescriptors... | Deletes references that <b>obj</b> points to.
All objects which we have a FK poiting to (Via ReferenceDescriptors)
will be deleted if auto-delete is true <b>AND</b>
the member field containing the object reference is NOT null.
@param obj Object which we will delete references for
@param listRds list of ObjectRederence... | [
"Deletes",
"references",
"that",
"<b",
">",
"obj<",
"/",
"b",
">",
"points",
"to",
".",
"All",
"objects",
"which",
"we",
"have",
"a",
"FK",
"poiting",
"to",
"(",
"Via",
"ReferenceDescriptors",
")",
"will",
"be",
"deleted",
"if",
"auto",
"-",
"delete",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java#L712-L744 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java | AjaxHelper.setCurrentOperationDetails | public static void setCurrentOperationDetails(final AjaxOperation operation, final ComponentWithContext trigger) {
"""
Sets the current AJAX operation details.
@param operation the current AJAX operation.
@param trigger the current AJAX operation trigger and its context.
"""
if (operation == null) {
T... | java | public static void setCurrentOperationDetails(final AjaxOperation operation, final ComponentWithContext trigger) {
if (operation == null) {
THREAD_LOCAL_OPERATION.remove();
} else {
THREAD_LOCAL_OPERATION.set(operation);
}
if (trigger == null) {
THREAD_LOCAL_COMPONENT_WITH_CONTEXT.remove();
} else {... | [
"public",
"static",
"void",
"setCurrentOperationDetails",
"(",
"final",
"AjaxOperation",
"operation",
",",
"final",
"ComponentWithContext",
"trigger",
")",
"{",
"if",
"(",
"operation",
"==",
"null",
")",
"{",
"THREAD_LOCAL_OPERATION",
".",
"remove",
"(",
")",
";",... | Sets the current AJAX operation details.
@param operation the current AJAX operation.
@param trigger the current AJAX operation trigger and its context. | [
"Sets",
"the",
"current",
"AJAX",
"operation",
"details",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L57-L69 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/CapabilityRegistry.java | CapabilityRegistry.registerPossibleCapability | @Override
public void registerPossibleCapability(Capability capability, PathAddress registrationPoint) {
"""
Registers a capability with the system. Any
{@link org.jboss.as.controller.capability.AbstractCapability#getRequirements() requirements}
associated with the capability will be recorded as requirements... | java | @Override
public void registerPossibleCapability(Capability capability, PathAddress registrationPoint) {
final CapabilityId capabilityId = new CapabilityId(capability.getName(), CapabilityScope.GLOBAL);
RegistrationPoint point = new RegistrationPoint(registrationPoint, null);
CapabilityRegis... | [
"@",
"Override",
"public",
"void",
"registerPossibleCapability",
"(",
"Capability",
"capability",
",",
"PathAddress",
"registrationPoint",
")",
"{",
"final",
"CapabilityId",
"capabilityId",
"=",
"new",
"CapabilityId",
"(",
"capability",
".",
"getName",
"(",
")",
","... | Registers a capability with the system. Any
{@link org.jboss.as.controller.capability.AbstractCapability#getRequirements() requirements}
associated with the capability will be recorded as requirements.
@param capability the capability. Cannot be {@code null} | [
"Registers",
"a",
"capability",
"with",
"the",
"system",
".",
"Any",
"{",
"@link",
"org",
".",
"jboss",
".",
"as",
".",
"controller",
".",
"capability",
".",
"AbstractCapability#getRequirements",
"()",
"requirements",
"}",
"associated",
"with",
"the",
"capabilit... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/CapabilityRegistry.java#L561-L584 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DBAssert.java | DBAssert.tableExists | private static boolean tableExists(CallInfo callInfo, DB db, String tableName) {
"""
Check if table exists.
@param callInfo Call info.
@param db Database.
@param tableName Table name.
@return <code>true<code> if and only if the table exists.
"""
return db.access(callInfo, () -> {
DatabaseMetaDat... | java | private static boolean tableExists(CallInfo callInfo, DB db, String tableName) {
return db.access(callInfo, () -> {
DatabaseMetaData dbmd = db.getConnection().getMetaData();
try(ResultSet rs = dbmd.getTables(null, null, null, new String[] {"TABLE"})) {
while(rs.next()) {
if (tableNam... | [
"private",
"static",
"boolean",
"tableExists",
"(",
"CallInfo",
"callInfo",
",",
"DB",
"db",
",",
"String",
"tableName",
")",
"{",
"return",
"db",
".",
"access",
"(",
"callInfo",
",",
"(",
")",
"->",
"{",
"DatabaseMetaData",
"dbmd",
"=",
"db",
".",
"getC... | Check if table exists.
@param callInfo Call info.
@param db Database.
@param tableName Table name.
@return <code>true<code> if and only if the table exists. | [
"Check",
"if",
"table",
"exists",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DBAssert.java#L163-L175 |
google/closure-templates | java/src/com/google/template/soy/basetree/CopyState.java | CopyState.registerRefListener | public <T> void registerRefListener(T oldObject, final Listener<T> listener) {
"""
Registers a listener to be invoked if the given object is ever updated via the {@link
#updateRefs} method.
<p>Note: the listener may be executed inline or not at all.
"""
checkNotNull(oldObject);
checkNotNull(listene... | java | public <T> void registerRefListener(T oldObject, final Listener<T> listener) {
checkNotNull(oldObject);
checkNotNull(listener);
Object oldMapping = mappings.get(oldObject);
if (oldMapping == null) {
// store the listener so it will be run when the old object mapping is registered
mappings.pu... | [
"public",
"<",
"T",
">",
"void",
"registerRefListener",
"(",
"T",
"oldObject",
",",
"final",
"Listener",
"<",
"T",
">",
"listener",
")",
"{",
"checkNotNull",
"(",
"oldObject",
")",
";",
"checkNotNull",
"(",
"listener",
")",
";",
"Object",
"oldMapping",
"="... | Registers a listener to be invoked if the given object is ever updated via the {@link
#updateRefs} method.
<p>Note: the listener may be executed inline or not at all. | [
"Registers",
"a",
"listener",
"to",
"be",
"invoked",
"if",
"the",
"given",
"object",
"is",
"ever",
"updated",
"via",
"the",
"{",
"@link",
"#updateRefs",
"}",
"method",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/basetree/CopyState.java#L76-L94 |
killme2008/gecko | src/main/java/com/taobao/gecko/service/timer/ConcurrentIdentityHashMap.java | ConcurrentIdentityHashMap.replace | public V replace(K key, V value) {
"""
{@inheritDoc}
@return the previous value associated with the specified key, or
<tt>null</tt> if there was no mapping for the key
@throws NullPointerException
if the specified key or value is null
"""
if (value == null) {
throw new NullPointerExce... | java | public V replace(K key, V value) {
if (value == null) {
throw new NullPointerException();
}
int hash = this.hashOf(key);
return this.segmentFor(hash).replace(key, hash, value);
} | [
"public",
"V",
"replace",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"int",
"hash",
"=",
"this",
".",
"hashOf",
"(",
"key",
")",
";",
"retu... | {@inheritDoc}
@return the previous value associated with the specified key, or
<tt>null</tt> if there was no mapping for the key
@throws NullPointerException
if the specified key or value is null | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/killme2008/gecko/blob/0873b690ffde51e40e6eadfcd5d599eb4e3b642d/src/main/java/com/taobao/gecko/service/timer/ConcurrentIdentityHashMap.java#L1088-L1094 |
fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getVersionLabel | public String getVersionLabel(final Graph graph, final Node subject) {
"""
Get the date time as the version label.
@param graph the graph
@param subject the subject
@return the datetime in RFC 1123 format.
"""
final Instant datetime = getVersionDate(graph, subject);
return MEMENTO_RFC_1123... | java | public String getVersionLabel(final Graph graph, final Node subject) {
final Instant datetime = getVersionDate(graph, subject);
return MEMENTO_RFC_1123_FORMATTER.format(datetime);
} | [
"public",
"String",
"getVersionLabel",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"subject",
")",
"{",
"final",
"Instant",
"datetime",
"=",
"getVersionDate",
"(",
"graph",
",",
"subject",
")",
";",
"return",
"MEMENTO_RFC_1123_FORMATTER",
".",
"format"... | Get the date time as the version label.
@param graph the graph
@param subject the subject
@return the datetime in RFC 1123 format. | [
"Get",
"the",
"date",
"time",
"as",
"the",
"version",
"label",
"."
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L155-L158 |
protostuff/protostuff | protostuff-core/src/main/java/io/protostuff/CodedInput.java | CodedInput.mergeObjectEncodedAsGroup | private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException {
"""
Reads a message field value from the stream (using the {@code group} encoding).
"""
// if (recursionDepth >= recursionLimit) {
// throw ProtobufException.recursionLimitExceeded();
// }
... | java | private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException
{
// if (recursionDepth >= recursionLimit) {
// throw ProtobufException.recursionLimitExceeded();
// }
// ++recursionDepth;
if (value == null)
{
value = schema.new... | [
"private",
"<",
"T",
">",
"T",
"mergeObjectEncodedAsGroup",
"(",
"T",
"value",
",",
"final",
"Schema",
"<",
"T",
">",
"schema",
")",
"throws",
"IOException",
"{",
"// if (recursionDepth >= recursionLimit) {",
"// throw ProtobufException.recursionLimitExceeded();",
"// }",... | Reads a message field value from the stream (using the {@code group} encoding). | [
"Reads",
"a",
"message",
"field",
"value",
"from",
"the",
"stream",
"(",
"using",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-core/src/main/java/io/protostuff/CodedInput.java#L348-L368 |
awin/rabbiteasy | rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/publisher/DiscretePublisher.java | DiscretePublisher.handleIoException | protected void handleIoException(int attempt, IOException ioException) throws IOException {
"""
Handles an IOException depending on the already used attempts to
send a message. Also performs a soft reset of the currently used channel.
@param attempt Current attempt count
@param ioException The thrown exceptio... | java | protected void handleIoException(int attempt, IOException ioException) throws IOException {
if (channel != null && channel.isOpen()) {
try {
channel.close();
} catch (IOException e) {
LOGGER.warn("Failed to close channel after failed publish", e);
... | [
"protected",
"void",
"handleIoException",
"(",
"int",
"attempt",
",",
"IOException",
"ioException",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channel",
"!=",
"null",
"&&",
"channel",
".",
"isOpen",
"(",
")",
")",
"{",
"try",
"{",
"channel",
".",
"clos... | Handles an IOException depending on the already used attempts to
send a message. Also performs a soft reset of the currently used channel.
@param attempt Current attempt count
@param ioException The thrown exception
@throws IOException if the maximum amount of attempts is exceeded | [
"Handles",
"an",
"IOException",
"depending",
"on",
"the",
"already",
"used",
"attempts",
"to",
"send",
"a",
"message",
".",
"Also",
"performs",
"a",
"soft",
"reset",
"of",
"the",
"currently",
"used",
"channel",
"."
] | train | https://github.com/awin/rabbiteasy/blob/c161efda6c0f7ef319aedf09dfe40a4a90165510/rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/publisher/DiscretePublisher.java#L89-L106 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getProperty | public static Object getProperty(Scriptable obj, int index) {
"""
Gets an indexed property from an object or any object in its prototype chain.
<p>
Searches the prototype chain for a property with integral index
<code>index</code>. Note that if you wish to look for properties with numerical
but non-integral in... | java | public static Object getProperty(Scriptable obj, int index)
{
Scriptable start = obj;
Object result;
do {
result = obj.get(index, start);
if (result != Scriptable.NOT_FOUND)
break;
obj = obj.getPrototype();
} while (obj != null);
... | [
"public",
"static",
"Object",
"getProperty",
"(",
"Scriptable",
"obj",
",",
"int",
"index",
")",
"{",
"Scriptable",
"start",
"=",
"obj",
";",
"Object",
"result",
";",
"do",
"{",
"result",
"=",
"obj",
".",
"get",
"(",
"index",
",",
"start",
")",
";",
... | Gets an indexed property from an object or any object in its prototype chain.
<p>
Searches the prototype chain for a property with integral index
<code>index</code>. Note that if you wish to look for properties with numerical
but non-integral indicies, you should use getProperty(Scriptable,String) with
the string value... | [
"Gets",
"an",
"indexed",
"property",
"from",
"an",
"object",
"or",
"any",
"object",
"in",
"its",
"prototype",
"chain",
".",
"<p",
">",
"Searches",
"the",
"prototype",
"chain",
"for",
"a",
"property",
"with",
"integral",
"index",
"<code",
">",
"index<",
"/"... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2386-L2397 |
petergeneric/stdlib | guice/hibernate/src/main/java/com/peterphi/std/guice/hibernate/webquery/impl/jpa/JPAQueryBuilder.java | JPAQueryBuilder.getOrCreateJoin | @Override
public JPAJoin getOrCreateJoin(final WQPath path) {
"""
Ensure a join has been set up for a path
@param path
@return
"""
if (path == null)
return new JPAJoin(criteriaBuilder, entity, root, false);
if (!joins.containsKey(path.getPath()))
{
final JPAJoin parent = getOrCreateJoin(pat... | java | @Override
public JPAJoin getOrCreateJoin(final WQPath path)
{
if (path == null)
return new JPAJoin(criteriaBuilder, entity, root, false);
if (!joins.containsKey(path.getPath()))
{
final JPAJoin parent = getOrCreateJoin(path.getTail());
final JPAJoin join = parent.join(path.getHead().getPath());
j... | [
"@",
"Override",
"public",
"JPAJoin",
"getOrCreateJoin",
"(",
"final",
"WQPath",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"return",
"new",
"JPAJoin",
"(",
"criteriaBuilder",
",",
"entity",
",",
"root",
",",
"false",
")",
";",
"if",
"(",
... | Ensure a join has been set up for a path
@param path
@return | [
"Ensure",
"a",
"join",
"has",
"been",
"set",
"up",
"for",
"a",
"path"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/hibernate/src/main/java/com/peterphi/std/guice/hibernate/webquery/impl/jpa/JPAQueryBuilder.java#L196-L216 |
abel533/Mapper | core/src/main/java/tk/mybatis/mapper/mapperhelper/SqlHelper.java | SqlHelper.logicDeleteColumnEqualsValue | public static String logicDeleteColumnEqualsValue(Class<?> entityClass, boolean isDeleted) {
"""
返回格式: column = value
<br>
默认isDeletedValue = 1 notDeletedValue = 0
<br>
则返回is_deleted = 1 或 is_deleted = 0
<br>
若没有逻辑删除注解,则返回空字符串
@param entityClass
@param isDeleted true 已经逻辑删除 false 未逻辑删除
"""
... | java | public static String logicDeleteColumnEqualsValue(Class<?> entityClass, boolean isDeleted) {
EntityColumn logicDeleteColumn = SqlHelper.getLogicDeleteColumn(entityClass);
if (logicDeleteColumn != null) {
return logicDeleteColumnEqualsValue(logicDeleteColumn, isDeleted);
}
r... | [
"public",
"static",
"String",
"logicDeleteColumnEqualsValue",
"(",
"Class",
"<",
"?",
">",
"entityClass",
",",
"boolean",
"isDeleted",
")",
"{",
"EntityColumn",
"logicDeleteColumn",
"=",
"SqlHelper",
".",
"getLogicDeleteColumn",
"(",
"entityClass",
")",
";",
"if",
... | 返回格式: column = value
<br>
默认isDeletedValue = 1 notDeletedValue = 0
<br>
则返回is_deleted = 1 或 is_deleted = 0
<br>
若没有逻辑删除注解,则返回空字符串
@param entityClass
@param isDeleted true 已经逻辑删除 false 未逻辑删除 | [
"返回格式",
":",
"column",
"=",
"value",
"<br",
">",
"默认isDeletedValue",
"=",
"1",
"notDeletedValue",
"=",
"0",
"<br",
">",
"则返回is_deleted",
"=",
"1",
"或",
"is_deleted",
"=",
"0",
"<br",
">",
"若没有逻辑删除注解,则返回空字符串"
] | train | https://github.com/abel533/Mapper/blob/45c3d716583cba3680e03f1f6790fab5e1f4f668/core/src/main/java/tk/mybatis/mapper/mapperhelper/SqlHelper.java#L740-L748 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java | OtpInputStream.read_string | public String read_string() throws OtpErlangDecodeException {
"""
Read a string from the stream.
@return the value of the string.
@exception OtpErlangDecodeException
if the next term in the stream is not a string.
"""
int tag;
int len;
byte[] strbuf;
int[] intbuf;
... | java | public String read_string() throws OtpErlangDecodeException {
int tag;
int len;
byte[] strbuf;
int[] intbuf;
tag = read1skip_version();
switch (tag) {
case OtpExternal.stringTag:
len = read2BE();
strbuf = new byte[len];
this.rea... | [
"public",
"String",
"read_string",
"(",
")",
"throws",
"OtpErlangDecodeException",
"{",
"int",
"tag",
";",
"int",
"len",
";",
"byte",
"[",
"]",
"strbuf",
";",
"int",
"[",
"]",
"intbuf",
";",
"tag",
"=",
"read1skip_version",
"(",
")",
";",
"switch",
"(",
... | Read a string from the stream.
@return the value of the string.
@exception OtpErlangDecodeException
if the next term in the stream is not a string. | [
"Read",
"a",
"string",
"from",
"the",
"stream",
"."
] | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java#L1115-L1146 |
google/gson | gson/src/main/java/com/google/gson/Gson.java | Gson.toJson | public void toJson(JsonElement jsonElement, JsonWriter writer) throws JsonIOException {
"""
Writes the JSON for {@code jsonElement} to {@code writer}.
@throws JsonIOException if there was a problem writing to the writer
"""
boolean oldLenient = writer.isLenient();
writer.setLenient(true);
boolean ... | java | public void toJson(JsonElement jsonElement, JsonWriter writer) throws JsonIOException {
boolean oldLenient = writer.isLenient();
writer.setLenient(true);
boolean oldHtmlSafe = writer.isHtmlSafe();
writer.setHtmlSafe(htmlSafe);
boolean oldSerializeNulls = writer.getSerializeNulls();
writer.setSer... | [
"public",
"void",
"toJson",
"(",
"JsonElement",
"jsonElement",
",",
"JsonWriter",
"writer",
")",
"throws",
"JsonIOException",
"{",
"boolean",
"oldLenient",
"=",
"writer",
".",
"isLenient",
"(",
")",
";",
"writer",
".",
"setLenient",
"(",
"true",
")",
";",
"b... | Writes the JSON for {@code jsonElement} to {@code writer}.
@throws JsonIOException if there was a problem writing to the writer | [
"Writes",
"the",
"JSON",
"for",
"{"
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/Gson.java#L776-L796 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/format/FastDateParser.java | FastDateParser.getLocaleSpecificStrategy | private Strategy getLocaleSpecificStrategy(final int field, final Calendar definingCalendar) {
"""
Construct a Strategy that parses a Text field
@param field The Calendar field
@param definingCalendar The calendar to obtain the short and long values
@return a TextStrategy for the field and Locale
"""
fi... | java | private Strategy getLocaleSpecificStrategy(final int field, final Calendar definingCalendar) {
final ConcurrentMap<Locale, Strategy> cache = getCache(field);
Strategy strategy = cache.get(locale);
if (strategy == null) {
strategy = field == Calendar.ZONE_OFFSET ? new TimeZoneStrategy(locale) : new CaseInsensit... | [
"private",
"Strategy",
"getLocaleSpecificStrategy",
"(",
"final",
"int",
"field",
",",
"final",
"Calendar",
"definingCalendar",
")",
"{",
"final",
"ConcurrentMap",
"<",
"Locale",
",",
"Strategy",
">",
"cache",
"=",
"getCache",
"(",
"field",
")",
";",
"Strategy",... | Construct a Strategy that parses a Text field
@param field The Calendar field
@param definingCalendar The calendar to obtain the short and long values
@return a TextStrategy for the field and Locale | [
"Construct",
"a",
"Strategy",
"that",
"parses",
"a",
"Text",
"field"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDateParser.java#L474-L485 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.addSource | @SuppressWarnings("unchecked")
public <OUT> DataStreamSource<OUT> addSource(SourceFunction<OUT> function, String sourceName, TypeInformation<OUT> typeInfo) {
"""
Ads a data source with a custom type information thus opening a
{@link DataStream}. Only in very special cases does the user need to
support type info... | java | @SuppressWarnings("unchecked")
public <OUT> DataStreamSource<OUT> addSource(SourceFunction<OUT> function, String sourceName, TypeInformation<OUT> typeInfo) {
if (typeInfo == null) {
if (function instanceof ResultTypeQueryable) {
typeInfo = ((ResultTypeQueryable<OUT>) function).getProducedType();
} else {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"addSource",
"(",
"SourceFunction",
"<",
"OUT",
">",
"function",
",",
"String",
"sourceName",
",",
"TypeInformation",
"<",
"OUT",
">",
"typeInfo... | Ads a data source with a custom type information thus opening a
{@link DataStream}. Only in very special cases does the user need to
support type information. Otherwise use
{@link #addSource(org.apache.flink.streaming.api.functions.source.SourceFunction)}
@param function
the user defined function
@param sourceName
Nam... | [
"Ads",
"a",
"data",
"source",
"with",
"a",
"custom",
"type",
"information",
"thus",
"opening",
"a",
"{",
"@link",
"DataStream",
"}",
".",
"Only",
"in",
"very",
"special",
"cases",
"does",
"the",
"user",
"need",
"to",
"support",
"type",
"information",
".",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L1449-L1472 |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeIA5String | public static int encodeIA5String(String value, ByteBuffer buf) {
"""
Encode an ASN.1 IA5String.
@param value
the value to be encoded
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data
"""
int pos = buf.position... | java | public static int encodeIA5String(String value, ByteBuffer buf) {
int pos = buf.position();
byte[] data = (value == null) ? new byte[0] : value.getBytes();
for (int i = data.length - 1; i >= 0; i--) {
pos--;
buf.put(pos, data[i]);
}
buf.position(buf.positi... | [
"public",
"static",
"int",
"encodeIA5String",
"(",
"String",
"value",
",",
"ByteBuffer",
"buf",
")",
"{",
"int",
"pos",
"=",
"buf",
".",
"position",
"(",
")",
";",
"byte",
"[",
"]",
"data",
"=",
"(",
"value",
"==",
"null",
")",
"?",
"new",
"byte",
... | Encode an ASN.1 IA5String.
@param value
the value to be encoded
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"IA5String",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L308-L319 |
sannies/mp4parser | streaming/src/main/java/org/mp4parser/streaming/output/mp4/FragmentedMp4Writer.java | FragmentedMp4Writer.isFragmentReady | protected boolean isFragmentReady(StreamingTrack streamingTrack, StreamingSample next) {
"""
Tests if the currently received samples for a given track
form a valid fragment taking the latest received sample into
account. The next sample is not part of the segment and
will be added to the fragment buffer later.
... | java | protected boolean isFragmentReady(StreamingTrack streamingTrack, StreamingSample next) {
long ts = nextSampleStartTime.get(streamingTrack);
long cfst = nextFragmentCreateStartTime.get(streamingTrack);
if ((ts > cfst + 3 * streamingTrack.getTimescale())) {
// mininum fragment length ... | [
"protected",
"boolean",
"isFragmentReady",
"(",
"StreamingTrack",
"streamingTrack",
",",
"StreamingSample",
"next",
")",
"{",
"long",
"ts",
"=",
"nextSampleStartTime",
".",
"get",
"(",
"streamingTrack",
")",
";",
"long",
"cfst",
"=",
"nextFragmentCreateStartTime",
"... | Tests if the currently received samples for a given track
form a valid fragment taking the latest received sample into
account. The next sample is not part of the segment and
will be added to the fragment buffer later.
@param streamingTrack track to test
@param next the lastest samples
@return true if a frag... | [
"Tests",
"if",
"the",
"currently",
"received",
"samples",
"for",
"a",
"given",
"track",
"form",
"a",
"valid",
"fragment",
"taking",
"the",
"latest",
"received",
"sample",
"into",
"account",
".",
"The",
"next",
"sample",
"is",
"not",
"part",
"of",
"the",
"s... | train | https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/streaming/src/main/java/org/mp4parser/streaming/output/mp4/FragmentedMp4Writer.java#L299-L314 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/MetatypeUtils.java | MetatypeUtils.parseBoolean | public static boolean parseBoolean(Object configAlias, String propertyKey, Object obj, boolean defaultValue) {
"""
Parse a boolean from the provided config value: checks for whether or not
the object read from the Service/Component configuration is a String
or a Metatype converted boolean.
<p>
If an exception ... | java | public static boolean parseBoolean(Object configAlias, String propertyKey, Object obj, boolean defaultValue) {
if (obj != null) {
if (obj instanceof String) {
String value = (String) obj;
if (value.equalsIgnoreCase("true")) {
return true;
... | [
"public",
"static",
"boolean",
"parseBoolean",
"(",
"Object",
"configAlias",
",",
"String",
"propertyKey",
",",
"Object",
"obj",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"obj",
"!=",
"null",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"String",
"... | Parse a boolean from the provided config value: checks for whether or not
the object read from the Service/Component configuration is a String
or a Metatype converted boolean.
<p>
If an exception occurs converting the object parameter:
A translated warning message will be issued using the provided propertyKey and objec... | [
"Parse",
"a",
"boolean",
"from",
"the",
"provided",
"config",
"value",
":",
"checks",
"for",
"whether",
"or",
"not",
"the",
"object",
"read",
"from",
"the",
"Service",
"/",
"Component",
"configuration",
"is",
"a",
"String",
"or",
"a",
"Metatype",
"converted"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/MetatypeUtils.java#L113-L134 |
GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/outputs/LevelDbOutputWriter.java | LevelDbOutputWriter.writePhysicalRecord | private void writePhysicalRecord(ByteBuffer data, Record record) {
"""
This method creates a record inside of a {@link ByteBuffer}
@param data The data to output.
@param record A {@link Record} object that describes
which data to write.
"""
writeBuffer.putInt(generateCrc(data.array(), data.position(),... | java | private void writePhysicalRecord(ByteBuffer data, Record record) {
writeBuffer.putInt(generateCrc(data.array(), data.position(), record.getBytes(),
record.getType()));
writeBuffer.putShort((short) record.getBytes());
writeBuffer.put(record.getType().value());
int oldLimit = data.limit();
dat... | [
"private",
"void",
"writePhysicalRecord",
"(",
"ByteBuffer",
"data",
",",
"Record",
"record",
")",
"{",
"writeBuffer",
".",
"putInt",
"(",
"generateCrc",
"(",
"data",
".",
"array",
"(",
")",
",",
"data",
".",
"position",
"(",
")",
",",
"record",
".",
"ge... | This method creates a record inside of a {@link ByteBuffer}
@param data The data to output.
@param record A {@link Record} object that describes
which data to write. | [
"This",
"method",
"creates",
"a",
"record",
"inside",
"of",
"a",
"{",
"@link",
"ByteBuffer",
"}"
] | train | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/outputs/LevelDbOutputWriter.java#L182-L191 |
zackpollard/JavaTelegramBot-API | core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java | TelegramBot.kickChatMember | public boolean kickChatMember(String chatId, int userId) {
"""
Use this method to kick a user from a group or a supergroup. In the case of supergroups, the user will not be
able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be
an administrator in the group for ... | java | public boolean kickChatMember(String chatId, int userId) {
HttpResponse<String> response;
JSONObject jsonResponse;
try {
MultipartBody request = Unirest.post(getBotAPIUrl() + "kickChatMember")
.field("chat_id", chatId, "application/json; charset=utf8;")
... | [
"public",
"boolean",
"kickChatMember",
"(",
"String",
"chatId",
",",
"int",
"userId",
")",
"{",
"HttpResponse",
"<",
"String",
">",
"response",
";",
"JSONObject",
"jsonResponse",
";",
"try",
"{",
"MultipartBody",
"request",
"=",
"Unirest",
".",
"post",
"(",
... | Use this method to kick a user from a group or a supergroup. In the case of supergroups, the user will not be
able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be
an administrator in the group for this to work
@param chatId The ID of the chat that you want to kic... | [
"Use",
"this",
"method",
"to",
"kick",
"a",
"user",
"from",
"a",
"group",
"or",
"a",
"supergroup",
".",
"In",
"the",
"case",
"of",
"supergroups",
"the",
"user",
"will",
"not",
"be",
"able",
"to",
"return",
"to",
"the",
"group",
"on",
"their",
"own",
... | train | https://github.com/zackpollard/JavaTelegramBot-API/blob/9d100f351824042ca5fc0ea735d1fa376a13e81d/core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java#L1036-L1058 |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java | ObjectMappedQuery.getObject | public T getObject(Connection conn, DataObject object) throws Exception {
"""
Executes the query and returns the first row of the results as a single object.
"""
return executeSelect(conn, object, new ResultSetMapper<SingleObjectCollector<T>>(new SingleObjectCollector<T>())).value;
} | java | public T getObject(Connection conn, DataObject object) throws Exception {
return executeSelect(conn, object, new ResultSetMapper<SingleObjectCollector<T>>(new SingleObjectCollector<T>())).value;
} | [
"public",
"T",
"getObject",
"(",
"Connection",
"conn",
",",
"DataObject",
"object",
")",
"throws",
"Exception",
"{",
"return",
"executeSelect",
"(",
"conn",
",",
"object",
",",
"new",
"ResultSetMapper",
"<",
"SingleObjectCollector",
"<",
"T",
">",
">",
"(",
... | Executes the query and returns the first row of the results as a single object. | [
"Executes",
"the",
"query",
"and",
"returns",
"the",
"first",
"row",
"of",
"the",
"results",
"as",
"a",
"single",
"object",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java#L135-L137 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java | CharsTrie.readValue | private static int readValue(CharSequence chars, int pos, int leadUnit) {
"""
pos is already after the leadUnit, and the lead unit has bit 15 reset.
"""
int value;
if(leadUnit<kMinTwoUnitValueLead) {
value=leadUnit;
} else if(leadUnit<kThreeUnitValueLead) {
value... | java | private static int readValue(CharSequence chars, int pos, int leadUnit) {
int value;
if(leadUnit<kMinTwoUnitValueLead) {
value=leadUnit;
} else if(leadUnit<kThreeUnitValueLead) {
value=((leadUnit-kMinTwoUnitValueLead)<<16)|chars.charAt(pos);
} else {
v... | [
"private",
"static",
"int",
"readValue",
"(",
"CharSequence",
"chars",
",",
"int",
"pos",
",",
"int",
"leadUnit",
")",
"{",
"int",
"value",
";",
"if",
"(",
"leadUnit",
"<",
"kMinTwoUnitValueLead",
")",
"{",
"value",
"=",
"leadUnit",
";",
"}",
"else",
"if... | pos is already after the leadUnit, and the lead unit has bit 15 reset. | [
"pos",
"is",
"already",
"after",
"the",
"leadUnit",
"and",
"the",
"lead",
"unit",
"has",
"bit",
"15",
"reset",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java#L627-L637 |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/util/CharsetUtils.java | CharsetUtils.asString | public static String asString(byte[] bytes, Charset charset) {
"""
Turns a byte[] array into a string in the provided {@link Charset}
@param bytes
@param charset
@return a String
"""
if (bytes == null)
{
return null;
}
if (charset == null)
{
... | java | public static String asString(byte[] bytes, Charset charset)
{
if (bytes == null)
{
return null;
}
if (charset == null)
{
throw new IllegalArgumentException("Cannot get bytes without a Charset");
}
try
{
return new... | [
"public",
"static",
"String",
"asString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"charset",
"==",
"null",
")",
"{",
"throw",
"new",
"Il... | Turns a byte[] array into a string in the provided {@link Charset}
@param bytes
@param charset
@return a String | [
"Turns",
"a",
"byte",
"[]",
"array",
"into",
"a",
"string",
"in",
"the",
"provided",
"{",
"@link",
"Charset",
"}"
] | train | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/util/CharsetUtils.java#L183-L203 |
Unicon/cas-addons | src/main/java/net/unicon/cas/addons/authentication/strong/oath/totp/TOTP.java | TOTP.generateTOTP | public static int generateTOTP(byte[] key, long time, int digits, String crypto) {
"""
This method generates a TOTP value for the given set of parameters.
@param key
: the shared secret
@param time
: a value that reflects a time
@param digits
: number of digits to return
@param crypto
: the crypto functi... | java | public static int generateTOTP(byte[] key, long time, int digits, String crypto) {
byte[] msg = ByteBuffer.allocate(8).putLong(time).array();
byte[] hash = hmacSha(crypto, key, msg);
// put selected bytes into result int
int offset = hash[hash.length - 1] & 0xf;
int binary = (... | [
"public",
"static",
"int",
"generateTOTP",
"(",
"byte",
"[",
"]",
"key",
",",
"long",
"time",
",",
"int",
"digits",
",",
"String",
"crypto",
")",
"{",
"byte",
"[",
"]",
"msg",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"8",
")",
".",
"putLong",
"(",
... | This method generates a TOTP value for the given set of parameters.
@param key
: the shared secret
@param time
: a value that reflects a time
@param digits
: number of digits to return
@param crypto
: the crypto function to use
@return digits | [
"This",
"method",
"generates",
"a",
"TOTP",
"value",
"for",
"the",
"given",
"set",
"of",
"parameters",
"."
] | train | https://github.com/Unicon/cas-addons/blob/9af2d4896e02d30622acec638539bfc41f45e480/src/main/java/net/unicon/cas/addons/authentication/strong/oath/totp/TOTP.java#L62-L75 |
brianwhu/xillium | base/src/main/java/org/xillium/base/Singleton.java | Singleton.slow | public synchronized T slow(Factory<T> p, Object... args) throws Exception {
"""
For performance evaluation only - do not use.
@param p a {@link org.xillium.base.Factory Factory} that can be called to create a new value with more than 1 arguments
@param args the arguments to pass to the factory
@return the sin... | java | public synchronized T slow(Factory<T> p, Object... args) throws Exception {
T result = _value;
if (isMissing(result)) {
_value = result = p.make(args);
}
return result;
} | [
"public",
"synchronized",
"T",
"slow",
"(",
"Factory",
"<",
"T",
">",
"p",
",",
"Object",
"...",
"args",
")",
"throws",
"Exception",
"{",
"T",
"result",
"=",
"_value",
";",
"if",
"(",
"isMissing",
"(",
"result",
")",
")",
"{",
"_value",
"=",
"result"... | For performance evaluation only - do not use.
@param p a {@link org.xillium.base.Factory Factory} that can be called to create a new value with more than 1 arguments
@param args the arguments to pass to the factory
@return the singleton object
@throws Exception if the factory fails to create a new value | [
"For",
"performance",
"evaluation",
"only",
"-",
"do",
"not",
"use",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/Singleton.java#L101-L107 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/calibration/CalibratedCurves.java | CalibratedCurves.getCloneShifted | public CalibratedCurves getCloneShifted(String symbol, double shift) throws SolverException, CloneNotSupportedException {
"""
Returns the set curves calibrated to "shifted" market data, that is,
the market date of <code>this</code> object, modified by the shifts
provided to this methods.
@param symbol The sym... | java | public CalibratedCurves getCloneShifted(String symbol, double shift) throws SolverException, CloneNotSupportedException {
// Clone calibration specs, shifting the desired symbol
List<CalibrationSpec> calibrationSpecsShifted = new ArrayList<>();
for(CalibrationSpec calibrationSpec : calibrationSpecs) {
if(calib... | [
"public",
"CalibratedCurves",
"getCloneShifted",
"(",
"String",
"symbol",
",",
"double",
"shift",
")",
"throws",
"SolverException",
",",
"CloneNotSupportedException",
"{",
"// Clone calibration specs, shifting the desired symbol",
"List",
"<",
"CalibrationSpec",
">",
"calibra... | Returns the set curves calibrated to "shifted" market data, that is,
the market date of <code>this</code> object, modified by the shifts
provided to this methods.
@param symbol The symbol to shift. All other symbols remain unshifted.
@param shift The shift to apply to the symbol.
@return A new set of calibrated curves... | [
"Returns",
"the",
"set",
"curves",
"calibrated",
"to",
"shifted",
"market",
"data",
"that",
"is",
"the",
"market",
"date",
"of",
"<code",
">",
"this<",
"/",
"code",
">",
"object",
"modified",
"by",
"the",
"shifts",
"provided",
"to",
"this",
"methods",
"."
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/calibration/CalibratedCurves.java#L568-L581 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/rebond/RebondTool.java | RebondTool.isBonded | private boolean isBonded(double covalentRadiusA, double covalentRadiusB, double distance2) {
"""
Returns the bond order for the bond. At this moment, it only returns
0 or 1, but not 2 or 3, or aromatic bond order.
"""
double maxAcceptable = covalentRadiusA + covalentRadiusB + bondTolerance;
do... | java | private boolean isBonded(double covalentRadiusA, double covalentRadiusB, double distance2) {
double maxAcceptable = covalentRadiusA + covalentRadiusB + bondTolerance;
double maxAcceptable2 = maxAcceptable * maxAcceptable;
double minBondDistance2 = this.minBondDistance * this.minBondDistance;
... | [
"private",
"boolean",
"isBonded",
"(",
"double",
"covalentRadiusA",
",",
"double",
"covalentRadiusB",
",",
"double",
"distance2",
")",
"{",
"double",
"maxAcceptable",
"=",
"covalentRadiusA",
"+",
"covalentRadiusB",
"+",
"bondTolerance",
";",
"double",
"maxAcceptable2"... | Returns the bond order for the bond. At this moment, it only returns
0 or 1, but not 2 or 3, or aromatic bond order. | [
"Returns",
"the",
"bond",
"order",
"for",
"the",
"bond",
".",
"At",
"this",
"moment",
"it",
"only",
"returns",
"0",
"or",
"1",
"but",
"not",
"2",
"or",
"3",
"or",
"aromatic",
"bond",
"order",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/rebond/RebondTool.java#L117-L123 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.getShort | public static Short getShort(Map<?, ?> map, Object key) {
"""
获取Map指定key的值,并转换为Short
@param map Map
@param key 键
@return 值
@since 4.0.6
"""
return get(map, key, Short.class);
} | java | public static Short getShort(Map<?, ?> map, Object key) {
return get(map, key, Short.class);
} | [
"public",
"static",
"Short",
"getShort",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Object",
"key",
")",
"{",
"return",
"get",
"(",
"map",
",",
"key",
",",
"Short",
".",
"class",
")",
";",
"}"
] | 获取Map指定key的值,并转换为Short
@param map Map
@param key 键
@return 值
@since 4.0.6 | [
"获取Map指定key的值,并转换为Short"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L804-L806 |
strator-dev/greenpepper | greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/compiler/CompilerWrapper.java | CompilerWrapper.addConstructor | public void addConstructor(Class<?> [] params, String ... lines) throws CannotCompileException, NotFoundException {
"""
<p>addConstructor.</p>
@param params an array of {@link java.lang.Class} objects.
@param lines a {@link java.lang.String} object.
@throws javassist.CannotCompileException if any.
@throws ja... | java | public void addConstructor(Class<?> [] params, String ... lines) throws CannotCompileException, NotFoundException {
CtConstructor c = new CtConstructor(getList(params), clazz);
int modifiers = Modifier.PUBLIC;
c.setModifiers(modifiers);
c.setBody(formatCode(lines));
clazz.addConstructor(c);
} | [
"public",
"void",
"addConstructor",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"params",
",",
"String",
"...",
"lines",
")",
"throws",
"CannotCompileException",
",",
"NotFoundException",
"{",
"CtConstructor",
"c",
"=",
"new",
"CtConstructor",
"(",
"getList",
"(",
... | <p>addConstructor.</p>
@param params an array of {@link java.lang.Class} objects.
@param lines a {@link java.lang.String} object.
@throws javassist.CannotCompileException if any.
@throws javassist.NotFoundException if any. | [
"<p",
">",
"addConstructor",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/compiler/CompilerWrapper.java#L171-L177 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java | PvmExecutionImpl.delayEvent | public void delayEvent(PvmExecutionImpl targetScope, VariableEvent variableEvent) {
"""
Delays a given variable event with the given target scope.
@param targetScope the target scope of the variable event
@param variableEvent the variable event which should be delayed
"""
DelayedVariableEvent delayed... | java | public void delayEvent(PvmExecutionImpl targetScope, VariableEvent variableEvent) {
DelayedVariableEvent delayedVariableEvent = new DelayedVariableEvent(targetScope, variableEvent);
delayEvent(delayedVariableEvent);
} | [
"public",
"void",
"delayEvent",
"(",
"PvmExecutionImpl",
"targetScope",
",",
"VariableEvent",
"variableEvent",
")",
"{",
"DelayedVariableEvent",
"delayedVariableEvent",
"=",
"new",
"DelayedVariableEvent",
"(",
"targetScope",
",",
"variableEvent",
")",
";",
"delayEvent",
... | Delays a given variable event with the given target scope.
@param targetScope the target scope of the variable event
@param variableEvent the variable event which should be delayed | [
"Delays",
"a",
"given",
"variable",
"event",
"with",
"the",
"given",
"target",
"scope",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L1866-L1869 |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EDBModelObject.java | EDBModelObject.getModelDescription | public ModelDescription getModelDescription() {
"""
Returns the model description for the model class of the EDBModelObject
"""
String modelType = object.getString(EDBConstants.MODEL_TYPE);
String version = object.getString(EDBConstants.MODEL_TYPE_VERSION);
return new ModelDescription(m... | java | public ModelDescription getModelDescription() {
String modelType = object.getString(EDBConstants.MODEL_TYPE);
String version = object.getString(EDBConstants.MODEL_TYPE_VERSION);
return new ModelDescription(modelType, version);
} | [
"public",
"ModelDescription",
"getModelDescription",
"(",
")",
"{",
"String",
"modelType",
"=",
"object",
".",
"getString",
"(",
"EDBConstants",
".",
"MODEL_TYPE",
")",
";",
"String",
"version",
"=",
"object",
".",
"getString",
"(",
"EDBConstants",
".",
"MODEL_T... | Returns the model description for the model class of the EDBModelObject | [
"Returns",
"the",
"model",
"description",
"for",
"the",
"model",
"class",
"of",
"the",
"EDBModelObject"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EDBModelObject.java#L46-L50 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javah/Gen.java | Gen.wrapWriter | protected PrintWriter wrapWriter(OutputStream o) throws Util.Exit {
"""
We explicitly need to write ASCII files because that is what C
compilers understand.
"""
try {
return new PrintWriter(new OutputStreamWriter(o, "ISO8859_1"), true);
} catch (UnsupportedEncodingException use) {
... | java | protected PrintWriter wrapWriter(OutputStream o) throws Util.Exit {
try {
return new PrintWriter(new OutputStreamWriter(o, "ISO8859_1"), true);
} catch (UnsupportedEncodingException use) {
util.bug("encoding.iso8859_1.not.found");
return null; /* dead code */
... | [
"protected",
"PrintWriter",
"wrapWriter",
"(",
"OutputStream",
"o",
")",
"throws",
"Util",
".",
"Exit",
"{",
"try",
"{",
"return",
"new",
"PrintWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"o",
",",
"\"ISO8859_1\"",
")",
",",
"true",
")",
";",
"}",
"cat... | We explicitly need to write ASCII files because that is what C
compilers understand. | [
"We",
"explicitly",
"need",
"to",
"write",
"ASCII",
"files",
"because",
"that",
"is",
"what",
"C",
"compilers",
"understand",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javah/Gen.java#L141-L148 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java | TableUtils.deleteTableIfExists | public static final boolean deleteTableIfExists(final AmazonDynamoDB dynamo, final DeleteTableRequest deleteTableRequest) {
"""
Deletes the table and ignores any errors if it doesn't exist.
@param dynamo The Dynamo client to use.
@param deleteTableRequest The delete table request.
@return True if deleted, false... | java | public static final boolean deleteTableIfExists(final AmazonDynamoDB dynamo, final DeleteTableRequest deleteTableRequest) {
try {
dynamo.deleteTable(deleteTableRequest);
return true;
} catch (final ResourceNotFoundException e) {
if (LOG.isTraceEnabled()) {
... | [
"public",
"static",
"final",
"boolean",
"deleteTableIfExists",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"DeleteTableRequest",
"deleteTableRequest",
")",
"{",
"try",
"{",
"dynamo",
".",
"deleteTable",
"(",
"deleteTableRequest",
")",
";",
"return",
"tru... | Deletes the table and ignores any errors if it doesn't exist.
@param dynamo The Dynamo client to use.
@param deleteTableRequest The delete table request.
@return True if deleted, false otherwise. | [
"Deletes",
"the",
"table",
"and",
"ignores",
"any",
"errors",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L251-L261 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generateBlockComment | protected static boolean generateBlockComment(String comment, PyAppendable it) {
"""
Generate a Python block comment with the given comment.
@param comment the comment.
@param it the receiver of the block comment.
@return {@code true} if the block comment is added, {@code false} otherwise.
"""
final Str... | java | protected static boolean generateBlockComment(String comment, PyAppendable it) {
final String cmt = comment == null ? null : comment.trim();
if (!Strings.isEmpty(cmt)) {
assert cmt != null;
for (final String line : cmt.split("[\n\r\f]+")) { //$NON-NLS-1$
it.append("# ").append(line).newLine(); //$NON-NLS... | [
"protected",
"static",
"boolean",
"generateBlockComment",
"(",
"String",
"comment",
",",
"PyAppendable",
"it",
")",
"{",
"final",
"String",
"cmt",
"=",
"comment",
"==",
"null",
"?",
"null",
":",
"comment",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"Str... | Generate a Python block comment with the given comment.
@param comment the comment.
@param it the receiver of the block comment.
@return {@code true} if the block comment is added, {@code false} otherwise. | [
"Generate",
"a",
"Python",
"block",
"comment",
"with",
"the",
"given",
"comment",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L309-L319 |
dita-ot/dita-ot | src/main/java/org/dita/dost/platform/PluginParser.java | PluginParser.addExtensionPoint | private void addExtensionPoint(final Element elem) {
"""
Add extension point.
@param elem extension point element attributes
@throws IllegalArgumentException if extension ID is {@code null}
"""
final String id = elem.getAttribute(EXTENSION_POINT_ID_ATTR);
if (id == null) {
throw... | java | private void addExtensionPoint(final Element elem) {
final String id = elem.getAttribute(EXTENSION_POINT_ID_ATTR);
if (id == null) {
throw new IllegalArgumentException(EXTENSION_POINT_ID_ATTR + " attribute not set on extension-point");
}
final String name = elem.getAttribute(... | [
"private",
"void",
"addExtensionPoint",
"(",
"final",
"Element",
"elem",
")",
"{",
"final",
"String",
"id",
"=",
"elem",
".",
"getAttribute",
"(",
"EXTENSION_POINT_ID_ATTR",
")",
";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | Add extension point.
@param elem extension point element attributes
@throws IllegalArgumentException if extension ID is {@code null} | [
"Add",
"extension",
"point",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/PluginParser.java#L158-L165 |
seedstack/seed | security/core/src/main/java/org/seedstack/seed/security/internal/securityexpr/SecurityExpressionUtils.java | SecurityExpressionUtils.hasPermissionOn | public static boolean hasPermissionOn(String permission, String simpleScope) {
"""
Checks the current user permission.
@param permission the permission to check
@param simpleScope the simple scope to check this permission on.
@return true if user has the given permission for the given simple scope.
"""
... | java | public static boolean hasPermissionOn(String permission, String simpleScope) {
return securitySupport.isPermitted(permission, new SimpleScope(simpleScope));
} | [
"public",
"static",
"boolean",
"hasPermissionOn",
"(",
"String",
"permission",
",",
"String",
"simpleScope",
")",
"{",
"return",
"securitySupport",
".",
"isPermitted",
"(",
"permission",
",",
"new",
"SimpleScope",
"(",
"simpleScope",
")",
")",
";",
"}"
] | Checks the current user permission.
@param permission the permission to check
@param simpleScope the simple scope to check this permission on.
@return true if user has the given permission for the given simple scope. | [
"Checks",
"the",
"current",
"user",
"permission",
"."
] | train | https://github.com/seedstack/seed/blob/d9cf33bfb2fffcdbb0976f4726e943acda90e828/security/core/src/main/java/org/seedstack/seed/security/internal/securityexpr/SecurityExpressionUtils.java#L66-L68 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/android/ContentValues.java | ContentValues.put | public ContentValues put(String key, String value) {
"""
Adds a value to the set.
@param key the name of the value to forceInsert
@param value the data for the value to forceInsert
"""
mValues.put(key, value);
return this;
} | java | public ContentValues put(String key, String value) {
mValues.put(key, value);
return this;
} | [
"public",
"ContentValues",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"mValues",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a value to the set.
@param key the name of the value to forceInsert
@param value the data for the value to forceInsert | [
"Adds",
"a",
"value",
"to",
"the",
"set",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/android/ContentValues.java#L96-L99 |
jhipster/jhipster | jhipster-framework/src/main/java/io/github/jhipster/service/QueryService.java | QueryService.buildRangeSpecification | protected <X extends Comparable<? super X>> Specification<ENTITY> buildRangeSpecification(RangeFilter<X> filter,
SingularAttribute<? super ENTITY, X> field) {
"""
Helper function to return a specification for filtering on... | java | protected <X extends Comparable<? super X>> Specification<ENTITY> buildRangeSpecification(RangeFilter<X> filter,
SingularAttribute<? super ENTITY, X> field) {
return buildSpecification(filter, root -> root.get(field));... | [
"protected",
"<",
"X",
"extends",
"Comparable",
"<",
"?",
"super",
"X",
">",
">",
"Specification",
"<",
"ENTITY",
">",
"buildRangeSpecification",
"(",
"RangeFilter",
"<",
"X",
">",
"filter",
",",
"SingularAttribute",
"<",
"?",
"super",
"ENTITY",
",",
"X",
... | Helper function to return a specification for filtering on a single {@link Comparable}, where equality, less
than, greater than and less-than-or-equal-to and greater-than-or-equal-to and null/non-null conditions are
supported.
@param filter the individual attribute filter coming from the frontend.
@param field the JP... | [
"Helper",
"function",
"to",
"return",
"a",
"specification",
"for",
"filtering",
"on",
"a",
"single",
"{",
"@link",
"Comparable",
"}",
"where",
"equality",
"less",
"than",
"greater",
"than",
"and",
"less",
"-",
"than",
"-",
"or",
"-",
"equal",
"-",
"to",
... | train | https://github.com/jhipster/jhipster/blob/5dcf4239c7cc035e188ef02447d3c628fac5c5d9/jhipster-framework/src/main/java/io/github/jhipster/service/QueryService.java#L124-L127 |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.addNumber | @Nonnull
public CSSExpression addNumber (@Nonnegative final int nIndex, final double dValue) {
"""
Shortcut method to add a numeric value
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param dValue
The value to be added.
@return this
"""
return addMember (nIndex, new CS... | java | @Nonnull
public CSSExpression addNumber (@Nonnegative final int nIndex, final double dValue)
{
return addMember (nIndex, new CSSExpressionMemberTermSimple (dValue));
} | [
"@",
"Nonnull",
"public",
"CSSExpression",
"addNumber",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"final",
"double",
"dValue",
")",
"{",
"return",
"addMember",
"(",
"nIndex",
",",
"new",
"CSSExpressionMemberTermSimple",
"(",
"dValue",
")",
")",
"... | Shortcut method to add a numeric value
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param dValue
The value to be added.
@return this | [
"Shortcut",
"method",
"to",
"add",
"a",
"numeric",
"value"
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L224-L228 |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee.mejb/src/com/ibm/ws/management/j2ee/mejb/ManagementEJB.java | ManagementEJB.getAttributes | public AttributeList getAttributes(ObjectName name, String[] attributes)
throws InstanceNotFoundException, ReflectionException {
"""
/*
Gets the values of several attributes of a named managed object. The
managed object is identified by its object name.
Throws:
javax.management.InstanceNotF... | java | public AttributeList getAttributes(ObjectName name, String[] attributes)
throws InstanceNotFoundException, ReflectionException {
AttributeList a = getMBeanServer().getAttributes(name, attributes);
return a;
} | [
"public",
"AttributeList",
"getAttributes",
"(",
"ObjectName",
"name",
",",
"String",
"[",
"]",
"attributes",
")",
"throws",
"InstanceNotFoundException",
",",
"ReflectionException",
"{",
"AttributeList",
"a",
"=",
"getMBeanServer",
"(",
")",
".",
"getAttributes",
"(... | /*
Gets the values of several attributes of a named managed object. The
managed object is identified by its object name.
Throws:
javax.management.InstanceNotFoundException
javax.management.ReflectionException
java.rmi.RemoteException
Parameters:
name - The object name of the managed object from which the
attributes are... | [
"/",
"*",
"Gets",
"the",
"values",
"of",
"several",
"attributes",
"of",
"a",
"named",
"managed",
"object",
".",
"The",
"managed",
"object",
"is",
"identified",
"by",
"its",
"object",
"name",
".",
"Throws",
":",
"javax",
".",
"management",
".",
"InstanceNot... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee.mejb/src/com/ibm/ws/management/j2ee/mejb/ManagementEJB.java#L195-L201 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.zip | public static Map zip(List keys, List values, boolean includeNull) {
"""
Creates a map where the object at index N from the first List is the key for the object at index N of the second
List. If either List is shorter than the other, the resulting Map will have only as many keys as are in the
smallest of the two... | java | public static Map zip(List keys, List values, boolean includeNull) {
Iterator k = keys.iterator();
Iterator v = values.iterator();
HashMap hm = new HashMap();
while (k.hasNext() && v.hasNext()) {
Object o = k.next();
Object p = v.next();
if (includeNul... | [
"public",
"static",
"Map",
"zip",
"(",
"List",
"keys",
",",
"List",
"values",
",",
"boolean",
"includeNull",
")",
"{",
"Iterator",
"k",
"=",
"keys",
".",
"iterator",
"(",
")",
";",
"Iterator",
"v",
"=",
"values",
".",
"iterator",
"(",
")",
";",
"Hash... | Creates a map where the object at index N from the first List is the key for the object at index N of the second
List. If either List is shorter than the other, the resulting Map will have only as many keys as are in the
smallest of the two Lists. <br> If includeNull is true, both keys and values of null are allowed. N... | [
"Creates",
"a",
"map",
"where",
"the",
"object",
"at",
"index",
"N",
"from",
"the",
"first",
"List",
"is",
"the",
"key",
"for",
"the",
"object",
"at",
"index",
"N",
"of",
"the",
"second",
"List",
".",
"If",
"either",
"List",
"is",
"shorter",
"than",
... | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L181-L193 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/CSL.java | CSL.setOutputFormat | public void setOutputFormat(String format) {
"""
Sets the processor's output format
@param format the format (one of <code>"html"</code>,
<code>"text"</code>, <code>"asciidoc"</code>, <code>"fo"</code>,
or <code>"rtf"</code>)
"""
try {
runner.callMethod(engine, "setOutputFormat", format);
outputForm... | java | public void setOutputFormat(String format) {
try {
runner.callMethod(engine, "setOutputFormat", format);
outputFormat = format;
} catch (ScriptRunnerException e) {
throw new IllegalArgumentException("Could not set output format", e);
}
} | [
"public",
"void",
"setOutputFormat",
"(",
"String",
"format",
")",
"{",
"try",
"{",
"runner",
".",
"callMethod",
"(",
"engine",
",",
"\"setOutputFormat\"",
",",
"format",
")",
";",
"outputFormat",
"=",
"format",
";",
"}",
"catch",
"(",
"ScriptRunnerException",... | Sets the processor's output format
@param format the format (one of <code>"html"</code>,
<code>"text"</code>, <code>"asciidoc"</code>, <code>"fo"</code>,
or <code>"rtf"</code>) | [
"Sets",
"the",
"processor",
"s",
"output",
"format"
] | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/CSL.java#L564-L571 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/Tree.java | Tree.renderTagId | protected final String renderTagId(HttpServletRequest request, String tagId, AbstractHtmlState state) {
"""
This method will handle creating the tagId attribute. The tagId attribute indentifies the
tag in the generated HTML. There is a lookup table created in JavaScript mapping the <coe>tagId</code>
to the act... | java | protected final String renderTagId(HttpServletRequest request, String tagId, AbstractHtmlState state)
{
assert(_trs.tagId != null);
state.id = getIdForTagId(tagId);
String script = renderDefaultJavaScript(request, state.id);
return script;
} | [
"protected",
"final",
"String",
"renderTagId",
"(",
"HttpServletRequest",
"request",
",",
"String",
"tagId",
",",
"AbstractHtmlState",
"state",
")",
"{",
"assert",
"(",
"_trs",
".",
"tagId",
"!=",
"null",
")",
";",
"state",
".",
"id",
"=",
"getIdForTagId",
"... | This method will handle creating the tagId attribute. The tagId attribute indentifies the
tag in the generated HTML. There is a lookup table created in JavaScript mapping the <coe>tagId</code>
to the actual name. The tagId is also run through the naming service so it can be scoped. Some tags will
write that <code>t... | [
"This",
"method",
"will",
"handle",
"creating",
"the",
"tagId",
"attribute",
".",
"The",
"tagId",
"attribute",
"indentifies",
"the",
"tag",
"in",
"the",
"generated",
"HTML",
".",
"There",
"is",
"a",
"lookup",
"table",
"created",
"in",
"JavaScript",
"mapping",
... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/Tree.java#L1020-L1026 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java | JvmTypesBuilder.setExtension | public void setExtension(/* @Nullable */ JvmFormalParameter parameter, EObject sourceElement, boolean value) {
"""
Adds or removes the annotation {@link Extension @Extension} from the given parameter. If the annotation is
already present, nothing is done if {@code value} is {@code true}. If it is not present and ... | java | public void setExtension(/* @Nullable */ JvmFormalParameter parameter, EObject sourceElement, boolean value) {
if (parameter == null)
return;
internalSetExtension(parameter, sourceElement, value);
} | [
"public",
"void",
"setExtension",
"(",
"/* @Nullable */",
"JvmFormalParameter",
"parameter",
",",
"EObject",
"sourceElement",
",",
"boolean",
"value",
")",
"{",
"if",
"(",
"parameter",
"==",
"null",
")",
"return",
";",
"internalSetExtension",
"(",
"parameter",
","... | Adds or removes the annotation {@link Extension @Extension} from the given parameter. If the annotation is
already present, nothing is done if {@code value} is {@code true}. If it is not present and {@code value}
is {@code false}, this is a no-op, too.
@param parameter the parameter that will be processed
@param sourc... | [
"Adds",
"or",
"removes",
"the",
"annotation",
"{",
"@link",
"Extension",
"@Extension",
"}",
"from",
"the",
"given",
"parameter",
".",
"If",
"the",
"annotation",
"is",
"already",
"present",
"nothing",
"is",
"done",
"if",
"{",
"@code",
"value",
"}",
"is",
"{... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java#L620-L624 |
webjars/webjars-locator | src/main/java/org/webjars/RequireJS.java | RequireJS.generateSetupJavaScript | public static String generateSetupJavaScript(List<String> prefixes) {
"""
Returns the JavaScript that is used to setup the RequireJS config.
This value is not cached.
@param prefixes A list of the prefixes to use in the `paths` part of the RequireJS config.
@return The JavaScript block that can be embedded or... | java | public static String generateSetupJavaScript(List<String> prefixes) {
Map<String, String> webJars = new WebJarAssetLocator().getWebJars();
return generateSetupJavaScript(prefixes, webJars);
} | [
"public",
"static",
"String",
"generateSetupJavaScript",
"(",
"List",
"<",
"String",
">",
"prefixes",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"webJars",
"=",
"new",
"WebJarAssetLocator",
"(",
")",
".",
"getWebJars",
"(",
")",
";",
"return",
"ge... | Returns the JavaScript that is used to setup the RequireJS config.
This value is not cached.
@param prefixes A list of the prefixes to use in the `paths` part of the RequireJS config.
@return The JavaScript block that can be embedded or loaded in a <script> tag. | [
"Returns",
"the",
"JavaScript",
"that",
"is",
"used",
"to",
"setup",
"the",
"RequireJS",
"config",
".",
"This",
"value",
"is",
"not",
"cached",
"."
] | train | https://github.com/webjars/webjars-locator/blob/8796fb3ff1b9ad5c0d433ecf63a60520c715e3a0/src/main/java/org/webjars/RequireJS.java#L81-L85 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ScanAPI.java | ScanAPI.productGetlist | public static ProductGetlistResult productGetlist(String accessToken, ProductGetlist productGetlist) {
"""
批量查询商品信息
@param accessToken accessToken
@param productGetlist productGetlist
@return ProductGetlistResult
"""
return productGetlist(accessToken, JsonUtil.toJSONString(productGetlist));
... | java | public static ProductGetlistResult productGetlist(String accessToken, ProductGetlist productGetlist) {
return productGetlist(accessToken, JsonUtil.toJSONString(productGetlist));
} | [
"public",
"static",
"ProductGetlistResult",
"productGetlist",
"(",
"String",
"accessToken",
",",
"ProductGetlist",
"productGetlist",
")",
"{",
"return",
"productGetlist",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"productGetlist",
")",
")",
";",
... | 批量查询商品信息
@param accessToken accessToken
@param productGetlist productGetlist
@return ProductGetlistResult | [
"批量查询商品信息"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ScanAPI.java#L191-L193 |
lets-blade/blade | src/main/java/com/blade/server/netty/StaticFileHandler.java | StaticFileHandler.setDateAndCacheHeaders | private void setDateAndCacheHeaders(HttpResponse response, File fileToCache) {
"""
Sets the Date and Cache headers for the HTTP Response
@param response HTTP response
@param fileToCache file to extract content type
"""
response.headers().set(HttpConst.DATE, DateKit.gmtDate());
// Add cac... | java | private void setDateAndCacheHeaders(HttpResponse response, File fileToCache) {
response.headers().set(HttpConst.DATE, DateKit.gmtDate());
// Add cache headers
if (httpCacheSeconds > 0) {
response.headers().set(HttpConst.EXPIRES, DateKit.gmtDate(LocalDateTime.now().plusSeconds(httpCac... | [
"private",
"void",
"setDateAndCacheHeaders",
"(",
"HttpResponse",
"response",
",",
"File",
"fileToCache",
")",
"{",
"response",
".",
"headers",
"(",
")",
".",
"set",
"(",
"HttpConst",
".",
"DATE",
",",
"DateKit",
".",
"gmtDate",
"(",
")",
")",
";",
"// Add... | Sets the Date and Cache headers for the HTTP Response
@param response HTTP response
@param fileToCache file to extract content type | [
"Sets",
"the",
"Date",
"and",
"Cache",
"headers",
"for",
"the",
"HTTP",
"Response"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/server/netty/StaticFileHandler.java#L345-L357 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/CaffeineCacheMetrics.java | CaffeineCacheMetrics.monitor | public static <C extends AsyncCache<?, ?>> C monitor(MeterRegistry registry, C cache, String cacheName, String... tags) {
"""
Record metrics on a Caffeine cache. You must call {@link Caffeine#recordStats()} prior to building the cache
for metrics to be recorded.
@param registry The registry to bind metrics to... | java | public static <C extends AsyncCache<?, ?>> C monitor(MeterRegistry registry, C cache, String cacheName, String... tags) {
return monitor(registry, cache, cacheName, Tags.of(tags));
} | [
"public",
"static",
"<",
"C",
"extends",
"AsyncCache",
"<",
"?",
",",
"?",
">",
">",
"C",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"C",
"cache",
",",
"String",
"cacheName",
",",
"String",
"...",
"tags",
")",
"{",
"return",
"monitor",
"(",
"reg... | Record metrics on a Caffeine cache. You must call {@link Caffeine#recordStats()} prior to building the cache
for metrics to be recorded.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param cacheName Will be used to tag metrics with "cache".
@param tags Tags to apply ... | [
"Record",
"metrics",
"on",
"a",
"Caffeine",
"cache",
".",
"You",
"must",
"call",
"{",
"@link",
"Caffeine#recordStats",
"()",
"}",
"prior",
"to",
"building",
"the",
"cache",
"for",
"metrics",
"to",
"be",
"recorded",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/CaffeineCacheMetrics.java#L99-L101 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java | ELHelper.processString | @Trivial
protected String processString(String name, String expression, boolean immediateOnly) {
"""
This method will process a configuration value for any configuration setting in
{@link LdapIdentityStoreDefinition} or {@link DatabaseIdentityStoreDefinition} that
is a string and whose name is NOT a "*Expres... | java | @Trivial
protected String processString(String name, String expression, boolean immediateOnly) {
return processString(name, expression, immediateOnly, false);
} | [
"@",
"Trivial",
"protected",
"String",
"processString",
"(",
"String",
"name",
",",
"String",
"expression",
",",
"boolean",
"immediateOnly",
")",
"{",
"return",
"processString",
"(",
"name",
",",
"expression",
",",
"immediateOnly",
",",
"false",
")",
";",
"}"
... | This method will process a configuration value for any configuration setting in
{@link LdapIdentityStoreDefinition} or {@link DatabaseIdentityStoreDefinition} that
is a string and whose name is NOT a "*Expression". It will first check to see if it
is a EL expression. It it is, it will return the evaluated expression; o... | [
"This",
"method",
"will",
"process",
"a",
"configuration",
"value",
"for",
"any",
"configuration",
"setting",
"in",
"{",
"@link",
"LdapIdentityStoreDefinition",
"}",
"or",
"{",
"@link",
"DatabaseIdentityStoreDefinition",
"}",
"that",
"is",
"a",
"string",
"and",
"w... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java#L232-L235 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.toUpperCase | public static String toUpperCase(ULocale locale, String str) {
"""
Returns the uppercase version of the argument string.
Casing is dependent on the argument locale and context-sensitive.
@param locale which string is to be converted in
@param str source string to be performed on
@return uppercase version of th... | java | public static String toUpperCase(ULocale locale, String str) {
return toUpperCase(getCaseLocale(locale), str);
} | [
"public",
"static",
"String",
"toUpperCase",
"(",
"ULocale",
"locale",
",",
"String",
"str",
")",
"{",
"return",
"toUpperCase",
"(",
"getCaseLocale",
"(",
"locale",
")",
",",
"str",
")",
";",
"}"
] | Returns the uppercase version of the argument string.
Casing is dependent on the argument locale and context-sensitive.
@param locale which string is to be converted in
@param str source string to be performed on
@return uppercase version of the argument string | [
"Returns",
"the",
"uppercase",
"version",
"of",
"the",
"argument",
"string",
".",
"Casing",
"is",
"dependent",
"on",
"the",
"argument",
"locale",
"and",
"context",
"-",
"sensitive",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L4421-L4423 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java | NonBlockingCharArrayWriter.getAsString | @Nonnull
public String getAsString (@Nonnegative final int nLength) {
"""
Converts input data to a string.
@param nLength
The number of characters to convert. Must be ≤ than
{@link #getSize()}.
@return the string.
"""
ValueEnforcer.isBetweenInclusive (nLength, "Length", 0, m_nCount);
return ... | java | @Nonnull
public String getAsString (@Nonnegative final int nLength)
{
ValueEnforcer.isBetweenInclusive (nLength, "Length", 0, m_nCount);
return new String (m_aBuf, 0, nLength);
} | [
"@",
"Nonnull",
"public",
"String",
"getAsString",
"(",
"@",
"Nonnegative",
"final",
"int",
"nLength",
")",
"{",
"ValueEnforcer",
".",
"isBetweenInclusive",
"(",
"nLength",
",",
"\"Length\"",
",",
"0",
",",
"m_nCount",
")",
";",
"return",
"new",
"String",
"(... | Converts input data to a string.
@param nLength
The number of characters to convert. Must be ≤ than
{@link #getSize()}.
@return the string. | [
"Converts",
"input",
"data",
"to",
"a",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java#L350-L355 |
geomajas/geomajas-project-geometry | jts/src/main/java/org/geomajas/geometry/conversion/jts/GeometryConverterService.java | GeometryConverterService.fromJts | public static Coordinate fromJts(com.vividsolutions.jts.geom.Coordinate coordinate) throws JtsConversionException {
"""
Convert a GTS coordinate to a Geomajas coordinate.
@param coordinate jTS coordinate
@return Geomajas coordinate
@throws JtsConversionException conversion failed
"""
if (coordinate == n... | java | public static Coordinate fromJts(com.vividsolutions.jts.geom.Coordinate coordinate) throws JtsConversionException {
if (coordinate == null) {
throw new JtsConversionException("Cannot convert null argument");
}
return new Coordinate(coordinate.x, coordinate.y);
} | [
"public",
"static",
"Coordinate",
"fromJts",
"(",
"com",
".",
"vividsolutions",
".",
"jts",
".",
"geom",
".",
"Coordinate",
"coordinate",
")",
"throws",
"JtsConversionException",
"{",
"if",
"(",
"coordinate",
"==",
"null",
")",
"{",
"throw",
"new",
"JtsConvers... | Convert a GTS coordinate to a Geomajas coordinate.
@param coordinate jTS coordinate
@return Geomajas coordinate
@throws JtsConversionException conversion failed | [
"Convert",
"a",
"GTS",
"coordinate",
"to",
"a",
"Geomajas",
"coordinate",
"."
] | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/jts/src/main/java/org/geomajas/geometry/conversion/jts/GeometryConverterService.java#L208-L213 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getCreateUploadVersionSessionRequest | public BoxRequestsFile.CreateNewVersionUploadSession getCreateUploadVersionSessionRequest(InputStream is, String fileName, long fileSize, String fileId)
throws FileNotFoundException {
"""
Gets a request that creates an upload session for uploading a new file version
@param is the inputStream from wher... | java | public BoxRequestsFile.CreateNewVersionUploadSession getCreateUploadVersionSessionRequest(InputStream is, String fileName, long fileSize, String fileId)
throws FileNotFoundException {
return new BoxRequestsFile.CreateNewVersionUploadSession(is, fileName, fileSize, getUploadSessionForNewFileVersionUr... | [
"public",
"BoxRequestsFile",
".",
"CreateNewVersionUploadSession",
"getCreateUploadVersionSessionRequest",
"(",
"InputStream",
"is",
",",
"String",
"fileName",
",",
"long",
"fileSize",
",",
"String",
"fileId",
")",
"throws",
"FileNotFoundException",
"{",
"return",
"new",
... | Gets a request that creates an upload session for uploading a new file version
@param is the inputStream from where the file data will be read
@param fileName the fileName to create on server
@param fileSize the file size (also the inputStream size)
@param fileId the existing fileId to receive the new version
@return r... | [
"Gets",
"a",
"request",
"that",
"creates",
"an",
"upload",
"session",
"for",
"uploading",
"a",
"new",
"file",
"version"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L617-L620 |
osmdroid/osmdroid | GoogleWrapperSample/src/main/java/org/osmdroid/google/sample/MapsActivity.java | MapsActivity.onMapReady | @Override
public void onMapReady(GoogleMap googleMap) {
"""
Manipulates the map once available.
This callback is triggered when the map is ready to be used.
This is where we can add markers or lines, add listeners or move the camera. In this case,
we just add a marker near Sydney, Australia.
If Google Play... | java | @Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney and move the camera
LatLng sydney = new LatLng(-34, 151);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.n... | [
"@",
"Override",
"public",
"void",
"onMapReady",
"(",
"GoogleMap",
"googleMap",
")",
"{",
"mMap",
"=",
"googleMap",
";",
"// Add a marker in Sydney and move the camera",
"LatLng",
"sydney",
"=",
"new",
"LatLng",
"(",
"-",
"34",
",",
"151",
")",
";",
"mMap",
".... | Manipulates the map once available.
This callback is triggered when the map is ready to be used.
This is where we can add markers or lines, add listeners or move the camera. In this case,
we just add a marker near Sydney, Australia.
If Google Play services is not installed on the device, the user will be prompted to in... | [
"Manipulates",
"the",
"map",
"once",
"available",
".",
"This",
"callback",
"is",
"triggered",
"when",
"the",
"map",
"is",
"ready",
"to",
"be",
"used",
".",
"This",
"is",
"where",
"we",
"can",
"add",
"markers",
"or",
"lines",
"add",
"listeners",
"or",
"mo... | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/GoogleWrapperSample/src/main/java/org/osmdroid/google/sample/MapsActivity.java#L37-L45 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java | DfuServiceInitiator.setBinOrHex | @Deprecated
public DfuServiceInitiator setBinOrHex(@FileType final int fileType, @Nullable final Uri uri, @Nullable final String path) {
"""
Sets the URI or path to the BIN or HEX file containing the new firmware.
For DFU Bootloader version 0.5 or newer the init file must be specified using one of
{@link #setIn... | java | @Deprecated
public DfuServiceInitiator setBinOrHex(@FileType final int fileType, @Nullable final Uri uri, @Nullable final String path) {
if (fileType == DfuBaseService.TYPE_AUTO)
throw new UnsupportedOperationException("You must specify the file type");
return init(uri, path, 0, fileType, DfuBaseService.MIME_TY... | [
"@",
"Deprecated",
"public",
"DfuServiceInitiator",
"setBinOrHex",
"(",
"@",
"FileType",
"final",
"int",
"fileType",
",",
"@",
"Nullable",
"final",
"Uri",
"uri",
",",
"@",
"Nullable",
"final",
"String",
"path",
")",
"{",
"if",
"(",
"fileType",
"==",
"DfuBase... | Sets the URI or path to the BIN or HEX file containing the new firmware.
For DFU Bootloader version 0.5 or newer the init file must be specified using one of
{@link #setInitFile(String)} methods.
@param fileType see {@link #setBinOrHex(int, Uri)} for details
@param uri the URI of the file
@param path path to ... | [
"Sets",
"the",
"URI",
"or",
"path",
"to",
"the",
"BIN",
"or",
"HEX",
"file",
"containing",
"the",
"new",
"firmware",
".",
"For",
"DFU",
"Bootloader",
"version",
"0",
".",
"5",
"or",
"newer",
"the",
"init",
"file",
"must",
"be",
"specified",
"using",
"o... | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java#L656-L661 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.retrieveBean | @Override
public <T> T retrieveBean(T bean) throws CpoException {
"""
Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
function defined for this beans returns more than one row, an exception will be thrown.
@param bean This is an bean that has ... | java | @Override
public <T> T retrieveBean(T bean) throws CpoException {
return processSelectGroup(bean, null, null, null, null);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"retrieveBean",
"(",
"T",
"bean",
")",
"throws",
"CpoException",
"{",
"return",
"processSelectGroup",
"(",
"bean",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
function defined for this beans returns more than one row, an exception will be thrown.
@param bean This is an bean that has been defined within the metadata of the datasource. If the class is not
defined ... | [
"Retrieves",
"the",
"bean",
"from",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"bean",
"exists",
"in",
"the",
"datasource",
".",
"If",
"the",
"retrieve",
"function",
"defined",
"for",
"this",
"beans",
"returns",
"more",
"than",
"one"... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L1342-L1345 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java | SecurityRulesInner.beginDelete | public void beginDelete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) {
"""
Deletes the specified network security rule.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@param securityRuleNam... | java | public void beginDelete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkSecurityGroupName",
",",
"String",
"securityRuleName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkSecurityGroupName",
",",
"securityRuleNam... | Deletes the specified network security rule.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@param securityRuleName The name of the security rule.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExc... | [
"Deletes",
"the",
"specified",
"network",
"security",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java#L177-L179 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.maxByDouble | public OptionalInt maxByDouble(IntToDoubleFunction keyExtractor) {
"""
Returns the maximum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing the firs... | java | public OptionalInt maxByDouble(IntToDoubleFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, i) -> {
double key = keyExtractor.applyAsDouble(i);
if (!box.b || Double.compare(box.d, key) < 0) {
box.b = true;
box.d = key;
box.i ... | [
"public",
"OptionalInt",
"maxByDouble",
"(",
"IntToDoubleFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"i",
")",
"->",
"{",
"double",
"key",
"=",
"keyExtractor",
".",
"applyAsDouble",
"(",
"... | Returns the maximum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing the first element of this
stream for which the highest value was returned by key extractor,... | [
"Returns",
"the",
"maximum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L1188-L1197 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java | VirtualNetworkLinksInner.listAsync | public Observable<Page<VirtualNetworkLinkInner>> listAsync(final String resourceGroupName, final String privateZoneName, final Integer top) {
"""
Lists the virtual network links to the specified Private DNS zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Pr... | java | public Observable<Page<VirtualNetworkLinkInner>> listAsync(final String resourceGroupName, final String privateZoneName, final Integer top) {
return listWithServiceResponseAsync(resourceGroupName, privateZoneName, top)
.map(new Func1<ServiceResponse<Page<VirtualNetworkLinkInner>>, Page<VirtualNetwor... | [
"public",
"Observable",
"<",
"Page",
"<",
"VirtualNetworkLinkInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"privateZoneName",
",",
"final",
"Integer",
"top",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(... | Lists the virtual network links to the specified Private DNS zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param top The maximum number of virtual network links to return. If not specified, returns up to 100 virtual ... | [
"Lists",
"the",
"virtual",
"network",
"links",
"to",
"the",
"specified",
"Private",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java#L1460-L1468 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.getSegmentUpdateTransaction | private SegmentMetadataUpdateTransaction getSegmentUpdateTransaction(long segmentId) throws MetadataUpdateException {
"""
Gets all pending changes for the given Segment.
@param segmentId The Id of the Segment to query.
@throws MetadataUpdateException If no metadata entry exists for the given Segment Id.
""... | java | private SegmentMetadataUpdateTransaction getSegmentUpdateTransaction(long segmentId) throws MetadataUpdateException {
SegmentMetadataUpdateTransaction tsm = tryGetSegmentUpdateTransaction(segmentId);
if (tsm == null) {
throw new MetadataUpdateException(this.containerId, String.format("No met... | [
"private",
"SegmentMetadataUpdateTransaction",
"getSegmentUpdateTransaction",
"(",
"long",
"segmentId",
")",
"throws",
"MetadataUpdateException",
"{",
"SegmentMetadataUpdateTransaction",
"tsm",
"=",
"tryGetSegmentUpdateTransaction",
"(",
"segmentId",
")",
";",
"if",
"(",
"tsm... | Gets all pending changes for the given Segment.
@param segmentId The Id of the Segment to query.
@throws MetadataUpdateException If no metadata entry exists for the given Segment Id. | [
"Gets",
"all",
"pending",
"changes",
"for",
"the",
"given",
"Segment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L512-L519 |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/source/QualifiedName.java | QualifiedName.enclosingType | public QualifiedName enclosingType() {
"""
Returns the {@link QualifiedName} of the type enclosing this one.
@throws IllegalStateException if {@link #isTopLevel()} returns true
"""
checkState(!isTopLevel(), "Cannot return enclosing type of top-level type");
return new QualifiedName(packageName, simp... | java | public QualifiedName enclosingType() {
checkState(!isTopLevel(), "Cannot return enclosing type of top-level type");
return new QualifiedName(packageName, simpleNames.subList(0, simpleNames.size() - 1));
} | [
"public",
"QualifiedName",
"enclosingType",
"(",
")",
"{",
"checkState",
"(",
"!",
"isTopLevel",
"(",
")",
",",
"\"Cannot return enclosing type of top-level type\"",
")",
";",
"return",
"new",
"QualifiedName",
"(",
"packageName",
",",
"simpleNames",
".",
"subList",
... | Returns the {@link QualifiedName} of the type enclosing this one.
@throws IllegalStateException if {@link #isTopLevel()} returns true | [
"Returns",
"the",
"{",
"@link",
"QualifiedName",
"}",
"of",
"the",
"type",
"enclosing",
"this",
"one",
"."
] | train | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/QualifiedName.java#L130-L133 |
whitesource/fs-agent | src/main/java/org/whitesource/agent/dependency/resolver/ruby/RubyDependencyResolver.java | RubyDependencyResolver.versionCompare | public static int versionCompare(String str1, String str2) {
"""
/*
The result is a negative integer if str1 is _numerically_ less than str2.
The result is a positive integer if str1 is _numerically_ greater than str2.
The result is zero if the strings are _numerically_ equal.
"""
String[] vals1 = s... | java | public static int versionCompare(String str1, String str2) {
String[] vals1 = str1.split("\\.");
String[] vals2 = str2.split("\\.");
int i = 0;
// set index to first non-equal ordinal or length of shortest version string
while (i < vals1.length && i < vals2.length && vals1[i].equ... | [
"public",
"static",
"int",
"versionCompare",
"(",
"String",
"str1",
",",
"String",
"str2",
")",
"{",
"String",
"[",
"]",
"vals1",
"=",
"str1",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"String",
"[",
"]",
"vals2",
"=",
"str2",
".",
"split",
"(",
"\"\... | /*
The result is a negative integer if str1 is _numerically_ less than str2.
The result is a positive integer if str1 is _numerically_ greater than str2.
The result is zero if the strings are _numerically_ equal. | [
"/",
"*",
"The",
"result",
"is",
"a",
"negative",
"integer",
"if",
"str1",
"is",
"_numerically_",
"less",
"than",
"str2",
".",
"The",
"result",
"is",
"a",
"positive",
"integer",
"if",
"str1",
"is",
"_numerically_",
"greater",
"than",
"str2",
".",
"The",
... | train | https://github.com/whitesource/fs-agent/blob/d6ee4842c4f08f4aeda7eb2307b24c49b6bed0e1/src/main/java/org/whitesource/agent/dependency/resolver/ruby/RubyDependencyResolver.java#L507-L523 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.addTableSRIDConstraint | public static void addTableSRIDConstraint(Connection connection, TableLocation tableLocation, int srid)
throws SQLException {
"""
Alter a table to add a SRID constraint.
The srid must be greater than zero.
@param connection Active connection
@param tableLocation TableLocation of the table to updat... | java | public static void addTableSRIDConstraint(Connection connection, TableLocation tableLocation, int srid)
throws SQLException {
//Alter table to set the SRID constraint
if (srid > 0) {
connection.createStatement().execute(String.format("ALTER TABLE %s ADD CHECK ST_SRID(the_geom)=%d... | [
"public",
"static",
"void",
"addTableSRIDConstraint",
"(",
"Connection",
"connection",
",",
"TableLocation",
"tableLocation",
",",
"int",
"srid",
")",
"throws",
"SQLException",
"{",
"//Alter table to set the SRID constraint",
"if",
"(",
"srid",
">",
"0",
")",
"{",
"... | Alter a table to add a SRID constraint.
The srid must be greater than zero.
@param connection Active connection
@param tableLocation TableLocation of the table to update
@param srid SRID to set
@throws SQLException | [
"Alter",
"a",
"table",
"to",
"add",
"a",
"SRID",
"constraint",
".",
"The",
"srid",
"must",
"be",
"greater",
"than",
"zero",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L586-L593 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java | UtilWavelet.adjustForDisplay | public static void adjustForDisplay(ImageGray transform , int numLevels , double valueRange ) {
"""
Adjusts the values inside a wavelet transform to make it easier to view.
@param transform
@param numLevels Number of levels in the transform
"""
if( transform instanceof GrayF32)
adjustForDisplay((GrayF... | java | public static void adjustForDisplay(ImageGray transform , int numLevels , double valueRange ) {
if( transform instanceof GrayF32)
adjustForDisplay((GrayF32)transform,numLevels,(float)valueRange);
else
adjustForDisplay((GrayI)transform,numLevels,(int)valueRange);
} | [
"public",
"static",
"void",
"adjustForDisplay",
"(",
"ImageGray",
"transform",
",",
"int",
"numLevels",
",",
"double",
"valueRange",
")",
"{",
"if",
"(",
"transform",
"instanceof",
"GrayF32",
")",
"adjustForDisplay",
"(",
"(",
"GrayF32",
")",
"transform",
",",
... | Adjusts the values inside a wavelet transform to make it easier to view.
@param transform
@param numLevels Number of levels in the transform | [
"Adjusts",
"the",
"values",
"inside",
"a",
"wavelet",
"transform",
"to",
"make",
"it",
"easier",
"to",
"view",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L332-L337 |
google/flogger | api/src/main/java/com/google/common/flogger/parameter/SimpleParameter.java | SimpleParameter.createParameterArray | private static SimpleParameter[] createParameterArray(FormatChar formatChar) {
"""
Helper to make reusable default parameter instances for the commonest indices.
"""
SimpleParameter[] parameters = new SimpleParameter[MAX_CACHED_PARAMETERS];
for (int index = 0; index < MAX_CACHED_PARAMETERS; index++) {
... | java | private static SimpleParameter[] createParameterArray(FormatChar formatChar) {
SimpleParameter[] parameters = new SimpleParameter[MAX_CACHED_PARAMETERS];
for (int index = 0; index < MAX_CACHED_PARAMETERS; index++) {
parameters[index] = new SimpleParameter(index, formatChar, FormatOptions.getDefault());
... | [
"private",
"static",
"SimpleParameter",
"[",
"]",
"createParameterArray",
"(",
"FormatChar",
"formatChar",
")",
"{",
"SimpleParameter",
"[",
"]",
"parameters",
"=",
"new",
"SimpleParameter",
"[",
"MAX_CACHED_PARAMETERS",
"]",
";",
"for",
"(",
"int",
"index",
"=",
... | Helper to make reusable default parameter instances for the commonest indices. | [
"Helper",
"to",
"make",
"reusable",
"default",
"parameter",
"instances",
"for",
"the",
"commonest",
"indices",
"."
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parameter/SimpleParameter.java#L50-L56 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.