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 |
|---|---|---|---|---|---|---|---|---|---|---|
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java | Murmur2Hash.hash64 | public static long hash64(final String text) {
"""
Generates 64 bit hash from a string.
@param text string to hash
@return 64 bit hash of the given string
"""
final byte[] bytes = text.getBytes();
return hash64(bytes, bytes.length);
} | java | public static long hash64(final String text) {
final byte[] bytes = text.getBytes();
return hash64(bytes, bytes.length);
} | [
"public",
"static",
"long",
"hash64",
"(",
"final",
"String",
"text",
")",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"text",
".",
"getBytes",
"(",
")",
";",
"return",
"hash64",
"(",
"bytes",
",",
"bytes",
".",
"length",
")",
";",
"}"
] | Generates 64 bit hash from a string.
@param text string to hash
@return 64 bit hash of the given string | [
"Generates",
"64",
"bit",
"hash",
"from",
"a",
"string",
"."
] | train | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java#L184-L187 |
cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java | Cql2ElmVisitor.optimizeDateRangeInQuery | public Expression optimizeDateRangeInQuery(Expression where, AliasedQuerySource aqs) {
"""
Some systems may wish to optimize performance by restricting retrieves with available date ranges. Specifying
date ranges in a retrieve was removed from the CQL grammar, but it is still possible to extract date ranges from... | java | public Expression optimizeDateRangeInQuery(Expression where, AliasedQuerySource aqs) {
if (aqs.getExpression() instanceof Retrieve) {
Retrieve retrieve = (Retrieve) aqs.getExpression();
String alias = aqs.getAlias();
if ((where instanceof IncludedIn || where instanceof In) &&... | [
"public",
"Expression",
"optimizeDateRangeInQuery",
"(",
"Expression",
"where",
",",
"AliasedQuerySource",
"aqs",
")",
"{",
"if",
"(",
"aqs",
".",
"getExpression",
"(",
")",
"instanceof",
"Retrieve",
")",
"{",
"Retrieve",
"retrieve",
"=",
"(",
"Retrieve",
")",
... | Some systems may wish to optimize performance by restricting retrieves with available date ranges. Specifying
date ranges in a retrieve was removed from the CQL grammar, but it is still possible to extract date ranges from
the where clause and put them in the Retrieve in ELM. The <code>optimizeDateRangeInQuery</code>... | [
"Some",
"systems",
"may",
"wish",
"to",
"optimize",
"performance",
"by",
"restricting",
"retrieves",
"with",
"available",
"date",
"ranges",
".",
"Specifying",
"date",
"ranges",
"in",
"a",
"retrieve",
"was",
"removed",
"from",
"the",
"CQL",
"grammar",
"but",
"i... | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java#L3006-L3019 |
rubenlagus/TelegramBots | telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/InputFile.java | InputFile.setMedia | public InputFile setMedia(InputStream mediaStream, String fileName) {
"""
Use this setter to send new file as stream.
@param mediaStream File to send
@param fileName Name of the file
@return This object
"""
this.newMediaStream = mediaStream;
this.mediaName = fileName;
this.attachName... | java | public InputFile setMedia(InputStream mediaStream, String fileName) {
this.newMediaStream = mediaStream;
this.mediaName = fileName;
this.attachName = "attach://" + fileName;
this.isNew = true;
return this;
} | [
"public",
"InputFile",
"setMedia",
"(",
"InputStream",
"mediaStream",
",",
"String",
"fileName",
")",
"{",
"this",
".",
"newMediaStream",
"=",
"mediaStream",
";",
"this",
".",
"mediaName",
"=",
"fileName",
";",
"this",
".",
"attachName",
"=",
"\"attach://\"",
... | Use this setter to send new file as stream.
@param mediaStream File to send
@param fileName Name of the file
@return This object | [
"Use",
"this",
"setter",
"to",
"send",
"new",
"file",
"as",
"stream",
"."
] | train | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/InputFile.java#L84-L90 |
JavaMoney/jsr354-api | src/main/java/javax/money/format/AmountFormatContextBuilder.java | AmountFormatContextBuilder.setMonetaryAmountFactory | public AmountFormatContextBuilder setMonetaryAmountFactory(
@SuppressWarnings("rawtypes") MonetaryAmountFactory monetaryAmountBuilder) {
"""
Sets the {@link javax.money.MonetaryContext} to be used, when amount's are parsed.
@param monetaryAmountBuilder the monetary amount factory, not {@code null}.
... | java | public AmountFormatContextBuilder setMonetaryAmountFactory(
@SuppressWarnings("rawtypes") MonetaryAmountFactory monetaryAmountBuilder) {
Objects.requireNonNull(monetaryAmountBuilder);
return set(MonetaryAmountFactory.class, monetaryAmountBuilder);
} | [
"public",
"AmountFormatContextBuilder",
"setMonetaryAmountFactory",
"(",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"MonetaryAmountFactory",
"monetaryAmountBuilder",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"monetaryAmountBuilder",
")",
";",
"return",
"set",... | Sets the {@link javax.money.MonetaryContext} to be used, when amount's are parsed.
@param monetaryAmountBuilder the monetary amount factory, not {@code null}.
@return this builder for chaining. | [
"Sets",
"the",
"{",
"@link",
"javax",
".",
"money",
".",
"MonetaryContext",
"}",
"to",
"be",
"used",
"when",
"amount",
"s",
"are",
"parsed",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/format/AmountFormatContextBuilder.java#L107-L111 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java | ShardCache.verifyShard | public synchronized void verifyShard(TableDefinition tableDef, int shardNumber) {
"""
Verify that the shard with the given number has been registered for the given table.
If it hasn't, the shard's starting date is computed, the shard is registered in the
_shards row, and the start date is cached.
@param table... | java | public synchronized void verifyShard(TableDefinition tableDef, int shardNumber) {
assert tableDef != null;
assert tableDef.isSharded();
assert shardNumber > 0;
Map<String, Map<Integer, Date>> tableMap = m_appShardMap.get(tableDef.getAppDef().getAppName());
if (tabl... | [
"public",
"synchronized",
"void",
"verifyShard",
"(",
"TableDefinition",
"tableDef",
",",
"int",
"shardNumber",
")",
"{",
"assert",
"tableDef",
"!=",
"null",
";",
"assert",
"tableDef",
".",
"isSharded",
"(",
")",
";",
"assert",
"shardNumber",
">",
"0",
";",
... | Verify that the shard with the given number has been registered for the given table.
If it hasn't, the shard's starting date is computed, the shard is registered in the
_shards row, and the start date is cached.
@param tableDef TableDefinition of a sharded table.
@param shardNumber Shard number (must be > 0). | [
"Verify",
"that",
"the",
"shard",
"with",
"the",
"given",
"number",
"has",
"been",
"registered",
"for",
"the",
"given",
"table",
".",
"If",
"it",
"hasn",
"t",
"the",
"shard",
"s",
"starting",
"date",
"is",
"computed",
"the",
"shard",
"is",
"registered",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java#L119-L137 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/net/URLUtil.java | URLUtil.createUnCertifiedConnection | public static URLConnection createUnCertifiedConnection(URL url, Proxy proxy) throws IOException {
"""
Creates connection to the specified url. If the protocol is <code>https</code> the connection
created doesn't validate any certificates.
@param url url to which connection has to be created
@param proxy pr... | java | public static URLConnection createUnCertifiedConnection(URL url, Proxy proxy) throws IOException{
if(sc==null){
try{
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, SSLUtil.DUMMY_TRUST_MANAGERS, new SecureRandom());
URLUtil.sc = sc;
... | [
"public",
"static",
"URLConnection",
"createUnCertifiedConnection",
"(",
"URL",
"url",
",",
"Proxy",
"proxy",
")",
"throws",
"IOException",
"{",
"if",
"(",
"sc",
"==",
"null",
")",
"{",
"try",
"{",
"SSLContext",
"sc",
"=",
"SSLContext",
".",
"getInstance",
"... | Creates connection to the specified url. If the protocol is <code>https</code> the connection
created doesn't validate any certificates.
@param url url to which connection has to be created
@param proxy proxy to be used. can be null
@return <code>URLConnection</code>. the connection is not yet connected
@throws IOE... | [
"Creates",
"connection",
"to",
"the",
"specified",
"url",
".",
"If",
"the",
"protocol",
"is",
"<code",
">",
"https<",
"/",
"code",
">",
"the",
"connection",
"created",
"doesn",
"t",
"validate",
"any",
"certificates",
"."
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/net/URLUtil.java#L156-L178 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.getInstanceViewAsync | public Observable<VirtualMachineScaleSetInstanceViewInner> getInstanceViewAsync(String resourceGroupName, String vmScaleSetName) {
"""
Gets the status of a VM scale set instance.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumen... | java | public Observable<VirtualMachineScaleSetInstanceViewInner> getInstanceViewAsync(String resourceGroupName, String vmScaleSetName) {
return getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<VirtualMachineScaleSetInstanceViewInner>, VirtualMachineScaleSetInsta... | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetInstanceViewInner",
">",
"getInstanceViewAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"getInstanceViewWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetNam... | Gets the status of a VM scale set instance.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualMachineScaleSetInstanceViewInner object | [
"Gets",
"the",
"status",
"of",
"a",
"VM",
"scale",
"set",
"instance",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1320-L1327 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java | IOUtils.readFully | public static void readFully(Reader input, char[] buffer) throws IOException {
"""
Read the requested number of characters or fail if there are not enough left.
<p/>
This allows for the possibility that {@link Reader#read(char[], int, int)} may
not read as many characters as requested (most likely because of re... | java | public static void readFully(Reader input, char[] buffer) throws IOException {
readFully(input, buffer, 0, buffer.length);
} | [
"public",
"static",
"void",
"readFully",
"(",
"Reader",
"input",
",",
"char",
"[",
"]",
"buffer",
")",
"throws",
"IOException",
"{",
"readFully",
"(",
"input",
",",
"buffer",
",",
"0",
",",
"buffer",
".",
"length",
")",
";",
"}"
] | Read the requested number of characters or fail if there are not enough left.
<p/>
This allows for the possibility that {@link Reader#read(char[], int, int)} may
not read as many characters as requested (most likely because of reaching EOF).
@param input where to read input from
@param buffer destination
@throws IOEx... | [
"Read",
"the",
"requested",
"number",
"of",
"characters",
"or",
"fail",
"if",
"there",
"are",
"not",
"enough",
"left",
".",
"<p",
"/",
">",
"This",
"allows",
"for",
"the",
"possibility",
"that",
"{",
"@link",
"Reader#read",
"(",
"char",
"[]",
"int",
"int... | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L1011-L1013 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.generatePostconditionChecks | private void generatePostconditionChecks(WyilFile.Stmt.Return stmt, Expr[] exprs, Context context) {
"""
Generate the post-condition checks necessary at a return statement in a
function or method.
@param stmt
@param exprs
@param context
"""
WyilFile.Decl.FunctionOrMethod declaration = (WyilFile.Decl.Fu... | java | private void generatePostconditionChecks(WyilFile.Stmt.Return stmt, Expr[] exprs, Context context) {
WyilFile.Decl.FunctionOrMethod declaration = (WyilFile.Decl.FunctionOrMethod) context.getEnvironment()
.getParent().enclosingDeclaration;
WyilFile.Tuple<WyilFile.Expr> postcondition = declaration.getEnsures();
... | [
"private",
"void",
"generatePostconditionChecks",
"(",
"WyilFile",
".",
"Stmt",
".",
"Return",
"stmt",
",",
"Expr",
"[",
"]",
"exprs",
",",
"Context",
"context",
")",
"{",
"WyilFile",
".",
"Decl",
".",
"FunctionOrMethod",
"declaration",
"=",
"(",
"WyilFile",
... | Generate the post-condition checks necessary at a return statement in a
function or method.
@param stmt
@param exprs
@param context | [
"Generate",
"the",
"post",
"-",
"condition",
"checks",
"necessary",
"at",
"a",
"return",
"statement",
"in",
"a",
"function",
"or",
"method",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L943-L977 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbMemberTagsHandler.java | OjbMemberTagsHandler.checkTagAndParam | private boolean checkTagAndParam(XDoc doc, String tagName, String paramName, String paramValue) {
"""
Determines whether the given documentation part contains the specified tag with the given parameter having the
given value.
@param doc The documentation part
@param tagName The tag to be searched ... | java | private boolean checkTagAndParam(XDoc doc, String tagName, String paramName, String paramValue)
{
if (tagName == null) {
return true;
}
if (!doc.hasTag(tagName)) {
return false;
}
if (paramName == null) {
return true;
}
... | [
"private",
"boolean",
"checkTagAndParam",
"(",
"XDoc",
"doc",
",",
"String",
"tagName",
",",
"String",
"paramName",
",",
"String",
"paramValue",
")",
"{",
"if",
"(",
"tagName",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"doc",
... | Determines whether the given documentation part contains the specified tag with the given parameter having the
given value.
@param doc The documentation part
@param tagName The tag to be searched for
@param paramName The parameter that the tag is required to have
@param paramValue The value of the param... | [
"Determines",
"whether",
"the",
"given",
"documentation",
"part",
"contains",
"the",
"specified",
"tag",
"with",
"the",
"given",
"parameter",
"having",
"the",
"given",
"value",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbMemberTagsHandler.java#L551-L566 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java | JobAgentsInner.beginUpdate | public JobAgentInner beginUpdate(String resourceGroupName, String serverName, String jobAgentName, Map<String, String> tags) {
"""
Updates a job agent.
@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.... | java | public JobAgentInner beginUpdate(String resourceGroupName, String serverName, String jobAgentName, Map<String, String> tags) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, tags).toBlocking().single().body();
} | [
"public",
"JobAgentInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resource... | Updates a job agent.
@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 serverName The name of the server.
@param jobAgentName The name of the job agent to be updated.
@param tags Resource tags.
@throws... | [
"Updates",
"a",
"job",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java#L939-L941 |
apptik/jus | benchmark/src/perf/java/com/android/volley/toolbox/HurlStack.java | HurlStack.openConnection | private HttpURLConnection openConnection(URL url, Request<?> request) throws IOException {
"""
Opens an {@link HttpURLConnection} with parameters.
@param url
@return an open connection
@throws IOException
"""
HttpURLConnection connection = createConnection(url);
int timeoutMs = request.getT... | java | private HttpURLConnection openConnection(URL url, Request<?> request) throws IOException {
HttpURLConnection connection = createConnection(url);
int timeoutMs = request.getTimeoutMs();
connection.setConnectTimeout(timeoutMs);
connection.setReadTimeout(timeoutMs);
connection.setU... | [
"private",
"HttpURLConnection",
"openConnection",
"(",
"URL",
"url",
",",
"Request",
"<",
"?",
">",
"request",
")",
"throws",
"IOException",
"{",
"HttpURLConnection",
"connection",
"=",
"createConnection",
"(",
"url",
")",
";",
"int",
"timeoutMs",
"=",
"request"... | Opens an {@link HttpURLConnection} with parameters.
@param url
@return an open connection
@throws IOException | [
"Opens",
"an",
"{"
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/toolbox/HurlStack.java#L185-L200 |
apache/incubator-gobblin | gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java | GobblinEncryptionProvider.buildStreamEncryptor | public StreamCodec buildStreamEncryptor(Map<String, Object> parameters) {
"""
Return a StreamEncryptor for the given parameters. The algorithm type to use will be extracted
from the parameters object.
@param parameters Configured parameters for algorithm.
@return A StreamCodec for the requested algorithm
@thro... | java | public StreamCodec buildStreamEncryptor(Map<String, Object> parameters) {
String encryptionType = EncryptionConfigParser.getEncryptionType(parameters);
if (encryptionType == null) {
throw new IllegalArgumentException("Encryption type not present in parameters!");
}
return buildStreamCryptoProvide... | [
"public",
"StreamCodec",
"buildStreamEncryptor",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"String",
"encryptionType",
"=",
"EncryptionConfigParser",
".",
"getEncryptionType",
"(",
"parameters",
")",
";",
"if",
"(",
"encryptionType",
"... | Return a StreamEncryptor for the given parameters. The algorithm type to use will be extracted
from the parameters object.
@param parameters Configured parameters for algorithm.
@return A StreamCodec for the requested algorithm
@throws IllegalArgumentException If the given algorithm/parameter pair cannot be built | [
"Return",
"a",
"StreamEncryptor",
"for",
"the",
"given",
"parameters",
".",
"The",
"algorithm",
"type",
"to",
"use",
"will",
"be",
"extracted",
"from",
"the",
"parameters",
"object",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java#L60-L67 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/util/RidUtils.java | RidUtils.trackIdChange | public static void trackIdChange(final Proxy proxy, final Object pojo) {
"""
Shortcut for {@link #trackIdChange(ODocument, Object)}.
Used when detaching pojo into pure object to fix temporal id in resulted pojo after commit.
@param proxy object proxy
@param pojo detached pure pojo
"""
final ODocu... | java | public static void trackIdChange(final Proxy proxy, final Object pojo) {
final ODocument doc = OObjectEntitySerializer.getDocument(proxy);
if (doc != null) {
trackIdChange(doc, pojo);
}
} | [
"public",
"static",
"void",
"trackIdChange",
"(",
"final",
"Proxy",
"proxy",
",",
"final",
"Object",
"pojo",
")",
"{",
"final",
"ODocument",
"doc",
"=",
"OObjectEntitySerializer",
".",
"getDocument",
"(",
"proxy",
")",
";",
"if",
"(",
"doc",
"!=",
"null",
... | Shortcut for {@link #trackIdChange(ODocument, Object)}.
Used when detaching pojo into pure object to fix temporal id in resulted pojo after commit.
@param proxy object proxy
@param pojo detached pure pojo | [
"Shortcut",
"for",
"{",
"@link",
"#trackIdChange",
"(",
"ODocument",
"Object",
")",
"}",
".",
"Used",
"when",
"detaching",
"pojo",
"into",
"pure",
"object",
"to",
"fix",
"temporal",
"id",
"in",
"resulted",
"pojo",
"after",
"commit",
"."
] | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/util/RidUtils.java#L73-L78 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.getPresignedObjectUrl | public String getPresignedObjectUrl(Method method, String bucketName, String objectName, Integer expires,
Map<String, String> reqParams)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoRespon... | java | public String getPresignedObjectUrl(Method method, String bucketName, String objectName, Integer expires,
Map<String, String> reqParams)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoRespon... | [
"public",
"String",
"getPresignedObjectUrl",
"(",
"Method",
"method",
",",
"String",
"bucketName",
",",
"String",
"objectName",
",",
"Integer",
"expires",
",",
"Map",
"<",
"String",
",",
"String",
">",
"reqParams",
")",
"throws",
"InvalidBucketNameException",
",",... | Returns a presigned URL string with given HTTP method, expiry time and custom request params for a specific object
in the bucket.
</p><b>Example:</b><br>
<pre>{@code String url = minioClient.getPresignedObjectUrl(Method.DELETE, "my-bucketname", "my-objectname",
60 * 60 * 24, reqParams);
System.out.println(url); }</pre... | [
"Returns",
"a",
"presigned",
"URL",
"string",
"with",
"given",
"HTTP",
"method",
"expiry",
"time",
"and",
"custom",
"request",
"params",
"for",
"a",
"specific",
"object",
"in",
"the",
"bucket",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L2343-L2370 |
reactor/reactor-netty | src/main/java/reactor/netty/channel/BootstrapHandlers.java | BootstrapHandlers.updateLogSupport | public static Bootstrap updateLogSupport(Bootstrap b, LoggingHandler handler) {
"""
Configure log support for a {@link Bootstrap}
@param b the bootstrap to setup
@param handler the logging handler to setup
@return a mutated {@link Bootstrap}
"""
updateConfiguration(b, NettyPipeline.LoggingHandler, log... | java | public static Bootstrap updateLogSupport(Bootstrap b, LoggingHandler handler) {
updateConfiguration(b, NettyPipeline.LoggingHandler, logConfiguration(handler, SSL_CLIENT_DEBUG));
return b;
} | [
"public",
"static",
"Bootstrap",
"updateLogSupport",
"(",
"Bootstrap",
"b",
",",
"LoggingHandler",
"handler",
")",
"{",
"updateConfiguration",
"(",
"b",
",",
"NettyPipeline",
".",
"LoggingHandler",
",",
"logConfiguration",
"(",
"handler",
",",
"SSL_CLIENT_DEBUG",
")... | Configure log support for a {@link Bootstrap}
@param b the bootstrap to setup
@param handler the logging handler to setup
@return a mutated {@link Bootstrap} | [
"Configure",
"log",
"support",
"for",
"a",
"{",
"@link",
"Bootstrap",
"}"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/channel/BootstrapHandlers.java#L362-L365 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/data/AbstractDirtyMarker.java | AbstractDirtyMarker.setDirty | public static void setDirty(DirtyMarker aDirtyMarker, Object aObject1, Object aObject2) {
"""
if(aObject1 == null || !aObject1.equals(aObject2))
aDirtyMarker.setDirty(true)
@param aDirtyMarker
@param aObject1
@param aObject2
"""
if(aDirtyMarker == null)
return;
if(aObj... | java | public static void setDirty(DirtyMarker aDirtyMarker, Object aObject1, Object aObject2)
{
if(aDirtyMarker == null)
return;
if(aObject1 == null || !aObject1.equals(aObject2))
aDirtyMarker.setDirty(true);
} | [
"public",
"static",
"void",
"setDirty",
"(",
"DirtyMarker",
"aDirtyMarker",
",",
"Object",
"aObject1",
",",
"Object",
"aObject2",
")",
"{",
"if",
"(",
"aDirtyMarker",
"==",
"null",
")",
"return",
";",
"if",
"(",
"aObject1",
"==",
"null",
"||",
"!",
"aObjec... | if(aObject1 == null || !aObject1.equals(aObject2))
aDirtyMarker.setDirty(true)
@param aDirtyMarker
@param aObject1
@param aObject2 | [
"if",
"(",
"aObject1",
"==",
"null",
"||",
"!aObject1",
".",
"equals",
"(",
"aObject2",
"))",
"aDirtyMarker",
".",
"setDirty",
"(",
"true",
")"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/data/AbstractDirtyMarker.java#L53-L61 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/basic/impl/StageServiceImpl.java | StageServiceImpl.getStage | private Stage getStage(final StageWaveBean swb, final Scene scene) {
"""
Gets the stage.
@param swb the waveBean holding default values
@param scene the scene
@return the stage
"""
Stage stage = swb.stage();
if (stage == null) {
stage = new Stage();
}
stage.s... | java | private Stage getStage(final StageWaveBean swb, final Scene scene) {
Stage stage = swb.stage();
if (stage == null) {
stage = new Stage();
}
stage.setScene(scene);
return stage;
} | [
"private",
"Stage",
"getStage",
"(",
"final",
"StageWaveBean",
"swb",
",",
"final",
"Scene",
"scene",
")",
"{",
"Stage",
"stage",
"=",
"swb",
".",
"stage",
"(",
")",
";",
"if",
"(",
"stage",
"==",
"null",
")",
"{",
"stage",
"=",
"new",
"Stage",
"(",
... | Gets the stage.
@param swb the waveBean holding default values
@param scene the scene
@return the stage | [
"Gets",
"the",
"stage",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/basic/impl/StageServiceImpl.java#L132-L141 |
allengeorge/libraft | libraft-agent/src/main/java/io/libraft/agent/snapshots/OnDiskSnapshotsStore.java | OnDiskSnapshotsStore.storeSnapshot | @SuppressWarnings("ConstantConditions")
@Override
public void storeSnapshot(ExtendedSnapshotWriter snapshotWriter) throws StorageException {
"""
{@inheritDoc}
@throws IllegalStateException if this method is called before {@link OnDiskSnapshotsStore#initialize()}
"""
checkInitialized();
... | java | @SuppressWarnings("ConstantConditions")
@Override
public void storeSnapshot(ExtendedSnapshotWriter snapshotWriter) throws StorageException {
checkInitialized();
checkArgument(snapshotWriter instanceof SnapshotFileWriter, "unknown snapshot request type:%s", snapshotWriter.getClass().getSimpleNam... | [
"@",
"SuppressWarnings",
"(",
"\"ConstantConditions\"",
")",
"@",
"Override",
"public",
"void",
"storeSnapshot",
"(",
"ExtendedSnapshotWriter",
"snapshotWriter",
")",
"throws",
"StorageException",
"{",
"checkInitialized",
"(",
")",
";",
"checkArgument",
"(",
"snapshotWr... | {@inheritDoc}
@throws IllegalStateException if this method is called before {@link OnDiskSnapshotsStore#initialize()} | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-agent/src/main/java/io/libraft/agent/snapshots/OnDiskSnapshotsStore.java#L197-L246 |
jblas-project/jblas | src/main/java/org/jblas/ComplexFloat.java | ComplexFloat.subi | public ComplexFloat subi(ComplexFloat c, ComplexFloat result) {
"""
Subtract two complex numbers, in-place
@param c complex number to subtract
@param result resulting complex number
@return same as result
"""
if (this == result) {
r -= c.r;
i -= c.i;
} else {
result.r = r - ... | java | public ComplexFloat subi(ComplexFloat c, ComplexFloat result) {
if (this == result) {
r -= c.r;
i -= c.i;
} else {
result.r = r - c.r;
result.i = i - c.i;
}
return this;
} | [
"public",
"ComplexFloat",
"subi",
"(",
"ComplexFloat",
"c",
",",
"ComplexFloat",
"result",
")",
"{",
"if",
"(",
"this",
"==",
"result",
")",
"{",
"r",
"-=",
"c",
".",
"r",
";",
"i",
"-=",
"c",
".",
"i",
";",
"}",
"else",
"{",
"result",
".",
"r",
... | Subtract two complex numbers, in-place
@param c complex number to subtract
@param result resulting complex number
@return same as result | [
"Subtract",
"two",
"complex",
"numbers",
"in",
"-",
"place"
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/ComplexFloat.java#L176-L185 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/Statistics.java | Statistics.registerSince | public void registerSince( @Nonnull final StatsType statsType, final long startInMillis ) {
"""
A utility method that calculates the difference of the time
between the given <code>startInMillis</code> and {@link System#currentTimeMillis()}
and registers the difference via {@link #register(long)} for the probe of... | java | public void registerSince( @Nonnull final StatsType statsType, final long startInMillis ) {
register( statsType, System.currentTimeMillis() - startInMillis );
} | [
"public",
"void",
"registerSince",
"(",
"@",
"Nonnull",
"final",
"StatsType",
"statsType",
",",
"final",
"long",
"startInMillis",
")",
"{",
"register",
"(",
"statsType",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"startInMillis",
")",
";",
"}"
] | A utility method that calculates the difference of the time
between the given <code>startInMillis</code> and {@link System#currentTimeMillis()}
and registers the difference via {@link #register(long)} for the probe of the given {@link StatsType}.
@param statsType the specific execution type that is measured.
@param sta... | [
"A",
"utility",
"method",
"that",
"calculates",
"the",
"difference",
"of",
"the",
"time",
"between",
"the",
"given",
"<code",
">",
"startInMillis<",
"/",
"code",
">",
"and",
"{"
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/Statistics.java#L77-L79 |
sporniket/core | sporniket-core-io/src/main/java/com/sporniket/libre/io/TextLoader.java | TextLoader.append | public StringBuffer append(Reader source, StringBuffer buffer) throws IOException {
"""
Load a text from the specified reader and put it in the provided StringBuffer.
@param source source reader.
@param buffer buffer to load text into.
@return the buffer
@throws IOException if there is a problem to deal with... | java | public StringBuffer append(Reader source, StringBuffer buffer) throws IOException
{
BufferedReader _bufferedReader = new BufferedReader(source);
char[] _buffer = new char[getBufferSize()]; // load by chunk of 4 ko
try
{
for (int _countReadChars = 0; _countReadChars >= 0;)
{
buffer.append(_buffer, 0, ... | [
"public",
"StringBuffer",
"append",
"(",
"Reader",
"source",
",",
"StringBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"_bufferedReader",
"=",
"new",
"BufferedReader",
"(",
"source",
")",
";",
"char",
"[",
"]",
"_buffer",
"=",
"new",
... | Load a text from the specified reader and put it in the provided StringBuffer.
@param source source reader.
@param buffer buffer to load text into.
@return the buffer
@throws IOException if there is a problem to deal with. | [
"Load",
"a",
"text",
"from",
"the",
"specified",
"reader",
"and",
"put",
"it",
"in",
"the",
"provided",
"StringBuffer",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-io/src/main/java/com/sporniket/libre/io/TextLoader.java#L188-L205 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableNavigatorContext.java | PortableNavigatorContext.populateAnyNavigationFrames | void populateAnyNavigationFrames(int pathTokenIndex, int len) {
"""
Populates the context with multi-positions that have to be processed later on in the navigation process.
The contract is that the cell[0] path is read in the non-multi-position navigation.
Cells[1, len-1] are stored in the multi-positions and wi... | java | void populateAnyNavigationFrames(int pathTokenIndex, int len) {
// populate "recursive" multi-positions
if (multiPositions == null) {
// lazy-init only if necessary
multiPositions = new ArrayDeque<NavigationFrame>();
}
for (int cellIndex = len - 1; cellIndex > 0; ... | [
"void",
"populateAnyNavigationFrames",
"(",
"int",
"pathTokenIndex",
",",
"int",
"len",
")",
"{",
"// populate \"recursive\" multi-positions",
"if",
"(",
"multiPositions",
"==",
"null",
")",
"{",
"// lazy-init only if necessary",
"multiPositions",
"=",
"new",
"ArrayDeque"... | Populates the context with multi-positions that have to be processed later on in the navigation process.
The contract is that the cell[0] path is read in the non-multi-position navigation.
Cells[1, len-1] are stored in the multi-positions and will be followed up on later on. | [
"Populates",
"the",
"context",
"with",
"multi",
"-",
"positions",
"that",
"have",
"to",
"be",
"processed",
"later",
"on",
"in",
"the",
"navigation",
"process",
".",
"The",
"contract",
"is",
"that",
"the",
"cell",
"[",
"0",
"]",
"path",
"is",
"read",
"in"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableNavigatorContext.java#L179-L188 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildFieldInfo | public void buildFieldInfo(XMLNode node, Content fieldsContentTree) {
"""
Build the field information.
@param node the XML element that specifies which components to document
@param fieldsContentTree content tree to which the documentation will be added
"""
if(configuration.nocomment){
... | java | public void buildFieldInfo(XMLNode node, Content fieldsContentTree) {
if(configuration.nocomment){
return;
}
FieldDoc field = (FieldDoc)currentMember;
ClassDoc cd = field.containingClass();
// Process default Serializable field.
if ((field.tags("serial").lengt... | [
"public",
"void",
"buildFieldInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"fieldsContentTree",
")",
"{",
"if",
"(",
"configuration",
".",
"nocomment",
")",
"{",
"return",
";",
"}",
"FieldDoc",
"field",
"=",
"(",
"FieldDoc",
")",
"currentMember",
";",
"Clas... | Build the field information.
@param node the XML element that specifies which components to document
@param fieldsContentTree content tree to which the documentation will be added | [
"Build",
"the",
"field",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L498-L513 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/util/Constants.java | Constants.decode | public static Object decode(Object value, Type type) {
"""
Converts a constant in internal representation (in which
boolean, char, byte, short, and int are each represented by an
Integer) into standard representation. Other values (including
null) are returned unchanged.
"""
if (value instanceof In... | java | public static Object decode(Object value, Type type) {
if (value instanceof Integer) {
int i = (Integer) value;
switch (type.getTag()) {
case BOOLEAN: return i != 0;
case CHAR: return (char) i;
case BYTE: return (byte) i;
case SHOR... | [
"public",
"static",
"Object",
"decode",
"(",
"Object",
"value",
",",
"Type",
"type",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Integer",
")",
"{",
"int",
"i",
"=",
"(",
"Integer",
")",
"value",
";",
"switch",
"(",
"type",
".",
"getTag",
"(",
")",
... | Converts a constant in internal representation (in which
boolean, char, byte, short, and int are each represented by an
Integer) into standard representation. Other values (including
null) are returned unchanged. | [
"Converts",
"a",
"constant",
"in",
"internal",
"representation",
"(",
"in",
"which",
"boolean",
"char",
"byte",
"short",
"and",
"int",
"are",
"each",
"represented",
"by",
"an",
"Integer",
")",
"into",
"standard",
"representation",
".",
"Other",
"values",
"(",
... | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/util/Constants.java#L46-L57 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.getView | public View getView(FolderJob folder, String name) throws IOException {
"""
Get a single view object from the given folder
@param folder The name of the folder.
@param name name of the view in Jenkins
@return the view object
@throws IOException in case of an error.
"""
try {
View resu... | java | public View getView(FolderJob folder, String name) throws IOException {
try {
View resultView = client.get(UrlUtils.toViewBaseUrl(folder, name) + "/", View.class);
resultView.setClient(client);
// TODO: Think about the following? Does there exists a simpler/more
... | [
"public",
"View",
"getView",
"(",
"FolderJob",
"folder",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"try",
"{",
"View",
"resultView",
"=",
"client",
".",
"get",
"(",
"UrlUtils",
".",
"toViewBaseUrl",
"(",
"folder",
",",
"name",
")",
"+",
"... | Get a single view object from the given folder
@param folder The name of the folder.
@param name name of the view in Jenkins
@return the view object
@throws IOException in case of an error. | [
"Get",
"a",
"single",
"view",
"object",
"from",
"the",
"given",
"folder"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L239-L261 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.outputColorNumbers | void outputColorNumbers(Color color, float tint) {
"""
Outputs the color values to the content.
@param color The color
@param tint the tint if it is a spot color, ignored otherwise
"""
PdfXConformanceImp.checkPDFXConformance(writer, PdfXConformanceImp.PDFXKEY_COLOR, color);
int type = ExtendedCo... | java | void outputColorNumbers(Color color, float tint) {
PdfXConformanceImp.checkPDFXConformance(writer, PdfXConformanceImp.PDFXKEY_COLOR, color);
int type = ExtendedColor.getType(color);
switch (type) {
case ExtendedColor.TYPE_RGB:
content.append((float)(color.getRed()) / 0xF... | [
"void",
"outputColorNumbers",
"(",
"Color",
"color",
",",
"float",
"tint",
")",
"{",
"PdfXConformanceImp",
".",
"checkPDFXConformance",
"(",
"writer",
",",
"PdfXConformanceImp",
".",
"PDFXKEY_COLOR",
",",
"color",
")",
";",
"int",
"type",
"=",
"ExtendedColor",
"... | Outputs the color values to the content.
@param color The color
@param tint the tint if it is a spot color, ignored otherwise | [
"Outputs",
"the",
"color",
"values",
"to",
"the",
"content",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2311-L2337 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/FormModelMediatingValueModel.java | FormModelMediatingValueModel.firePropertyChange | protected final void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
"""
Handles the dirty event firing.
@param propertyName implementation only handles DIRTY_PROPERTY.
@param oldValue
@param newValue
"""
if (DIRTY_PROPERTY.equals(propertyName)) {
PropertyChangeEvent evt... | java | protected final void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
if (DIRTY_PROPERTY.equals(propertyName)) {
PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, Boolean.valueOf(oldValue), Boolean
.valueOf(newValue));
for (Iterator i = dirtyChangeListeners.... | [
"protected",
"final",
"void",
"firePropertyChange",
"(",
"String",
"propertyName",
",",
"boolean",
"oldValue",
",",
"boolean",
"newValue",
")",
"{",
"if",
"(",
"DIRTY_PROPERTY",
".",
"equals",
"(",
"propertyName",
")",
")",
"{",
"PropertyChangeEvent",
"evt",
"="... | Handles the dirty event firing.
@param propertyName implementation only handles DIRTY_PROPERTY.
@param oldValue
@param newValue | [
"Handles",
"the",
"dirty",
"event",
"firing",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/FormModelMediatingValueModel.java#L243-L251 |
liferay/com-liferay-commerce | commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountOrganizationRelPersistenceImpl.java | CommerceAccountOrganizationRelPersistenceImpl.findByCommerceAccountId | @Override
public List<CommerceAccountOrganizationRel> findByCommerceAccountId(
long commerceAccountId, int start, int end) {
"""
Returns a range of all the commerce account organization rels where commerceAccountId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> in... | java | @Override
public List<CommerceAccountOrganizationRel> findByCommerceAccountId(
long commerceAccountId, int start, int end) {
return findByCommerceAccountId(commerceAccountId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceAccountOrganizationRel",
">",
"findByCommerceAccountId",
"(",
"long",
"commerceAccountId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCommerceAccountId",
"(",
"commerceAccountId",
",",
"start",
... | Returns a range of all the commerce account organization rels where commerceAccountId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to th... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"account",
"organization",
"rels",
"where",
"commerceAccountId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountOrganizationRelPersistenceImpl.java#L144-L148 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.getRouteForVnetAsync | public Observable<List<VnetRouteInner>> getRouteForVnetAsync(String resourceGroupName, String name, String vnetName, String routeName) {
"""
Get a Virtual Network route in an App Service plan.
Get a Virtual Network route in an App Service plan.
@param resourceGroupName Name of the resource group to which the r... | java | public Observable<List<VnetRouteInner>> getRouteForVnetAsync(String resourceGroupName, String name, String vnetName, String routeName) {
return getRouteForVnetWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName).map(new Func1<ServiceResponse<List<VnetRouteInner>>, List<VnetRouteInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"VnetRouteInner",
">",
">",
"getRouteForVnetAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"vnetName",
",",
"String",
"routeName",
")",
"{",
"return",
"getRouteForVnetWithServiceResponseAsync... | Get a Virtual Network route in an App Service plan.
Get a Virtual Network route in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param vnetName Name of the Virtual Network.
@param routeName Name of the Virtual Network ... | [
"Get",
"a",
"Virtual",
"Network",
"route",
"in",
"an",
"App",
"Service",
"plan",
".",
"Get",
"a",
"Virtual",
"Network",
"route",
"in",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L3518-L3525 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/AjaxWPaginationExample.java | AjaxWPaginationExample.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
"""
Override preparePaintComponent in order to set up the example data the first time through.
@param request the request being responded to.
"""
super.preparePaintComponent(request);
if (!isInitialised()) {
List<Serializable> ... | java | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
List<Serializable> items = new ArrayList<>();
items.add(new SimpleTableBean("A", "none", "thing"));
items.add(new SimpleTableBean("B", "some", "thing2"));
items.add(new... | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"super",
".",
"preparePaintComponent",
"(",
"request",
")",
";",
"if",
"(",
"!",
"isInitialised",
"(",
")",
")",
"{",
"List",
"<",
"Serializable",
">... | Override preparePaintComponent in order to set up the example data the first time through.
@param request the request being responded to. | [
"Override",
"preparePaintComponent",
"in",
"order",
"to",
"set",
"up",
"the",
"example",
"data",
"the",
"first",
"time",
"through",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/AjaxWPaginationExample.java#L50-L73 |
kevoree/kevoree-library | mqttServer/src/main/java/org/dna/mqtt/moquette/parser/netty/Utils.java | Utils.decodeString | static String decodeString(ByteBuf in) throws UnsupportedEncodingException {
"""
Load a string from the given buffer, reading first the two bytes of len
and then the UTF-8 bytes of the string.
@return the decoded string or null if NEED_DATA
"""
if (in.readableBytes() < 2) {
return null;... | java | static String decodeString(ByteBuf in) throws UnsupportedEncodingException {
if (in.readableBytes() < 2) {
return null;
}
//int strLen = Utils.readWord(in);
int strLen = in.readUnsignedShort();
if (in.readableBytes() < strLen) {
return null;
}
... | [
"static",
"String",
"decodeString",
"(",
"ByteBuf",
"in",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"in",
".",
"readableBytes",
"(",
")",
"<",
"2",
")",
"{",
"return",
"null",
";",
"}",
"//int strLen = Utils.readWord(in);",
"int",
"strLen",
... | Load a string from the given buffer, reading first the two bytes of len
and then the UTF-8 bytes of the string.
@return the decoded string or null if NEED_DATA | [
"Load",
"a",
"string",
"from",
"the",
"given",
"buffer",
"reading",
"first",
"the",
"two",
"bytes",
"of",
"len",
"and",
"then",
"the",
"UTF",
"-",
"8",
"bytes",
"of",
"the",
"string",
"."
] | train | https://github.com/kevoree/kevoree-library/blob/617460e6c5881902ebc488a31ecdea179024d8f1/mqttServer/src/main/java/org/dna/mqtt/moquette/parser/netty/Utils.java#L115-L128 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/SingleInputSemanticProperties.java | SingleInputSemanticProperties.addForwardedField | public void addForwardedField(int sourceField, int targetField) {
"""
Adds, to the existing information, a field that is forwarded directly
from the source record(s) to the destination record(s).
@param sourceField the position in the source record(s)
@param targetField the position in the destination record(... | java | public void addForwardedField(int sourceField, int targetField) {
if(isTargetFieldPresent(targetField)) {
throw new InvalidSemanticAnnotationException("Target field "+targetField+" was added twice.");
}
FieldSet targetFields = fieldMapping.get(sourceField);
if (targetFields != null) {
fieldMapping.put(so... | [
"public",
"void",
"addForwardedField",
"(",
"int",
"sourceField",
",",
"int",
"targetField",
")",
"{",
"if",
"(",
"isTargetFieldPresent",
"(",
"targetField",
")",
")",
"{",
"throw",
"new",
"InvalidSemanticAnnotationException",
"(",
"\"Target field \"",
"+",
"targetF... | Adds, to the existing information, a field that is forwarded directly
from the source record(s) to the destination record(s).
@param sourceField the position in the source record(s)
@param targetField the position in the destination record(s) | [
"Adds",
"to",
"the",
"existing",
"information",
"a",
"field",
"that",
"is",
"forwarded",
"directly",
"from",
"the",
"source",
"record",
"(",
"s",
")",
"to",
"the",
"destination",
"record",
"(",
"s",
")",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/SingleInputSemanticProperties.java#L89-L100 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Collectors.java | Collectors.maxAll | public static <T> Collector<T, ?, List<T>> maxAll(final Comparator<? super T> comparator, final int atMostSize, final boolean areAllLargestSame) {
"""
Use occurrences to save the count of largest objects if {@code areAllLargestSame = true}(e.g. {@code Number/String/...}) and return a list by repeat the largest obj... | java | public static <T> Collector<T, ?, List<T>> maxAll(final Comparator<? super T> comparator, final int atMostSize, final boolean areAllLargestSame) {
N.checkArgPositive(atMostSize, "atMostSize");
if (areAllLargestSame) {
final Function<Pair<Optional<T>, Integer>, List<T>> finisher = new Fu... | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"List",
"<",
"T",
">",
">",
"maxAll",
"(",
"final",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comparator",
",",
"final",
"int",
"atMostSize",
",",
"final",
"boolean",
"areAllL... | Use occurrences to save the count of largest objects if {@code areAllLargestSame = true}(e.g. {@code Number/String/...}) and return a list by repeat the largest object {@code n} times.
@implSpec
The default implementation is equivalent to, for this {@code map}:
<pre>
<code>
if (areAllLargestSame) {
final Function<Pair... | [
"Use",
"occurrences",
"to",
"save",
"the",
"count",
"of",
"largest",
"objects",
"if",
"{",
"@code",
"areAllLargestSame",
"=",
"true",
"}",
"(",
"e",
".",
"g",
".",
"{",
"@code",
"Number",
"/",
"String",
"/",
"...",
"}",
")",
"and",
"return",
"a",
"li... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Collectors.java#L2217-L2233 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/graph/ObjectGraphUtils.java | ObjectGraphUtils.onAutoGenerateId | public static boolean onAutoGenerateId(Field idField, Object idValue) {
"""
Validates and set id, in case not set and intended for auto generation.
@param idField
id field
@param idValue
value of id attribute.
@return returns true if id is not set and @GeneratedValue annotation is
present. Else false.
... | java | public static boolean onAutoGenerateId(Field idField, Object idValue)
{
if (idField.isAnnotationPresent(GeneratedValue.class))
{
return !isIdSet(idValue, idField);
}
return false;
} | [
"public",
"static",
"boolean",
"onAutoGenerateId",
"(",
"Field",
"idField",
",",
"Object",
"idValue",
")",
"{",
"if",
"(",
"idField",
".",
"isAnnotationPresent",
"(",
"GeneratedValue",
".",
"class",
")",
")",
"{",
"return",
"!",
"isIdSet",
"(",
"idValue",
",... | Validates and set id, in case not set and intended for auto generation.
@param idField
id field
@param idValue
value of id attribute.
@return returns true if id is not set and @GeneratedValue annotation is
present. Else false. | [
"Validates",
"and",
"set",
"id",
"in",
"case",
"not",
"set",
"and",
"intended",
"for",
"auto",
"generation",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/graph/ObjectGraphUtils.java#L69-L77 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ReadingThread.java | ReadingThread.callOnFrameError | private void callOnFrameError(WebSocketException cause, WebSocketFrame frame) {
"""
Call {@link WebSocketListener#onFrameError(WebSocket,
WebSocketException, WebSocketFrame) onFrameError} method of the listeners.
"""
mWebSocket.getListenerManager().callOnFrameError(cause, frame);
} | java | private void callOnFrameError(WebSocketException cause, WebSocketFrame frame)
{
mWebSocket.getListenerManager().callOnFrameError(cause, frame);
} | [
"private",
"void",
"callOnFrameError",
"(",
"WebSocketException",
"cause",
",",
"WebSocketFrame",
"frame",
")",
"{",
"mWebSocket",
".",
"getListenerManager",
"(",
")",
".",
"callOnFrameError",
"(",
"cause",
",",
"frame",
")",
";",
"}"
] | Call {@link WebSocketListener#onFrameError(WebSocket,
WebSocketException, WebSocketFrame) onFrameError} method of the listeners. | [
"Call",
"{"
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ReadingThread.java#L294-L297 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.dropWhile | public static <U> Stream<U> dropWhile(final Stream<U> stream, final Predicate<? super U> predicate) {
"""
skip elements in a Stream while Predicate holds true
<pre>
{@code Streams.dropWhile(Stream.of(4,3,6,7).sorted(),i->i<6).collect(CyclopsCollectors.toList())
// [6,7]
}</pre>
@param stream
@param pred... | java | public static <U> Stream<U> dropWhile(final Stream<U> stream, final Predicate<? super U> predicate) {
return StreamSupport.stream(new SkipWhileSpliterator<U>(stream.spliterator(),predicate), stream.isParallel());
} | [
"public",
"static",
"<",
"U",
">",
"Stream",
"<",
"U",
">",
"dropWhile",
"(",
"final",
"Stream",
"<",
"U",
">",
"stream",
",",
"final",
"Predicate",
"<",
"?",
"super",
"U",
">",
"predicate",
")",
"{",
"return",
"StreamSupport",
".",
"stream",
"(",
"n... | skip elements in a Stream while Predicate holds true
<pre>
{@code Streams.dropWhile(Stream.of(4,3,6,7).sorted(),i->i<6).collect(CyclopsCollectors.toList())
// [6,7]
}</pre>
@param stream
@param predicate
@return | [
"skip",
"elements",
"in",
"a",
"Stream",
"while",
"Predicate",
"holds",
"true"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L1192-L1194 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Fn.java | Fn.sp | @Beta
public static <T, U> BiPredicate<T, U> sp(final Object mutex, final BiPredicate<T, U> biPredicate) {
"""
Synchronized {@code BiPredicate}
@param mutex to synchronized on
@param biPredicate
@return
"""
N.checkArgNotNull(mutex, "mutex");
N.checkArgNotNull(biPredicate, "biPredica... | java | @Beta
public static <T, U> BiPredicate<T, U> sp(final Object mutex, final BiPredicate<T, U> biPredicate) {
N.checkArgNotNull(mutex, "mutex");
N.checkArgNotNull(biPredicate, "biPredicate");
return new BiPredicate<T, U>() {
@Override
public boolean test(T t, U u... | [
"@",
"Beta",
"public",
"static",
"<",
"T",
",",
"U",
">",
"BiPredicate",
"<",
"T",
",",
"U",
">",
"sp",
"(",
"final",
"Object",
"mutex",
",",
"final",
"BiPredicate",
"<",
"T",
",",
"U",
">",
"biPredicate",
")",
"{",
"N",
".",
"checkArgNotNull",
"("... | Synchronized {@code BiPredicate}
@param mutex to synchronized on
@param biPredicate
@return | [
"Synchronized",
"{",
"@code",
"BiPredicate",
"}"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fn.java#L2819-L2832 |
IBM-Cloud/gp-java-client | src/main/java/com/ibm/g11n/pipeline/client/ServiceAccount.java | ServiceAccount.getInstance | public static ServiceAccount getInstance(String url, String instanceId,
String userId, String password) {
"""
Returns an instance of ServiceAccount for the specified IBM Globalization
Pipeline service URL and credentials.
<p>
All arguments must not be null.
@param url The service URL of... | java | public static ServiceAccount getInstance(String url, String instanceId,
String userId, String password) {
if (url.endsWith("/")) {
// trim off trailing slash
url = url.substring(0, url.length() - 1);
}
return new ServiceAccount(url, instanceId, userId, passw... | [
"public",
"static",
"ServiceAccount",
"getInstance",
"(",
"String",
"url",
",",
"String",
"instanceId",
",",
"String",
"userId",
",",
"String",
"password",
")",
"{",
"if",
"(",
"url",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"// trim off trailing slash",
... | Returns an instance of ServiceAccount for the specified IBM Globalization
Pipeline service URL and credentials.
<p>
All arguments must not be null.
@param url The service URL of Globlization Pipeline service.
(e.g. https://gp-rest.ng.bluemix.net/translate/rest)
@param instanceId The instance ID of the ser... | [
"Returns",
"an",
"instance",
"of",
"ServiceAccount",
"for",
"the",
"specified",
"IBM",
"Globalization",
"Pipeline",
"service",
"URL",
"and",
"credentials",
".",
"<p",
">",
"All",
"arguments",
"must",
"not",
"be",
"null",
"."
] | train | https://github.com/IBM-Cloud/gp-java-client/blob/b015a081d7a7313bc48c448087fbc07bce860427/src/main/java/com/ibm/g11n/pipeline/client/ServiceAccount.java#L178-L187 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/GenericLogicDiscoverer.java | GenericLogicDiscoverer.findServicesClassifiedByAll | @Override
public Map<URI, MatchResult> findServicesClassifiedByAll(Set<URI> modelReferences) {
"""
Discover the services that are classified by all the types given. That is, all those that have some level of
matching with respect to all services provided in the model references.
@param modelReferences the ... | java | @Override
public Map<URI, MatchResult> findServicesClassifiedByAll(Set<URI> modelReferences) {
return findServicesClassifiedByAll(modelReferences, LogicConceptMatchType.Subsume);
} | [
"@",
"Override",
"public",
"Map",
"<",
"URI",
",",
"MatchResult",
">",
"findServicesClassifiedByAll",
"(",
"Set",
"<",
"URI",
">",
"modelReferences",
")",
"{",
"return",
"findServicesClassifiedByAll",
"(",
"modelReferences",
",",
"LogicConceptMatchType",
".",
"Subsu... | Discover the services that are classified by all the types given. That is, all those that have some level of
matching with respect to all services provided in the model references.
@param modelReferences the classifications to match against
@return a Set containing all the matching services. If there are no solutions,... | [
"Discover",
"the",
"services",
"that",
"are",
"classified",
"by",
"all",
"the",
"types",
"given",
".",
"That",
"is",
"all",
"those",
"that",
"have",
"some",
"level",
"of",
"matching",
"with",
"respect",
"to",
"all",
"services",
"provided",
"in",
"the",
"mo... | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/GenericLogicDiscoverer.java#L435-L438 |
VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/vnode/builder/VNodeBuilder.java | VNodeBuilder.el | public VNode el(String tag, Object... children) {
"""
Create a VNode with the given HTML tag
@param tag HTML tag for the new VNode
@param children Children
@return a new VNode of this tag
"""
return this.function.create(tag, children, null);
} | java | public VNode el(String tag, Object... children) {
return this.function.create(tag, children, null);
} | [
"public",
"VNode",
"el",
"(",
"String",
"tag",
",",
"Object",
"...",
"children",
")",
"{",
"return",
"this",
".",
"function",
".",
"create",
"(",
"tag",
",",
"children",
",",
"null",
")",
";",
"}"
] | Create a VNode with the given HTML tag
@param tag HTML tag for the new VNode
@param children Children
@return a new VNode of this tag | [
"Create",
"a",
"VNode",
"with",
"the",
"given",
"HTML",
"tag"
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/vnode/builder/VNodeBuilder.java#L36-L38 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.addForeignKey | void addForeignKey(Constraint c) {
"""
Creates a foreign key on an existing table. Foreign keys are enforced by
indexes on both the referencing (child) and referenced (main) tables.
<p> Since version 1.7.2, a unique constraint on the referenced columns
must exist. The non-unique index on the referencing table... | java | void addForeignKey(Constraint c) {
checkCreateForeignKey(c);
Constraint uniqueConstraint =
c.core.mainTable.getUniqueConstraintForColumns(c.core.mainCols,
c.core.refCols);
Index mainIndex = uniqueConstraint.getMainIndex();
uniqueConstraint.checkReferencedRo... | [
"void",
"addForeignKey",
"(",
"Constraint",
"c",
")",
"{",
"checkCreateForeignKey",
"(",
"c",
")",
";",
"Constraint",
"uniqueConstraint",
"=",
"c",
".",
"core",
".",
"mainTable",
".",
"getUniqueConstraintForColumns",
"(",
"c",
".",
"core",
".",
"mainCols",
","... | Creates a foreign key on an existing table. Foreign keys are enforced by
indexes on both the referencing (child) and referenced (main) tables.
<p> Since version 1.7.2, a unique constraint on the referenced columns
must exist. The non-unique index on the referencing table is now always
created whether or not a PK or un... | [
"Creates",
"a",
"foreign",
"key",
"on",
"an",
"existing",
"table",
".",
"Foreign",
"keys",
"are",
"enforced",
"by",
"indexes",
"on",
"both",
"the",
"referencing",
"(",
"child",
")",
"and",
"referenced",
"(",
"main",
")",
"tables",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L159-L208 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java | RangeUtils.getSplitsBySize | public static List<DeepTokenRange> getSplitsBySize(
CassandraDeepJobConfig config) {
"""
Returns the token ranges that will be mapped to Spark partitions.
@param config the Deep configuration object.
@return the list of computed token ranges.
"""
IPartitioner p = getPartitioner(config)... | java | public static List<DeepTokenRange> getSplitsBySize(
CassandraDeepJobConfig config) {
IPartitioner p = getPartitioner(config);
AbstractType tokenValidator = p.getTokenValidator();
Pair<Session, String> sessionWithHost = CassandraClientProvider
.getSession(config.getH... | [
"public",
"static",
"List",
"<",
"DeepTokenRange",
">",
"getSplitsBySize",
"(",
"CassandraDeepJobConfig",
"config",
")",
"{",
"IPartitioner",
"p",
"=",
"getPartitioner",
"(",
"config",
")",
";",
"AbstractType",
"tokenValidator",
"=",
"p",
".",
"getTokenValidator",
... | Returns the token ranges that will be mapped to Spark partitions.
@param config the Deep configuration object.
@return the list of computed token ranges. | [
"Returns",
"the",
"token",
"ranges",
"that",
"will",
"be",
"mapped",
"to",
"Spark",
"partitions",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java#L357-L387 |
JodaOrg/joda-time | src/main/java/org/joda/time/YearMonthDay.java | YearMonthDay.toDateTime | public DateTime toDateTime(TimeOfDay time, DateTimeZone zone) {
"""
Converts this object to a DateTime using a TimeOfDay to fill in the
missing fields.
This instance is immutable and unaffected by this method call.
<p>
The resulting chronology is determined by the chronology of this
YearMonthDay plus the time... | java | public DateTime toDateTime(TimeOfDay time, DateTimeZone zone) {
Chronology chrono = getChronology().withZone(zone);
long instant = DateTimeUtils.currentTimeMillis();
instant = chrono.set(this, instant);
if (time != null) {
instant = chrono.set(time, instant);
}
... | [
"public",
"DateTime",
"toDateTime",
"(",
"TimeOfDay",
"time",
",",
"DateTimeZone",
"zone",
")",
"{",
"Chronology",
"chrono",
"=",
"getChronology",
"(",
")",
".",
"withZone",
"(",
"zone",
")",
";",
"long",
"instant",
"=",
"DateTimeUtils",
".",
"currentTimeMilli... | Converts this object to a DateTime using a TimeOfDay to fill in the
missing fields.
This instance is immutable and unaffected by this method call.
<p>
The resulting chronology is determined by the chronology of this
YearMonthDay plus the time zone.
The chronology of the time is ignored - only the field values are used.... | [
"Converts",
"this",
"object",
"to",
"a",
"DateTime",
"using",
"a",
"TimeOfDay",
"to",
"fill",
"in",
"the",
"missing",
"fields",
".",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
".",
"<p",
">",
"The",
"resulti... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonthDay.java#L769-L777 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/impl/GeldKarteParser.java | GeldKarteParser.extractEF_ID | protected void extractEF_ID(final Application pApplication) throws CommunicationException {
"""
Method used to extract Ef_iD record
@param pApplication EMV application
@throws CommunicationException communication error
"""
// 00B201BC00
byte[] data = template.get().getProvider().transceive(new Comman... | java | protected void extractEF_ID(final Application pApplication) throws CommunicationException {
// 00B201BC00
byte[] data = template.get().getProvider().transceive(new CommandApdu(CommandEnum.READ_RECORD, 0x01, 0xBC, 0).toBytes());
if (ResponseUtils.isSucceed(data)) {
pApplication.setReadingStep(ApplicationStepEnu... | [
"protected",
"void",
"extractEF_ID",
"(",
"final",
"Application",
"pApplication",
")",
"throws",
"CommunicationException",
"{",
"// 00B201BC00",
"byte",
"[",
"]",
"data",
"=",
"template",
".",
"get",
"(",
")",
".",
"getProvider",
"(",
")",
".",
"transceive",
"... | Method used to extract Ef_iD record
@param pApplication EMV application
@throws CommunicationException communication error | [
"Method",
"used",
"to",
"extract",
"Ef_iD",
"record"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/GeldKarteParser.java#L195-L213 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.lastIndexOf | public static int lastIndexOf(final CharSequence seq, final CharSequence searchSeq, final int startPos) {
"""
<p>Finds the last index within a CharSequence, handling {@code null}.
This method uses {@link String#lastIndexOf(String, int)} if possible.</p>
<p>A {@code null} CharSequence will return {@code -1}.
A... | java | public static int lastIndexOf(final CharSequence seq, final CharSequence searchSeq, final int startPos) {
if (seq == null || searchSeq == null) {
return INDEX_NOT_FOUND;
}
return CharSequenceUtils.lastIndexOf(seq, searchSeq, startPos);
} | [
"public",
"static",
"int",
"lastIndexOf",
"(",
"final",
"CharSequence",
"seq",
",",
"final",
"CharSequence",
"searchSeq",
",",
"final",
"int",
"startPos",
")",
"{",
"if",
"(",
"seq",
"==",
"null",
"||",
"searchSeq",
"==",
"null",
")",
"{",
"return",
"INDEX... | <p>Finds the last index within a CharSequence, handling {@code null}.
This method uses {@link String#lastIndexOf(String, int)} if possible.</p>
<p>A {@code null} CharSequence will return {@code -1}.
A negative start position returns {@code -1}.
An empty ("") search CharSequence always matches unless the start position... | [
"<p",
">",
"Finds",
"the",
"last",
"index",
"within",
"a",
"CharSequence",
"handling",
"{",
"@code",
"null",
"}",
".",
"This",
"method",
"uses",
"{",
"@link",
"String#lastIndexOf",
"(",
"String",
"int",
")",
"}",
"if",
"possible",
".",
"<",
"/",
"p",
"... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L1837-L1842 |
dottydingo/hyperion | client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java | QueryBuilder.notIn | public QueryExpression notIn(String propertyName,String... values) {
"""
Create a not in expression
@param propertyName The propery name
@param values The values
@return The query expression
"""
return new MultiValueQueryExpression(propertyName, ComparisonOperator.NOT_IN,wrap(values));
} | java | public QueryExpression notIn(String propertyName,String... values)
{
return new MultiValueQueryExpression(propertyName, ComparisonOperator.NOT_IN,wrap(values));
} | [
"public",
"QueryExpression",
"notIn",
"(",
"String",
"propertyName",
",",
"String",
"...",
"values",
")",
"{",
"return",
"new",
"MultiValueQueryExpression",
"(",
"propertyName",
",",
"ComparisonOperator",
".",
"NOT_IN",
",",
"wrap",
"(",
"values",
")",
")",
";",... | Create a not in expression
@param propertyName The propery name
@param values The values
@return The query expression | [
"Create",
"a",
"not",
"in",
"expression"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java#L434-L437 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java | VirtualNetworksInner.checkIPAddressAvailabilityAsync | public Observable<IPAddressAvailabilityResultInner> checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName) {
"""
Checks whether a private IP address is available for use.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual net... | java | public Observable<IPAddressAvailabilityResultInner> checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName) {
return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1<ServiceResponse<IPAddressAvailabilityResultInner>, IPAddressAv... | [
"public",
"Observable",
"<",
"IPAddressAvailabilityResultInner",
">",
"checkIPAddressAvailabilityAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkName",
")",
"{",
"return",
"checkIPAddressAvailabilityWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Checks whether a private IP address is available for use.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the IPAddressAvailabilityResultInner object | [
"Checks",
"whether",
"a",
"private",
"IP",
"address",
"is",
"available",
"for",
"use",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java#L1180-L1187 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/CommentAPI.java | CommentAPI.open | public static BaseResult open(String access_token,Long msg_data_id,Integer index) {
"""
打开已群发文章评论
@param access_token access_token
@param msg_data_id 群发返回的msg_data_id
@param index 多图文时,用来指定第几篇图文,从0开始,不带默认操作该msg_data_id的第一篇图文
@return BaseResult BaseResult
"""
String json = String.format("{\"msg_data_id\":... | java | public static BaseResult open(String access_token,Long msg_data_id,Integer index){
String json = String.format("{\"msg_data_id\":%d,\"index\":%d}",msg_data_id,index == null?0:index);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bin/comment/o... | [
"public",
"static",
"BaseResult",
"open",
"(",
"String",
"access_token",
",",
"Long",
"msg_data_id",
",",
"Integer",
"index",
")",
"{",
"String",
"json",
"=",
"String",
".",
"format",
"(",
"\"{\\\"msg_data_id\\\":%d,\\\"index\\\":%d}\"",
",",
"msg_data_id",
",",
"... | 打开已群发文章评论
@param access_token access_token
@param msg_data_id 群发返回的msg_data_id
@param index 多图文时,用来指定第几篇图文,从0开始,不带默认操作该msg_data_id的第一篇图文
@return BaseResult BaseResult | [
"打开已群发文章评论"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/CommentAPI.java#L32-L41 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/event/EventBuilder.java | EventBuilder.withExtra | public EventBuilder withExtra(String extraName, Object extraValue) {
"""
Adds an extra property to the event.
@param extraName name of the extra property.
@param extraValue value of the extra property.
@return the current {@code EventBuilder} for chained calls.
"""
event.getExtra().put(extraName,... | java | public EventBuilder withExtra(String extraName, Object extraValue) {
event.getExtra().put(extraName, extraValue);
return this;
} | [
"public",
"EventBuilder",
"withExtra",
"(",
"String",
"extraName",
",",
"Object",
"extraValue",
")",
"{",
"event",
".",
"getExtra",
"(",
")",
".",
"put",
"(",
"extraName",
",",
"extraValue",
")",
";",
"return",
"this",
";",
"}"
] | Adds an extra property to the event.
@param extraName name of the extra property.
@param extraValue value of the extra property.
@return the current {@code EventBuilder} for chained calls. | [
"Adds",
"an",
"extra",
"property",
"to",
"the",
"event",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/event/EventBuilder.java#L348-L351 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java | CommerceSubscriptionEntryPersistenceImpl.findByGroupId | @Override
public List<CommerceSubscriptionEntry> findByGroupId(long groupId,
int start, int end) {
"""
Returns a range of all the commerce subscription entries where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end... | java | @Override
public List<CommerceSubscriptionEntry> findByGroupId(long groupId,
int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceSubscriptionEntry",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",... | Returns a range of all the commerce subscription entries where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"subscription",
"entries",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java#L1553-L1557 |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/HttpContext.java | HttpContext.doSecurePost | public String doSecurePost(String host, String path, String postData,
int port, Map<String, String> headers,
int timeout)
throws UnknownHostException, ConnectException, IOException {
"""
Perform a secure HTTPS POST at the given path sending in ... | java | public String doSecurePost(String host, String path, String postData,
int port, Map<String, String> headers,
int timeout)
throws UnknownHostException, ConnectException, IOException {
return doHttpCall(host, path, postData, port, hea... | [
"public",
"String",
"doSecurePost",
"(",
"String",
"host",
",",
"String",
"path",
",",
"String",
"postData",
",",
"int",
"port",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"int",
"timeout",
")",
"throws",
"UnknownHostException",
",",
"C... | Perform a secure HTTPS POST at the given path sending in the given post
data returning the results of the response.
@param host The hostname of the request
@param path The path of the request
@param postData The POST data to send in the request
@param port The port of the request
@param headers The headers to pass in ... | [
"Perform",
"a",
"secure",
"HTTPS",
"POST",
"at",
"the",
"given",
"path",
"sending",
"in",
"the",
"given",
"post",
"data",
"returning",
"the",
"results",
"of",
"the",
"response",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/HttpContext.java#L132-L138 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java | Levenshtein.NGram | @SuppressWarnings("unchecked")
public static <T extends Levenshtein> T NGram(String baseTarget, String compareTarget, Integer n) {
"""
Returns an new n-Gram distance (Kondrak) instance with compare target string and n
@see NGram
@param baseTarget
@param compareTarget
@param n
@return
"""
return (T) n... | java | @SuppressWarnings("unchecked")
public static <T extends Levenshtein> T NGram(String baseTarget, String compareTarget, Integer n) {
return (T) new NGram(baseTarget, n).update(compareTarget);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Levenshtein",
">",
"T",
"NGram",
"(",
"String",
"baseTarget",
",",
"String",
"compareTarget",
",",
"Integer",
"n",
")",
"{",
"return",
"(",
"T",
")",
"new",
"NGra... | Returns an new n-Gram distance (Kondrak) instance with compare target string and n
@see NGram
@param baseTarget
@param compareTarget
@param n
@return | [
"Returns",
"an",
"new",
"n",
"-",
"Gram",
"distance",
"(",
"Kondrak",
")",
"instance",
"with",
"compare",
"target",
"string",
"and",
"n"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java#L234-L237 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.delegatedAccount_email_filter_POST | public OvhTaskFilter delegatedAccount_email_filter_POST(String email, OvhDomainFilterActionEnum action, String actionParam, Boolean active, String header, String name, OvhDomainFilterOperandEnum operand, Long priority, String value) throws IOException {
"""
Create new filter for account
REST: POST /email/domain... | java | public OvhTaskFilter delegatedAccount_email_filter_POST(String email, OvhDomainFilterActionEnum action, String actionParam, Boolean active, String header, String name, OvhDomainFilterOperandEnum operand, Long priority, String value) throws IOException {
String qPath = "/email/domain/delegatedAccount/{email}/filter";
... | [
"public",
"OvhTaskFilter",
"delegatedAccount_email_filter_POST",
"(",
"String",
"email",
",",
"OvhDomainFilterActionEnum",
"action",
",",
"String",
"actionParam",
",",
"Boolean",
"active",
",",
"String",
"header",
",",
"String",
"name",
",",
"OvhDomainFilterOperandEnum",
... | Create new filter for account
REST: POST /email/domain/delegatedAccount/{email}/filter
@param value [required] Rule parameter of filter
@param action [required] Action of filter
@param actionParam [required] Action parameter of filter
@param priority [required] Priority of filter
@param operand [required] Rule of filt... | [
"Create",
"new",
"filter",
"for",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L120-L134 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedProperties.java | ExtendedProperties.put | @Override
public String put(final String key, final String value) {
"""
Sets the property with the specified key.
@param key
The key (may not be {@code null})
@param value
The value (may not be {@code null})
@return The previous value of the property, or {@code null} if it did not have one
"""
retu... | java | @Override
public String put(final String key, final String value) {
return propsMap.put(key, value);
} | [
"@",
"Override",
"public",
"String",
"put",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"return",
"propsMap",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Sets the property with the specified key.
@param key
The key (may not be {@code null})
@param value
The value (may not be {@code null})
@return The previous value of the property, or {@code null} if it did not have one | [
"Sets",
"the",
"property",
"with",
"the",
"specified",
"key",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedProperties.java#L213-L216 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getWithTrailing | @Nonnull
public static String getWithTrailing (@Nullable final String sSrc, @Nonnegative final int nMinLen, final char cEnd) {
"""
Get a string that is filled at the end with the passed character until the
minimum length is reached. If the input string is empty, the result is a
string with the provided len onl... | java | @Nonnull
public static String getWithTrailing (@Nullable final String sSrc, @Nonnegative final int nMinLen, final char cEnd)
{
return _getWithLeadingOrTrailing (sSrc, nMinLen, cEnd, false);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getWithTrailing",
"(",
"@",
"Nullable",
"final",
"String",
"sSrc",
",",
"@",
"Nonnegative",
"final",
"int",
"nMinLen",
",",
"final",
"char",
"cEnd",
")",
"{",
"return",
"_getWithLeadingOrTrailing",
"(",
"sSrc",
",... | Get a string that is filled at the end with the passed character until the
minimum length is reached. If the input string is empty, the result is a
string with the provided len only consisting of the passed characters. If the
input String is longer than the provided length, it is returned unchanged.
@param sSrc
Source... | [
"Get",
"a",
"string",
"that",
"is",
"filled",
"at",
"the",
"end",
"with",
"the",
"passed",
"character",
"until",
"the",
"minimum",
"length",
"is",
"reached",
".",
"If",
"the",
"input",
"string",
"is",
"empty",
"the",
"result",
"is",
"a",
"string",
"with"... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L560-L564 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/impl/AbstractInvocationFuture.java | AbstractInvocationFuture.warnIfSuspiciousDoubleCompletion | private void warnIfSuspiciousDoubleCompletion(Object s0, Object s1) {
"""
received a response, but before it cleans up itself, it receives a HazelcastInstanceNotActiveException
"""
if (s0 != s1 && !(s0 instanceof CancellationException) && !(s1 instanceof CancellationException)) {
logger.war... | java | private void warnIfSuspiciousDoubleCompletion(Object s0, Object s1) {
if (s0 != s1 && !(s0 instanceof CancellationException) && !(s1 instanceof CancellationException)) {
logger.warning(String.format("Future.complete(Object) on completed future. "
+ "Request: %s, current v... | [
"private",
"void",
"warnIfSuspiciousDoubleCompletion",
"(",
"Object",
"s0",
",",
"Object",
"s1",
")",
"{",
"if",
"(",
"s0",
"!=",
"s1",
"&&",
"!",
"(",
"s0",
"instanceof",
"CancellationException",
")",
"&&",
"!",
"(",
"s1",
"instanceof",
"CancellationException... | received a response, but before it cleans up itself, it receives a HazelcastInstanceNotActiveException | [
"received",
"a",
"response",
"but",
"before",
"it",
"cleans",
"up",
"itself",
"it",
"receives",
"a",
"HazelcastInstanceNotActiveException"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/AbstractInvocationFuture.java#L388-L394 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.element | public JSONObject element( String key, Object value ) {
"""
Put a key/value pair in the JSONObject. If the value is null, then the key
will be removed from the JSONObject if it is present.<br>
If there is a previous value assigned to the key, it will call accumulate.
@param key A key string.
@param value An ... | java | public JSONObject element( String key, Object value ) {
return element( key, value, new JsonConfig() );
} | [
"public",
"JSONObject",
"element",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"return",
"element",
"(",
"key",
",",
"value",
",",
"new",
"JsonConfig",
"(",
")",
")",
";",
"}"
] | Put a key/value pair in the JSONObject. If the value is null, then the key
will be removed from the JSONObject if it is present.<br>
If there is a previous value assigned to the key, it will call accumulate.
@param key A key string.
@param value An object which is the value. It should be of one of these
types: Boolean... | [
"Put",
"a",
"key",
"/",
"value",
"pair",
"in",
"the",
"JSONObject",
".",
"If",
"the",
"value",
"is",
"null",
"then",
"the",
"key",
"will",
"be",
"removed",
"from",
"the",
"JSONObject",
"if",
"it",
"is",
"present",
".",
"<br",
">",
"If",
"there",
"is"... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L1689-L1691 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java | InternalDebugControl.isDebugEnabled | public static boolean isDebugEnabled(JShell state, int flag) {
"""
Tests if any of the specified debug flags are enabled.
@param state the JShell instance
@param flag the {@code DBG_*} bits to check
@return true if any of the flags are enabled
"""
if (debugMap == null) {
return false;
... | java | public static boolean isDebugEnabled(JShell state, int flag) {
if (debugMap == null) {
return false;
}
Integer flags = debugMap.get(state);
if (flags == null) {
return false;
}
return (flags & flag) != 0;
} | [
"public",
"static",
"boolean",
"isDebugEnabled",
"(",
"JShell",
"state",
",",
"int",
"flag",
")",
"{",
"if",
"(",
"debugMap",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"Integer",
"flags",
"=",
"debugMap",
".",
"get",
"(",
"state",
")",
";",
... | Tests if any of the specified debug flags are enabled.
@param state the JShell instance
@param flag the {@code DBG_*} bits to check
@return true if any of the flags are enabled | [
"Tests",
"if",
"any",
"of",
"the",
"specified",
"debug",
"flags",
"are",
"enabled",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java#L110-L119 |
googlegenomics/utils-java | src/main/java/com/google/cloud/genomics/utils/CredentialFactory.java | CredentialFactory.getCredentialFromClientSecrets | public static Credential getCredentialFromClientSecrets(String clientSecretsFile,
String credentialId) {
"""
Creates an OAuth2 credential from client secrets, which may require an interactive authorization prompt.
Use this method when the Application Default Credential is not sufficient.
@param clientS... | java | public static Credential getCredentialFromClientSecrets(String clientSecretsFile,
String credentialId) {
Preconditions.checkArgument(clientSecretsFile != null);
Preconditions.checkArgument(credentialId != null);
HttpTransport httpTransport;
try {
httpTransport = GoogleNetHttpTransport.newTr... | [
"public",
"static",
"Credential",
"getCredentialFromClientSecrets",
"(",
"String",
"clientSecretsFile",
",",
"String",
"credentialId",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"clientSecretsFile",
"!=",
"null",
")",
";",
"Preconditions",
".",
"checkArgument... | Creates an OAuth2 credential from client secrets, which may require an interactive authorization prompt.
Use this method when the Application Default Credential is not sufficient.
@param clientSecretsFile The {@code client_secrets.json} file path.
@param credentialId The credentialId for use in identifying the creden... | [
"Creates",
"an",
"OAuth2",
"credential",
"from",
"client",
"secrets",
"which",
"may",
"require",
"an",
"interactive",
"authorization",
"prompt",
"."
] | train | https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/CredentialFactory.java#L117-L167 |
javers/javers | javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java | QueryBuilder.withCommitProperty | public QueryBuilder withCommitProperty(String name, String value) {
"""
Only snapshots with a given commit property.
<br/><br/
If this method is called multiple times,
<b>all</b> given properties must match with persisted commit properties.
@since 2.0
"""
Validate.argumentsAreNotNull(name, value)... | java | public QueryBuilder withCommitProperty(String name, String value) {
Validate.argumentsAreNotNull(name, value);
queryParamsBuilder.commitProperty(name, value);
return this;
} | [
"public",
"QueryBuilder",
"withCommitProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Validate",
".",
"argumentsAreNotNull",
"(",
"name",
",",
"value",
")",
";",
"queryParamsBuilder",
".",
"commitProperty",
"(",
"name",
",",
"value",
")",
"... | Only snapshots with a given commit property.
<br/><br/
If this method is called multiple times,
<b>all</b> given properties must match with persisted commit properties.
@since 2.0 | [
"Only",
"snapshots",
"with",
"a",
"given",
"commit",
"property",
".",
"<br",
"/",
">",
"<br",
"/"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java#L383-L387 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/MessagesApi.java | MessagesApi.getLastNormalizedMessagesAsync | public com.squareup.okhttp.Call getLastNormalizedMessagesAsync(Integer count, String sdids, String fieldPresence, final ApiCallback<NormalizedMessagesEnvelope> callback) throws ApiException {
"""
Get Last Normalized Message (asynchronously)
Get last messages normalized.
@param count Number of items to return per... | java | public com.squareup.okhttp.Call getLastNormalizedMessagesAsync(Integer count, String sdids, String fieldPresence, final ApiCallback<NormalizedMessagesEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener prog... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getLastNormalizedMessagesAsync",
"(",
"Integer",
"count",
",",
"String",
"sdids",
",",
"String",
"fieldPresence",
",",
"final",
"ApiCallback",
"<",
"NormalizedMessagesEnvelope",
">",
"callback",
")",
"... | Get Last Normalized Message (asynchronously)
Get last messages normalized.
@param count Number of items to return per query. (optional)
@param sdids Comma separated list of source device IDs (minimum: 1). (optional)
@param fieldPresence String representing a field from the specified device ID. (optional)
@param callbac... | [
"Get",
"Last",
"Normalized",
"Message",
"(",
"asynchronously",
")",
"Get",
"last",
"messages",
"normalized",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/MessagesApi.java#L459-L484 |
OpenTSDB/opentsdb | src/core/TSQuery.java | TSQuery.buildQueries | public Query[] buildQueries(final TSDB tsdb) {
"""
Compiles the TSQuery into an array of Query objects for execution.
If the user has not set a down sampler explicitly, and they don't want
millisecond resolution, then we set the down sampler to 1 second to handle
situations where storage may have multiple data ... | java | public Query[] buildQueries(final TSDB tsdb) {
try {
return buildQueriesAsync(tsdb).joinUninterruptibly();
} catch (final Exception e) {
throw new RuntimeException("Unexpected exception", e);
}
} | [
"public",
"Query",
"[",
"]",
"buildQueries",
"(",
"final",
"TSDB",
"tsdb",
")",
"{",
"try",
"{",
"return",
"buildQueriesAsync",
"(",
"tsdb",
")",
".",
"joinUninterruptibly",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"Exception",
"e",
")",
"{",
"throw",
... | Compiles the TSQuery into an array of Query objects for execution.
If the user has not set a down sampler explicitly, and they don't want
millisecond resolution, then we set the down sampler to 1 second to handle
situations where storage may have multiple data points per second.
@param tsdb The tsdb to use for {@link T... | [
"Compiles",
"the",
"TSQuery",
"into",
"an",
"array",
"of",
"Query",
"objects",
"for",
"execution",
".",
"If",
"the",
"user",
"has",
"not",
"set",
"a",
"down",
"sampler",
"explicitly",
"and",
"they",
"don",
"t",
"want",
"millisecond",
"resolution",
"then",
... | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSQuery.java#L220-L226 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setNumber | public void setNumber(int index, Number value) {
"""
Set a number value.
@param index number index (1-20)
@param value number value
"""
set(selectField(TaskFieldLists.CUSTOM_NUMBER, index), value);
} | java | public void setNumber(int index, Number value)
{
set(selectField(TaskFieldLists.CUSTOM_NUMBER, index), value);
} | [
"public",
"void",
"setNumber",
"(",
"int",
"index",
",",
"Number",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"CUSTOM_NUMBER",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a number value.
@param index number index (1-20)
@param value number value | [
"Set",
"a",
"number",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L2260-L2263 |
jglobus/JGlobus | gss/src/main/java/org/globus/net/ServerSocketFactory.java | ServerSocketFactory.createServerSocket | private ServerSocket createServerSocket(int backlog, InetAddress binAddr)
throws IOException {
"""
Tries to find first available port within the port range specified.
If it finds a free port, it first checks if the port is not used
by any other server. If it is, it keeps looking for a next available
por... | java | private ServerSocket createServerSocket(int backlog, InetAddress binAddr)
throws IOException {
ServerSocket server = null ;
int port = 0;
while(true) {
port = this.portRange.getFreePort(port);
try {
server = new PrServerSocket(port, backlog, binA... | [
"private",
"ServerSocket",
"createServerSocket",
"(",
"int",
"backlog",
",",
"InetAddress",
"binAddr",
")",
"throws",
"IOException",
"{",
"ServerSocket",
"server",
"=",
"null",
";",
"int",
"port",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"port",
"=",
... | Tries to find first available port within the port range specified.
If it finds a free port, it first checks if the port is not used
by any other server. If it is, it keeps looking for a next available
port. If none found, it throws an exception. If the port is available
the server instance is returned. | [
"Tries",
"to",
"find",
"first",
"available",
"port",
"within",
"the",
"port",
"range",
"specified",
".",
"If",
"it",
"finds",
"a",
"free",
"port",
"it",
"first",
"checks",
"if",
"the",
"port",
"is",
"not",
"used",
"by",
"any",
"other",
"server",
".",
"... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/net/ServerSocketFactory.java#L124-L142 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java | RobustResilienceStrategy.getFailure | @Override
public V getFailure(K key, StoreAccessException e) {
"""
Return null.
@param key the key being retrieved
@param e the triggered failure
@return null
"""
cleanup(key, e);
return null;
} | java | @Override
public V getFailure(K key, StoreAccessException e) {
cleanup(key, e);
return null;
} | [
"@",
"Override",
"public",
"V",
"getFailure",
"(",
"K",
"key",
",",
"StoreAccessException",
"e",
")",
"{",
"cleanup",
"(",
"key",
",",
"e",
")",
";",
"return",
"null",
";",
"}"
] | Return null.
@param key the key being retrieved
@param e the triggered failure
@return null | [
"Return",
"null",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java#L54-L58 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/Word2VecModel.java | Word2VecModel.fromBinFile | public static Word2VecModel fromBinFile(File file)
throws IOException {
"""
Forwards to {@link #fromBinFile(File, ByteOrder, ProfilingTimer)} with the default
ByteOrder.LITTLE_ENDIAN and no ProfilingTimer
"""
return fromBinFile(file, ByteOrder.LITTLE_ENDIAN, ProfilingTimer.NONE);
} | java | public static Word2VecModel fromBinFile(File file)
throws IOException {
return fromBinFile(file, ByteOrder.LITTLE_ENDIAN, ProfilingTimer.NONE);
} | [
"public",
"static",
"Word2VecModel",
"fromBinFile",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"return",
"fromBinFile",
"(",
"file",
",",
"ByteOrder",
".",
"LITTLE_ENDIAN",
",",
"ProfilingTimer",
".",
"NONE",
")",
";",
"}"
] | Forwards to {@link #fromBinFile(File, ByteOrder, ProfilingTimer)} with the default
ByteOrder.LITTLE_ENDIAN and no ProfilingTimer | [
"Forwards",
"to",
"{"
] | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/Word2VecModel.java#L108-L111 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractLongIntMap.java | AbstractLongIntMap.keyOf | public long keyOf(final int value) {
"""
Returns the first key the given value is associated with.
It is often a good idea to first check with {@link #containsValue(int)} whether there exists an association from a key to this value.
Search order is guaranteed to be <i>identical</i> to the order used by method {@... | java | public long keyOf(final int value) {
final long[] foundKey = new long[1];
boolean notFound = forEachPair(
new LongIntProcedure() {
public boolean apply(long iterKey, int iterValue) {
boolean found = value == iterValue;
if (found) foundKey[0] = iterKey;
return !found;
}
}
);
if (notF... | [
"public",
"long",
"keyOf",
"(",
"final",
"int",
"value",
")",
"{",
"final",
"long",
"[",
"]",
"foundKey",
"=",
"new",
"long",
"[",
"1",
"]",
";",
"boolean",
"notFound",
"=",
"forEachPair",
"(",
"new",
"LongIntProcedure",
"(",
")",
"{",
"public",
"boole... | Returns the first key the given value is associated with.
It is often a good idea to first check with {@link #containsValue(int)} whether there exists an association from a key to this value.
Search order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(LongProcedure)}.
@param value ... | [
"Returns",
"the",
"first",
"key",
"the",
"given",
"value",
"is",
"associated",
"with",
".",
"It",
"is",
"often",
"a",
"good",
"idea",
"to",
"first",
"check",
"with",
"{",
"@link",
"#containsValue",
"(",
"int",
")",
"}",
"whether",
"there",
"exists",
"an"... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractLongIntMap.java#L170-L183 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/FullTextMapperV2.java | FullTextMapperV2.getIndexTextForClassifications | public String getIndexTextForClassifications(String guid, List<AtlasClassification> classifications) throws AtlasBaseException {
"""
Map newly associated/defined classifications for the entity with given GUID
@param guid Entity guid
@param classifications new classifications added to the entity
@return Full tex... | java | public String getIndexTextForClassifications(String guid, List<AtlasClassification> classifications) throws AtlasBaseException {
String ret = null;
AtlasEntityWithExtInfo entityWithExtInfo = getAndCacheEntity(guid);
if (entityWithExtInfo != null) {
StringBuilder... | [
"public",
"String",
"getIndexTextForClassifications",
"(",
"String",
"guid",
",",
"List",
"<",
"AtlasClassification",
">",
"classifications",
")",
"throws",
"AtlasBaseException",
"{",
"String",
"ret",
"=",
"null",
";",
"AtlasEntityWithExtInfo",
"entityWithExtInfo",
"=",... | Map newly associated/defined classifications for the entity with given GUID
@param guid Entity guid
@param classifications new classifications added to the entity
@return Full text string ONLY for the added classifications
@throws AtlasBaseException | [
"Map",
"newly",
"associated",
"/",
"defined",
"classifications",
"for",
"the",
"entity",
"with",
"given",
"GUID"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/FullTextMapperV2.java#L67-L90 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java | AbstractManagedType.isSetAttribute | private boolean isSetAttribute(PluralAttribute<? super X, ?, ?> attribute) {
"""
Checks if is sets the attribute.
@param attribute
the attribute
@return true, if is sets the attribute
"""
return attribute != null && attribute.getCollectionType().equals(CollectionType.SET);
} | java | private boolean isSetAttribute(PluralAttribute<? super X, ?, ?> attribute)
{
return attribute != null && attribute.getCollectionType().equals(CollectionType.SET);
} | [
"private",
"boolean",
"isSetAttribute",
"(",
"PluralAttribute",
"<",
"?",
"super",
"X",
",",
"?",
",",
"?",
">",
"attribute",
")",
"{",
"return",
"attribute",
"!=",
"null",
"&&",
"attribute",
".",
"getCollectionType",
"(",
")",
".",
"equals",
"(",
"Collect... | Checks if is sets the attribute.
@param attribute
the attribute
@return true, if is sets the attribute | [
"Checks",
"if",
"is",
"sets",
"the",
"attribute",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java#L1051-L1054 |
Daytron/SimpleDialogFX | src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java | Dialog.setFontSize | public void setFontSize(int header_font_size, int details_font_size) {
"""
Sets both font sizes in pixels for the header and the details label with
two font sizes <code>integer</code> parameters given.
@param header_font_size The header font size in pixels
@param details_font_size The details font size in pix... | java | public void setFontSize(int header_font_size, int details_font_size) {
this.headerLabel
.setStyle("-fx-font-size:" + Integer.toString(header_font_size) + "px;");
this.detailsLabel
.setStyle("-fx-font-size:" + Integer.toString(details_font_size) + "px;");
} | [
"public",
"void",
"setFontSize",
"(",
"int",
"header_font_size",
",",
"int",
"details_font_size",
")",
"{",
"this",
".",
"headerLabel",
".",
"setStyle",
"(",
"\"-fx-font-size:\"",
"+",
"Integer",
".",
"toString",
"(",
"header_font_size",
")",
"+",
"\"px;\"",
")"... | Sets both font sizes in pixels for the header and the details label with
two font sizes <code>integer</code> parameters given.
@param header_font_size The header font size in pixels
@param details_font_size The details font size in pixels | [
"Sets",
"both",
"font",
"sizes",
"in",
"pixels",
"for",
"the",
"header",
"and",
"the",
"details",
"label",
"with",
"two",
"font",
"sizes",
"<code",
">",
"integer<",
"/",
"code",
">",
"parameters",
"given",
"."
] | train | https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L746-L751 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.translationRotate | public Matrix4x3f translationRotate(float tx, float ty, float tz, Quaternionfc quat) {
"""
Set <code>this</code> matrix to <code>T * R</code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code> and
<code>R</code> is a rotation transformation specified by the given quaternion.
<p>
When ... | java | public Matrix4x3f translationRotate(float tx, float ty, float tz, Quaternionfc quat) {
float dqx = quat.x() + quat.x();
float dqy = quat.y() + quat.y();
float dqz = quat.z() + quat.z();
float q00 = dqx * quat.x();
float q11 = dqy * quat.y();
float q22 = dqz * quat.z();
... | [
"public",
"Matrix4x3f",
"translationRotate",
"(",
"float",
"tx",
",",
"float",
"ty",
",",
"float",
"tz",
",",
"Quaternionfc",
"quat",
")",
"{",
"float",
"dqx",
"=",
"quat",
".",
"x",
"(",
")",
"+",
"quat",
".",
"x",
"(",
")",
";",
"float",
"dqy",
"... | Set <code>this</code> matrix to <code>T * R</code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code> and
<code>R</code> is a rotation transformation specified by the given quaternion.
<p>
When transforming a vector by the resulting matrix the rotation transformation will be applied first and... | [
"Set",
"<code",
">",
"this<",
"/",
"code",
">",
"matrix",
"to",
"<code",
">",
"T",
"*",
"R<",
"/",
"code",
">",
"where",
"<code",
">",
"T<",
"/",
"code",
">",
"is",
"a",
"translation",
"by",
"the",
"given",
"<code",
">",
"(",
"tx",
"ty",
"tz",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L2900-L2927 |
mgormley/prim | src/main/java/edu/jhu/prim/arrays/Multinomials.java | Multinomials.assertLogNormalized | public static void assertLogNormalized(double[] logProps, double delta) {
"""
Asserts that the parameters are log-normalized within some delta.
"""
double logPropSum = DoubleArrays.logSum(logProps);
assert(Primitives.equals(0.0, logPropSum, delta));
} | java | public static void assertLogNormalized(double[] logProps, double delta) {
double logPropSum = DoubleArrays.logSum(logProps);
assert(Primitives.equals(0.0, logPropSum, delta));
} | [
"public",
"static",
"void",
"assertLogNormalized",
"(",
"double",
"[",
"]",
"logProps",
",",
"double",
"delta",
")",
"{",
"double",
"logPropSum",
"=",
"DoubleArrays",
".",
"logSum",
"(",
"logProps",
")",
";",
"assert",
"(",
"Primitives",
".",
"equals",
"(",
... | Asserts that the parameters are log-normalized within some delta. | [
"Asserts",
"that",
"the",
"parameters",
"are",
"log",
"-",
"normalized",
"within",
"some",
"delta",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/arrays/Multinomials.java#L91-L94 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.countParameterOfType | public static int countParameterOfType(ModelMethod method, TypeName parameter) {
"""
Count parameter of type.
@param method
the method
@param parameter
the parameter
@return the int
"""
int counter = 0;
for (Pair<String, TypeName> item : method.getParameters()) {
if (item.value1.equals(parameter)... | java | public static int countParameterOfType(ModelMethod method, TypeName parameter) {
int counter = 0;
for (Pair<String, TypeName> item : method.getParameters()) {
if (item.value1.equals(parameter)) {
counter++;
}
}
return counter;
} | [
"public",
"static",
"int",
"countParameterOfType",
"(",
"ModelMethod",
"method",
",",
"TypeName",
"parameter",
")",
"{",
"int",
"counter",
"=",
"0",
";",
"for",
"(",
"Pair",
"<",
"String",
",",
"TypeName",
">",
"item",
":",
"method",
".",
"getParameters",
... | Count parameter of type.
@param method
the method
@param parameter
the parameter
@return the int | [
"Count",
"parameter",
"of",
"type",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L401-L410 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.tracef | public void tracef(Throwable t, String format, Object... params) {
"""
Issue a formatted log message with a level of TRACE.
@param t the throwable
@param format the format string, as per {@link String#format(String, Object...)}
@param params the parameters
"""
doLogf(Level.TRACE, FQCN, format, par... | java | public void tracef(Throwable t, String format, Object... params) {
doLogf(Level.TRACE, FQCN, format, params, t);
} | [
"public",
"void",
"tracef",
"(",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLogf",
"(",
"Level",
".",
"TRACE",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"t",
")",
";",
"}"
] | Issue a formatted log message with a level of TRACE.
@param t the throwable
@param format the format string, as per {@link String#format(String, Object...)}
@param params the parameters | [
"Issue",
"a",
"formatted",
"log",
"message",
"with",
"a",
"level",
"of",
"TRACE",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L326-L328 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/PropertyDefinitionId.java | PropertyDefinitionId.fromString | public static PropertyDefinitionId fromString( String definition,
NameFactory factory ) {
"""
Parse the supplied string for of an identifer, and return the object form for that identifier.
@param definition the {@link #getString() string form of the identifier}... | java | public static PropertyDefinitionId fromString( String definition,
NameFactory factory ) {
String[] parts = definition.split("/");
String nodeTypeNameString = parts[0];
String propertyDefinitionNameString = parts[1];
Name nodeTypeName = f... | [
"public",
"static",
"PropertyDefinitionId",
"fromString",
"(",
"String",
"definition",
",",
"NameFactory",
"factory",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"definition",
".",
"split",
"(",
"\"/\"",
")",
";",
"String",
"nodeTypeNameString",
"=",
"parts",
... | Parse the supplied string for of an identifer, and return the object form for that identifier.
@param definition the {@link #getString() string form of the identifier}; may not be null
@param factory the factory that should be used to create Name objects; may not be null
@return the object form of the identifier; neve... | [
"Parse",
"the",
"supplied",
"string",
"for",
"of",
"an",
"identifer",
"and",
"return",
"the",
"object",
"form",
"for",
"that",
"identifier",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/PropertyDefinitionId.java#L147-L157 |
apache/groovy | src/main/groovy/groovy/lang/ExpandoMetaClass.java | ExpandoMetaClass.getProperty | public Object getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass) {
"""
Overrides default implementation just in case getProperty method has been overridden by ExpandoMetaClass
@see MetaClassImpl#getProperty(Class, Object, String, boolean, boolean)
"""
if... | java | public Object getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass) {
if (hasOverrideGetProperty(name) && getJavaClass().isInstance(object)) {
return getPropertyMethod.invoke(object, new Object[]{name});
}
if ("mixedIn".equals(name)) {
... | [
"public",
"Object",
"getProperty",
"(",
"Class",
"sender",
",",
"Object",
"object",
",",
"String",
"name",
",",
"boolean",
"useSuper",
",",
"boolean",
"fromInsideClass",
")",
"{",
"if",
"(",
"hasOverrideGetProperty",
"(",
"name",
")",
"&&",
"getJavaClass",
"("... | Overrides default implementation just in case getProperty method has been overridden by ExpandoMetaClass
@see MetaClassImpl#getProperty(Class, Object, String, boolean, boolean) | [
"Overrides",
"default",
"implementation",
"just",
"in",
"case",
"getProperty",
"method",
"has",
"been",
"overridden",
"by",
"ExpandoMetaClass"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/ExpandoMetaClass.java#L1146-L1156 |
classgraph/classgraph | src/main/java/io/github/classgraph/ResourceList.java | ResourceList.forEachByteArray | public void forEachByteArray(final ByteArrayConsumer byteArrayConsumer, final boolean ignoreIOExceptions) {
"""
Fetch the content of each {@link Resource} in this {@link ResourceList} as a byte array, pass the byte array
to the given {@link ByteArrayConsumer}, then close the underlying InputStream or release the ... | java | public void forEachByteArray(final ByteArrayConsumer byteArrayConsumer, final boolean ignoreIOExceptions) {
for (final Resource resource : this) {
try {
final byte[] resourceContent = resource.load();
byteArrayConsumer.accept(resource, resourceContent);
} ... | [
"public",
"void",
"forEachByteArray",
"(",
"final",
"ByteArrayConsumer",
"byteArrayConsumer",
",",
"final",
"boolean",
"ignoreIOExceptions",
")",
"{",
"for",
"(",
"final",
"Resource",
"resource",
":",
"this",
")",
"{",
"try",
"{",
"final",
"byte",
"[",
"]",
"r... | Fetch the content of each {@link Resource} in this {@link ResourceList} as a byte array, pass the byte array
to the given {@link ByteArrayConsumer}, then close the underlying InputStream or release the underlying
ByteBuffer by calling {@link Resource#close()}.
@param byteArrayConsumer
The {@link ByteArrayConsumer}.
@p... | [
"Fetch",
"the",
"content",
"of",
"each",
"{",
"@link",
"Resource",
"}",
"in",
"this",
"{",
"@link",
"ResourceList",
"}",
"as",
"a",
"byte",
"array",
"pass",
"the",
"byte",
"array",
"to",
"the",
"given",
"{",
"@link",
"ByteArrayConsumer",
"}",
"then",
"cl... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ResourceList.java#L329-L342 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/writer/FileAwareInputStreamDataWriter.java | FileAwareInputStreamDataWriter.safeSetPathPermission | private void safeSetPathPermission(Path path, OwnerAndPermission ownerAndPermission) {
"""
Sets the {@link FsPermission}, owner, group for the path passed. It will not throw exceptions, if operations
cannot be executed, will warn and continue.
"""
try {
if (ownerAndPermission.getFsPermission() != n... | java | private void safeSetPathPermission(Path path, OwnerAndPermission ownerAndPermission) {
try {
if (ownerAndPermission.getFsPermission() != null) {
this.fs.setPermission(path, ownerAndPermission.getFsPermission());
}
} catch (IOException ioe) {
log.warn("Failed to set permission for dire... | [
"private",
"void",
"safeSetPathPermission",
"(",
"Path",
"path",
",",
"OwnerAndPermission",
"ownerAndPermission",
")",
"{",
"try",
"{",
"if",
"(",
"ownerAndPermission",
".",
"getFsPermission",
"(",
")",
"!=",
"null",
")",
"{",
"this",
".",
"fs",
".",
"setPermi... | Sets the {@link FsPermission}, owner, group for the path passed. It will not throw exceptions, if operations
cannot be executed, will warn and continue. | [
"Sets",
"the",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/writer/FileAwareInputStreamDataWriter.java#L333-L353 |
tweea/matrixjavalib-main-common | src/main/java/net/matrix/lang/Objects2.java | Objects2.nullIf | public static <T> T nullIf(final T value, final T value2) {
"""
如果两个对象中有 null 值或两个对象相同,返回 null,否则返回对象 1。
@param value
对象 1
@param value2
对象 2
@param <T>
对象类型
@return 结果
"""
if (value == null || value2 == null) {
return null;
}
if (value.equals(value2)) {
return null;
}
return value;
} | java | public static <T> T nullIf(final T value, final T value2) {
if (value == null || value2 == null) {
return null;
}
if (value.equals(value2)) {
return null;
}
return value;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"nullIf",
"(",
"final",
"T",
"value",
",",
"final",
"T",
"value2",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value2",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"value",
".",
... | 如果两个对象中有 null 值或两个对象相同,返回 null,否则返回对象 1。
@param value
对象 1
@param value2
对象 2
@param <T>
对象类型
@return 结果 | [
"如果两个对象中有",
"null",
"值或两个对象相同,返回",
"null,否则返回对象",
"1。"
] | train | https://github.com/tweea/matrixjavalib-main-common/blob/ac8f98322a422e3ef76c3e12d47b98268cec7006/src/main/java/net/matrix/lang/Objects2.java#L46-L54 |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java | CommunicationManager.addTorrent | public TorrentManager addTorrent(String dotTorrentFilePath, String downloadDirPath, List<TorrentListener> listeners) throws IOException {
"""
Adds torrent to storage with specified listeners, validate downloaded files and start seeding and leeching the torrent
@param dotTorrentFilePath path to torrent metadata ... | java | public TorrentManager addTorrent(String dotTorrentFilePath, String downloadDirPath, List<TorrentListener> listeners) throws IOException {
return addTorrent(dotTorrentFilePath, downloadDirPath, FairPieceStorageFactory.INSTANCE, listeners);
} | [
"public",
"TorrentManager",
"addTorrent",
"(",
"String",
"dotTorrentFilePath",
",",
"String",
"downloadDirPath",
",",
"List",
"<",
"TorrentListener",
">",
"listeners",
")",
"throws",
"IOException",
"{",
"return",
"addTorrent",
"(",
"dotTorrentFilePath",
",",
"download... | Adds torrent to storage with specified listeners, validate downloaded files and start seeding and leeching the torrent
@param dotTorrentFilePath path to torrent metadata file
@param downloadDirPath path to directory where downloaded files are placed
@param listeners specified listeners
@return {@link Torre... | [
"Adds",
"torrent",
"to",
"storage",
"with",
"specified",
"listeners",
"validate",
"downloaded",
"files",
"and",
"start",
"seeding",
"and",
"leeching",
"the",
"torrent"
] | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java#L142-L144 |
Alluxio/alluxio | examples/src/main/java/alluxio/examples/Performance.java | Performance.logPerIteration | public static void logPerIteration(long startTimeMs, int times, String msg, int workerId) {
"""
Writes log information.
@param startTimeMs the start time in milliseconds
@param times the number of the iteration
@param msg the message
@param workerId the id of the worker
"""
long takenTimeMs = System.... | java | public static void logPerIteration(long startTimeMs, int times, String msg, int workerId) {
long takenTimeMs = System.currentTimeMillis() - startTimeMs;
double result = 1000.0 * sFileBytes / takenTimeMs / 1024 / 1024;
LOG.info(times + msg + workerId + " : " + result + " Mb/sec. Took " + takenTimeMs + " ms. ... | [
"public",
"static",
"void",
"logPerIteration",
"(",
"long",
"startTimeMs",
",",
"int",
"times",
",",
"String",
"msg",
",",
"int",
"workerId",
")",
"{",
"long",
"takenTimeMs",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"startTimeMs",
";",
"double... | Writes log information.
@param startTimeMs the start time in milliseconds
@param times the number of the iteration
@param msg the message
@param workerId the id of the worker | [
"Writes",
"log",
"information",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/examples/src/main/java/alluxio/examples/Performance.java#L75-L79 |
google/error-prone | check_api/src/main/java/com/google/errorprone/apply/SourceFile.java | SourceFile.replaceLines | public void replaceLines(int startLine, int endLine, List<String> replacementLines) {
"""
Replace the source code between the start and end lines with some new lines of code.
"""
Preconditions.checkArgument(startLine <= endLine);
List<String> originalLines = getLines();
List<String> newLines = new ... | java | public void replaceLines(int startLine, int endLine, List<String> replacementLines) {
Preconditions.checkArgument(startLine <= endLine);
List<String> originalLines = getLines();
List<String> newLines = new ArrayList<>();
for (int i = 0; i < originalLines.size(); i++) {
int lineNum = i + 1;
i... | [
"public",
"void",
"replaceLines",
"(",
"int",
"startLine",
",",
"int",
"endLine",
",",
"List",
"<",
"String",
">",
"replacementLines",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"startLine",
"<=",
"endLine",
")",
";",
"List",
"<",
"String",
">",
... | Replace the source code between the start and end lines with some new lines of code. | [
"Replace",
"the",
"source",
"code",
"between",
"the",
"start",
"and",
"end",
"lines",
"with",
"some",
"new",
"lines",
"of",
"code",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/apply/SourceFile.java#L127-L142 |
spring-projects/spring-mobile | spring-mobile-device/src/main/java/org/springframework/mobile/device/switcher/StandardSiteSwitcherHandlerFactory.java | StandardSiteSwitcherHandlerFactory.urlPath | public static SiteSwitcherHandler urlPath(String mobilePath) {
"""
Creates a site switcher that redirects to a path on the current domain for normal site requests that either
originate from a mobile device or indicate a mobile site preference.
Uses a {@link CookieSitePreferenceRepository} that saves a cookie tha... | java | public static SiteSwitcherHandler urlPath(String mobilePath) {
return new StandardSiteSwitcherHandler(
new NormalSitePathUrlFactory(mobilePath),
new MobileSitePathUrlFactory(mobilePath, null),
null,
new StandardSitePreferenceHandler(new CookieSitePreferenceRepository()),
false);
} | [
"public",
"static",
"SiteSwitcherHandler",
"urlPath",
"(",
"String",
"mobilePath",
")",
"{",
"return",
"new",
"StandardSiteSwitcherHandler",
"(",
"new",
"NormalSitePathUrlFactory",
"(",
"mobilePath",
")",
",",
"new",
"MobileSitePathUrlFactory",
"(",
"mobilePath",
",",
... | Creates a site switcher that redirects to a path on the current domain for normal site requests that either
originate from a mobile device or indicate a mobile site preference.
Uses a {@link CookieSitePreferenceRepository} that saves a cookie that is stored on the root path. | [
"Creates",
"a",
"site",
"switcher",
"that",
"redirects",
"to",
"a",
"path",
"on",
"the",
"current",
"domain",
"for",
"normal",
"site",
"requests",
"that",
"either",
"originate",
"from",
"a",
"mobile",
"device",
"or",
"indicate",
"a",
"mobile",
"site",
"prefe... | train | https://github.com/spring-projects/spring-mobile/blob/a402cbcaf208e24288b957f44c9984bd6e8bf064/spring-mobile-device/src/main/java/org/springframework/mobile/device/switcher/StandardSiteSwitcherHandlerFactory.java#L131-L138 |
EdwardRaff/JSAT | JSAT/src/jsat/math/integration/Romberg.java | Romberg.romb | public static double romb(Function1D f, double a, double b, int max) {
"""
Numerically computes the integral of the given function
@param f the function to integrate
@param a the lower limit of the integral
@param b the upper limit of the integral
@param max the maximum number of extrapolation steps to perfo... | java | public static double romb(Function1D f, double a, double b, int max)
{
// see http://en.wikipedia.org/wiki/Romberg's_method
max+=1;
double[] s = new double[max];//first index will not be used
double var = 0;//var is used to hold the value R(n-1,m-1), from the previous row so t... | [
"public",
"static",
"double",
"romb",
"(",
"Function1D",
"f",
",",
"double",
"a",
",",
"double",
"b",
",",
"int",
"max",
")",
"{",
"// see http://en.wikipedia.org/wiki/Romberg's_method\r",
"max",
"+=",
"1",
";",
"double",
"[",
"]",
"s",
"=",
"new",
"double",... | Numerically computes the integral of the given function
@param f the function to integrate
@param a the lower limit of the integral
@param b the upper limit of the integral
@param max the maximum number of extrapolation steps to perform.
∫<sub>a</sub><sup>b</sup>f(x) , dx | [
"Numerically",
"computes",
"the",
"integral",
"of",
"the",
"given",
"function"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/integration/Romberg.java#L38-L71 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/ObjectUtils.java | ObjectUtils.containsElement | public static boolean containsElement(@Nullable final Object[] array, final Object element) {
"""
Check whether the given array contains the given element.
@param array the array to check (may be {@code null}, in which case the return value will
always be {@code false})
@param element the element to check for... | java | public static boolean containsElement(@Nullable final Object[] array, final Object element) {
if (array == null) {
return false;
}
for (final Object arrayEle : array) {
if (ObjectUtils.nullSafeEquals(arrayEle, element)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsElement",
"(",
"@",
"Nullable",
"final",
"Object",
"[",
"]",
"array",
",",
"final",
"Object",
"element",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"final",
"Ob... | Check whether the given array contains the given element.
@param array the array to check (may be {@code null}, in which case the return value will
always be {@code false})
@param element the element to check for
@return whether the element has been found in the given array | [
"Check",
"whether",
"the",
"given",
"array",
"contains",
"the",
"given",
"element",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/ObjectUtils.java#L198-L208 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/SpatialUtil.java | SpatialUtil.unionTolerant | public static ModifiableHyperBoundingBox unionTolerant(SpatialComparable mbr1, SpatialComparable mbr2) {
"""
Returns the union of the two specified MBRs. Tolerant of "null" values.
@param mbr1 the first MBR
@param mbr2 the second MBR
@return the union of the two specified MBRs
"""
if(mbr1 == null && m... | java | public static ModifiableHyperBoundingBox unionTolerant(SpatialComparable mbr1, SpatialComparable mbr2) {
if(mbr1 == null && mbr2 == null) {
return null;
}
if(mbr1 == null) {
// Clone - intentionally
return new ModifiableHyperBoundingBox(mbr2);
}
if(mbr2 == null) {
// Clone - ... | [
"public",
"static",
"ModifiableHyperBoundingBox",
"unionTolerant",
"(",
"SpatialComparable",
"mbr1",
",",
"SpatialComparable",
"mbr2",
")",
"{",
"if",
"(",
"mbr1",
"==",
"null",
"&&",
"mbr2",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"mb... | Returns the union of the two specified MBRs. Tolerant of "null" values.
@param mbr1 the first MBR
@param mbr2 the second MBR
@return the union of the two specified MBRs | [
"Returns",
"the",
"union",
"of",
"the",
"two",
"specified",
"MBRs",
".",
"Tolerant",
"of",
"null",
"values",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/SpatialUtil.java#L395-L408 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/classfile/ClassFile.java | ClassFile.addConstructor | public MethodInfo addConstructor(Modifiers modifiers,
TypeDesc... params) {
"""
Add a constructor to this class.
@param params May be null if constructor accepts no parameters.
"""
String[] paramNames = MethodDesc.createGenericParameterNames(params);
retu... | java | public MethodInfo addConstructor(Modifiers modifiers,
TypeDesc... params) {
String[] paramNames = MethodDesc.createGenericParameterNames(params);
return addConstructor(modifiers, params, paramNames);
} | [
"public",
"MethodInfo",
"addConstructor",
"(",
"Modifiers",
"modifiers",
",",
"TypeDesc",
"...",
"params",
")",
"{",
"String",
"[",
"]",
"paramNames",
"=",
"MethodDesc",
".",
"createGenericParameterNames",
"(",
"params",
")",
";",
"return",
"addConstructor",
"(",
... | Add a constructor to this class.
@param params May be null if constructor accepts no parameters. | [
"Add",
"a",
"constructor",
"to",
"this",
"class",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/ClassFile.java#L630-L634 |
landawn/AbacusUtil | src/com/landawn/abacus/util/RegExUtil.java | RegExUtil.removePattern | public static String removePattern(final String text, final String regex) {
"""
<p>Removes each substring of the source String that matches the given regular expression using the DOTALL option.</p>
This call is a {@code null} safe equivalent to:
<ul>
<li>{@code text.replaceAll("(?s)" + regex, N.EMPT... | java | public static String removePattern(final String text, final String regex) {
return replacePattern(text, regex, N.EMPTY_STRING);
} | [
"public",
"static",
"String",
"removePattern",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"regex",
")",
"{",
"return",
"replacePattern",
"(",
"text",
",",
"regex",
",",
"N",
".",
"EMPTY_STRING",
")",
";",
"}"
] | <p>Removes each substring of the source String that matches the given regular expression using the DOTALL option.</p>
This call is a {@code null} safe equivalent to:
<ul>
<li>{@code text.replaceAll("(?s)" + regex, N.EMPTY_STRING)}</li>
<li>{@code Pattern.compile(regex, Pattern.DOTALL).matcher(text).replaceAl... | [
"<p",
">",
"Removes",
"each",
"substring",
"of",
"the",
"source",
"String",
"that",
"matches",
"the",
"given",
"regular",
"expression",
"using",
"the",
"DOTALL",
"option",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/RegExUtil.java#L226-L228 |
devnull-tools/kodo | src/main/java/tools/devnull/kodo/Expectation.java | Expectation.throwAssertionError | public static Consumer throwAssertionError(String format) {
"""
Returns a consumer that throws an {@link AssertionError} based on the
given object.
@param format the format to apply to the message
(see {@link String#format(String, Object...)}), there will
be only one parameter to the message
@return a consu... | java | public static Consumer throwAssertionError(String format) {
return object -> {
throw new AssertionError(String.format(format, object));
};
} | [
"public",
"static",
"Consumer",
"throwAssertionError",
"(",
"String",
"format",
")",
"{",
"return",
"object",
"->",
"{",
"throw",
"new",
"AssertionError",
"(",
"String",
".",
"format",
"(",
"format",
",",
"object",
")",
")",
";",
"}",
";",
"}"
] | Returns a consumer that throws an {@link AssertionError} based on the
given object.
@param format the format to apply to the message
(see {@link String#format(String, Object...)}), there will
be only one parameter to the message
@return a consumer object
@since 3.2 | [
"Returns",
"a",
"consumer",
"that",
"throws",
"an",
"{",
"@link",
"AssertionError",
"}",
"based",
"on",
"the",
"given",
"object",
"."
] | train | https://github.com/devnull-tools/kodo/blob/02448b8fe8308a78116de650bc077e196b100999/src/main/java/tools/devnull/kodo/Expectation.java#L251-L255 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_dialplan_dialplanId_GET | public OvhOvhPabxDialplan billingAccount_ovhPabx_serviceName_dialplan_dialplanId_GET(String billingAccount, String serviceName, Long dialplanId) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}
@param billingAccount [required]... | java | public OvhOvhPabxDialplan billingAccount_ovhPabx_serviceName_dialplan_dialplanId_GET(String billingAccount, String serviceName, Long dialplanId) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}";
StringBuilder sb = path(qPath, billingAccount, serviceName, ... | [
"public",
"OvhOvhPabxDialplan",
"billingAccount_ovhPabx_serviceName_dialplan_dialplanId_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"dialplanId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/ovhP... | Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param dialplanId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7371-L7376 |
rhiot/rhiot | gateway/components/camel-webcam/src/main/java/io/rhiot/gateway/camel/webcam/WebcamHelper.java | WebcamHelper.consumeWebcamMotionEvent | public static void consumeWebcamMotionEvent(WebcamMotionEvent motionEvent, Processor processor, WebcamEndpoint endpoint, ExceptionHandler exceptionHandler) {
"""
Consume the motion event from the webcam, all params required.
The event is stored in the header while the latest image is available as the body.
@pa... | java | public static void consumeWebcamMotionEvent(WebcamMotionEvent motionEvent, Processor processor, WebcamEndpoint endpoint, ExceptionHandler exceptionHandler){
Validate.notNull(motionEvent);
Validate.notNull(processor);
Validate.notNull(endpoint);
try {
Exchange exchange = crea... | [
"public",
"static",
"void",
"consumeWebcamMotionEvent",
"(",
"WebcamMotionEvent",
"motionEvent",
",",
"Processor",
"processor",
",",
"WebcamEndpoint",
"endpoint",
",",
"ExceptionHandler",
"exceptionHandler",
")",
"{",
"Validate",
".",
"notNull",
"(",
"motionEvent",
")",... | Consume the motion event from the webcam, all params required.
The event is stored in the header while the latest image is available as the body.
@param motionEvent The motion event that triggered.
@param processor Processor that handles the exchange.
@param endpoint WebcamEndpoint receiving the exchange. | [
"Consume",
"the",
"motion",
"event",
"from",
"the",
"webcam",
"all",
"params",
"required",
".",
"The",
"event",
"is",
"stored",
"in",
"the",
"header",
"while",
"the",
"latest",
"image",
"is",
"available",
"as",
"the",
"body",
"."
] | train | https://github.com/rhiot/rhiot/blob/82eac10e365f72bab9248b8c3bd0ec9a2fc0a721/gateway/components/camel-webcam/src/main/java/io/rhiot/gateway/camel/webcam/WebcamHelper.java#L87-L99 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java | WCheckBoxSelectExample.addExampleUsingLookupTable | private void addExampleUsingLookupTable() {
"""
This example creates the WCheckBoxSelect using an a look up table. All other optional properties are in their default state.
<p>Note for Framework devs: the unit tests for this Example are used to test the Selenium WebElement extension and this example is expected
... | java | private void addExampleUsingLookupTable() {
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using a lookup table"));
final WCheckBoxSelect select = new WCheckBoxSelect("australian_state");
final WTextField text = new WTextField();
text.setReadOnly(true);
text.setText(NO_SELECTION);
WButton updat... | [
"private",
"void",
"addExampleUsingLookupTable",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"WCheckBoxSelect created using a lookup table\"",
")",
")",
";",
"final",
"WCheckBoxSelect",
"select",
"=",
"new",
"WCheckBoxSelect",
... | This example creates the WCheckBoxSelect using an a look up table. All other optional properties are in their default state.
<p>Note for Framework devs: the unit tests for this Example are used to test the Selenium WebElement extension and this example is expected
to be: the first WCheckBoxSelect in the example; and to... | [
"This",
"example",
"creates",
"the",
"WCheckBoxSelect",
"using",
"an",
"a",
"look",
"up",
"table",
".",
"All",
"other",
"optional",
"properties",
"are",
"in",
"their",
"default",
"state",
".",
"<p",
">",
"Note",
"for",
"Framework",
"devs",
":",
"the",
"uni... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L83-L105 |
gallandarakhneorg/afc | advanced/shapefile/src/main/java/org/arakhne/afc/io/shape/AbstractCommonShapeFileWriter.java | AbstractCommonShapeFileWriter.writeHeader | private void writeHeader(ESRIBounds box, ShapeElementType type, Collection<? extends E> elements) throws IOException {
"""
Write the header of a Shape file.
@param box is the bounds of the data in the shape file.
@param stream is the output stream
@param type is the type of the elements.
@param elements are ... | java | private void writeHeader(ESRIBounds box, ShapeElementType type, Collection<? extends E> elements) throws IOException {
if (!this.headerWasWritten) {
initializeContentBuffer();
box.ensureMinMax();
//Byte 0 : File Code (9994)
writeBEInt(SHAPE_FILE_CODE);
//Byte 4 : Unused (0)
writeBEInt(0);
//Byt... | [
"private",
"void",
"writeHeader",
"(",
"ESRIBounds",
"box",
",",
"ShapeElementType",
"type",
",",
"Collection",
"<",
"?",
"extends",
"E",
">",
"elements",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"this",
".",
"headerWasWritten",
")",
"{",
"initiali... | Write the header of a Shape file.
@param box is the bounds of the data in the shape file.
@param stream is the output stream
@param type is the type of the elements.
@param elements are the elements which are caused the header to be written.
@throws IOException in case of error. | [
"Write",
"the",
"header",
"of",
"a",
"Shape",
"file",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/shapefile/src/main/java/org/arakhne/afc/io/shape/AbstractCommonShapeFileWriter.java#L269-L315 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.createJob | @Deprecated
public CreateJobResponse createJob(CreateJobRequest request) {
"""
Creates a new transcoder job which converts media files in BOS buckets with specified preset.
@param request The request object containing all options for creating a job.
@return The newly created job ID.
@deprecated As of re... | java | @Deprecated
public CreateJobResponse createJob(CreateJobRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getPipelineName(),
"The parameter pipelineName should NOT be null or empty string.");
checkNotNu... | [
"@",
"Deprecated",
"public",
"CreateJobResponse",
"createJob",
"(",
"CreateJobRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getPipelineName",
"(",... | Creates a new transcoder job which converts media files in BOS buckets with specified preset.
@param request The request object containing all options for creating a job.
@return The newly created job ID.
@deprecated As of release 0.8.5, replaced by {@link #createTranscodingJob(CreateTranscodingJobRequest)}} | [
"Creates",
"a",
"new",
"transcoder",
"job",
"which",
"converts",
"media",
"files",
"in",
"BOS",
"buckets",
"with",
"specified",
"preset",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L205-L223 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java | SARLEclipsePlugin.createStatus | public IStatus createStatus(int severity, int code, Throwable cause) {
"""
Create a status.
@param severity the severity level, see {@link IStatus}.
@param code the code of the error.
@param cause the cause of the problem.
@return the status.
"""
return createStatus(severity, code, null, cause);
} | java | public IStatus createStatus(int severity, int code, Throwable cause) {
return createStatus(severity, code, null, cause);
} | [
"public",
"IStatus",
"createStatus",
"(",
"int",
"severity",
",",
"int",
"code",
",",
"Throwable",
"cause",
")",
"{",
"return",
"createStatus",
"(",
"severity",
",",
"code",
",",
"null",
",",
"cause",
")",
";",
"}"
] | Create a status.
@param severity the severity level, see {@link IStatus}.
@param code the code of the error.
@param cause the cause of the problem.
@return the status. | [
"Create",
"a",
"status",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L208-L210 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/captcha/draw/CaptchaPanel.java | CaptchaPanel.newImage | protected Image newImage(final String id, final IResource imageResource) {
"""
Factory method for creating a new {@link Image}. This method is invoked in the constructor
from the derived classes and can be overridden so users can provide their own version of a
Button.
@param id
the wicket id
@param imageRes... | java | protected Image newImage(final String id, final IResource imageResource)
{
return ComponentFactory.newImage(id, imageResource);
} | [
"protected",
"Image",
"newImage",
"(",
"final",
"String",
"id",
",",
"final",
"IResource",
"imageResource",
")",
"{",
"return",
"ComponentFactory",
".",
"newImage",
"(",
"id",
",",
"imageResource",
")",
";",
"}"
] | Factory method for creating a new {@link Image}. This method is invoked in the constructor
from the derived classes and can be overridden so users can provide their own version of a
Button.
@param id
the wicket id
@param imageResource
the image resource.
@return the new {@link Image} | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"{",
"@link",
"Image",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"the... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/captcha/draw/CaptchaPanel.java#L92-L95 |
looly/hutool | hutool-dfa/src/main/java/cn/hutool/dfa/SensitiveUtil.java | SensitiveUtil.init | public static void init(String sensitiveWords, char separator, boolean isAsync) {
"""
初始化敏感词树
@param sensitiveWords 敏感词列表组成的字符串
@param isAsync 是否异步初始化
@param separator 分隔符
"""
if(StrUtil.isNotBlank(sensitiveWords)){
init(StrUtil.split(sensitiveWords, separator), isAsync);
}
} | java | public static void init(String sensitiveWords, char separator, boolean isAsync){
if(StrUtil.isNotBlank(sensitiveWords)){
init(StrUtil.split(sensitiveWords, separator), isAsync);
}
} | [
"public",
"static",
"void",
"init",
"(",
"String",
"sensitiveWords",
",",
"char",
"separator",
",",
"boolean",
"isAsync",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isNotBlank",
"(",
"sensitiveWords",
")",
")",
"{",
"init",
"(",
"StrUtil",
".",
"split",
"(",
... | 初始化敏感词树
@param sensitiveWords 敏感词列表组成的字符串
@param isAsync 是否异步初始化
@param separator 分隔符 | [
"初始化敏感词树"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-dfa/src/main/java/cn/hutool/dfa/SensitiveUtil.java#L65-L69 |
google/closure-templates | java/src/com/google/template/soy/sharedpasses/render/RenderException.java | RenderException.addStackTraceElement | RenderException addStackTraceElement(SoyNode node) {
"""
Add a partial stack trace element by specifying the source location of the soy file.
"""
// Typically, this is fast since templates aren't that deep and we only do this in error
// situations so performance matters less.
TemplateNode template... | java | RenderException addStackTraceElement(SoyNode node) {
// Typically, this is fast since templates aren't that deep and we only do this in error
// situations so performance matters less.
TemplateNode template = node.getNearestAncestor(TemplateNode.class);
return addStackTraceElement(template, node.getSour... | [
"RenderException",
"addStackTraceElement",
"(",
"SoyNode",
"node",
")",
"{",
"// Typically, this is fast since templates aren't that deep and we only do this in error",
"// situations so performance matters less.",
"TemplateNode",
"template",
"=",
"node",
".",
"getNearestAncestor",
"("... | Add a partial stack trace element by specifying the source location of the soy file. | [
"Add",
"a",
"partial",
"stack",
"trace",
"element",
"by",
"specifying",
"the",
"source",
"location",
"of",
"the",
"soy",
"file",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/sharedpasses/render/RenderException.java#L75-L80 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java | JobSchedulesImpl.addAsync | public Observable<Void> addAsync(JobScheduleAddParameter cloudJobSchedule) {
"""
Adds a job schedule to the specified account.
@param cloudJobSchedule The job schedule to be added.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponseWithHeaders} object i... | java | public Observable<Void> addAsync(JobScheduleAddParameter cloudJobSchedule) {
return addWithServiceResponseAsync(cloudJobSchedule).map(new Func1<ServiceResponseWithHeaders<Void, JobScheduleAddHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeaders<Void, JobScheduleAddHea... | [
"public",
"Observable",
"<",
"Void",
">",
"addAsync",
"(",
"JobScheduleAddParameter",
"cloudJobSchedule",
")",
"{",
"return",
"addWithServiceResponseAsync",
"(",
"cloudJobSchedule",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponseWithHeaders",
"<",
"Void",
... | Adds a job schedule to the specified account.
@param cloudJobSchedule The job schedule to be added.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponseWithHeaders} object if successful. | [
"Adds",
"a",
"job",
"schedule",
"to",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java#L2018-L2025 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.