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 |
|---|---|---|---|---|---|---|---|---|---|---|
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java | Diff.skippedComparison | public void skippedComparison(Node control, Node test) {
"""
DifferenceListener implementation.
If the {@link Diff#overrideDifferenceListener overrideDifferenceListener}
method has been called then the call will be delegated
otherwise a message is printed to <code>System.err</code>.
@param control
@param tes... | java | public void skippedComparison(Node control, Node test) {
if (differenceListenerDelegate != null) {
differenceListenerDelegate.skippedComparison(control, test);
} else {
System.err.println("DifferenceListener.skippedComparison: "
+ "unhandled control... | [
"public",
"void",
"skippedComparison",
"(",
"Node",
"control",
",",
"Node",
"test",
")",
"{",
"if",
"(",
"differenceListenerDelegate",
"!=",
"null",
")",
"{",
"differenceListenerDelegate",
".",
"skippedComparison",
"(",
"control",
",",
"test",
")",
";",
"}",
"... | DifferenceListener implementation.
If the {@link Diff#overrideDifferenceListener overrideDifferenceListener}
method has been called then the call will be delegated
otherwise a message is printed to <code>System.err</code>.
@param control
@param test | [
"DifferenceListener",
"implementation",
".",
"If",
"the",
"{"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/Diff.java#L334-L342 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.beginCreateOrUpdate | public InstanceFailoverGroupInner beginCreateOrUpdate(String resourceGroupName, String locationName, String failoverGroupName, InstanceFailoverGroupInner parameters) {
"""
Creates or updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this... | java | public InstanceFailoverGroupInner beginCreateOrUpdate(String resourceGroupName, String locationName, String failoverGroupName, InstanceFailoverGroupInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName, parameters).toBlocking().single().body();... | [
"public",
"InstanceFailoverGroupInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"locationName",
",",
"String",
"failoverGroupName",
",",
"InstanceFailoverGroupInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync"... | Creates or updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param locationName The name of the region where the resource is located.
@param failoverGroupName The name of the failov... | [
"Creates",
"or",
"updates",
"a",
"failover",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L300-L302 |
trajano/caliper | caliper/src/main/java/com/google/caliper/util/InterleavedReader.java | InterleavedReader.read | public Object read() throws IOException {
"""
Returns the next value in the stream: either a String, a JsonElement, or
null to indicate the end of the stream. Callers should use instanceof to
inspect the return type.
"""
char[] buffer = new char[BUFFER_LENGTH];
reader.mark(BUFFER_LENGTH);
int cou... | java | public Object read() throws IOException {
char[] buffer = new char[BUFFER_LENGTH];
reader.mark(BUFFER_LENGTH);
int count = 0;
int textEnd;
while (true) {
int r = reader.read(buffer, count, buffer.length - count);
if (r == -1) {
// the input is exhausted; return the remaining ch... | [
"public",
"Object",
"read",
"(",
")",
"throws",
"IOException",
"{",
"char",
"[",
"]",
"buffer",
"=",
"new",
"char",
"[",
"BUFFER_LENGTH",
"]",
";",
"reader",
".",
"mark",
"(",
"BUFFER_LENGTH",
")",
";",
"int",
"count",
"=",
"0",
";",
"int",
"textEnd",
... | Returns the next value in the stream: either a String, a JsonElement, or
null to indicate the end of the stream. Callers should use instanceof to
inspect the return type. | [
"Returns",
"the",
"next",
"value",
"in",
"the",
"stream",
":",
"either",
"a",
"String",
"a",
"JsonElement",
"or",
"null",
"to",
"indicate",
"the",
"end",
"of",
"the",
"stream",
".",
"Callers",
"should",
"use",
"instanceof",
"to",
"inspect",
"the",
"return"... | train | https://github.com/trajano/caliper/blob/a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658/caliper/src/main/java/com/google/caliper/util/InterleavedReader.java#L63-L106 |
ops4j/org.ops4j.base | ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java | Environment.processLinesOfEnvironmentVariables | private static void processLinesOfEnvironmentVariables( BufferedReader reader, Properties properties )
throws IOException {
"""
Process the lines of the environment variables returned.
@param reader The Reader that containes the lines to be parsed.
@param properties The Properties objects to be pop... | java | private static void processLinesOfEnvironmentVariables( BufferedReader reader, Properties properties )
throws IOException
{
String line = reader.readLine();
while( null != line )
{
int index = line.indexOf( '=' );
if( -1 == index && line.length() != 0 )
... | [
"private",
"static",
"void",
"processLinesOfEnvironmentVariables",
"(",
"BufferedReader",
"reader",
",",
"Properties",
"properties",
")",
"throws",
"IOException",
"{",
"String",
"line",
"=",
"reader",
".",
"readLine",
"(",
")",
";",
"while",
"(",
"null",
"!=",
"... | Process the lines of the environment variables returned.
@param reader The Reader that containes the lines to be parsed.
@param properties The Properties objects to be populated with the environment variable names and values.
@throws IOException if an underlying I/O problem occurs. | [
"Process",
"the",
"lines",
"of",
"the",
"environment",
"variables",
"returned",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L559-L580 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthenticationHandler.java | AuthenticationHandler.endRequest | private void endRequest(HttpServerExchange exchange, String redirect) {
"""
Ends the current request by sending a HTTP 302 status code and a direct to the given URL
@param exchange The HttpServerExchange
"""
exchange.setStatusCode(StatusCodes.FOUND);
Server.headers()
.entr... | java | private void endRequest(HttpServerExchange exchange, String redirect) {
exchange.setStatusCode(StatusCodes.FOUND);
Server.headers()
.entrySet()
.stream()
.filter(entry -> StringUtils.isNotBlank(entry.getValue()))
.forEach(entry -> exchange.getResp... | [
"private",
"void",
"endRequest",
"(",
"HttpServerExchange",
"exchange",
",",
"String",
"redirect",
")",
"{",
"exchange",
".",
"setStatusCode",
"(",
"StatusCodes",
".",
"FOUND",
")",
";",
"Server",
".",
"headers",
"(",
")",
".",
"entrySet",
"(",
")",
".",
"... | Ends the current request by sending a HTTP 302 status code and a direct to the given URL
@param exchange The HttpServerExchange | [
"Ends",
"the",
"current",
"request",
"by",
"sending",
"a",
"HTTP",
"302",
"status",
"code",
"and",
"a",
"direct",
"to",
"the",
"given",
"URL"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthenticationHandler.java#L62-L73 |
qcloudsms/qcloudsms_java | src/main/java/com/github/qcloudsms/SmsBase.java | SmsBase.handleError | public HTTPResponse handleError(HTTPResponse response) throws HTTPException {
"""
Handle http status error
@param response raw http response
@return response raw http response
@throws HTTPException http status exception
"""
if (response.statusCode < 200 || response.statusCode >= 300) {
... | java | public HTTPResponse handleError(HTTPResponse response) throws HTTPException {
if (response.statusCode < 200 || response.statusCode >= 300) {
throw new HTTPException(response.statusCode, response.reason);
}
return response;
} | [
"public",
"HTTPResponse",
"handleError",
"(",
"HTTPResponse",
"response",
")",
"throws",
"HTTPException",
"{",
"if",
"(",
"response",
".",
"statusCode",
"<",
"200",
"||",
"response",
".",
"statusCode",
">=",
"300",
")",
"{",
"throw",
"new",
"HTTPException",
"(... | Handle http status error
@param response raw http response
@return response raw http response
@throws HTTPException http status exception | [
"Handle",
"http",
"status",
"error"
] | train | https://github.com/qcloudsms/qcloudsms_java/blob/920ba838b4fdafcbf684e71bb09846de72294eea/src/main/java/com/github/qcloudsms/SmsBase.java#L34-L39 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java | MatrixFeatures_DDRM.isSymmetric | public static boolean isSymmetric(DMatrixRMaj m , double tol ) {
"""
<p>
Returns true if the matrix is symmetric within the tolerance. Only square matrices can be
symmetric.
</p>
<p>
A matrix is symmetric if:<br>
|a<sub>ij</sub> - a<sub>ji</sub>| ≤ tol
</p>
@param m A matrix. Not modified.
@param to... | java | public static boolean isSymmetric(DMatrixRMaj m , double tol ) {
if( m.numCols != m.numRows )
return false;
double max = CommonOps_DDRM.elementMaxAbs(m);
for( int i = 0; i < m.numRows; i++ ) {
for( int j = 0; j < i; j++ ) {
double a = m.get(i,j)/max;
... | [
"public",
"static",
"boolean",
"isSymmetric",
"(",
"DMatrixRMaj",
"m",
",",
"double",
"tol",
")",
"{",
"if",
"(",
"m",
".",
"numCols",
"!=",
"m",
".",
"numRows",
")",
"return",
"false",
";",
"double",
"max",
"=",
"CommonOps_DDRM",
".",
"elementMaxAbs",
"... | <p>
Returns true if the matrix is symmetric within the tolerance. Only square matrices can be
symmetric.
</p>
<p>
A matrix is symmetric if:<br>
|a<sub>ij</sub> - a<sub>ji</sub>| ≤ tol
</p>
@param m A matrix. Not modified.
@param tol Tolerance for how similar two elements need to be.
@return true if it is symmetric... | [
"<p",
">",
"Returns",
"true",
"if",
"the",
"matrix",
"is",
"symmetric",
"within",
"the",
"tolerance",
".",
"Only",
"square",
"matrices",
"can",
"be",
"symmetric",
".",
"<",
"/",
"p",
">",
"<p",
">",
"A",
"matrix",
"is",
"symmetric",
"if",
":",
"<br",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java#L190-L209 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/api/HttpApiUtil.java | HttpApiUtil.newResponse | public static HttpResponse newResponse(RequestContext ctx, HttpStatus status,
Throwable cause, String message) {
"""
Returns a newly created {@link HttpResponse} with the specified {@link HttpStatus}, {@code cause} and
{@code message}.
"""
requireNonNull(ctx,... | java | public static HttpResponse newResponse(RequestContext ctx, HttpStatus status,
Throwable cause, String message) {
requireNonNull(ctx, "ctx");
requireNonNull(status, "status");
requireNonNull(cause, "cause");
requireNonNull(message, "message");
... | [
"public",
"static",
"HttpResponse",
"newResponse",
"(",
"RequestContext",
"ctx",
",",
"HttpStatus",
"status",
",",
"Throwable",
"cause",
",",
"String",
"message",
")",
"{",
"requireNonNull",
"(",
"ctx",
",",
"\"ctx\"",
")",
";",
"requireNonNull",
"(",
"status",
... | Returns a newly created {@link HttpResponse} with the specified {@link HttpStatus}, {@code cause} and
{@code message}. | [
"Returns",
"a",
"newly",
"created",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/api/HttpApiUtil.java#L151-L159 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.setForward | public void setForward(String destination) throws WorkspaceApiException {
"""
Set call forwarding on the current agent's DN to the specified destination.
@param destination The number where Workspace should forward calls.
"""
try {
VoicesetforwardData forwardData = new VoicesetforwardDat... | java | public void setForward(String destination) throws WorkspaceApiException {
try {
VoicesetforwardData forwardData = new VoicesetforwardData();
forwardData.setForwardTo(destination);
ForwardData data = new ForwardData();
data.data(forwardData);
... | [
"public",
"void",
"setForward",
"(",
"String",
"destination",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"VoicesetforwardData",
"forwardData",
"=",
"new",
"VoicesetforwardData",
"(",
")",
";",
"forwardData",
".",
"setForwardTo",
"(",
"destination",
")"... | Set call forwarding on the current agent's DN to the specified destination.
@param destination The number where Workspace should forward calls. | [
"Set",
"call",
"forwarding",
"on",
"the",
"current",
"agent",
"s",
"DN",
"to",
"the",
"specified",
"destination",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L443-L456 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/proxy/TaskHolder.java | TaskHolder.getProperty | public String getProperty(String strKey, Map<String, Object> properties) {
"""
Get the servlet's property.
For Ajax proxies, the top level proxy is shared among sessions. since it is not unique, don't return property.
"""
String strProperty = super.getProperty(strKey, properties);
if (strPrope... | java | public String getProperty(String strKey, Map<String, Object> properties)
{
String strProperty = super.getProperty(strKey, properties);
if (strProperty == null)
if (!m_proxyTask.isShared())
strProperty = m_proxyTask.getProperty(strKey);
return strProperty;
} | [
"public",
"String",
"getProperty",
"(",
"String",
"strKey",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strProperty",
"=",
"super",
".",
"getProperty",
"(",
"strKey",
",",
"properties",
")",
";",
"if",
"(",
"strPropert... | Get the servlet's property.
For Ajax proxies, the top level proxy is shared among sessions. since it is not unique, don't return property. | [
"Get",
"the",
"servlet",
"s",
"property",
".",
"For",
"Ajax",
"proxies",
"the",
"top",
"level",
"proxy",
"is",
"shared",
"among",
"sessions",
".",
"since",
"it",
"is",
"not",
"unique",
"don",
"t",
"return",
"property",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/TaskHolder.java#L152-L159 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/CreateOptions.java | CreateOptions.writeOptions | public static WriteOptions writeOptions(Boolean overwrite, Boolean forceSync) {
"""
Creates a WriteOptions from given overwrite and forceSync values. If null passed,
it will use their default value.
"""
WriteOptions wo = new WriteOptions();
if (overwrite != null)
wo.setOverwrite(overwrite);
... | java | public static WriteOptions writeOptions(Boolean overwrite, Boolean forceSync){
WriteOptions wo = new WriteOptions();
if (overwrite != null)
wo.setOverwrite(overwrite);
if (forceSync != null)
wo.setForcesync(forceSync);
return wo;
} | [
"public",
"static",
"WriteOptions",
"writeOptions",
"(",
"Boolean",
"overwrite",
",",
"Boolean",
"forceSync",
")",
"{",
"WriteOptions",
"wo",
"=",
"new",
"WriteOptions",
"(",
")",
";",
"if",
"(",
"overwrite",
"!=",
"null",
")",
"wo",
".",
"setOverwrite",
"("... | Creates a WriteOptions from given overwrite and forceSync values. If null passed,
it will use their default value. | [
"Creates",
"a",
"WriteOptions",
"from",
"given",
"overwrite",
"and",
"forceSync",
"values",
".",
"If",
"null",
"passed",
"it",
"will",
"use",
"their",
"default",
"value",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/CreateOptions.java#L39-L46 |
apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/DynamoDBStreamsProxy.java | DynamoDBStreamsProxy.createKinesisClient | @Override
protected AmazonKinesis createKinesisClient(Properties configProps) {
"""
Creates an AmazonDynamoDBStreamsAdapterClient.
Uses it as the internal client interacting with the DynamoDB streams.
@param configProps configuration properties
@return an AWS DynamoDB streams adapter client
"""
ClientC... | java | @Override
protected AmazonKinesis createKinesisClient(Properties configProps) {
ClientConfiguration awsClientConfig = new ClientConfigurationFactory().getConfig();
setAwsClientConfigProperties(awsClientConfig, configProps);
AWSCredentialsProvider credentials = getCredentialsProvider(configProps);
awsClientCon... | [
"@",
"Override",
"protected",
"AmazonKinesis",
"createKinesisClient",
"(",
"Properties",
"configProps",
")",
"{",
"ClientConfiguration",
"awsClientConfig",
"=",
"new",
"ClientConfigurationFactory",
"(",
")",
".",
"getConfig",
"(",
")",
";",
"setAwsClientConfigProperties",... | Creates an AmazonDynamoDBStreamsAdapterClient.
Uses it as the internal client interacting with the DynamoDB streams.
@param configProps configuration properties
@return an AWS DynamoDB streams adapter client | [
"Creates",
"an",
"AmazonDynamoDBStreamsAdapterClient",
".",
"Uses",
"it",
"as",
"the",
"internal",
"client",
"interacting",
"with",
"the",
"DynamoDB",
"streams",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/DynamoDBStreamsProxy.java#L77-L100 |
Mthwate/DatLib | src/main/java/com/mthwate/datlib/HashUtils.java | HashUtils.sha384Hex | public static String sha384Hex(String data, Charset charset) throws NoSuchAlgorithmException {
"""
Hashes a string using the SHA-384 algorithm. Returns a hexadecimal result.
@since 1.1
@param data the string to hash
@param charset the charset of the string
@return the hexadecimal SHA-384 hash of the string
... | java | public static String sha384Hex(String data, Charset charset) throws NoSuchAlgorithmException {
return sha384Hex(data.getBytes(charset));
} | [
"public",
"static",
"String",
"sha384Hex",
"(",
"String",
"data",
",",
"Charset",
"charset",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"return",
"sha384Hex",
"(",
"data",
".",
"getBytes",
"(",
"charset",
")",
")",
";",
"}"
] | Hashes a string using the SHA-384 algorithm. Returns a hexadecimal result.
@since 1.1
@param data the string to hash
@param charset the charset of the string
@return the hexadecimal SHA-384 hash of the string
@throws NoSuchAlgorithmException the algorithm is not supported by existing providers | [
"Hashes",
"a",
"string",
"using",
"the",
"SHA",
"-",
"384",
"algorithm",
".",
"Returns",
"a",
"hexadecimal",
"result",
"."
] | train | https://github.com/Mthwate/DatLib/blob/f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077/src/main/java/com/mthwate/datlib/HashUtils.java#L508-L510 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createSSHKey | public GitlabSSHKey createSSHKey(String title, String key) throws IOException {
"""
Create a new ssh key for the authenticated user.
@param title The title of the ssh key
@param key The public key
@return The new GitlabSSHKey
@throws IOException on gitlab api call error
"""
Query... | java | public GitlabSSHKey createSSHKey(String title, String key) throws IOException {
Query query = new Query()
.append("title", title)
.append("key", key);
String tailUrl = GitlabUser.USER_URL + GitlabSSHKey.KEYS_URL + query.toString();
return dispatch().to(tailUrl,... | [
"public",
"GitlabSSHKey",
"createSSHKey",
"(",
"String",
"title",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"Query",
"query",
"=",
"new",
"Query",
"(",
")",
".",
"append",
"(",
"\"title\"",
",",
"title",
")",
".",
"append",
"(",
"\"key\"",
... | Create a new ssh key for the authenticated user.
@param title The title of the ssh key
@param key The public key
@return The new GitlabSSHKey
@throws IOException on gitlab api call error | [
"Create",
"a",
"new",
"ssh",
"key",
"for",
"the",
"authenticated",
"user",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L404-L413 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/Program.java | Program.addRule | public Rule addRule(String name, Node condition) {
"""
Add a rule to this program.
<p>
@param name is the rule name
@param condition is the rule condition
@return the rule
"""
Rule rule = new Rule(name, condition);
rules.put(name, rule);
return rule;
} | java | public Rule addRule(String name, Node condition) {
Rule rule = new Rule(name, condition);
rules.put(name, rule);
return rule;
} | [
"public",
"Rule",
"addRule",
"(",
"String",
"name",
",",
"Node",
"condition",
")",
"{",
"Rule",
"rule",
"=",
"new",
"Rule",
"(",
"name",
",",
"condition",
")",
";",
"rules",
".",
"put",
"(",
"name",
",",
"rule",
")",
";",
"return",
"rule",
";",
"}"... | Add a rule to this program.
<p>
@param name is the rule name
@param condition is the rule condition
@return the rule | [
"Add",
"a",
"rule",
"to",
"this",
"program",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/Program.java#L123-L127 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java | URI.setFragment | public void setFragment(String p_fragment) throws MalformedURIException {
"""
Set the fragment for this URI. A non-null value is valid only
if this is a URI conforming to the generic URI syntax and
the path value is not null.
@param p_fragment the fragment for this URI
@throws MalformedURIException if p_fr... | java | public void setFragment(String p_fragment) throws MalformedURIException
{
if (p_fragment == null)
{
m_fragment = null;
}
else if (!isGenericURI())
{
throw new MalformedURIException(
Utils.messages.createMessage(MsgKey.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be se... | [
"public",
"void",
"setFragment",
"(",
"String",
"p_fragment",
")",
"throws",
"MalformedURIException",
"{",
"if",
"(",
"p_fragment",
"==",
"null",
")",
"{",
"m_fragment",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"!",
"isGenericURI",
"(",
")",
")",
"{",
"... | Set the fragment for this URI. A non-null value is valid only
if this is a URI conforming to the generic URI syntax and
the path value is not null.
@param p_fragment the fragment for this URI
@throws MalformedURIException if p_fragment is not null and this
URI does not conform to the generic
URI syntax or if the path... | [
"Set",
"the",
"fragment",
"for",
"this",
"URI",
".",
"A",
"non",
"-",
"null",
"value",
"is",
"valid",
"only",
"if",
"this",
"is",
"a",
"URI",
"conforming",
"to",
"the",
"generic",
"URI",
"syntax",
"and",
"the",
"path",
"value",
"is",
"not",
"null",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java#L1286-L1311 |
WiQuery/wiquery | wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java | Options.putDouble | public Options putDouble(String key, IModel<Double> value) {
"""
<p>
Puts an IModel <Double> value for the given option name.
</p>
@param key
the option name.
@param value
the float value.
"""
putOption(key, new DoubleOption(value));
return this;
} | java | public Options putDouble(String key, IModel<Double> value)
{
putOption(key, new DoubleOption(value));
return this;
} | [
"public",
"Options",
"putDouble",
"(",
"String",
"key",
",",
"IModel",
"<",
"Double",
">",
"value",
")",
"{",
"putOption",
"(",
"key",
",",
"new",
"DoubleOption",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Puts an IModel <Double> value for the given option name.
</p>
@param key
the option name.
@param value
the float value. | [
"<p",
">",
"Puts",
"an",
"IModel",
"<",
";",
"Double>",
";",
"value",
"for",
"the",
"given",
"option",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java#L387-L391 |
kubernetes-client/java | util/src/main/java/io/kubernetes/client/util/WebSockets.java | WebSockets.streamRequest | private static void streamRequest(Request request, ApiClient client, SocketListener listener) {
"""
/*
If we ever upgrade to okhttp 3...
public static void stream(Call call, ApiClient client, SocketListener listener) {
streamRequest(call.request(), client, listener);
}
"""
WebSocketCall.create(client.g... | java | private static void streamRequest(Request request, ApiClient client, SocketListener listener) {
WebSocketCall.create(client.getHttpClient(), request).enqueue(new Listener(listener));
} | [
"private",
"static",
"void",
"streamRequest",
"(",
"Request",
"request",
",",
"ApiClient",
"client",
",",
"SocketListener",
"listener",
")",
"{",
"WebSocketCall",
".",
"create",
"(",
"client",
".",
"getHttpClient",
"(",
")",
",",
"request",
")",
".",
"enqueue"... | /*
If we ever upgrade to okhttp 3...
public static void stream(Call call, ApiClient client, SocketListener listener) {
streamRequest(call.request(), client, listener);
} | [
"/",
"*",
"If",
"we",
"ever",
"upgrade",
"to",
"okhttp",
"3",
"...",
"public",
"static",
"void",
"stream",
"(",
"Call",
"call",
"ApiClient",
"client",
"SocketListener",
"listener",
")",
"{",
"streamRequest",
"(",
"call",
".",
"request",
"()",
"client",
"li... | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/WebSockets.java#L113-L115 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJ.java | IfmapJ.createSsrc | public static SSRC createSsrc(CertAuthConfig config)
throws InitializationException {
"""
Create a new {@link SSRC} object to operate on the given configuration
using certificate based authentication.
@param config
the configuration parameter for the new SSRC
@return a new {@link SSRC} that uses certifica... | java | public static SSRC createSsrc(CertAuthConfig config)
throws InitializationException {
TrustManager[] trustManagers = IfmapJHelper.getTrustManagers(
config.trustStorePath,
config.trustStorePassword);
KeyManager[] keyManagers = IfmapJHelper.getKeyManagers(
config.keyStorePath,
config.keyStorePasswo... | [
"public",
"static",
"SSRC",
"createSsrc",
"(",
"CertAuthConfig",
"config",
")",
"throws",
"InitializationException",
"{",
"TrustManager",
"[",
"]",
"trustManagers",
"=",
"IfmapJHelper",
".",
"getTrustManagers",
"(",
"config",
".",
"trustStorePath",
",",
"config",
".... | Create a new {@link SSRC} object to operate on the given configuration
using certificate based authentication.
@param config
the configuration parameter for the new SSRC
@return a new {@link SSRC} that uses certificate based authentication
@throws InitializationException
if the SSRC initialization fails | [
"Create",
"a",
"new",
"{",
"@link",
"SSRC",
"}",
"object",
"to",
"operate",
"on",
"the",
"given",
"configuration",
"using",
"certificate",
"based",
"authentication",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJ.java#L163-L178 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/ClassDescriptorDef.java | ClassDescriptorDef.cloneField | private FieldDescriptorDef cloneField(FieldDescriptorDef fieldDef, String prefix) {
"""
Clones the given field.
@param fieldDef The field descriptor
@param prefix A prefix for the name
@return The cloned field
"""
FieldDescriptorDef copyFieldDef = new FieldDescriptorDef(fieldDef, prefix);
... | java | private FieldDescriptorDef cloneField(FieldDescriptorDef fieldDef, String prefix)
{
FieldDescriptorDef copyFieldDef = new FieldDescriptorDef(fieldDef, prefix);
copyFieldDef.setOwner(this);
// we remove properties that are only relevant to the class the features are declared in
... | [
"private",
"FieldDescriptorDef",
"cloneField",
"(",
"FieldDescriptorDef",
"fieldDef",
",",
"String",
"prefix",
")",
"{",
"FieldDescriptorDef",
"copyFieldDef",
"=",
"new",
"FieldDescriptorDef",
"(",
"fieldDef",
",",
"prefix",
")",
";",
"copyFieldDef",
".",
"setOwner",
... | Clones the given field.
@param fieldDef The field descriptor
@param prefix A prefix for the name
@return The cloned field | [
"Clones",
"the",
"given",
"field",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/ClassDescriptorDef.java#L446-L470 |
TakahikoKawasaki/nv-cipher | src/main/java/com/neovisionaries/security/AESCipher.java | AESCipher.setKey | public AESCipher setKey(SecretKey key, IvParameterSpec iv) {
"""
Set cipher initialization parameters.
<p>
This method is an alias of {@link #setInit(java.security.Key,
java.security.spec.AlgorithmParameterSpec) setInit(key, iv)}.
</p>
@param key
Secret key.
@param iv
Initial vector.
@return
{@co... | java | public AESCipher setKey(SecretKey key, IvParameterSpec iv)
{
return (AESCipher)setInit(key, iv);
} | [
"public",
"AESCipher",
"setKey",
"(",
"SecretKey",
"key",
",",
"IvParameterSpec",
"iv",
")",
"{",
"return",
"(",
"AESCipher",
")",
"setInit",
"(",
"key",
",",
"iv",
")",
";",
"}"
] | Set cipher initialization parameters.
<p>
This method is an alias of {@link #setInit(java.security.Key,
java.security.spec.AlgorithmParameterSpec) setInit(key, iv)}.
</p>
@param key
Secret key.
@param iv
Initial vector.
@return
{@code this} object.
@throws IllegalArgumentException
{@code key} is {@code null}. | [
"Set",
"cipher",
"initialization",
"parameters",
"."
] | train | https://github.com/TakahikoKawasaki/nv-cipher/blob/d01aa4f53611e2724ae03633060f55bacf549175/src/main/java/com/neovisionaries/security/AESCipher.java#L228-L231 |
soarcn/AndroidLifecyle | lifecycle/src/main/java/com/cocosw/lifecycle/LifecycleDispatcher.java | LifecycleDispatcher.unregisterActivityLifecycleCallbacks | public static void unregisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
"""
Unregisters a previously registered callback.
@param application The application with which to unregister the callback.
@param callback The callback to unregister.
"""
... | java | public static void unregisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
if (PRE_ICS) {
preIcsUnregisterActivityLifecycleCallbacks(callback);
} else {
postIcsUnregisterActivityLifecycleCallbacks(application, callback);
... | [
"public",
"static",
"void",
"unregisterActivityLifecycleCallbacks",
"(",
"Application",
"application",
",",
"ActivityLifecycleCallbacksCompat",
"callback",
")",
"{",
"if",
"(",
"PRE_ICS",
")",
"{",
"preIcsUnregisterActivityLifecycleCallbacks",
"(",
"callback",
")",
";",
"... | Unregisters a previously registered callback.
@param application The application with which to unregister the callback.
@param callback The callback to unregister. | [
"Unregisters",
"a",
"previously",
"registered",
"callback",
"."
] | train | https://github.com/soarcn/AndroidLifecyle/blob/f1e36f1f20871863cc2007aa0fa6c30143dd2091/lifecycle/src/main/java/com/cocosw/lifecycle/LifecycleDispatcher.java#L65-L71 |
apache/incubator-atlas | typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java | TypeSystem.commitTypes | public void commitTypes(Map<String, IDataType> typesAdded) throws AtlasException {
"""
Commit the given types to this {@link TypeSystem} instance.
This step should be called only after the types have been committed to the backend stores successfully.
@param typesAdded newly added types.
@throws AtlasException... | java | public void commitTypes(Map<String, IDataType> typesAdded) throws AtlasException {
for (Map.Entry<String, IDataType> typeEntry : typesAdded.entrySet()) {
IDataType type = typeEntry.getValue();
//Add/replace the new type in the typesystem
typeCache.put(type);
}
} | [
"public",
"void",
"commitTypes",
"(",
"Map",
"<",
"String",
",",
"IDataType",
">",
"typesAdded",
")",
"throws",
"AtlasException",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"IDataType",
">",
"typeEntry",
":",
"typesAdded",
".",
"entrySet",
"... | Commit the given types to this {@link TypeSystem} instance.
This step should be called only after the types have been committed to the backend stores successfully.
@param typesAdded newly added types.
@throws AtlasException | [
"Commit",
"the",
"given",
"types",
"to",
"this",
"{",
"@link",
"TypeSystem",
"}",
"instance",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java#L362-L368 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/LinkedConverter.java | LinkedConverter.setData | public int setData(Object state, boolean bDisplayOption, int iMoveMode) {
"""
For binary fields, set the current state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN).
""" // Mus... | java | public int setData(Object state, boolean bDisplayOption, int iMoveMode)
{ // Must be overidden
if (this.getNextConverter() != null)
return this.getNextConverter().setData(state, bDisplayOption, iMoveMode);
else
return super.setData(state, bDisplayOption, iMoveMode);
... | [
"public",
"int",
"setData",
"(",
"Object",
"state",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"// Must be overidden",
"if",
"(",
"this",
".",
"getNextConverter",
"(",
")",
"!=",
"null",
")",
"return",
"this",
".",
"getNextConverter",... | For binary fields, set the current state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN). | [
"For",
"binary",
"fields",
"set",
"the",
"current",
"state",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/LinkedConverter.java#L167-L173 |
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 int nValue) {
"""
Shortcut method to add a numeric value
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param nValue
The value to be added.
@return this
"""
return addMember (nIndex, new CSSEx... | java | @Nonnull
public CSSExpression addNumber (@Nonnegative final int nIndex, final int nValue)
{
return addMember (nIndex, new CSSExpressionMemberTermSimple (nValue));
} | [
"@",
"Nonnull",
"public",
"CSSExpression",
"addNumber",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"final",
"int",
"nValue",
")",
"{",
"return",
"addMember",
"(",
"nIndex",
",",
"new",
"CSSExpressionMemberTermSimple",
"(",
"nValue",
")",
")",
";",... | Shortcut method to add a numeric value
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param nValue
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#L140-L144 |
srikalyc/Sql4D | Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/Mapper4Bean.java | Mapper4Bean.extractKeyAndRow | private T extractKeyAndRow(String timestamp, JSONObject jsonRow) {
"""
Extract v = all fields from json. The first field is always timestamp and
is not extracted here.
@param timestamp
@param jsonRow
@return
"""
T rowValues = null;
try {
rowValues = rowMapper.newInstance();
... | java | private T extractKeyAndRow(String timestamp, JSONObject jsonRow) {
T rowValues = null;
try {
rowValues = rowMapper.newInstance();
rowValues.getClass().getMethod("setTimestamp", String.class).invoke(rowValues, timestamp);
for (Object key : jsonRow.keySet()) {
... | [
"private",
"T",
"extractKeyAndRow",
"(",
"String",
"timestamp",
",",
"JSONObject",
"jsonRow",
")",
"{",
"T",
"rowValues",
"=",
"null",
";",
"try",
"{",
"rowValues",
"=",
"rowMapper",
".",
"newInstance",
"(",
")",
";",
"rowValues",
".",
"getClass",
"(",
")"... | Extract v = all fields from json. The first field is always timestamp and
is not extracted here.
@param timestamp
@param jsonRow
@return | [
"Extract",
"v",
"=",
"all",
"fields",
"from",
"json",
".",
"The",
"first",
"field",
"is",
"always",
"timestamp",
"and",
"is",
"not",
"extracted",
"here",
"."
] | train | https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/Mapper4Bean.java#L80-L93 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ClassUtils.java | ClassUtils.resolveConstructor | public static <T> Constructor<T> resolveConstructor(Class<T> type, Class<?>[] parameterTypes, Object... arguments) {
"""
Attempts to resolve the constructor from the given class type based on the constructor's exact signature,
otherwise finds a constructor who's signature parameter types satisfy the array of Obje... | java | public static <T> Constructor<T> resolveConstructor(Class<T> type, Class<?>[] parameterTypes, Object... arguments) {
try {
return getConstructor(type, parameterTypes);
}
catch (ConstructorNotFoundException cause) {
Constructor<T> constructor = findConstructor(type, arguments);
Assert.no... | [
"public",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"resolveConstructor",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"Object",
"...",
"arguments",
")",
"{",
"try",
"{",
"return",
"g... | Attempts to resolve the constructor from the given class type based on the constructor's exact signature,
otherwise finds a constructor who's signature parameter types satisfy the array of Object arguments.
@param <T> the generic class type from which to resolve the constructor.
@param type the Class type from which t... | [
"Attempts",
"to",
"resolve",
"the",
"constructor",
"from",
"the",
"given",
"class",
"type",
"based",
"on",
"the",
"constructor",
"s",
"exact",
"signature",
"otherwise",
"finds",
"a",
"constructor",
"who",
"s",
"signature",
"parameter",
"types",
"satisfy",
"the",... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ClassUtils.java#L267-L282 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePicker.java | DateTimePicker.getConvertedValue | @Override
public Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException {
"""
Converts the date from the moment.js format to a java.util.Date.
"""
if (submittedValue == null) {
return null;
}
String val = (String) submittedValue;
// If the Trimmed submitted... | java | @Override
public Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException {
if (submittedValue == null) {
return null;
}
String val = (String) submittedValue;
// If the Trimmed submitted value is empty, return null
if (val.trim().length() == 0) {
return null;
}... | [
"@",
"Override",
"public",
"Object",
"getConvertedValue",
"(",
"FacesContext",
"context",
",",
"Object",
"submittedValue",
")",
"throws",
"ConverterException",
"{",
"if",
"(",
"submittedValue",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"val",... | Converts the date from the moment.js format to a java.util.Date. | [
"Converts",
"the",
"date",
"from",
"the",
"moment",
".",
"js",
"format",
"to",
"a",
"java",
".",
"util",
".",
"Date",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePicker.java#L142-L186 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/JsonPullParser.java | JsonPullParser.newParser | public static JsonPullParser newParser(InputStream is, String charsetName)
throws UnsupportedEncodingException {
"""
Creates a new parser, using the given InputStream as its {@code JSON} feed.
<p>
Please call one of the {@code setSource(...)}'s before calling other methods.
</p>
@param is
An InputStrea... | java | public static JsonPullParser newParser(InputStream is, String charsetName)
throws UnsupportedEncodingException {
if (is == null) {
throw new IllegalArgumentException("'is' must not be null.");
}
try {
final Charset charset = (charsetName == null) ? null : Charset.forName(charsetName);
return newParse... | [
"public",
"static",
"JsonPullParser",
"newParser",
"(",
"InputStream",
"is",
",",
"String",
"charsetName",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"is",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"'is' must not ... | Creates a new parser, using the given InputStream as its {@code JSON} feed.
<p>
Please call one of the {@code setSource(...)}'s before calling other methods.
</p>
@param is
An InputStream serves as {@code JSON} feed. Cannot be null.
@param charsetName
The character set should be assumed in which in the stream are enc... | [
"Creates",
"a",
"new",
"parser",
"using",
"the",
"given",
"InputStream",
"as",
"its",
"{",
"@code",
"JSON",
"}",
"feed",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/JsonPullParser.java#L174-L186 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.listTemplatesForDocument | public TemplateInformation listTemplatesForDocument(String accountId, String envelopeId, String documentId) throws ApiException {
"""
Gets the templates associated with a document in an existing envelope.
Retrieves the templates associated with a document in the specified envelope.
@param accountId The external ... | java | public TemplateInformation listTemplatesForDocument(String accountId, String envelopeId, String documentId) throws ApiException {
return listTemplatesForDocument(accountId, envelopeId, documentId, null);
} | [
"public",
"TemplateInformation",
"listTemplatesForDocument",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"String",
"documentId",
")",
"throws",
"ApiException",
"{",
"return",
"listTemplatesForDocument",
"(",
"accountId",
",",
"envelopeId",
",",
"docume... | Gets the templates associated with a document in an existing envelope.
Retrieves the templates associated with a document in the specified envelope.
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelopeId Guid of the envelope being accessed. (required)
@param d... | [
"Gets",
"the",
"templates",
"associated",
"with",
"a",
"document",
"in",
"an",
"existing",
"envelope",
".",
"Retrieves",
"the",
"templates",
"associated",
"with",
"a",
"document",
"in",
"the",
"specified",
"envelope",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L4426-L4428 |
qspin/qtaste | kernel/src/main/java/com/qspin/qtaste/ui/jedit/LineNumberPanel.java | LineNumberPanel.updateSize | private void updateSize() {
"""
Update the size of the line numbers based on the length of the document
"""
int newLineCount = ActionUtils.getLineCount(pane);
if (newLineCount == lineCount) {
return;
}
lineCount = newLineCount;
int h = (int) pane.getPreferred... | java | private void updateSize() {
int newLineCount = ActionUtils.getLineCount(pane);
if (newLineCount == lineCount) {
return;
}
lineCount = newLineCount;
int h = (int) pane.getPreferredSize().getHeight();
int d = (int) Math.log10(lineCount) + 1;
if (d < 1) {... | [
"private",
"void",
"updateSize",
"(",
")",
"{",
"int",
"newLineCount",
"=",
"ActionUtils",
".",
"getLineCount",
"(",
"pane",
")",
";",
"if",
"(",
"newLineCount",
"==",
"lineCount",
")",
"{",
"return",
";",
"}",
"lineCount",
"=",
"newLineCount",
";",
"int",... | Update the size of the line numbers based on the length of the document | [
"Update",
"the",
"size",
"of",
"the",
"line",
"numbers",
"based",
"on",
"the",
"length",
"of",
"the",
"document"
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/ui/jedit/LineNumberPanel.java#L146-L161 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayLanguage | public static String getDisplayLanguage(String localeID, ULocale displayLocale) {
"""
<strong>[icu]</strong> Returns a locale's language localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the id of the locale whose language will be displayed.
@param displayLocale th... | java | public static String getDisplayLanguage(String localeID, ULocale displayLocale) {
return getDisplayLanguageInternal(new ULocale(localeID), displayLocale, false);
} | [
"public",
"static",
"String",
"getDisplayLanguage",
"(",
"String",
"localeID",
",",
"ULocale",
"displayLocale",
")",
"{",
"return",
"getDisplayLanguageInternal",
"(",
"new",
"ULocale",
"(",
"localeID",
")",
",",
"displayLocale",
",",
"false",
")",
";",
"}"
] | <strong>[icu]</strong> Returns a locale's language localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the id of the locale whose language will be displayed.
@param displayLocale the locale in which to display the name.
@return the localized language name. | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"a",
"locale",
"s",
"language",
"localized",
"for",
"display",
"in",
"the",
"provided",
"locale",
".",
"This",
"is",
"a",
"cover",
"for",
"the",
"ICU4C",
"API",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1405-L1407 |
opencb/java-common-libs | commons-datastore/commons-datastore-solr/src/main/java/org/opencb/commons/datastore/solr/SolrManager.java | SolrManager.createCore | public void createCore(String coreName, String configSet) throws SolrException {
"""
Create a Solr core from a configuration set directory. By default, the configuration set directory is located
inside the folder server/solr/configsets.
@param coreName Core name
@param configSet Configuration set name
@thro... | java | public void createCore(String coreName, String configSet) throws SolrException {
try {
logger.debug("Creating core: host={}, core={}, configSet={}", host, coreName, configSet);
CoreAdminRequest.Create request = new CoreAdminRequest.Create();
request.setCoreName(coreName);
... | [
"public",
"void",
"createCore",
"(",
"String",
"coreName",
",",
"String",
"configSet",
")",
"throws",
"SolrException",
"{",
"try",
"{",
"logger",
".",
"debug",
"(",
"\"Creating core: host={}, core={}, configSet={}\"",
",",
"host",
",",
"coreName",
",",
"configSet",
... | Create a Solr core from a configuration set directory. By default, the configuration set directory is located
inside the folder server/solr/configsets.
@param coreName Core name
@param configSet Configuration set name
@throws SolrException Exception | [
"Create",
"a",
"Solr",
"core",
"from",
"a",
"configuration",
"set",
"directory",
".",
"By",
"default",
"the",
"configuration",
"set",
"directory",
"is",
"located",
"inside",
"the",
"folder",
"server",
"/",
"solr",
"/",
"configsets",
"."
] | train | https://github.com/opencb/java-common-libs/blob/5c97682530d0be55828e1e4e374ff01fceb5f198/commons-datastore/commons-datastore-solr/src/main/java/org/opencb/commons/datastore/solr/SolrManager.java#L136-L146 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Bindings.java | Bindings.bindVisible | public static void bindVisible (Value<Boolean> value, final Widget... targets) {
"""
Binds the visible state of the target widget to the supplied boolean value.
"""
value.addListenerAndTrigger(new Value.Listener<Boolean>() {
public void valueChanged (Boolean visible) {
for (... | java | public static void bindVisible (Value<Boolean> value, final Widget... targets)
{
value.addListenerAndTrigger(new Value.Listener<Boolean>() {
public void valueChanged (Boolean visible) {
for (Widget target : targets) {
target.setVisible(visible);
... | [
"public",
"static",
"void",
"bindVisible",
"(",
"Value",
"<",
"Boolean",
">",
"value",
",",
"final",
"Widget",
"...",
"targets",
")",
"{",
"value",
".",
"addListenerAndTrigger",
"(",
"new",
"Value",
".",
"Listener",
"<",
"Boolean",
">",
"(",
")",
"{",
"p... | Binds the visible state of the target widget to the supplied boolean value. | [
"Binds",
"the",
"visible",
"state",
"of",
"the",
"target",
"widget",
"to",
"the",
"supplied",
"boolean",
"value",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L73-L82 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.TITLE | public static HtmlTree TITLE(Content body) {
"""
Generates a TITLE tag with some content.
@param body content for the tag
@return an HtmlTree object for the TITLE tag
"""
HtmlTree htmltree = new HtmlTree(HtmlTag.TITLE, nullCheck(body));
return htmltree;
} | java | public static HtmlTree TITLE(Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.TITLE, nullCheck(body));
return htmltree;
} | [
"public",
"static",
"HtmlTree",
"TITLE",
"(",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"TITLE",
",",
"nullCheck",
"(",
"body",
")",
")",
";",
"return",
"htmltree",
";",
"}"
] | Generates a TITLE tag with some content.
@param body content for the tag
@return an HtmlTree object for the TITLE tag | [
"Generates",
"a",
"TITLE",
"tag",
"with",
"some",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L842-L845 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/msg/ReadCommEventLogResponse.java | ReadCommEventLogResponse.getEvent | public int getEvent(int index) {
"""
getEvent -- get an event from the event log.
@param index Index of the event
@return Event ID
"""
if (events == null || index < 0 || index >= events.length) {
throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "nu... | java | public int getEvent(int index) {
if (events == null || index < 0 || index >= events.length) {
throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "null" : events.length));
}
return events[index] & 0xFF;
} | [
"public",
"int",
"getEvent",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"events",
"==",
"null",
"||",
"index",
"<",
"0",
"||",
"index",
">=",
"events",
".",
"length",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"index = \"",
"+",
"index"... | getEvent -- get an event from the event log.
@param index Index of the event
@return Event ID | [
"getEvent",
"--",
"get",
"an",
"event",
"from",
"the",
"event",
"log",
"."
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/msg/ReadCommEventLogResponse.java#L106-L112 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Force.java | Force.setDirection | public void setDirection(double fh, double fv) {
"""
Set directions.
@param fh The horizontal direction.
@param fv The vertical direction.
"""
fhLast = fh;
fvLast = fv;
this.fh = fh;
this.fv = fv;
fixForce();
} | java | public void setDirection(double fh, double fv)
{
fhLast = fh;
fvLast = fv;
this.fh = fh;
this.fv = fv;
fixForce();
} | [
"public",
"void",
"setDirection",
"(",
"double",
"fh",
",",
"double",
"fv",
")",
"{",
"fhLast",
"=",
"fh",
";",
"fvLast",
"=",
"fv",
";",
"this",
".",
"fh",
"=",
"fh",
";",
"this",
".",
"fv",
"=",
"fv",
";",
"fixForce",
"(",
")",
";",
"}"
] | Set directions.
@param fh The horizontal direction.
@param fv The vertical direction. | [
"Set",
"directions",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Force.java#L231-L238 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.getSubmittedValue | public String getSubmittedValue(final String rowKey, final int col) {
"""
Retrieves the submitted value for the row and col.
@param row
@param col
@return
"""
return submittedValues.get(new SheetRowColIndex(rowKey, col));
} | java | public String getSubmittedValue(final String rowKey, final int col) {
return submittedValues.get(new SheetRowColIndex(rowKey, col));
} | [
"public",
"String",
"getSubmittedValue",
"(",
"final",
"String",
"rowKey",
",",
"final",
"int",
"col",
")",
"{",
"return",
"submittedValues",
".",
"get",
"(",
"new",
"SheetRowColIndex",
"(",
"rowKey",
",",
"col",
")",
")",
";",
"}"
] | Retrieves the submitted value for the row and col.
@param row
@param col
@return | [
"Retrieves",
"the",
"submitted",
"value",
"for",
"the",
"row",
"and",
"col",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L280-L282 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/FileUtils.java | FileUtils.isSubPath | public static boolean isSubPath(org.apache.hadoop.fs.Path parent, org.apache.hadoop.fs.Path child) throws IOException {
"""
*
Check if child path is child of parent path.
@param parent Expected parent path.
@param child Expected child path.
@return If child path is child of parent path.
@throws IOException
... | java | public static boolean isSubPath(org.apache.hadoop.fs.Path parent, org.apache.hadoop.fs.Path child) throws IOException {
String childStr = child.toString();
String parentStr = parent.toString();
return childStr.startsWith(parentStr);
} | [
"public",
"static",
"boolean",
"isSubPath",
"(",
"org",
".",
"apache",
".",
"hadoop",
".",
"fs",
".",
"Path",
"parent",
",",
"org",
".",
"apache",
".",
"hadoop",
".",
"fs",
".",
"Path",
"child",
")",
"throws",
"IOException",
"{",
"String",
"childStr",
... | *
Check if child path is child of parent path.
@param parent Expected parent path.
@param child Expected child path.
@return If child path is child of parent path.
@throws IOException | [
"*",
"Check",
"if",
"child",
"path",
"is",
"child",
"of",
"parent",
"path",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/FileUtils.java#L59-L64 |
knowm/XChange | xchange-coinbene/src/main/java/org/knowm/xchange/coinbene/service/CoinbeneUtils.java | CoinbeneUtils.signParams | public static void signParams(Map<String, String> params) {
"""
Sign Coinbene private API request parameters.
<p>Docs: <a href="https://github.com/Coinbene/API-Documents/wiki/0.1.0-Sign-Verification">
@param params parameters
@return the sign
"""
String requestString =
params.entrySet().str... | java | public static void signParams(Map<String, String> params) {
String requestString =
params.entrySet().stream()
.sorted(Comparator.comparing(Map.Entry::getKey))
.map(e -> e.getKey() + "=" + e.getValue())
.map(String::toUpperCase)
.collect(Collectors.joining("&"... | [
"public",
"static",
"void",
"signParams",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"String",
"requestString",
"=",
"params",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"sorted",
"(",
"Comparator",
".",
"comparing",... | Sign Coinbene private API request parameters.
<p>Docs: <a href="https://github.com/Coinbene/API-Documents/wiki/0.1.0-Sign-Verification">
@param params parameters
@return the sign | [
"Sign",
"Coinbene",
"private",
"API",
"request",
"parameters",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbene/src/main/java/org/knowm/xchange/coinbene/service/CoinbeneUtils.java#L20-L33 |
msteiger/jxmapviewer2 | jxmapviewer2/src/main/java/org/jxmapviewer/viewer/GeoBounds.java | GeoBounds.setRect | private void setRect(double minLat, double minLng, double maxLat, double maxLng) {
"""
Sets the internal rectangle representation.
@param minLat The minimum latitude.
@param minLng The minimum longitude.
@param maxLat The maximum latitude.
@param maxLng The maximum longitude.
"""
if (!(minLat < max... | java | private void setRect(double minLat, double minLng, double maxLat, double maxLng)
{
if (!(minLat < maxLat))
{
throw new IllegalArgumentException("GeoBounds is not valid - minLat must be less that maxLat.");
}
if (!(minLng < maxLng))
{
if (minLng > 0 && ... | [
"private",
"void",
"setRect",
"(",
"double",
"minLat",
",",
"double",
"minLng",
",",
"double",
"maxLat",
",",
"double",
"maxLng",
")",
"{",
"if",
"(",
"!",
"(",
"minLat",
"<",
"maxLat",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"G... | Sets the internal rectangle representation.
@param minLat The minimum latitude.
@param minLng The minimum longitude.
@param maxLat The maximum latitude.
@param maxLng The maximum longitude. | [
"Sets",
"the",
"internal",
"rectangle",
"representation",
"."
] | train | https://github.com/msteiger/jxmapviewer2/blob/82639273b0aac983b6026fb90aa925c0cf596410/jxmapviewer2/src/main/java/org/jxmapviewer/viewer/GeoBounds.java#L62-L90 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/TextureFutureHelper.java | TextureFutureHelper.getSolidColorTexture | public GVRBitmapTexture getSolidColorTexture(int color) {
"""
Gets an immutable {@linkplain GVRBitmapTexture texture} with the specified color,
returning a cached instance if possible.
@param color An Android {@link Color}.
@return And immutable instance of {@link GVRBitmapTexture}.
"""
GVRBitmapT... | java | public GVRBitmapTexture getSolidColorTexture(int color) {
GVRBitmapTexture texture;
synchronized (mColorTextureCache) {
texture = mColorTextureCache.get(color);
Log.d(TAG, "getSolidColorTexture(): have cached texture for 0x%08X: %b", color, texture != null);
if (textu... | [
"public",
"GVRBitmapTexture",
"getSolidColorTexture",
"(",
"int",
"color",
")",
"{",
"GVRBitmapTexture",
"texture",
";",
"synchronized",
"(",
"mColorTextureCache",
")",
"{",
"texture",
"=",
"mColorTextureCache",
".",
"get",
"(",
"color",
")",
";",
"Log",
".",
"d... | Gets an immutable {@linkplain GVRBitmapTexture texture} with the specified color,
returning a cached instance if possible.
@param color An Android {@link Color}.
@return And immutable instance of {@link GVRBitmapTexture}. | [
"Gets",
"an",
"immutable",
"{",
"@linkplain",
"GVRBitmapTexture",
"texture",
"}",
"with",
"the",
"specified",
"color",
"returning",
"a",
"cached",
"instance",
"if",
"possible",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/TextureFutureHelper.java#L67-L82 |
fabric8io/fabric8-forge | addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java | MavenHelpers.getConfigurationElement | public static ConfigurationElement getConfigurationElement(Configuration config, String... names) {
"""
Returns the plugin configuration element for the given set of element names
"""
if (config != null && names.length > 0) {
String first = names[0];
ConfigurationElement root = ... | java | public static ConfigurationElement getConfigurationElement(Configuration config, String... names) {
if (config != null && names.length > 0) {
String first = names[0];
ConfigurationElement root = findConfigurationElement(config, first);
if (root != null) {
if (... | [
"public",
"static",
"ConfigurationElement",
"getConfigurationElement",
"(",
"Configuration",
"config",
",",
"String",
"...",
"names",
")",
"{",
"if",
"(",
"config",
"!=",
"null",
"&&",
"names",
".",
"length",
">",
"0",
")",
"{",
"String",
"first",
"=",
"name... | Returns the plugin configuration element for the given set of element names | [
"Returns",
"the",
"plugin",
"configuration",
"element",
"for",
"the",
"given",
"set",
"of",
"element",
"names"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L277-L293 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/ir/transform/GosuClassTransformer.java | GosuClassTransformer.addCovarientProxyBridgeMethods | private boolean addCovarientProxyBridgeMethods( DynamicFunctionSymbol dfs ) {
"""
Add a bridge method for a Java interface method that is not only implemented
by a method in this Gosu class, but is also itself a covariant "override" of
its super interface E.g.,
<pre>
interface JavaBase {
public CharSequence m... | java | private boolean addCovarientProxyBridgeMethods( DynamicFunctionSymbol dfs )
{
IGosuClassInternal gsProxyClass = dfs.getGosuClass();
if( gsProxyClass == null || !gsProxyClass.isProxy() )
{
// Not a proxy class so no java method to override
return false;
}
if( dfs.getReturnType().isPrim... | [
"private",
"boolean",
"addCovarientProxyBridgeMethods",
"(",
"DynamicFunctionSymbol",
"dfs",
")",
"{",
"IGosuClassInternal",
"gsProxyClass",
"=",
"dfs",
".",
"getGosuClass",
"(",
")",
";",
"if",
"(",
"gsProxyClass",
"==",
"null",
"||",
"!",
"gsProxyClass",
".",
"i... | Add a bridge method for a Java interface method that is not only implemented
by a method in this Gosu class, but is also itself a covariant "override" of
its super interface E.g.,
<pre>
interface JavaBase {
public CharSequence makeText();
}
interface JavaSub extends JavaBase {
public String makeText();
}
class GosuSu... | [
"Add",
"a",
"bridge",
"method",
"for",
"a",
"Java",
"interface",
"method",
"that",
"is",
"not",
"only",
"implemented",
"by",
"a",
"method",
"in",
"this",
"Gosu",
"class",
"but",
"is",
"also",
"itself",
"a",
"covariant",
"override",
"of",
"its",
"super",
... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/ir/transform/GosuClassTransformer.java#L1208-L1233 |
btaz/data-util | src/main/java/com/btaz/util/unit/ResourceUtil.java | ResourceUtil.readFromFileIntoString | public static String readFromFileIntoString(File file) throws IOException {
"""
This method reads all data from a file into a String object
@param file file to read text from
@return <code>String</code> containing all file data
@throws IOException IO exception
"""
FileInputStream inputStream = new F... | java | public static String readFromFileIntoString(File file) throws IOException {
FileInputStream inputStream = new FileInputStream(file);
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
StringBuilder text = new StringBuilder();
String line;
wh... | [
"public",
"static",
"String",
"readFromFileIntoString",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"inputStream",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"... | This method reads all data from a file into a String object
@param file file to read text from
@return <code>String</code> containing all file data
@throws IOException IO exception | [
"This",
"method",
"reads",
"all",
"data",
"from",
"a",
"file",
"into",
"a",
"String",
"object"
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/unit/ResourceUtil.java#L43-L55 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPUtility.java | MPPUtility.fileHexDump | public static final void fileHexDump(String fileName, byte[] data) {
"""
Writes a hex dump to a file for a large byte array.
@param fileName output file name
@param data target data
"""
System.out.println("FILE HEX DUMP");
try
{
FileOutputStream os = new FileOutputStream(fileName... | java | public static final void fileHexDump(String fileName, byte[] data)
{
System.out.println("FILE HEX DUMP");
try
{
FileOutputStream os = new FileOutputStream(fileName);
os.write(ByteArrayHelper.hexdump(data, true, 16, "").getBytes());
os.close();
}
catch (IOExce... | [
"public",
"static",
"final",
"void",
"fileHexDump",
"(",
"String",
"fileName",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"FILE HEX DUMP\"",
")",
";",
"try",
"{",
"FileOutputStream",
"os",
"=",
"new",
"FileOutputS... | Writes a hex dump to a file for a large byte array.
@param fileName output file name
@param data target data | [
"Writes",
"a",
"hex",
"dump",
"to",
"a",
"file",
"for",
"a",
"large",
"byte",
"array",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L955-L969 |
googleapis/api-client-staging | generated/java/gapic-google-longrunning-v1/src/main/java/com/google/longrunning/OperationsClient.java | OperationsClient.listOperations | public final ListOperationsPagedResponse listOperations(String name, String filter) {
"""
Lists operations that match the specified filter in the request. If the server doesn't support
this method, it returns `UNIMPLEMENTED`.
<p>NOTE: the `name` binding below allows API services to override the binding to use ... | java | public final ListOperationsPagedResponse listOperations(String name, String filter) {
ListOperationsRequest request =
ListOperationsRequest.newBuilder().setName(name).setFilter(filter).build();
return listOperations(request);
} | [
"public",
"final",
"ListOperationsPagedResponse",
"listOperations",
"(",
"String",
"name",
",",
"String",
"filter",
")",
"{",
"ListOperationsRequest",
"request",
"=",
"ListOperationsRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"set... | Lists operations that match the specified filter in the request. If the server doesn't support
this method, it returns `UNIMPLEMENTED`.
<p>NOTE: the `name` binding below allows API services to override the binding to use different
resource name schemes, such as `users/*/operations`.
<p>Sample code:
<pre><code>
t... | [
"Lists",
"operations",
"that",
"match",
"the",
"specified",
"filter",
"in",
"the",
"request",
".",
"If",
"the",
"server",
"doesn",
"t",
"support",
"this",
"method",
"it",
"returns",
"UNIMPLEMENTED",
"."
] | train | https://github.com/googleapis/api-client-staging/blob/126aee68401977b5dc2b1b4be48decd0e9759db7/generated/java/gapic-google-longrunning-v1/src/main/java/com/google/longrunning/OperationsClient.java#L253-L257 |
GCRC/nunaliit | nunaliit2-couch-command/src/main/java/ca/carleton/gcrc/couch/command/impl/PathComputer.java | PathComputer.computeNunaliitDir | static public File computeNunaliitDir(File installDir) {
"""
Given an installation directory, find the root directory
for the nunaliit2 project. This makes sense only in the
context that the command-line tool is run from a development
environment.
@param installDir Computed install directory where command-line... | java | static public File computeNunaliitDir(File installDir) {
while( null != installDir ){
// The root of the nunalii2 project contains "nunaliit2-couch-command",
// "nunaliit2-couch-sdk" and "nunaliit2-js"
boolean commandExists = (new File(installDir, "nunaliit2-couch-command")).exists();
boolean sdkExists = ... | [
"static",
"public",
"File",
"computeNunaliitDir",
"(",
"File",
"installDir",
")",
"{",
"while",
"(",
"null",
"!=",
"installDir",
")",
"{",
"// The root of the nunalii2 project contains \"nunaliit2-couch-command\",",
"// \"nunaliit2-couch-sdk\" and \"nunaliit2-js\"",
"boolean",
... | Given an installation directory, find the root directory
for the nunaliit2 project. This makes sense only in the
context that the command-line tool is run from a development
environment.
@param installDir Computed install directory where command-line is run
@return Root directory where nunaliit2 project is located, or ... | [
"Given",
"an",
"installation",
"directory",
"find",
"the",
"root",
"directory",
"for",
"the",
"nunaliit2",
"project",
".",
"This",
"makes",
"sense",
"only",
"in",
"the",
"context",
"that",
"the",
"command",
"-",
"line",
"tool",
"is",
"run",
"from",
"a",
"d... | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-couch-command/src/main/java/ca/carleton/gcrc/couch/command/impl/PathComputer.java#L439-L456 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.mapToBean | public static <T> T mapToBean(Map<?, ?> map, Class<T> beanClass, boolean isIgnoreError) {
"""
Map转换为Bean对象
@param <T> Bean类型
@param map {@link Map}
@param beanClass Bean Class
@param isIgnoreError 是否忽略注入错误
@return Bean
"""
return fillBeanWithMap(map, ReflectUtil.newInstance(beanClass), isIgnoreError)... | java | public static <T> T mapToBean(Map<?, ?> map, Class<T> beanClass, boolean isIgnoreError) {
return fillBeanWithMap(map, ReflectUtil.newInstance(beanClass), isIgnoreError);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"mapToBean",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Class",
"<",
"T",
">",
"beanClass",
",",
"boolean",
"isIgnoreError",
")",
"{",
"return",
"fillBeanWithMap",
"(",
"map",
",",
"ReflectUtil",
".",
"n... | Map转换为Bean对象
@param <T> Bean类型
@param map {@link Map}
@param beanClass Bean Class
@param isIgnoreError 是否忽略注入错误
@return Bean | [
"Map转换为Bean对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L327-L329 |
jenkinsci/jenkins | core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java | WindowsServiceLifecycle.rewriteHudsonWar | @Override
public void rewriteHudsonWar(File by) throws IOException {
"""
On Windows, jenkins.war is locked, so we place a new version under a special name,
which is picked up by the service wrapper upon restart.
"""
File dest = getHudsonWar();
// this should be impossible given the canRewr... | java | @Override
public void rewriteHudsonWar(File by) throws IOException {
File dest = getHudsonWar();
// this should be impossible given the canRewriteHudsonWar method,
// but let's be defensive
if(dest==null) throw new IOException("jenkins.war location is not known.");
// backi... | [
"@",
"Override",
"public",
"void",
"rewriteHudsonWar",
"(",
"File",
"by",
")",
"throws",
"IOException",
"{",
"File",
"dest",
"=",
"getHudsonWar",
"(",
")",
";",
"// this should be impossible given the canRewriteHudsonWar method,",
"// but let's be defensive",
"if",
"(",
... | On Windows, jenkins.war is locked, so we place a new version under a special name,
which is picked up by the service wrapper upon restart. | [
"On",
"Windows",
"jenkins",
".",
"war",
"is",
"locked",
"so",
"we",
"place",
"a",
"new",
"version",
"under",
"a",
"special",
"name",
"which",
"is",
"picked",
"up",
"by",
"the",
"service",
"wrapper",
"upon",
"restart",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java#L94-L116 |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/gc/GarbageCollector.java | GarbageCollector.onBeanCreated | public synchronized void onBeanCreated(Object bean, boolean rootBean) {
"""
This method must be called for each new Dolphin bean (see {@link RemotingBean}).
Normally beans are created by {@link BeanManager#create(Class)}
@param bean the bean that was created
@param rootBean if this is true the bean is han... | java | public synchronized void onBeanCreated(Object bean, boolean rootBean) {
if (!configuration.isUseGc()) {
return;
}
Assert.requireNonNull(bean, "bean");
if (allInstances.containsKey(bean)) {
throw new IllegalArgumentException("Bean instance is already managed!");
... | [
"public",
"synchronized",
"void",
"onBeanCreated",
"(",
"Object",
"bean",
",",
"boolean",
"rootBean",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"isUseGc",
"(",
")",
")",
"{",
"return",
";",
"}",
"Assert",
".",
"requireNonNull",
"(",
"bean",
",",
"\... | This method must be called for each new Dolphin bean (see {@link RemotingBean}).
Normally beans are created by {@link BeanManager#create(Class)}
@param bean the bean that was created
@param rootBean if this is true the bean is handled as a root bean. This bean don't need a reference. | [
"This",
"method",
"must",
"be",
"called",
"for",
"each",
"new",
"Dolphin",
"bean",
"(",
"see",
"{",
"@link",
"RemotingBean",
"}",
")",
".",
"Normally",
"beans",
"are",
"created",
"by",
"{",
"@link",
"BeanManager#create",
"(",
"Class",
")",
"}"
] | train | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/gc/GarbageCollector.java#L88-L112 |
cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/RGroupQuery.java | RGroupQuery.checkIfThenConditionsMet | private boolean checkIfThenConditionsMet(List<Integer> rGroupNumbers, List<Integer[]> distributions) {
"""
Checks whether IF..THEN conditions that can be set for the R-groups are met.
It is used to filter away invalid configurations in {@link #findConfigurationsRecursively}.
<P>
Scenario: suppose R1 is substitu... | java | private boolean checkIfThenConditionsMet(List<Integer> rGroupNumbers, List<Integer[]> distributions) {
for (int outer = 0; outer < rGroupNumbers.size(); outer++) {
int rgroupNum = rGroupNumbers.get(outer);
if (allZeroArray(distributions.get(outer))) {
for (int inner = 0; ... | [
"private",
"boolean",
"checkIfThenConditionsMet",
"(",
"List",
"<",
"Integer",
">",
"rGroupNumbers",
",",
"List",
"<",
"Integer",
"[",
"]",
">",
"distributions",
")",
"{",
"for",
"(",
"int",
"outer",
"=",
"0",
";",
"outer",
"<",
"rGroupNumbers",
".",
"size... | Checks whether IF..THEN conditions that can be set for the R-groups are met.
It is used to filter away invalid configurations in {@link #findConfigurationsRecursively}.
<P>
Scenario: suppose R1 is substituted 0 times, whereas R2 is substituted.
Also suppose there is a condition IF R2 THEN R1. Because R1 does not
occur ... | [
"Checks",
"whether",
"IF",
"..",
"THEN",
"conditions",
"that",
"can",
"be",
"set",
"for",
"the",
"R",
"-",
"groups",
"are",
"met",
".",
"It",
"is",
"used",
"to",
"filter",
"away",
"invalid",
"configurations",
"in",
"{"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/RGroupQuery.java#L543-L561 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.checkFileProgress | boolean checkFileProgress(INodeFile v, boolean checkall)
throws IOException {
"""
Check that the indicated file's blocks are present and
replicated. If not, return false. If checkall is true, then check
all blocks, otherwise check only penultimate block.
"""
INode.enforceRegularStorageINode(v,
... | java | boolean checkFileProgress(INodeFile v, boolean checkall)
throws IOException {
INode.enforceRegularStorageINode(v,
"checkFileProgress is not supported for non-regular files");
if (checkall) {
//
// check all blocks of the file.
//
int closeFileReplicationMin =
Math.m... | [
"boolean",
"checkFileProgress",
"(",
"INodeFile",
"v",
",",
"boolean",
"checkall",
")",
"throws",
"IOException",
"{",
"INode",
".",
"enforceRegularStorageINode",
"(",
"v",
",",
"\"checkFileProgress is not supported for non-regular files\"",
")",
";",
"if",
"(",
"checkal... | Check that the indicated file's blocks are present and
replicated. If not, return false. If checkall is true, then check
all blocks, otherwise check only penultimate block. | [
"Check",
"that",
"the",
"indicated",
"file",
"s",
"blocks",
"are",
"present",
"and",
"replicated",
".",
"If",
"not",
"return",
"false",
".",
"If",
"checkall",
"is",
"true",
"then",
"check",
"all",
"blocks",
"otherwise",
"check",
"only",
"penultimate",
"block... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L3340-L3363 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.withObjectOutputStream | public static <T> T withObjectOutputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectOutputStream") Closure<T> closure) throws IOException {
"""
Create a new ObjectOutputStream for this file and then pass it to the
closure. This method ensures the stream is closed after the clo... | java | public static <T> T withObjectOutputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectOutputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectOutputStream(file), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withObjectOutputStream",
"(",
"File",
"file",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.ObjectOutputStream\"",
")",
"Closure",
"<",
"T",
">",
"closure",
... | Create a new ObjectOutputStream for this file and then pass it to the
closure. This method ensures the stream is closed after the closure
returns.
@param file a File
@param closure a closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@see IOGroovyMethods#withStream(java... | [
"Create",
"a",
"new",
"ObjectOutputStream",
"for",
"this",
"file",
"and",
"then",
"pass",
"it",
"to",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L149-L151 |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.settings/src/main/java/org/carewebframework/plugin/settings/MainController.java | MainController.init | private void init() {
"""
Activates the property grid once the provider and group ids are set.
"""
if (provider != null) {
propertyGrid.setTarget(StringUtils.isEmpty(groupId) ? null : new Settings(groupId, provider));
}
} | java | private void init() {
if (provider != null) {
propertyGrid.setTarget(StringUtils.isEmpty(groupId) ? null : new Settings(groupId, provider));
}
} | [
"private",
"void",
"init",
"(",
")",
"{",
"if",
"(",
"provider",
"!=",
"null",
")",
"{",
"propertyGrid",
".",
"setTarget",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"groupId",
")",
"?",
"null",
":",
"new",
"Settings",
"(",
"groupId",
",",
"provider",
")... | Activates the property grid once the provider and group ids are set. | [
"Activates",
"the",
"property",
"grid",
"once",
"the",
"provider",
"and",
"group",
"ids",
"are",
"set",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.settings/src/main/java/org/carewebframework/plugin/settings/MainController.java#L100-L104 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/FileBeanStore.java | FileBeanStore.getOutputStream | public OutputStream getOutputStream(BeanId beanId)
throws CSIException {
"""
LIDB2018-1
new method for just dumping in the byte array to a file,
byte array in gzip format.
@param key the BeanId for this SFSB
@return an OutputStream
"""
final String fileName = getPortableFile... | java | public OutputStream getOutputStream(BeanId beanId)
throws CSIException
{
final String fileName = getPortableFilename(beanId);
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "getOutputStream: k... | [
"public",
"OutputStream",
"getOutputStream",
"(",
"BeanId",
"beanId",
")",
"throws",
"CSIException",
"{",
"final",
"String",
"fileName",
"=",
"getPortableFilename",
"(",
"beanId",
")",
";",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEn... | LIDB2018-1
new method for just dumping in the byte array to a file,
byte array in gzip format.
@param key the BeanId for this SFSB
@return an OutputStream | [
"LIDB2018",
"-",
"1",
"new",
"method",
"for",
"just",
"dumping",
"in",
"the",
"byte",
"array",
"to",
"a",
"file",
"byte",
"array",
"in",
"gzip",
"format",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/FileBeanStore.java#L401-L439 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Byte> getAt(byte[] array, Collection indices) {
"""
Support the subscript operator with a collection for a byte array
@param array a byte array
@param indices a collection of indices for the items to retrieve
@return list of the bytes at the given indices
... | java | @SuppressWarnings("unchecked")
public static List<Byte> getAt(byte[] array, Collection indices) {
return primitiveArrayGet(array, indices);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Byte",
">",
"getAt",
"(",
"byte",
"[",
"]",
"array",
",",
"Collection",
"indices",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"indices",
")",
";",
"}"
] | Support the subscript operator with a collection for a byte array
@param array a byte array
@param indices a collection of indices for the items to retrieve
@return list of the bytes at the given indices
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"a",
"collection",
"for",
"a",
"byte",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13938-L13941 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.elementMult | public static void elementMult( DMatrix2x2 a , DMatrix2x2 b , DMatrix2x2 c ) {
"""
<p>Performs an element by element multiplication operation:<br>
<br>
c<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br>
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix i... | java | public static void elementMult( DMatrix2x2 a , DMatrix2x2 b , DMatrix2x2 c ) {
c.a11 = a.a11*b.a11; c.a12 = a.a12*b.a12;
c.a21 = a.a21*b.a21; c.a22 = a.a22*b.a22;
} | [
"public",
"static",
"void",
"elementMult",
"(",
"DMatrix2x2",
"a",
",",
"DMatrix2x2",
"b",
",",
"DMatrix2x2",
"c",
")",
"{",
"c",
".",
"a11",
"=",
"a",
".",
"a11",
"*",
"b",
".",
"a11",
";",
"c",
".",
"a12",
"=",
"a",
".",
"a12",
"*",
"b",
".",... | <p>Performs an element by element multiplication operation:<br>
<br>
c<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br>
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multiplication operation. Not modified.
@param c Where the results of the operation are... | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"multiplication",
"operation",
":",
"<br",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"*",
"b<sub",
">",
"ij<",
"/",
"sub",
">",
"<br",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L893-L896 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java | PropertiesConfigHelper.getCommonProperty | public String getCommonProperty(String key, String defaultValue) {
"""
Returns the value of the common property, or the default value if no
value is defined instead.
@param key
the key of the property
@param defaultValue
the default value
@return the value of the common property
"""
return props.getP... | java | public String getCommonProperty(String key, String defaultValue) {
return props.getProperty(PropertiesBundleConstant.PROPS_PREFIX + key, defaultValue);
} | [
"public",
"String",
"getCommonProperty",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"return",
"props",
".",
"getProperty",
"(",
"PropertiesBundleConstant",
".",
"PROPS_PREFIX",
"+",
"key",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value of the common property, or the default value if no
value is defined instead.
@param key
the key of the property
@param defaultValue
the default value
@return the value of the common property | [
"Returns",
"the",
"value",
"of",
"the",
"common",
"property",
"or",
"the",
"default",
"value",
"if",
"no",
"value",
"is",
"defined",
"instead",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java#L94-L96 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/sms/SmsClientSupport.java | SmsClientSupport.createGeneralRequest | protected InternalRequest createGeneralRequest(String pathPrefix, AbstractBceRequest bceRequest,
HttpMethodName httpMethod, String... pathVariables) {
"""
create general request: by pathPrefix(not contains v1 URL_PREFIX)
pathPrefix combined with pathVariables wil... | java | protected InternalRequest createGeneralRequest(String pathPrefix, AbstractBceRequest bceRequest,
HttpMethodName httpMethod, String... pathVariables) {
List<String> pathComponents = new ArrayList<String>();
assertStringNotNullOrEmpty(pathPrefix, "String ... | [
"protected",
"InternalRequest",
"createGeneralRequest",
"(",
"String",
"pathPrefix",
",",
"AbstractBceRequest",
"bceRequest",
",",
"HttpMethodName",
"httpMethod",
",",
"String",
"...",
"pathVariables",
")",
"{",
"List",
"<",
"String",
">",
"pathComponents",
"=",
"new"... | create general request: by pathPrefix(not contains v1 URL_PREFIX)
pathPrefix combined with pathVariables will generate new path
For example:/pathPrefix/../pathVariable1/pathVariable2
@param pathPrefix resourcePath
@param bceRequest bceRequest
@param httpMethod method: post、get etc.
@param pathVariables variab... | [
"create",
"general",
"request",
":",
"by",
"pathPrefix",
"(",
"not",
"contains",
"v1",
"URL_PREFIX",
")",
"pathPrefix",
"combined",
"with",
"pathVariables",
"will",
"generate",
"new",
"path",
"For",
"example",
":",
"/",
"pathPrefix",
"/",
"..",
"/",
"pathVaria... | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/sms/SmsClientSupport.java#L62-L89 |
apache/incubator-atlas | common/src/main/java/org/apache/atlas/utils/ParamChecker.java | ParamChecker.notEmptyIfNotNull | public static String notEmptyIfNotNull(String value, String name) {
"""
Check that a string is not empty if its not null.
@param value value.
@param name parameter name for the exception message.
@return the given value.
"""
return notEmptyIfNotNull(value, name, null);
} | java | public static String notEmptyIfNotNull(String value, String name) {
return notEmptyIfNotNull(value, name, null);
} | [
"public",
"static",
"String",
"notEmptyIfNotNull",
"(",
"String",
"value",
",",
"String",
"name",
")",
"{",
"return",
"notEmptyIfNotNull",
"(",
"value",
",",
"name",
",",
"null",
")",
";",
"}"
] | Check that a string is not empty if its not null.
@param value value.
@param name parameter name for the exception message.
@return the given value. | [
"Check",
"that",
"a",
"string",
"is",
"not",
"empty",
"if",
"its",
"not",
"null",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/common/src/main/java/org/apache/atlas/utils/ParamChecker.java#L104-L106 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java | ListManagementTermsImpl.deleteTermAsync | public Observable<String> deleteTermAsync(String listId, String term, String language) {
"""
Deletes a term from the list with list Id equal to the list Id passed.
@param listId List Id of the image list.
@param term Term to be deleted
@param language Language of the terms.
@throws IllegalArgumentException t... | java | public Observable<String> deleteTermAsync(String listId, String term, String language) {
return deleteTermWithServiceResponseAsync(listId, term, language).map(new Func1<ServiceResponse<String>, String>() {
@Override
public String call(ServiceResponse<String> response) {
r... | [
"public",
"Observable",
"<",
"String",
">",
"deleteTermAsync",
"(",
"String",
"listId",
",",
"String",
"term",
",",
"String",
"language",
")",
"{",
"return",
"deleteTermWithServiceResponseAsync",
"(",
"listId",
",",
"term",
",",
"language",
")",
".",
"map",
"(... | Deletes a term from the list with list Id equal to the list Id passed.
@param listId List Id of the image list.
@param term Term to be deleted
@param language Language of the terms.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the String object | [
"Deletes",
"a",
"term",
"from",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"the",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java#L207-L214 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optChar | public static char optChar(@Nullable Bundle bundle, @Nullable String key, char fallback) {
"""
Returns a optional char value. In other words, returns the value mapped by key if it exists and is a char.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value.
... | java | public static char optChar(@Nullable Bundle bundle, @Nullable String key, char fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getChar(key, fallback);
} | [
"public",
"static",
"char",
"optChar",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
",",
"char",
"fallback",
")",
"{",
"if",
"(",
"bundle",
"==",
"null",
")",
"{",
"return",
"fallback",
";",
"}",
"return",
"bundle",
... | Returns a optional char value. In other words, returns the value mapped by key if it exists and is a char.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value.
@param bundle a bundle. If the bundle is null, this method will return null.
@param key a key for the... | [
"Returns",
"a",
"optional",
"char",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"char",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"be",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L284-L289 |
CloudSlang/cs-actions | cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java | VmService.cloneVM | public Map<String, String> cloneVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
"""
Method used to connect to data center and clone a virtual machine identified by the inputs provided.
@param httpInputs Object that has all the inputs necessary to made a connection to data center
@param vmInputs... | java | public Map<String, String> cloneVM(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
try {
ManagedObjectReference vmMor = new MorObjectHandler().getMor(connectionResources,
... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"cloneVM",
"(",
"HttpInputs",
"httpInputs",
",",
"VmInputs",
"vmInputs",
")",
"throws",
"Exception",
"{",
"ConnectionResources",
"connectionResources",
"=",
"new",
"ConnectionResources",
"(",
"httpInputs",
",",
"... | Method used to connect to data center and clone a virtual machine identified by the inputs provided.
@param httpInputs Object that has all the inputs necessary to made a connection to data center
@param vmInputs Object that has all the specific inputs necessary to identify the virtual machine that will be
cloned
@re... | [
"Method",
"used",
"to",
"connect",
"to",
"data",
"center",
"and",
"clone",
"a",
"virtual",
"machine",
"identified",
"by",
"the",
"inputs",
"provided",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-vmware/src/main/java/io/cloudslang/content/vmware/services/VmService.java#L337-L372 |
airlift/slice | src/main/java/io/airlift/slice/Slices.java | Slices.wrappedIntArray | public static Slice wrappedIntArray(int[] array, int offset, int length) {
"""
Creates a slice over the specified array range.
@param offset the array position at which the slice begins
@param length the number of array positions to include in the slice
"""
if (length == 0) {
return EMP... | java | public static Slice wrappedIntArray(int[] array, int offset, int length)
{
if (length == 0) {
return EMPTY_SLICE;
}
return new Slice(array, offset, length);
} | [
"public",
"static",
"Slice",
"wrappedIntArray",
"(",
"int",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"EMPTY_SLICE",
";",
"}",
"return",
"new",
"Slice",
"(",
"array",
... | Creates a slice over the specified array range.
@param offset the array position at which the slice begins
@param length the number of array positions to include in the slice | [
"Creates",
"a",
"slice",
"over",
"the",
"specified",
"array",
"range",
"."
] | train | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/Slices.java#L215-L221 |
wkgcass/Style | src/main/java/net/cassite/style/aggregation/ListFuncSup.java | ListFuncSup.forThose | public <R> R forThose(RFunc1<Boolean, T> predicate, def<R> func, int index) {
"""
define a function to deal with each element in the list with given
start index
@param predicate
a function takes in each element from list and returns
true or false(or null)
@param func
a function returns 'last loop result'
... | java | public <R> R forThose(RFunc1<Boolean, T> predicate, def<R> func, int index) {
ListIterator<T> it = ((List<T>) iterable).listIterator(index);
IteratorInfo<R> info = new IteratorInfo<>();
return While(it::hasNext, (loopInfo) -> {
int previousIndex = ... | [
"public",
"<",
"R",
">",
"R",
"forThose",
"(",
"RFunc1",
"<",
"Boolean",
",",
"T",
">",
"predicate",
",",
"def",
"<",
"R",
">",
"func",
",",
"int",
"index",
")",
"{",
"ListIterator",
"<",
"T",
">",
"it",
"=",
"(",
"(",
"List",
"<",
"T",
">",
... | define a function to deal with each element in the list with given
start index
@param predicate
a function takes in each element from list and returns
true or false(or null)
@param func
a function returns 'last loop result'
@param index
the index where to start iteration
@return return 'last loop value'.<br>
check
<a ... | [
"define",
"a",
"function",
"to",
"deal",
"with",
"each",
"element",
"in",
"the",
"list",
"with",
"given",
"start",
"index"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/aggregation/ListFuncSup.java#L253-L281 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.assignUsersToPrivilege | public Boolean assignUsersToPrivilege(String id, List<Long> userIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Assign one or more users to a privilege.
@param id
Id of the privilege
@param userIds
The ids of the users to be assigned.
@return true if success
@throws OA... | java | public Boolean assignUsersToPrivilege(String id, List<Long> userIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBu... | [
"public",
"Boolean",
"assignUsersToPrivilege",
"(",
"String",
"id",
",",
"List",
"<",
"Long",
">",
"userIds",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")"... | Assign one or more users to a privilege.
@param id
Id of the privilege
@param userIds
The ids of the users to be assigned.
@return true if success
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the On... | [
"Assign",
"one",
"or",
"more",
"users",
"to",
"a",
"privilege",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3792-L3822 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Utilities.java | Utilities.decrComputeSpecs | public static void decrComputeSpecs(ComputeSpecs target, ComputeSpecs decr) {
"""
Decrease the compute specs by decr
@param target the specs to decrease
@param decr the decrement
"""
target.numCpus -= decr.numCpus;
target.memoryMB -= decr.memoryMB;
target.diskGB -= decr.diskGB;
} | java | public static void decrComputeSpecs(ComputeSpecs target, ComputeSpecs decr) {
target.numCpus -= decr.numCpus;
target.memoryMB -= decr.memoryMB;
target.diskGB -= decr.diskGB;
} | [
"public",
"static",
"void",
"decrComputeSpecs",
"(",
"ComputeSpecs",
"target",
",",
"ComputeSpecs",
"decr",
")",
"{",
"target",
".",
"numCpus",
"-=",
"decr",
".",
"numCpus",
";",
"target",
".",
"memoryMB",
"-=",
"decr",
".",
"memoryMB",
";",
"target",
".",
... | Decrease the compute specs by decr
@param target the specs to decrease
@param decr the decrement | [
"Decrease",
"the",
"compute",
"specs",
"by",
"decr"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Utilities.java#L99-L103 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/ClassUtil.java | ClassUtil.newInstance | public static <T> T newInstance(String pClassName, Object ... pArguments) {
"""
Instantiate an instance of the given class with its default constructor. The context class loader is used
to lookup the class
@param pClassName name of class to instantiate
@param pArguments optional constructor arguments. Works o... | java | public static <T> T newInstance(String pClassName, Object ... pArguments) {
Class<T> clazz = classForName(pClassName);
if (clazz == null) {
throw new IllegalArgumentException("Cannot find " + pClassName);
}
return newInstance(clazz, pArguments);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"String",
"pClassName",
",",
"Object",
"...",
"pArguments",
")",
"{",
"Class",
"<",
"T",
">",
"clazz",
"=",
"classForName",
"(",
"pClassName",
")",
";",
"if",
"(",
"clazz",
"==",
"null",
")",
... | Instantiate an instance of the given class with its default constructor. The context class loader is used
to lookup the class
@param pClassName name of class to instantiate
@param pArguments optional constructor arguments. Works only for objects with the same class as declared in
the constructor types (no subclasses)
... | [
"Instantiate",
"an",
"instance",
"of",
"the",
"given",
"class",
"with",
"its",
"default",
"constructor",
".",
"The",
"context",
"class",
"loader",
"is",
"used",
"to",
"lookup",
"the",
"class"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ClassUtil.java#L131-L137 |
bennidi/mbassador | src/main/java/net/engio/mbassy/common/ReflectionUtils.java | ReflectionUtils.getOverridingMethod | public static Method getOverridingMethod( final Method overridingMethod, final Class subclass ) {
"""
Traverses the class hierarchy upwards, starting at the given subclass, looking
for an override of the given methods -> finds the bottom most override of the given
method if any exists
@param overridingMethod
... | java | public static Method getOverridingMethod( final Method overridingMethod, final Class subclass ) {
Class current = subclass;
while ( !current.equals( overridingMethod.getDeclaringClass() ) ) {
try {
return current.getDeclaredMethod( overridingMethod.getName(), overridingMethod... | [
"public",
"static",
"Method",
"getOverridingMethod",
"(",
"final",
"Method",
"overridingMethod",
",",
"final",
"Class",
"subclass",
")",
"{",
"Class",
"current",
"=",
"subclass",
";",
"while",
"(",
"!",
"current",
".",
"equals",
"(",
"overridingMethod",
".",
"... | Traverses the class hierarchy upwards, starting at the given subclass, looking
for an override of the given methods -> finds the bottom most override of the given
method if any exists
@param overridingMethod
@param subclass | [
"Traverses",
"the",
"class",
"hierarchy",
"upwards",
"starting",
"at",
"the",
"given",
"subclass",
"looking",
"for",
"an",
"override",
"of",
"the",
"given",
"methods",
"-",
">",
"finds",
"the",
"bottom",
"most",
"override",
"of",
"the",
"given",
"method",
"i... | train | https://github.com/bennidi/mbassador/blob/60c153fb72868fc31e535852cf0c420022d26c2b/src/main/java/net/engio/mbassy/common/ReflectionUtils.java#L61-L72 |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/MultiScopeRecoveryLog.java | MultiScopeRecoveryLog.associateLog | @Override
public void associateLog(DistributedRecoveryLog otherLog, boolean failAssociatedLog) {
"""
Associates another log with this one. PI45254.
The code is protects against infinite recursion since associated logs are only marked as failed if
the log isn't already mark as failed.
The code does NOT prote... | java | @Override
public void associateLog(DistributedRecoveryLog otherLog, boolean failAssociatedLog)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "associateLog", new Object[] { otherLog, failAssociatedLog, this });
if (otherLog instanceof MultiScopeLog)
{
_associatedLog = (... | [
"@",
"Override",
"public",
"void",
"associateLog",
"(",
"DistributedRecoveryLog",
"otherLog",
",",
"boolean",
"failAssociatedLog",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"associateLog\"",
",",
"... | Associates another log with this one. PI45254.
The code is protects against infinite recursion since associated logs are only marked as failed if
the log isn't already mark as failed.
The code does NOT protect against deadlock due to synchronization for logA->logB and logB->logA
- this is not an issue since failAssocia... | [
"Associates",
"another",
"log",
"with",
"this",
"one",
".",
"PI45254",
".",
"The",
"code",
"is",
"protects",
"against",
"infinite",
"recursion",
"since",
"associated",
"logs",
"are",
"only",
"marked",
"as",
"failed",
"if",
"the",
"log",
"isn",
"t",
"already"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/MultiScopeRecoveryLog.java#L2564-L2577 |
op4j/op4j-jodatime | src/main/java/org/op4j/jodatime/functions/FnPeriod.java | FnPeriod.longFieldCollectionToPeriod | public static final Function<Collection<Long>, Period> longFieldCollectionToPeriod(final PeriodType periodType, final Chronology chronology) {
"""
<p>
The given {@link Long} targets representing the time in milliseconds will be used as the start
and end instants of the {@link Period} returned
</p>
@param per... | java | public static final Function<Collection<Long>, Period> longFieldCollectionToPeriod(final PeriodType periodType, final Chronology chronology) {
return new LongFieldCollectionToPeriod(periodType, chronology);
} | [
"public",
"static",
"final",
"Function",
"<",
"Collection",
"<",
"Long",
">",
",",
"Period",
">",
"longFieldCollectionToPeriod",
"(",
"final",
"PeriodType",
"periodType",
",",
"final",
"Chronology",
"chronology",
")",
"{",
"return",
"new",
"LongFieldCollectionToPeri... | <p>
The given {@link Long} targets representing the time in milliseconds will be used as the start
and end instants of the {@link Period} returned
</p>
@param periodType the {@link PeriodType} to be created. It specifies which duration fields are to be used
@param chronology {@link Chronology} to be used
@return the ... | [
"<p",
">",
"The",
"given",
"{",
"@link",
"Long",
"}",
"targets",
"representing",
"the",
"time",
"in",
"milliseconds",
"will",
"be",
"used",
"as",
"the",
"start",
"and",
"end",
"instants",
"of",
"the",
"{",
"@link",
"Period",
"}",
"returned",
"<",
"/",
... | train | https://github.com/op4j/op4j-jodatime/blob/26e5b8cda8553fb3b5a4a64b3109dbbf5df21194/src/main/java/org/op4j/jodatime/functions/FnPeriod.java#L408-L410 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.email_exchange_organizationName_service_exchangeService_outlook_duration_POST | public OvhOrder email_exchange_organizationName_service_exchangeService_outlook_duration_POST(String organizationName, String exchangeService, String duration, OvhOutlookVersionEnum licence, String primaryEmailAddress) throws IOException {
"""
Create order
REST: POST /order/email/exchange/{organizationName}/ser... | java | public OvhOrder email_exchange_organizationName_service_exchangeService_outlook_duration_POST(String organizationName, String exchangeService, String duration, OvhOutlookVersionEnum licence, String primaryEmailAddress) throws IOException {
String qPath = "/order/email/exchange/{organizationName}/service/{exchangeServ... | [
"public",
"OvhOrder",
"email_exchange_organizationName_service_exchangeService_outlook_duration_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"duration",
",",
"OvhOutlookVersionEnum",
"licence",
",",
"String",
"primaryEmailAddress",
")... | Create order
REST: POST /order/email/exchange/{organizationName}/service/{exchangeService}/outlook/{duration}
@param licence [required] Outlook version
@param primaryEmailAddress [required] Primary email address for account which You want to buy an outlook
@param organizationName [required] The internal name of your e... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3851-L3859 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java | GVRAssetLoader.loadJassimpModel | private GVRSceneObject loadJassimpModel(AssetRequest request, final GVRSceneObject model) throws IOException {
"""
Loads a scene object {@link GVRSceneObject} from a 3D model.
@param request
AssetRequest with the filename, relative to the root of the volume.
@param model
GVRSceneObject that is the root of th... | java | private GVRSceneObject loadJassimpModel(AssetRequest request, final GVRSceneObject model) throws IOException
{
Jassimp.setWrapperProvider(GVRJassimpAdapter.sWrapperProvider);
org.gearvrf.jassimp.AiScene assimpScene = null;
String filePath = request.getBaseName();
GVRJassimpAdapter ja... | [
"private",
"GVRSceneObject",
"loadJassimpModel",
"(",
"AssetRequest",
"request",
",",
"final",
"GVRSceneObject",
"model",
")",
"throws",
"IOException",
"{",
"Jassimp",
".",
"setWrapperProvider",
"(",
"GVRJassimpAdapter",
".",
"sWrapperProvider",
")",
";",
"org",
".",
... | Loads a scene object {@link GVRSceneObject} from a 3D model.
@param request
AssetRequest with the filename, relative to the root of the volume.
@param model
GVRSceneObject that is the root of the loaded asset
@return A {@link GVRSceneObject} that contains the meshes with textures and bones
and animations.
@throws IOEx... | [
"Loads",
"a",
"scene",
"object",
"{",
"@link",
"GVRSceneObject",
"}",
"from",
"a",
"3D",
"model",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java#L1812-L1851 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java | PropertiesConfigHelper.getCustomBundlePropertyAsList | public List<String> getCustomBundlePropertyAsList(String bundleName, String key) {
"""
Returns as a list, the comma separated values of a property
@param bundleName
the bundle name
@param key
the key of the property
@return a list of the comma separated values of a property
"""
List<String> properties... | java | public List<String> getCustomBundlePropertyAsList(String bundleName, String key) {
List<String> propertiesList = new ArrayList<>();
StringTokenizer tk = new StringTokenizer(getCustomBundleProperty(bundleName, key, ""), ",");
while (tk.hasMoreTokens())
propertiesList.add(tk.nextToken().trim());
return propert... | [
"public",
"List",
"<",
"String",
">",
"getCustomBundlePropertyAsList",
"(",
"String",
"bundleName",
",",
"String",
"key",
")",
"{",
"List",
"<",
"String",
">",
"propertiesList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"StringTokenizer",
"tk",
"=",
"new... | Returns as a list, the comma separated values of a property
@param bundleName
the bundle name
@param key
the key of the property
@return a list of the comma separated values of a property | [
"Returns",
"as",
"a",
"list",
"the",
"comma",
"separated",
"values",
"of",
"a",
"property"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java#L181-L187 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/random/RandomInteger.java | RandomInteger.nextInteger | public static int nextInteger(int min, int max) {
"""
Generates a integer in the range ['min', 'max']. If 'max' is omitted, then
the range will be set to [0, 'min'].
@param min minimum value of the integer that will be generated. If 'max' is
omitted, then 'max' is set to 'min' and 'min' is set to 0.
@param m... | java | public static int nextInteger(int min, int max) {
if (max - min <= 0)
return min;
return min + _random.nextInt(max - min);
} | [
"public",
"static",
"int",
"nextInteger",
"(",
"int",
"min",
",",
"int",
"max",
")",
"{",
"if",
"(",
"max",
"-",
"min",
"<=",
"0",
")",
"return",
"min",
";",
"return",
"min",
"+",
"_random",
".",
"nextInt",
"(",
"max",
"-",
"min",
")",
";",
"}"
] | Generates a integer in the range ['min', 'max']. If 'max' is omitted, then
the range will be set to [0, 'min'].
@param min minimum value of the integer that will be generated. If 'max' is
omitted, then 'max' is set to 'min' and 'min' is set to 0.
@param max (optional) maximum value of the integer that will be generate... | [
"Generates",
"a",
"integer",
"in",
"the",
"range",
"[",
"min",
"max",
"]",
".",
"If",
"max",
"is",
"omitted",
"then",
"the",
"range",
"will",
"be",
"set",
"to",
"[",
"0",
"min",
"]",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/random/RandomInteger.java#L41-L46 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final Object... aObjArray) {
"""
Gets the internationalized value for the supplied message key, using an object array as additional information.
@param aMessageKey A message key
@param aObjArray Additional details for the message
@return The internationalized... | java | protected String getI18n(final String aMessageKey, final Object... aObjArray) {
final String[] strings = new String[aObjArray.length];
for (int index = 0; index < aObjArray.length; index++) {
if (aObjArray[index] instanceof File) {
strings[index] = ((File) aObjArray[index]).... | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"Object",
"...",
"aObjArray",
")",
"{",
"final",
"String",
"[",
"]",
"strings",
"=",
"new",
"String",
"[",
"aObjArray",
".",
"length",
"]",
";",
"for",
"(",
"int",
"in... | Gets the internationalized value for the supplied message key, using an object array as additional information.
@param aMessageKey A message key
@param aObjArray Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"an",
"object",
"array",
"as",
"additional",
"information",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L140-L152 |
elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/util/XSplitter.java | XSplitter.sortEntriesForDimension | private void sortEntriesForDimension(int d, int[] entriesByLB, int[] entriesByUB) {
"""
Indirectly sort the entries into the arrays
<code>entriesByLB</code> and <code>entriesByUB</code> by lower and upper
bound of dimension <code>d</code>.
@param d selected dimension
@param entriesByLB entry array to be sort... | java | private void sortEntriesForDimension(int d, int[] entriesByLB, int[] entriesByUB) {
// Lists which hold entries sorted by their lower and
// upper bounds in the current dimension.
etdc.set(d, true);
IntegerArrayQuickSort.sort(entriesByLB, etdc);
etdc.setLb(false);
IntegerArrayQuickSort.sort(entr... | [
"private",
"void",
"sortEntriesForDimension",
"(",
"int",
"d",
",",
"int",
"[",
"]",
"entriesByLB",
",",
"int",
"[",
"]",
"entriesByUB",
")",
"{",
"// Lists which hold entries sorted by their lower and",
"// upper bounds in the current dimension.",
"etdc",
".",
"set",
"... | Indirectly sort the entries into the arrays
<code>entriesByLB</code> and <code>entriesByUB</code> by lower and upper
bound of dimension <code>d</code>.
@param d selected dimension
@param entriesByLB entry array to be sorted by the lower bound of
<code>d</code> (must be initialized to a valid selection of indices
@para... | [
"Indirectly",
"sort",
"the",
"entries",
"into",
"the",
"arrays",
"<code",
">",
"entriesByLB<",
"/",
"code",
">",
"and",
"<code",
">",
"entriesByUB<",
"/",
"code",
">",
"by",
"lower",
"and",
"upper",
"bound",
"of",
"dimension",
"<code",
">",
"d<",
"/",
"c... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/util/XSplitter.java#L323-L330 |
morimekta/providence | providence-core/src/main/java-gen/net/morimekta/providence/util/Any.java | Any.unwrapMessage | public <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>
M unwrapMessage(@javax.annotation.Nonnull net.morimekta.providence.descriptor.PMessageDescriptor<M,F> descriptor, @javax.annotation.Nonnull net.morimekta.providence.serializer.SerializerProvider provider... | java | public <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>
M unwrapMessage(@javax.annotation.Nonnull net.morimekta.providence.descriptor.PMessageDescriptor<M,F> descriptor, @javax.annotation.Nonnull net.morimekta.providence.serializer.SerializerProvider provider... | [
"public",
"<",
"M",
"extends",
"net",
".",
"morimekta",
".",
"providence",
".",
"PMessage",
"<",
"M",
",",
"F",
">",
",",
"F",
"extends",
"net",
".",
"morimekta",
".",
"providence",
".",
"descriptor",
".",
"PField",
">",
"M",
"unwrapMessage",
"(",
"@",... | Unwrap a message from this wrapper message. This will use the provided
serializer provider to find a suitable serializer to use to deserialize
the wrapped message. If no serializer is available, or the message
cannot be deserialized an unchecked IO exception is thrown.
@param descriptor The message type to unpack from... | [
"Unwrap",
"a",
"message",
"from",
"this",
"wrapper",
"message",
".",
"This",
"will",
"use",
"the",
"provided",
"serializer",
"provider",
"to",
"find",
"a",
"suitable",
"serializer",
"to",
"use",
"to",
"deserialize",
"the",
"wrapped",
"message",
".",
"If",
"n... | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java-gen/net/morimekta/providence/util/Any.java#L307-L326 |
EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.getRemoteObject | static public RemoteObject getRemoteObject (Connection connection, int objectID, Class... ifaces) {
"""
Returns a proxy object that implements the specified interfaces. Methods invoked on the proxy object will be invoked
remotely on the object with the specified ID in the ObjectSpace for the specified connection.... | java | static public RemoteObject getRemoteObject (Connection connection, int objectID, Class... ifaces) {
if (connection == null) throw new IllegalArgumentException("connection cannot be null.");
if (ifaces == null) throw new IllegalArgumentException("ifaces cannot be null.");
Class[] temp = new Class[ifaces.length + 1... | [
"static",
"public",
"RemoteObject",
"getRemoteObject",
"(",
"Connection",
"connection",
",",
"int",
"objectID",
",",
"Class",
"...",
"ifaces",
")",
"{",
"if",
"(",
"connection",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"connection cann... | Returns a proxy object that implements the specified interfaces. Methods invoked on the proxy object will be invoked
remotely on the object with the specified ID in the ObjectSpace for the specified connection. If the remote end of the
connection has not {@link #addConnection(Connection) added} the connection to the Ob... | [
"Returns",
"a",
"proxy",
"object",
"that",
"implements",
"the",
"specified",
"interfaces",
".",
"Methods",
"invoked",
"on",
"the",
"proxy",
"object",
"will",
"be",
"invoked",
"remotely",
"on",
"the",
"object",
"with",
"the",
"specified",
"ID",
"in",
"the",
"... | train | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L289-L297 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelStationary.java | BackgroundModelStationary.updateBackground | public void updateBackground( T frame , GrayU8 segment ) {
"""
Updates the background and segments it at the same time. In some implementations this can be
significantly faster than doing it with separate function calls. Segmentation is performed using the model
which it has prior to the update.
"""
update... | java | public void updateBackground( T frame , GrayU8 segment ) {
updateBackground(frame);
segment(frame,segment);
} | [
"public",
"void",
"updateBackground",
"(",
"T",
"frame",
",",
"GrayU8",
"segment",
")",
"{",
"updateBackground",
"(",
"frame",
")",
";",
"segment",
"(",
"frame",
",",
"segment",
")",
";",
"}"
] | Updates the background and segments it at the same time. In some implementations this can be
significantly faster than doing it with separate function calls. Segmentation is performed using the model
which it has prior to the update. | [
"Updates",
"the",
"background",
"and",
"segments",
"it",
"at",
"the",
"same",
"time",
".",
"In",
"some",
"implementations",
"this",
"can",
"be",
"significantly",
"faster",
"than",
"doing",
"it",
"with",
"separate",
"function",
"calls",
".",
"Segmentation",
"is... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/background/BackgroundModelStationary.java#L48-L51 |
line/armeria | logback/src/main/java/com/linecorp/armeria/common/logback/RequestContextExportingAppender.java | RequestContextExportingAppender.addAttribute | public void addAttribute(String alias, AttributeKey<?> attrKey) {
"""
Adds the specified {@link AttributeKey} to the export list.
@param alias the alias of the attribute to export
@param attrKey the key of the attribute to export
"""
ensureNotStarted();
builder.addAttribute(alias, attrKey);... | java | public void addAttribute(String alias, AttributeKey<?> attrKey) {
ensureNotStarted();
builder.addAttribute(alias, attrKey);
} | [
"public",
"void",
"addAttribute",
"(",
"String",
"alias",
",",
"AttributeKey",
"<",
"?",
">",
"attrKey",
")",
"{",
"ensureNotStarted",
"(",
")",
";",
"builder",
".",
"addAttribute",
"(",
"alias",
",",
"attrKey",
")",
";",
"}"
] | Adds the specified {@link AttributeKey} to the export list.
@param alias the alias of the attribute to export
@param attrKey the key of the attribute to export | [
"Adds",
"the",
"specified",
"{",
"@link",
"AttributeKey",
"}",
"to",
"the",
"export",
"list",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/logback/src/main/java/com/linecorp/armeria/common/logback/RequestContextExportingAppender.java#L103-L106 |
Domo42/saga-lib | saga-lib/src/main/java/com/codebullets/sagalib/AbstractSaga.java | AbstractSaga.requestTimeout | protected TimeoutId requestTimeout(final long delay, final TimeUnit unit, @Nullable final String name, @Nullable final Object data) {
"""
Requests a timeout event with a specific name and attached data.
"""
return timeoutManager.requestTimeout(context(), state().getSagaId(), delay, unit, name, data);
... | java | protected TimeoutId requestTimeout(final long delay, final TimeUnit unit, @Nullable final String name, @Nullable final Object data) {
return timeoutManager.requestTimeout(context(), state().getSagaId(), delay, unit, name, data);
} | [
"protected",
"TimeoutId",
"requestTimeout",
"(",
"final",
"long",
"delay",
",",
"final",
"TimeUnit",
"unit",
",",
"@",
"Nullable",
"final",
"String",
"name",
",",
"@",
"Nullable",
"final",
"Object",
"data",
")",
"{",
"return",
"timeoutManager",
".",
"requestTi... | Requests a timeout event with a specific name and attached data. | [
"Requests",
"a",
"timeout",
"event",
"with",
"a",
"specific",
"name",
"and",
"attached",
"data",
"."
] | train | https://github.com/Domo42/saga-lib/blob/c8f232e2a51fcb6a3fe0082cfbf105c1e6bf90ef/saga-lib/src/main/java/com/codebullets/sagalib/AbstractSaga.java#L109-L111 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/session/SessionCookie.java | SessionCookie.getInstance | public static Session getInstance(String name, PageContext pc, Log log) {
"""
load new instance of the class
@param name
@param pc
@return
"""
if (!StringUtil.isEmpty(name)) name = StringUtil.toUpperCase(StringUtil.toVariableName(name));
String cookieName = "CF_" + TYPE + "_" + name;
return new Session... | java | public static Session getInstance(String name, PageContext pc, Log log) {
if (!StringUtil.isEmpty(name)) name = StringUtil.toUpperCase(StringUtil.toVariableName(name));
String cookieName = "CF_" + TYPE + "_" + name;
return new SessionCookie(pc, cookieName, _loadData(pc, cookieName, SCOPE_SESSION, "session", log));
... | [
"public",
"static",
"Session",
"getInstance",
"(",
"String",
"name",
",",
"PageContext",
"pc",
",",
"Log",
"log",
")",
"{",
"if",
"(",
"!",
"StringUtil",
".",
"isEmpty",
"(",
"name",
")",
")",
"name",
"=",
"StringUtil",
".",
"toUpperCase",
"(",
"StringUt... | load new instance of the class
@param name
@param pc
@return | [
"load",
"new",
"instance",
"of",
"the",
"class"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/session/SessionCookie.java#L60-L64 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/ClassHelper.java | ClassHelper.newInstance | public static Object newInstance(Class target, boolean makeAccessible) throws InstantiationException,
IllegalAccessException {
"""
Returns a new instance of the given class, using the default or a no-arg constructor.
This method ca... | java | public static Object newInstance(Class target, boolean makeAccessible) throws InstantiationException,
IllegalAccessException
{
if (makeAccessible)
{
try
{
return newInstan... | [
"public",
"static",
"Object",
"newInstance",
"(",
"Class",
"target",
",",
"boolean",
"makeAccessible",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"if",
"(",
"makeAccessible",
")",
"{",
"try",
"{",
"return",
"newInstance",
"(",
"ta... | Returns a new instance of the given class, using the default or a no-arg constructor.
This method can also use private no-arg constructors if <code>makeAccessible</code>
is set to <code>true</code> (and there are no other security constraints).
@param target The class to instantiate
@param makeAccessible If th... | [
"Returns",
"a",
"new",
"instance",
"of",
"the",
"given",
"class",
"using",
"the",
"default",
"or",
"a",
"no",
"-",
"arg",
"constructor",
".",
"This",
"method",
"can",
"also",
"use",
"private",
"no",
"-",
"arg",
"constructors",
"if",
"<code",
">",
"makeAc... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/ClassHelper.java#L146-L170 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java | TemplateElasticsearchUpdater.isTemplateExist | @Deprecated
public static boolean isTemplateExist(Client client, String template) {
"""
Check if a template exists
@param client Elasticsearch client
@param template template name
@return true if the template exists
@deprecated Will be removed when we don't support TransportClient anymore
"""
return !cl... | java | @Deprecated
public static boolean isTemplateExist(Client client, String template) {
return !client.admin().indices().prepareGetTemplates(template).get().getIndexTemplates().isEmpty();
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"isTemplateExist",
"(",
"Client",
"client",
",",
"String",
"template",
")",
"{",
"return",
"!",
"client",
".",
"admin",
"(",
")",
".",
"indices",
"(",
")",
".",
"prepareGetTemplates",
"(",
"template",
")",
... | Check if a template exists
@param client Elasticsearch client
@param template template name
@return true if the template exists
@deprecated Will be removed when we don't support TransportClient anymore | [
"Check",
"if",
"a",
"template",
"exists"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java#L131-L134 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/ByteBufferUtil.java | ByteBufferUtil.compareSubArrays | public static int compareSubArrays(ByteBuffer bytes1, int offset1, ByteBuffer bytes2, int offset2, int length) {
"""
Compare two ByteBuffer at specified offsets for length.
Compares the non equal bytes as unsigned.
@param bytes1 First byte buffer to compare.
@param offset1 Position to start the comparison at in... | java | public static int compareSubArrays(ByteBuffer bytes1, int offset1, ByteBuffer bytes2, int offset2, int length)
{
if (bytes1 == null)
return bytes2 == null ? 0 : -1;
if (bytes2 == null) return 1;
assert bytes1.limit() >= offset1 + length : "The first byte array isn't long enough ... | [
"public",
"static",
"int",
"compareSubArrays",
"(",
"ByteBuffer",
"bytes1",
",",
"int",
"offset1",
",",
"ByteBuffer",
"bytes2",
",",
"int",
"offset2",
",",
"int",
"length",
")",
"{",
"if",
"(",
"bytes1",
"==",
"null",
")",
"return",
"bytes2",
"==",
"null",... | Compare two ByteBuffer at specified offsets for length.
Compares the non equal bytes as unsigned.
@param bytes1 First byte buffer to compare.
@param offset1 Position to start the comparison at in the first array.
@param bytes2 Second byte buffer to compare.
@param offset2 Position to start the comparison at in the seco... | [
"Compare",
"two",
"ByteBuffer",
"at",
"specified",
"offsets",
"for",
"length",
".",
"Compares",
"the",
"non",
"equal",
"bytes",
"as",
"unsigned",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/ByteBufferUtil.java#L472-L490 |
apache/incubator-heron | heron/api/src/java/org/apache/heron/streamlet/impl/StreamletImpl.java | StreamletImpl.setDefaultNameIfNone | protected void setDefaultNameIfNone(StreamletNamePrefix prefix, Set<String> stageNames) {
"""
Sets a default unique name to the Streamlet by type if it is not set.
Otherwise, just checks its uniqueness.
@param prefix The name prefix of this streamlet
@param stageNames The collections of created streamlet/stage ... | java | protected void setDefaultNameIfNone(StreamletNamePrefix prefix, Set<String> stageNames) {
if (getName() == null) {
setName(defaultNameCalculator(prefix, stageNames));
}
if (stageNames.contains(getName())) {
throw new RuntimeException(String.format(
"The stage name %s is used multiple t... | [
"protected",
"void",
"setDefaultNameIfNone",
"(",
"StreamletNamePrefix",
"prefix",
",",
"Set",
"<",
"String",
">",
"stageNames",
")",
"{",
"if",
"(",
"getName",
"(",
")",
"==",
"null",
")",
"{",
"setName",
"(",
"defaultNameCalculator",
"(",
"prefix",
",",
"s... | Sets a default unique name to the Streamlet by type if it is not set.
Otherwise, just checks its uniqueness.
@param prefix The name prefix of this streamlet
@param stageNames The collections of created streamlet/stage names | [
"Sets",
"a",
"default",
"unique",
"name",
"to",
"the",
"Streamlet",
"by",
"type",
"if",
"it",
"is",
"not",
"set",
".",
"Otherwise",
"just",
"checks",
"its",
"uniqueness",
"."
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/api/src/java/org/apache/heron/streamlet/impl/StreamletImpl.java#L187-L196 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageContentHelper.java | PageContentHelper.addCssHeadlines | public static void addCssHeadlines(final PrintWriter writer, final List cssHeadlines) {
"""
Add a list of css headline entries intended to be added only once to the page.
@param writer the writer to write to.
@param cssHeadlines a list of css entries to be added to the page as a whole.
"""
if (cssHeadlin... | java | public static void addCssHeadlines(final PrintWriter writer, final List cssHeadlines) {
if (cssHeadlines == null || cssHeadlines.isEmpty()) {
return;
}
writer.write("<!-- Start css headlines -->"
+ "\n<style type=\"" + WebUtilities.CONTENT_TYPE_CSS + "\" media=\"screen\">");
for (Iterator iter = cssHea... | [
"public",
"static",
"void",
"addCssHeadlines",
"(",
"final",
"PrintWriter",
"writer",
",",
"final",
"List",
"cssHeadlines",
")",
"{",
"if",
"(",
"cssHeadlines",
"==",
"null",
"||",
"cssHeadlines",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"wr... | Add a list of css headline entries intended to be added only once to the page.
@param writer the writer to write to.
@param cssHeadlines a list of css entries to be added to the page as a whole. | [
"Add",
"a",
"list",
"of",
"css",
"headline",
"entries",
"intended",
"to",
"be",
"added",
"only",
"once",
"to",
"the",
"page",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageContentHelper.java#L91-L106 |
JOML-CI/JOML | src/org/joml/AABBd.java | AABBd.intersectLineSegment | public int intersectLineSegment(double p0X, double p0Y, double p0Z, double p1X, double p1Y, double p1Z, Vector2d result) {
"""
Determine whether the undirected line segment with the end points <code>(p0X, p0Y, p0Z)</code> and <code>(p1X, p1Y, p1Z)</code>
intersects this AABB, and return the values of the paramete... | java | public int intersectLineSegment(double p0X, double p0Y, double p0Z, double p1X, double p1Y, double p1Z, Vector2d result) {
return Intersectiond.intersectLineSegmentAab(p0X, p0Y, p0Z, p1X, p1Y, p1Z, minX, minY, minZ, maxX, maxY, maxZ, result);
} | [
"public",
"int",
"intersectLineSegment",
"(",
"double",
"p0X",
",",
"double",
"p0Y",
",",
"double",
"p0Z",
",",
"double",
"p1X",
",",
"double",
"p1Y",
",",
"double",
"p1Z",
",",
"Vector2d",
"result",
")",
"{",
"return",
"Intersectiond",
".",
"intersectLineSe... | Determine whether the undirected line segment with the end points <code>(p0X, p0Y, p0Z)</code> and <code>(p1X, p1Y, p1Z)</code>
intersects this AABB, and return the values of the parameter <i>t</i> in the ray equation
<i>p(t) = origin + p0 * (p1 - p0)</i> of the near and far point of intersection.
<p>
This method retur... | [
"Determine",
"whether",
"the",
"undirected",
"line",
"segment",
"with",
"the",
"end",
"points",
"<code",
">",
"(",
"p0X",
"p0Y",
"p0Z",
")",
"<",
"/",
"code",
">",
"and",
"<code",
">",
"(",
"p1X",
"p1Y",
"p1Z",
")",
"<",
"/",
"code",
">",
"intersects... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/AABBd.java#L507-L509 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.addJwtCookies | protected boolean addJwtCookies(String cookieByteString, HttpServletRequest req, HttpServletResponse resp) {
"""
Add the cookie or cookies as needed, depending on size of token.
Return true if any cookies were added
"""
String baseName = getJwtCookieName();
if (baseName == null) {
... | java | protected boolean addJwtCookies(String cookieByteString, HttpServletRequest req, HttpServletResponse resp) {
String baseName = getJwtCookieName();
if (baseName == null) {
return false;
}
if ((!req.isSecure()) && getJwtCookieSecure()) {
Tr.warning(tc, "JWT_COOKIE_... | [
"protected",
"boolean",
"addJwtCookies",
"(",
"String",
"cookieByteString",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"{",
"String",
"baseName",
"=",
"getJwtCookieName",
"(",
")",
";",
"if",
"(",
"baseName",
"==",
"null",
")",
"{... | Add the cookie or cookies as needed, depending on size of token.
Return true if any cookies were added | [
"Add",
"the",
"cookie",
"or",
"cookies",
"as",
"needed",
"depending",
"on",
"size",
"of",
"token",
".",
"Return",
"true",
"if",
"any",
"cookies",
"were",
"added"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L129-L151 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/DatePicker.java | DatePicker.zInternalSetLastValidDateAndNotifyListeners | private void zInternalSetLastValidDateAndNotifyListeners(LocalDate newDate) {
"""
zInternalSetLastValidDateAndNotifyListeners, This should be called whenever we need to change
the last valid date variable. This will store the supplied last valid date. If needed, this
will notify all date change listeners that th... | java | private void zInternalSetLastValidDateAndNotifyListeners(LocalDate newDate) {
LocalDate oldDate = lastValidDate;
lastValidDate = newDate;
if (!PickerUtilities.isSameLocalDate(oldDate, newDate)) {
for (DateChangeListener dateChangeListener : dateChangeListeners) {
Date... | [
"private",
"void",
"zInternalSetLastValidDateAndNotifyListeners",
"(",
"LocalDate",
"newDate",
")",
"{",
"LocalDate",
"oldDate",
"=",
"lastValidDate",
";",
"lastValidDate",
"=",
"newDate",
";",
"if",
"(",
"!",
"PickerUtilities",
".",
"isSameLocalDate",
"(",
"oldDate",... | zInternalSetLastValidDateAndNotifyListeners, This should be called whenever we need to change
the last valid date variable. This will store the supplied last valid date. If needed, this
will notify all date change listeners that the date has been changed. This does -not- update
the displayed calendar, and does not perf... | [
"zInternalSetLastValidDateAndNotifyListeners",
"This",
"should",
"be",
"called",
"whenever",
"we",
"need",
"to",
"change",
"the",
"last",
"valid",
"date",
"variable",
".",
"This",
"will",
"store",
"the",
"supplied",
"last",
"valid",
"date",
".",
"If",
"needed",
... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/DatePicker.java#L840-L851 |
code4everything/util | src/main/java/com/zhazhapan/util/RandomUtils.java | RandomUtils.getRandomText | public static String getRandomText(int floor, int ceil, int length) {
"""
获取自定义随机字符串
@param floor ascii下限
@param ceil ascii上限
@param length 长度
@return 字符串
"""
StringBuilder builder = new StringBuilder();
for (int i = 0; i < length; i++) {
builder.append((char) getRandomInteg... | java | public static String getRandomText(int floor, int ceil, int length) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < length; i++) {
builder.append((char) getRandomInteger(floor, ceil));
}
return builder.toString();
} | [
"public",
"static",
"String",
"getRandomText",
"(",
"int",
"floor",
",",
"int",
"ceil",
",",
"int",
"length",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
... | 获取自定义随机字符串
@param floor ascii下限
@param ceil ascii上限
@param length 长度
@return 字符串 | [
"获取自定义随机字符串"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/RandomUtils.java#L133-L139 |
splitwise/TokenAutoComplete | library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java | TokenCompleteTextView.removeSpan | private void removeSpan(Editable text, TokenImageSpan span) {
"""
Remove a span from the current EditText and fire the appropriate callback
@param text Editable to remove the span from
@param span TokenImageSpan to be removed
"""
//We usually add whitespace after a token, so let's try to remove it ... | java | private void removeSpan(Editable text, TokenImageSpan span) {
//We usually add whitespace after a token, so let's try to remove it as well if it's present
int end = text.getSpanEnd(span);
if (end < text.length() && text.charAt(end) == ' ') {
end += 1;
}
internalEditI... | [
"private",
"void",
"removeSpan",
"(",
"Editable",
"text",
",",
"TokenImageSpan",
"span",
")",
"{",
"//We usually add whitespace after a token, so let's try to remove it as well if it's present",
"int",
"end",
"=",
"text",
".",
"getSpanEnd",
"(",
"span",
")",
";",
"if",
... | Remove a span from the current EditText and fire the appropriate callback
@param text Editable to remove the span from
@param span TokenImageSpan to be removed | [
"Remove",
"a",
"span",
"from",
"the",
"current",
"EditText",
"and",
"fire",
"the",
"appropriate",
"callback"
] | train | https://github.com/splitwise/TokenAutoComplete/blob/3f92f90c4c42efc7129d91cbc3d3ec2d1a7bfac5/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java#L1040-L1054 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.addParentChildRelation | protected void addParentChildRelation(Document doc, String parentId) throws RepositoryException {
"""
Adds a parent child relation to the given <code>doc</code>.
@param doc the document.
@param parentId the id of the parent node.
@throws RepositoryException if the parent node does not have a child node
... | java | protected void addParentChildRelation(Document doc, String parentId) throws RepositoryException
{
doc.add(new Field(FieldNames.PARENT, parentId, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
Field.TermVector.NO));
// NodeState parent = (NodeState) stateProvider.getItemState(parentId... | [
"protected",
"void",
"addParentChildRelation",
"(",
"Document",
"doc",
",",
"String",
"parentId",
")",
"throws",
"RepositoryException",
"{",
"doc",
".",
"add",
"(",
"new",
"Field",
"(",
"FieldNames",
".",
"PARENT",
",",
"parentId",
",",
"Field",
".",
"Store",
... | Adds a parent child relation to the given <code>doc</code>.
@param doc the document.
@param parentId the id of the parent node.
@throws RepositoryException if the parent node does not have a child node
entry for the current node. | [
"Adds",
"a",
"parent",
"child",
"relation",
"to",
"the",
"given",
"<code",
">",
"doc<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L1072-L1087 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_oldPhone_GET | public ArrayList<OvhPhone> billingAccount_oldPhone_GET(String billingAccount) throws IOException {
"""
List old phones archived as they were not returned after an RMA
REST: GET /telephony/{billingAccount}/oldPhone
@param billingAccount [required] The name of your billingAccount
"""
String qPath = "/telep... | java | public ArrayList<OvhPhone> billingAccount_oldPhone_GET(String billingAccount) throws IOException {
String qPath = "/telephony/{billingAccount}/oldPhone";
StringBuilder sb = path(qPath, billingAccount);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t16);
} | [
"public",
"ArrayList",
"<",
"OvhPhone",
">",
"billingAccount_oldPhone_GET",
"(",
"String",
"billingAccount",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/oldPhone\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
"... | List old phones archived as they were not returned after an RMA
REST: GET /telephony/{billingAccount}/oldPhone
@param billingAccount [required] The name of your billingAccount | [
"List",
"old",
"phones",
"archived",
"as",
"they",
"were",
"not",
"returned",
"after",
"an",
"RMA"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5006-L5011 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getShardSatatus | @Deprecated
public Future<ShardStatus> getShardSatatus(Shard shard) {
"""
<p>
Retrieves detailed information about the specified shard.
</p><br>
This method does not count towards your rate limit.
@param shard The target region
@return A list of shard infomation.
@deprecated Use #getShardStatus instead.
... | java | @Deprecated
public Future<ShardStatus> getShardSatatus(Shard shard) {
return new DummyFuture<>(handler.getShardStatus(shard));
} | [
"@",
"Deprecated",
"public",
"Future",
"<",
"ShardStatus",
">",
"getShardSatatus",
"(",
"Shard",
"shard",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getShardStatus",
"(",
"shard",
")",
")",
";",
"}"
] | <p>
Retrieves detailed information about the specified shard.
</p><br>
This method does not count towards your rate limit.
@param shard The target region
@return A list of shard infomation.
@deprecated Use #getShardStatus instead.
@see <a href="https://developer.riotgames.com/api/methods#!/835/2938">Official API Docume... | [
"<p",
">",
"Retrieves",
"detailed",
"information",
"about",
"the",
"specified",
"shard",
".",
"<",
"/",
"p",
">",
"<br",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"your",
"rate",
"limit",
"."
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L938-L941 |
opencb/biodata | biodata-models/src/main/java/org/opencb/biodata/models/variant/VariantBuilder.java | VariantBuilder.parseStructuralVariationAttributes | private void parseStructuralVariationAttributes(String key, String value) {
"""
Be aware! this method may change the main alternate
@param key
@param value
"""
if (key == null || value == null) {
return;
}
switch (key) {
case SVINSSEQ_INFO:
// S... | java | private void parseStructuralVariationAttributes(String key, String value) {
if (key == null || value == null) {
return;
}
switch (key) {
case SVINSSEQ_INFO:
// Seen DELETIONS with this field set. Makes no sense
if (VariantType.INSERTION.equ... | [
"private",
"void",
"parseStructuralVariationAttributes",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
"||",
"value",
"==",
"null",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"key",
")",
"{",
"case",
"SVINSSEQ_... | Be aware! this method may change the main alternate
@param key
@param value | [
"Be",
"aware!",
"this",
"method",
"may",
"change",
"the",
"main",
"alternate"
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-models/src/main/java/org/opencb/biodata/models/variant/VariantBuilder.java#L1110-L1153 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/implementation/BingCustomInstancesImpl.java | BingCustomInstancesImpl.imageSearchAsync | public ServiceFuture<Images> imageSearchAsync(long customConfig, String query, ImageSearchOptionalParameter imageSearchOptionalParameter, final ServiceCallback<Images> serviceCallback) {
"""
The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of t... | java | public ServiceFuture<Images> imageSearchAsync(long customConfig, String query, ImageSearchOptionalParameter imageSearchOptionalParameter, final ServiceCallback<Images> serviceCallback) {
return ServiceFuture.fromResponse(imageSearchWithServiceResponseAsync(customConfig, query, imageSearchOptionalParameter), ser... | [
"public",
"ServiceFuture",
"<",
"Images",
">",
"imageSearchAsync",
"(",
"long",
"customConfig",
",",
"String",
"query",
",",
"ImageSearchOptionalParameter",
"imageSearchOptionalParameter",
",",
"final",
"ServiceCallback",
"<",
"Images",
">",
"serviceCallback",
")",
"{",... | The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web.
@param customConfig The identifier for the custom search configuration
@param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](... | [
"The",
"Custom",
"Image",
"Search",
"API",
"lets",
"you",
"send",
"an",
"image",
"search",
"query",
"to",
"Bing",
"and",
"get",
"image",
"results",
"found",
"in",
"your",
"custom",
"view",
"of",
"the",
"web",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/implementation/BingCustomInstancesImpl.java#L96-L98 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/workers/cmd/AbstractSendCommandJob.java | AbstractSendCommandJob.sendCommand2 | @Override
public String sendCommand2(String command) throws IOException {
"""
Runs a command on the gerrit server and returns the output from the command.
@param command the command.
@return the output of the command, or null if something went wrong.
@throws IOException if error.
"""
String str ... | java | @Override
public String sendCommand2(String command) throws IOException {
String str = null;
SshConnection ssh = null;
try {
ssh = SshConnectionFactory.getConnection(config.getGerritHostName(),
config.getGerritSshPort(), config.getGerritProxy(), config.getGerr... | [
"@",
"Override",
"public",
"String",
"sendCommand2",
"(",
"String",
"command",
")",
"throws",
"IOException",
"{",
"String",
"str",
"=",
"null",
";",
"SshConnection",
"ssh",
"=",
"null",
";",
"try",
"{",
"ssh",
"=",
"SshConnectionFactory",
".",
"getConnection",... | Runs a command on the gerrit server and returns the output from the command.
@param command the command.
@return the output of the command, or null if something went wrong.
@throws IOException if error. | [
"Runs",
"a",
"command",
"on",
"the",
"gerrit",
"server",
"and",
"returns",
"the",
"output",
"from",
"the",
"command",
"."
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/workers/cmd/AbstractSendCommandJob.java#L109-L125 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.