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 |
|---|---|---|---|---|---|---|---|---|---|---|
landawn/AbacusUtil | src/com/landawn/abacus/util/Matth.java | Matth.log2 | @SuppressWarnings("fallthrough")
// TODO(kevinb): remove after this warning is disabled globally
public static int log2(BigInteger x, RoundingMode mode) {
"""
Returns the base-2 logarithm of {@code x}, rounded according to the specified rounding mode.
@throws IllegalArgumentException if {@code x <= 0}... | java | @SuppressWarnings("fallthrough")
// TODO(kevinb): remove after this warning is disabled globally
public static int log2(BigInteger x, RoundingMode mode) {
checkPositive("x", N.checkArgNotNull(x));
int logFloor = x.bitLength() - 1;
switch (mode) {
case UNNECESSARY:
... | [
"@",
"SuppressWarnings",
"(",
"\"fallthrough\"",
")",
"// TODO(kevinb): remove after this warning is disabled globally\r",
"public",
"static",
"int",
"log2",
"(",
"BigInteger",
"x",
",",
"RoundingMode",
"mode",
")",
"{",
"checkPositive",
"(",
"\"x\"",
",",
"N",
".",
"... | Returns the base-2 logarithm of {@code x}, rounded according to the specified rounding mode.
@throws IllegalArgumentException if {@code x <= 0}
@throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
is not a power of two | [
"Returns",
"the",
"base",
"-",
"2",
"logarithm",
"of",
"{",
"@code",
"x",
"}",
"rounded",
"according",
"to",
"the",
"specified",
"rounding",
"mode",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L474-L512 |
icode/ameba | src/main/java/ameba/db/ebean/internal/ModelInterceptor.java | ModelInterceptor.applyOrderBy | public static void applyOrderBy(MultivaluedMap<String, String> queryParams, Query query) {
"""
<p>applyOrderBy.</p>
@param queryParams a {@link javax.ws.rs.core.MultivaluedMap} object.
@param query a {@link io.ebean.Query} object.
"""
List<String> orders = queryParams.get(SORT_PARAM_NAME);
... | java | public static void applyOrderBy(MultivaluedMap<String, String> queryParams, Query query) {
List<String> orders = queryParams.get(SORT_PARAM_NAME);
if (orders != null && orders.size() > 0) {
OrderBy orderBy = query.orderBy();
for (String order : orders) {
EbeanUtil... | [
"public",
"static",
"void",
"applyOrderBy",
"(",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"Query",
"query",
")",
"{",
"List",
"<",
"String",
">",
"orders",
"=",
"queryParams",
".",
"get",
"(",
"SORT_PARAM_NAME",
")",
";",
"i... | <p>applyOrderBy.</p>
@param queryParams a {@link javax.ws.rs.core.MultivaluedMap} object.
@param query a {@link io.ebean.Query} object. | [
"<p",
">",
"applyOrderBy",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/internal/ModelInterceptor.java#L236-L244 |
solita/clamav-java | src/main/java/fi/solita/clamav/ClamAVClient.java | ClamAVClient.isCleanReply | public static boolean isCleanReply(byte[] reply) {
"""
Interpret the result from a ClamAV scan, and determine if the result means the data is clean
@param reply The reply from the server after scanning
@return true if no virus was found according to the clamd reply message
"""
String r = new String(re... | java | public static boolean isCleanReply(byte[] reply) {
String r = new String(reply, StandardCharsets.US_ASCII);
return (r.contains("OK") && !r.contains("FOUND"));
} | [
"public",
"static",
"boolean",
"isCleanReply",
"(",
"byte",
"[",
"]",
"reply",
")",
"{",
"String",
"r",
"=",
"new",
"String",
"(",
"reply",
",",
"StandardCharsets",
".",
"US_ASCII",
")",
";",
"return",
"(",
"r",
".",
"contains",
"(",
"\"OK\"",
")",
"&&... | Interpret the result from a ClamAV scan, and determine if the result means the data is clean
@param reply The reply from the server after scanning
@return true if no virus was found according to the clamd reply message | [
"Interpret",
"the",
"result",
"from",
"a",
"ClamAV",
"scan",
"and",
"determine",
"if",
"the",
"result",
"means",
"the",
"data",
"is",
"clean"
] | train | https://github.com/solita/clamav-java/blob/4ff23d37fb0763862db76f2f3389f3e45e80dd09/src/main/java/fi/solita/clamav/ClamAVClient.java#L133-L136 |
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java | HadoopInputs.readHadoopFile | public static <K, V> HadoopInputFormat<K, V> readHadoopFile(org.apache.hadoop.mapred.FileInputFormat<K, V> mapredInputFormat, Class<K> key, Class<V> value, String inputPath) {
"""
Creates a Flink {@link InputFormat} that wraps the given Hadoop {@link org.apache.hadoop.mapred.FileInputFormat}.
@return A Flink In... | java | public static <K, V> HadoopInputFormat<K, V> readHadoopFile(org.apache.hadoop.mapred.FileInputFormat<K, V> mapredInputFormat, Class<K> key, Class<V> value, String inputPath) {
return readHadoopFile(mapredInputFormat, key, value, inputPath, new JobConf());
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"HadoopInputFormat",
"<",
"K",
",",
"V",
">",
"readHadoopFile",
"(",
"org",
".",
"apache",
".",
"hadoop",
".",
"mapred",
".",
"FileInputFormat",
"<",
"K",
",",
"V",
">",
"mapredInputFormat",
",",
"Class",
"<... | Creates a Flink {@link InputFormat} that wraps the given Hadoop {@link org.apache.hadoop.mapred.FileInputFormat}.
@return A Flink InputFormat that wraps the Hadoop FileInputFormat. | [
"Creates",
"a",
"Flink",
"{",
"@link",
"InputFormat",
"}",
"that",
"wraps",
"the",
"given",
"Hadoop",
"{",
"@link",
"org",
".",
"apache",
".",
"hadoop",
".",
"mapred",
".",
"FileInputFormat",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java#L62-L64 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_volume_snapshot_snapshotId_DELETE | public void project_serviceName_volume_snapshot_snapshotId_DELETE(String serviceName, String snapshotId) throws IOException {
"""
Delete a volume snapshot
REST: DELETE /cloud/project/{serviceName}/volume/snapshot/{snapshotId}
@param serviceName [required] Project id
@param snapshotId [required] Snapshot id
... | java | public void project_serviceName_volume_snapshot_snapshotId_DELETE(String serviceName, String snapshotId) throws IOException {
String qPath = "/cloud/project/{serviceName}/volume/snapshot/{snapshotId}";
StringBuilder sb = path(qPath, serviceName, snapshotId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"project_serviceName_volume_snapshot_snapshotId_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"snapshotId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/volume/snapshot/{snapshotId}\"",
";",
"StringBuilder",
... | Delete a volume snapshot
REST: DELETE /cloud/project/{serviceName}/volume/snapshot/{snapshotId}
@param serviceName [required] Project id
@param snapshotId [required] Snapshot id | [
"Delete",
"a",
"volume",
"snapshot"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1265-L1269 |
codescape/bitvunit | bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlElementUtil.java | HtmlElementUtil.hasNonEmptyAttribute | public static boolean hasNonEmptyAttribute(HtmlElement element, String attributeName) {
"""
Returns <code>true</code> when the given element contains a non empty attribute with the given attribute name.
@param element element to check for an attribute
@param attributeName name of the attribute
@return <... | java | public static boolean hasNonEmptyAttribute(HtmlElement element, String attributeName) {
return hasAttribute(element, attributeName) && !element.getAttribute(attributeName).isEmpty();
} | [
"public",
"static",
"boolean",
"hasNonEmptyAttribute",
"(",
"HtmlElement",
"element",
",",
"String",
"attributeName",
")",
"{",
"return",
"hasAttribute",
"(",
"element",
",",
"attributeName",
")",
"&&",
"!",
"element",
".",
"getAttribute",
"(",
"attributeName",
")... | Returns <code>true</code> when the given element contains a non empty attribute with the given attribute name.
@param element element to check for an attribute
@param attributeName name of the attribute
@return <code>true</code> if an attribute with the given name exists and is not empty, otherwise
<code>false</... | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"when",
"the",
"given",
"element",
"contains",
"a",
"non",
"empty",
"attribute",
"with",
"the",
"given",
"attribute",
"name",
"."
] | train | https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlElementUtil.java#L24-L26 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/scriptio/ScriptWriterBase.java | ScriptWriterBase.openFile | protected void openFile() {
"""
File is opened in append mode although in current usage the file
never pre-exists
"""
try {
FileAccess fa = isDump ? FileUtil.getDefaultInstance()
: database.getFileAccess();
OutputStream fos = fa.openOut... | java | protected void openFile() {
try {
FileAccess fa = isDump ? FileUtil.getDefaultInstance()
: database.getFileAccess();
OutputStream fos = fa.openOutputStreamElement(outFile);
outDescriptor = fa.getFileSync(fos);
fileStreamO... | [
"protected",
"void",
"openFile",
"(",
")",
"{",
"try",
"{",
"FileAccess",
"fa",
"=",
"isDump",
"?",
"FileUtil",
".",
"getDefaultInstance",
"(",
")",
":",
"database",
".",
"getFileAccess",
"(",
")",
";",
"OutputStream",
"fos",
"=",
"fa",
".",
"openOutputStr... | File is opened in append mode although in current usage the file
never pre-exists | [
"File",
"is",
"opened",
"in",
"append",
"mode",
"although",
"in",
"current",
"usage",
"the",
"file",
"never",
"pre",
"-",
"exists"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/scriptio/ScriptWriterBase.java#L253-L268 |
neo4j-contrib/neo4j-apoc-procedures | src/main/java/apoc/periodic/Periodic.java | Periodic.schedule | public static JobInfo schedule(String name, Runnable task, long delay, long repeat) {
"""
Call from a procedure that gets a <code>@Context GraphDatbaseAPI db;</code> injected and provide that db to the runnable.
"""
JobInfo info = new JobInfo(name,delay,repeat);
Future future = list.remove(info... | java | public static JobInfo schedule(String name, Runnable task, long delay, long repeat) {
JobInfo info = new JobInfo(name,delay,repeat);
Future future = list.remove(info);
if (future != null && !future.isDone()) future.cancel(false);
ScheduledFuture<?> newFuture = Pools.SCHEDULED.scheduleWi... | [
"public",
"static",
"JobInfo",
"schedule",
"(",
"String",
"name",
",",
"Runnable",
"task",
",",
"long",
"delay",
",",
"long",
"repeat",
")",
"{",
"JobInfo",
"info",
"=",
"new",
"JobInfo",
"(",
"name",
",",
"delay",
",",
"repeat",
")",
";",
"Future",
"f... | Call from a procedure that gets a <code>@Context GraphDatbaseAPI db;</code> injected and provide that db to the runnable. | [
"Call",
"from",
"a",
"procedure",
"that",
"gets",
"a",
"<code",
">"
] | train | https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/e8386975d1c512c0e4388a1a61f5496121c04f86/src/main/java/apoc/periodic/Periodic.java#L202-L210 |
springfox/springfox | springfox-core/src/main/java/springfox/documentation/schema/AlternateTypeRules.java | AlternateTypeRules.newMapRule | public static AlternateTypeRule newMapRule(Class<?> key, Class<?> value) {
"""
Helper method to create a new alternate for <code>Map<K,V></code> that results in an alternate of type
<code>List<Entry<K,V>></code>.
@param key the class that represents a key
@param value the value
@return th... | java | public static AlternateTypeRule newMapRule(Class<?> key, Class<?> value) {
TypeResolver resolver = new TypeResolver();
return new AlternateTypeRule(
resolver.resolve(Map.class, key, value),
resolver.resolve(List.class, resolver.resolve(Entry.class, key, value)),
Ordered.LOWES... | [
"public",
"static",
"AlternateTypeRule",
"newMapRule",
"(",
"Class",
"<",
"?",
">",
"key",
",",
"Class",
"<",
"?",
">",
"value",
")",
"{",
"TypeResolver",
"resolver",
"=",
"new",
"TypeResolver",
"(",
")",
";",
"return",
"new",
"AlternateTypeRule",
"(",
"re... | Helper method to create a new alternate for <code>Map<K,V></code> that results in an alternate of type
<code>List<Entry<K,V>></code>.
@param key the class that represents a key
@param value the value
@return the alternate type rule | [
"Helper",
"method",
"to",
"create",
"a",
"new",
"alternate",
"for",
"<code",
">",
"Map<",
";",
"K",
"V>",
";",
"<",
"/",
"code",
">",
"that",
"results",
"in",
"an",
"alternate",
"of",
"type",
"<code",
">",
"List<",
";",
"Entry<",
";",
"K",
"V... | train | https://github.com/springfox/springfox/blob/e40e2d6f4b345ffa35cd5c0ca7a12589036acaf7/springfox-core/src/main/java/springfox/documentation/schema/AlternateTypeRules.java#L69-L75 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java | VirtualNetworkLinksInner.beginCreateOrUpdateAsync | public Observable<VirtualNetworkLinkInner> beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) {
"""
Creates or updates a virtual network link to the specified Private DNS zone.
@param resourceGroupName The name of the res... | java | public Observable<VirtualNetworkLinkInner> beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).ma... | [
"public",
"Observable",
"<",
"VirtualNetworkLinkInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"privateZoneName",
",",
"String",
"virtualNetworkLinkName",
",",
"VirtualNetworkLinkInner",
"parameters",
")",
"{",
"return",
"beginCr... | Creates or updates a virtual network link to the specified Private DNS zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param virtualNetworkLinkName The name of the virtual network link.
@param parameters Parameters sup... | [
"Creates",
"or",
"updates",
"a",
"virtual",
"network",
"link",
"to",
"the",
"specified",
"Private",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java#L321-L328 |
mapbox/mapbox-events-android | liblocation/src/main/java/com/mapbox/android/core/location/LocationEngineProvider.java | LocationEngineProvider.getBestLocationEngine | @NonNull
public static LocationEngine getBestLocationEngine(@NonNull Context context) {
"""
Returns instance to the best location engine, given the included libraries.
@param context {@link Context}.
@return a unique instance of {@link LocationEngine} every time method is called.
@since 1.1.0
"""
... | java | @NonNull
public static LocationEngine getBestLocationEngine(@NonNull Context context) {
checkNotNull(context, "context == null");
boolean hasGoogleLocationServices = isOnClasspath(GOOGLE_LOCATION_SERVICES);
if (isOnClasspath(GOOGLE_API_AVAILABILITY)) {
// Check Google Play services APK is available... | [
"@",
"NonNull",
"public",
"static",
"LocationEngine",
"getBestLocationEngine",
"(",
"@",
"NonNull",
"Context",
"context",
")",
"{",
"checkNotNull",
"(",
"context",
",",
"\"context == null\"",
")",
";",
"boolean",
"hasGoogleLocationServices",
"=",
"isOnClasspath",
"(",... | Returns instance to the best location engine, given the included libraries.
@param context {@link Context}.
@return a unique instance of {@link LocationEngine} every time method is called.
@since 1.1.0 | [
"Returns",
"instance",
"to",
"the",
"best",
"location",
"engine",
"given",
"the",
"included",
"libraries",
"."
] | train | https://github.com/mapbox/mapbox-events-android/blob/5b5ca7e04cb8fab31a8dc040b6e7521f930a58a4/liblocation/src/main/java/com/mapbox/android/core/location/LocationEngineProvider.java#L43-L54 |
alkacon/opencms-core | src/org/opencms/relations/CmsLinkUpdateUtil.java | CmsLinkUpdateUtil.updateXmlForHtmlValue | public static void updateXmlForHtmlValue(CmsLink link, String name, Element element) {
"""
Updates the given xml element with this link information.<p>
@param link the link to get the information from
@param name the (optional) name of the link
@param element the <link> element to update
"""
... | java | public static void updateXmlForHtmlValue(CmsLink link, String name, Element element) {
// if element is not null
if (element != null) {
// update the additional attributes
if (name != null) {
updateAttribute(element, CmsLink.ATTRIBUTE_NAME, link.getName());
... | [
"public",
"static",
"void",
"updateXmlForHtmlValue",
"(",
"CmsLink",
"link",
",",
"String",
"name",
",",
"Element",
"element",
")",
"{",
"// if element is not null",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"// update the additional attributes",
"if",
"(",
"n... | Updates the given xml element with this link information.<p>
@param link the link to get the information from
@param name the (optional) name of the link
@param element the <link> element to update | [
"Updates",
"the",
"given",
"xml",
"element",
"with",
"this",
"link",
"information",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsLinkUpdateUtil.java#L89-L101 |
voldemort/voldemort | src/java/voldemort/utils/ByteUtils.java | ByteUtils.writeBytes | public static void writeBytes(byte[] bytes, long value, int offset, int numBytes) {
"""
Write the given number of bytes out to the array
@param bytes The array to write to
@param value The value to write from
@param offset the offset into the array
@param numBytes The number of bytes to write
"""
... | java | public static void writeBytes(byte[] bytes, long value, int offset, int numBytes) {
int shift = 0;
for(int i = offset + numBytes - 1; i >= offset; i--) {
bytes[i] = (byte) (0xFF & (value >> shift));
shift += 8;
}
} | [
"public",
"static",
"void",
"writeBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"long",
"value",
",",
"int",
"offset",
",",
"int",
"numBytes",
")",
"{",
"int",
"shift",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"offset",
"+",
"numBytes",
"-",
"1",... | Write the given number of bytes out to the array
@param bytes The array to write to
@param value The value to write from
@param offset the offset into the array
@param numBytes The number of bytes to write | [
"Write",
"the",
"given",
"number",
"of",
"bytes",
"out",
"to",
"the",
"array"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L295-L301 |
javamonkey/beetl2.0 | beetl-core/src/main/java/org/beetl/ext/spring/UtilsFunctionPackage.java | UtilsFunctionPackage.joinEx | public String joinEx(Object collection, String delim, String prefix, String suffix) {
"""
在集合或数组元素之间拼接指定分隔符返回字符串, 并在前后拼接前后缀
@param collection
传入集合或数组, null表示空集, 其他类型表示单元素集合
@param delim
分隔符
@param prefix
前缀
@param suffix
后缀
@return 在集合或数组元素之间拼接指定分隔符返回字符串
"""
if (collection == null) {
return Str... | java | public String joinEx(Object collection, String delim, String prefix, String suffix) {
if (collection == null) {
return StringUtils.collectionToDelimitedString(Collections.emptyList(), delim, prefix, suffix);
} else if (collection instanceof Collection) {
return StringUtils.collectionToDelimitedString((Collect... | [
"public",
"String",
"joinEx",
"(",
"Object",
"collection",
",",
"String",
"delim",
",",
"String",
"prefix",
",",
"String",
"suffix",
")",
"{",
"if",
"(",
"collection",
"==",
"null",
")",
"{",
"return",
"StringUtils",
".",
"collectionToDelimitedString",
"(",
... | 在集合或数组元素之间拼接指定分隔符返回字符串, 并在前后拼接前后缀
@param collection
传入集合或数组, null表示空集, 其他类型表示单元素集合
@param delim
分隔符
@param prefix
前缀
@param suffix
后缀
@return 在集合或数组元素之间拼接指定分隔符返回字符串 | [
"在集合或数组元素之间拼接指定分隔符返回字符串",
"并在前后拼接前后缀"
] | train | https://github.com/javamonkey/beetl2.0/blob/f32f729ad238079df5aca6e38a3c3ba0a55c78d6/beetl-core/src/main/java/org/beetl/ext/spring/UtilsFunctionPackage.java#L158-L168 |
spockframework/spock | spock-core/src/main/java/org/spockframework/util/inspector/AstInspector.java | AstInspector.load | public void load(File sourceFile) throws CompilationFailedException {
"""
Compiles the source text in the specified file up to the
configured compile phase and stores the resulting AST for subsequent
inspection.
@param sourceFile the file containing the source text to compile
@throws CompilationFailedExcepti... | java | public void load(File sourceFile) throws CompilationFailedException {
reset();
try {
classLoader.parseClass(sourceFile);
} catch (IOException e) {
throw new AstInspectorException("cannot read source file", e);
} catch (AstSuccessfullyCaptured e) {
indexAstNodes();
return;
}
... | [
"public",
"void",
"load",
"(",
"File",
"sourceFile",
")",
"throws",
"CompilationFailedException",
"{",
"reset",
"(",
")",
";",
"try",
"{",
"classLoader",
".",
"parseClass",
"(",
"sourceFile",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"thro... | Compiles the source text in the specified file up to the
configured compile phase and stores the resulting AST for subsequent
inspection.
@param sourceFile the file containing the source text to compile
@throws CompilationFailedException if an error occurs during compilation
@throws AstInspectorException if an IOExcep... | [
"Compiles",
"the",
"source",
"text",
"in",
"the",
"specified",
"file",
"up",
"to",
"the",
"configured",
"compile",
"phase",
"and",
"stores",
"the",
"resulting",
"AST",
"for",
"subsequent",
"inspection",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/util/inspector/AstInspector.java#L160-L173 |
VoltDB/voltdb | src/frontend/org/voltcore/utils/CoreUtils.java | CoreUtils.printPortsInUse | public static synchronized void printPortsInUse(VoltLogger log) {
"""
Log (to the fatal logger) the list of ports in use.
Uses "lsof -i" internally.
@param log VoltLogger used to print output or warnings.
"""
try {
/*
* Don't do DNS resolution, don't use names for port numb... | java | public static synchronized void printPortsInUse(VoltLogger log) {
try {
/*
* Don't do DNS resolution, don't use names for port numbers
*/
ProcessBuilder pb = new ProcessBuilder("lsof", "-i", "-n", "-P");
pb.redirectErrorStream(true);
Proc... | [
"public",
"static",
"synchronized",
"void",
"printPortsInUse",
"(",
"VoltLogger",
"log",
")",
"{",
"try",
"{",
"/*\n * Don't do DNS resolution, don't use names for port numbers\n */",
"ProcessBuilder",
"pb",
"=",
"new",
"ProcessBuilder",
"(",
"\"lsof\"",... | Log (to the fatal logger) the list of ports in use.
Uses "lsof -i" internally.
@param log VoltLogger used to print output or warnings. | [
"Log",
"(",
"to",
"the",
"fatal",
"logger",
")",
"the",
"list",
"of",
"ports",
"in",
"use",
".",
"Uses",
"lsof",
"-",
"i",
"internally",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L1196-L1223 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/summary/BM25.java | BM25.sim | public double sim(List<String> sentence, int index) {
"""
计算一个句子与一个文档的BM25相似度
@param sentence 句子(查询语句)
@param index 文档(用语料库中的下标表示)
@return BM25 score
"""
double score = 0;
for (String word : sentence)
{
if (!f[index].containsKey(word)) continue;
int d = d... | java | public double sim(List<String> sentence, int index)
{
double score = 0;
for (String word : sentence)
{
if (!f[index].containsKey(word)) continue;
int d = docs.get(index).size();
Integer tf = f[index].get(word);
score += (idf.get(word) * tf * (k... | [
"public",
"double",
"sim",
"(",
"List",
"<",
"String",
">",
"sentence",
",",
"int",
"index",
")",
"{",
"double",
"score",
"=",
"0",
";",
"for",
"(",
"String",
"word",
":",
"sentence",
")",
"{",
"if",
"(",
"!",
"f",
"[",
"index",
"]",
".",
"contai... | 计算一个句子与一个文档的BM25相似度
@param sentence 句子(查询语句)
@param index 文档(用语料库中的下标表示)
@return BM25 score | [
"计算一个句子与一个文档的BM25相似度"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/summary/BM25.java#L119-L133 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/io/TemporaryFile.java | TemporaryFile.createTemporaryFile | public static RandomAccessFile createTemporaryFile
(String prefix, String suffix, File directory) throws IOException {
"""
Creates a new writable temporary file that is deleted when closed,
finalized, or when the system exits.
@see File#createTempFile
"""
File file = File.createTempFile(pr... | java | public static RandomAccessFile createTemporaryFile
(String prefix, String suffix, File directory) throws IOException {
File file = File.createTempFile(prefix, suffix, directory);
file.deleteOnExit();
return new TemporaryFile(file);
} | [
"public",
"static",
"RandomAccessFile",
"createTemporaryFile",
"(",
"String",
"prefix",
",",
"String",
"suffix",
",",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"File",
".",
"createTempFile",
"(",
"prefix",
",",
"suffix",
",",
... | Creates a new writable temporary file that is deleted when closed,
finalized, or when the system exits.
@see File#createTempFile | [
"Creates",
"a",
"new",
"writable",
"temporary",
"file",
"that",
"is",
"deleted",
"when",
"closed",
"finalized",
"or",
"when",
"the",
"system",
"exits",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/io/TemporaryFile.java#L36-L42 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/HttpUtils.java | HttpUtils.doPost | public static String doPost(final String action, final Map<String, String> parameters,
final int retryTimes) {
"""
access given action with given parameters by post, if get exception, will
retry by given retryTimes.
@param action action url to access
@param parameters parameters to post
@param retryTimes... | java | public static String doPost(final String action, final Map<String, String> parameters,
final int retryTimes) {
try {
return doPostByLoop(action, parameters, retryTimes);
} catch (HttpException e) {
throw new HttpException(format(
"Failed to download content for action url: '%s' with par... | [
"public",
"static",
"String",
"doPost",
"(",
"final",
"String",
"action",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"final",
"int",
"retryTimes",
")",
"{",
"try",
"{",
"return",
"doPostByLoop",
"(",
"action",
",",
"paramete... | access given action with given parameters by post, if get exception, will
retry by given retryTimes.
@param action action url to access
@param parameters parameters to post
@param retryTimes retry times when get exception.
@return response content of target action url. | [
"access",
"given",
"action",
"with",
"given",
"parameters",
"by",
"post",
"if",
"get",
"exception",
"will",
"retry",
"by",
"given",
"retryTimes",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/HttpUtils.java#L143-L153 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/utilities/PHPMethods.java | PHPMethods.asort | public static <T extends Comparable<T>> Integer[] asort(T[] array) {
"""
Sorts an array in ascending order and returns an array with indexes of
the original order.
@param <T>
@param array
@return
"""
return _asort(array, false);
} | java | public static <T extends Comparable<T>> Integer[] asort(T[] array) {
return _asort(array, false);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"T",
">",
">",
"Integer",
"[",
"]",
"asort",
"(",
"T",
"[",
"]",
"array",
")",
"{",
"return",
"_asort",
"(",
"array",
",",
"false",
")",
";",
"}"
] | Sorts an array in ascending order and returns an array with indexes of
the original order.
@param <T>
@param array
@return | [
"Sorts",
"an",
"array",
"in",
"ascending",
"order",
"and",
"returns",
"an",
"array",
"with",
"indexes",
"of",
"the",
"original",
"order",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/utilities/PHPMethods.java#L269-L271 |
j256/simplecsv | src/main/java/com/j256/simplecsv/processor/CsvProcessor.java | CsvProcessor.writeRow | public void writeRow(BufferedWriter bufferedWriter, T entity, boolean appendLineTermination) throws IOException {
"""
Write an entity row to the writer.
@param bufferedWriter
Where to write our header information.
@param entity
The entity we are writing to the buffered writer.
@param appendLineTermination
... | java | public void writeRow(BufferedWriter bufferedWriter, T entity, boolean appendLineTermination) throws IOException {
checkEntityConfig();
String line = buildLine(entity, appendLineTermination);
bufferedWriter.write(line);
} | [
"public",
"void",
"writeRow",
"(",
"BufferedWriter",
"bufferedWriter",
",",
"T",
"entity",
",",
"boolean",
"appendLineTermination",
")",
"throws",
"IOException",
"{",
"checkEntityConfig",
"(",
")",
";",
"String",
"line",
"=",
"buildLine",
"(",
"entity",
",",
"ap... | Write an entity row to the writer.
@param bufferedWriter
Where to write our header information.
@param entity
The entity we are writing to the buffered writer.
@param appendLineTermination
Set to true to add the newline to the end of the line.
@throws IOException
If there are any IO exceptions thrown when writing. | [
"Write",
"an",
"entity",
"row",
"to",
"the",
"writer",
"."
] | train | https://github.com/j256/simplecsv/blob/964fe53073c43e2a311341e3f8fd2c94372f60cb/src/main/java/com/j256/simplecsv/processor/CsvProcessor.java#L468-L472 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/refer/Descriptor.java | Descriptor.exactMatch | public boolean exactMatch(Descriptor descriptor) {
"""
Matches this descriptor to another descriptor by all fields. No exceptions
are made.
@param descriptor the descriptor to match this one against.
@return true if descriptors match and false otherwise.
@see #match(Descriptor)
"""
return exactMatchF... | java | public boolean exactMatch(Descriptor descriptor) {
return exactMatchField(_group, descriptor.getGroup()) && exactMatchField(_type, descriptor.getType())
&& exactMatchField(_kind, descriptor.getKind()) && exactMatchField(_name, descriptor.getName())
&& exactMatchField(_version, descriptor.getVersion());
} | [
"public",
"boolean",
"exactMatch",
"(",
"Descriptor",
"descriptor",
")",
"{",
"return",
"exactMatchField",
"(",
"_group",
",",
"descriptor",
".",
"getGroup",
"(",
")",
")",
"&&",
"exactMatchField",
"(",
"_type",
",",
"descriptor",
".",
"getType",
"(",
")",
"... | Matches this descriptor to another descriptor by all fields. No exceptions
are made.
@param descriptor the descriptor to match this one against.
@return true if descriptors match and false otherwise.
@see #match(Descriptor) | [
"Matches",
"this",
"descriptor",
"to",
"another",
"descriptor",
"by",
"all",
"fields",
".",
"No",
"exceptions",
"are",
"made",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/refer/Descriptor.java#L154-L158 |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/convert/reflection/AnnotationUtil.java | AnnotationUtil.getLinks | public static <T> RiakLinks getLinks(RiakLinks container, T domainObject) {
"""
Attempts to get the the Riak links from a domain object by looking for a
{@literal @RiakLinks} annotated member.
@param <T> the domain object type
@param container the RiakLinks container
@param domainObject the domain object
@r... | java | public static <T> RiakLinks getLinks(RiakLinks container, T domainObject)
{
return AnnotationHelper.getInstance().getLinks(container, domainObject);
} | [
"public",
"static",
"<",
"T",
">",
"RiakLinks",
"getLinks",
"(",
"RiakLinks",
"container",
",",
"T",
"domainObject",
")",
"{",
"return",
"AnnotationHelper",
".",
"getInstance",
"(",
")",
".",
"getLinks",
"(",
"container",
",",
"domainObject",
")",
";",
"}"
] | Attempts to get the the Riak links from a domain object by looking for a
{@literal @RiakLinks} annotated member.
@param <T> the domain object type
@param container the RiakLinks container
@param domainObject the domain object
@return a Collection of RiakLink objects. | [
"Attempts",
"to",
"get",
"the",
"the",
"Riak",
"links",
"from",
"a",
"domain",
"object",
"by",
"looking",
"for",
"a",
"{",
"@literal",
"@RiakLinks",
"}",
"annotated",
"member",
"."
] | train | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/convert/reflection/AnnotationUtil.java#L237-L240 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java | SimpleVersionedSerialization.readVersionAndDeSerialize | public static <T> T readVersionAndDeSerialize(SimpleVersionedSerializer<T> serializer, DataInputView in) throws IOException {
"""
Deserializes the version and datum from a stream.
<p>This method deserializes data serialized via
{@link #writeVersionAndSerialize(SimpleVersionedSerializer, Object, DataOutputView)... | java | public static <T> T readVersionAndDeSerialize(SimpleVersionedSerializer<T> serializer, DataInputView in) throws IOException {
checkNotNull(serializer, "serializer");
checkNotNull(in, "in");
final int version = in.readInt();
final int length = in.readInt();
final byte[] data = new byte[length];
in.readFully... | [
"public",
"static",
"<",
"T",
">",
"T",
"readVersionAndDeSerialize",
"(",
"SimpleVersionedSerializer",
"<",
"T",
">",
"serializer",
",",
"DataInputView",
"in",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"serializer",
",",
"\"serializer\"",
")",
";",
... | Deserializes the version and datum from a stream.
<p>This method deserializes data serialized via
{@link #writeVersionAndSerialize(SimpleVersionedSerializer, Object, DataOutputView)}.
<p>The first four bytes will be interpreted as the version. The next four bytes will be
interpreted as the length of the datum bytes, ... | [
"Deserializes",
"the",
"version",
"and",
"datum",
"from",
"a",
"stream",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java#L78-L88 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.getTimestamp | @Override
public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException {
"""
Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object, using the given Calendar object to construct the Timestamp object.
"""
checkClosed();
throw SQLError.noSupp... | java | @Override
public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"Timestamp",
"getTimestamp",
"(",
"String",
"parameterName",
",",
"Calendar",
"cal",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object, using the given Calendar object to construct the Timestamp object. | [
"Retrieves",
"the",
"value",
"of",
"a",
"JDBC",
"TIMESTAMP",
"parameter",
"as",
"a",
"java",
".",
"sql",
".",
"Timestamp",
"object",
"using",
"the",
"given",
"Calendar",
"object",
"to",
"construct",
"the",
"Timestamp",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L495-L500 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/NotAcceptable.java | NotAcceptable.of | public static NotAcceptable of(Throwable cause) {
"""
Returns a static NotAcceptable instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause... | java | public static NotAcceptable of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(NOT_ACCEPTABLE));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"NotAcceptable",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"NOT_ACCEPTABLE",
")",
")",
";",
"}",
"else",
"{",
"touchPayload"... | Returns a static NotAcceptable instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static NotAcceptable instance as described above | [
"Returns",
"a",
"static",
"NotAcceptable",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/NotAcceptable.java#L117-L124 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapCircuitExtractor.java | MapCircuitExtractor.getCircuitGroups | private static Circuit getCircuitGroups(String group, Collection<String> neighborGroups) {
"""
Get the tile circuit between two groups.
@param group The initial group.
@param neighborGroups The neighbor groups.
@return The tile circuit, <code>null</code> if invalid groups number.
"""
final Collec... | java | private static Circuit getCircuitGroups(String group, Collection<String> neighborGroups)
{
final Collection<String> set = new HashSet<>(neighborGroups);
final Circuit circuit;
if (set.size() > 1)
{
final Iterator<String> iterator = set.iterator();
final... | [
"private",
"static",
"Circuit",
"getCircuitGroups",
"(",
"String",
"group",
",",
"Collection",
"<",
"String",
">",
"neighborGroups",
")",
"{",
"final",
"Collection",
"<",
"String",
">",
"set",
"=",
"new",
"HashSet",
"<>",
"(",
"neighborGroups",
")",
";",
"fi... | Get the tile circuit between two groups.
@param group The initial group.
@param neighborGroups The neighbor groups.
@return The tile circuit, <code>null</code> if invalid groups number. | [
"Get",
"the",
"tile",
"circuit",
"between",
"two",
"groups",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapCircuitExtractor.java#L41-L66 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/BosClient.java | BosClient.listObjects | public ListObjectsResponse listObjects(String bucketName, String prefix) {
"""
Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets.
List results are <i>always</i> returned in lexicographic (alphabetical) order.
@param bucketName The name of the Bos bu... | java | public ListObjectsResponse listObjects(String bucketName, String prefix) {
return this.listObjects(new ListObjectsRequest(bucketName, prefix));
} | [
"public",
"ListObjectsResponse",
"listObjects",
"(",
"String",
"bucketName",
",",
"String",
"prefix",
")",
"{",
"return",
"this",
".",
"listObjects",
"(",
"new",
"ListObjectsRequest",
"(",
"bucketName",
",",
"prefix",
")",
")",
";",
"}"
] | Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets.
List results are <i>always</i> returned in lexicographic (alphabetical) order.
@param bucketName The name of the Bos bucket to list.
@param prefix An optional parameter restricting the response to keys begi... | [
"Returns",
"ListObjectsResponse",
"containing",
"a",
"list",
"of",
"summary",
"information",
"about",
"the",
"objects",
"in",
"the",
"specified",
"buckets",
".",
"List",
"results",
"are",
"<i",
">",
"always<",
"/",
"i",
">",
"returned",
"in",
"lexicographic",
... | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L565-L567 |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java | SystemInputJson.asCondition | private static ICondition asCondition( JsonObject json) {
"""
Returns the condition definition represented by the given JSON object.
"""
List<Function<JsonObject,Optional<ICondition>>> converters = Arrays.asList
(
SystemInputJson::asContainsAll,
SystemInputJson::asContainsAny,
... | java | private static ICondition asCondition( JsonObject json)
{
List<Function<JsonObject,Optional<ICondition>>> converters = Arrays.asList
(
SystemInputJson::asContainsAll,
SystemInputJson::asContainsAny,
SystemInputJson::asContainsNone,
SystemInputJson::asNot,
SystemInpu... | [
"private",
"static",
"ICondition",
"asCondition",
"(",
"JsonObject",
"json",
")",
"{",
"List",
"<",
"Function",
"<",
"JsonObject",
",",
"Optional",
"<",
"ICondition",
">",
">",
">",
"converters",
"=",
"Arrays",
".",
"asList",
"(",
"SystemInputJson",
"::",
"a... | Returns the condition definition represented by the given JSON object. | [
"Returns",
"the",
"condition",
"definition",
"represented",
"by",
"the",
"given",
"JSON",
"object",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java#L400-L426 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/SSLConfig.java | SSLConfig.setProperty | public SSLConfig setProperty(String name, String value) {
"""
Sets a property.
@param name the name of the property to set
@param value the value of the property to set
@return the updated SSLConfig
@throws NullPointerException if name or value is {@code null}
"""
properties.put(name, value);
... | java | public SSLConfig setProperty(String name, String value) {
properties.put(name, value);
return this;
} | [
"public",
"SSLConfig",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"properties",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets a property.
@param name the name of the property to set
@param value the value of the property to set
@return the updated SSLConfig
@throws NullPointerException if name or value is {@code null} | [
"Sets",
"a",
"property",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/SSLConfig.java#L117-L120 |
ggrandes/packer | src/main/java/org/javastack/packer/Packer.java | Packer.useAES | public Packer useAES(final String passphrase, final String sharedIV) throws NoSuchAlgorithmException,
NoSuchPaddingException {
"""
Sets he usage of "AES/CBC/PKCS5Padding" with pre-shared IV for encryption (default no)
@param passphrase shared secret
@param sharedIV shared Initialization Vector
@return
@... | java | public Packer useAES(final String passphrase, final String sharedIV) throws NoSuchAlgorithmException,
NoSuchPaddingException {
initCipher();
initCipherIV(generateMdfromString(sharedIV, aesCipherLen), AESTYPEIV.SHARED_IV);
initCipherKey(passphrase);
return this;
} | [
"public",
"Packer",
"useAES",
"(",
"final",
"String",
"passphrase",
",",
"final",
"String",
"sharedIV",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchPaddingException",
"{",
"initCipher",
"(",
")",
";",
"initCipherIV",
"(",
"generateMdfromString",
"(",
"sha... | Sets he usage of "AES/CBC/PKCS5Padding" with pre-shared IV for encryption (default no)
@param passphrase shared secret
@param sharedIV shared Initialization Vector
@return
@throws NoSuchAlgorithmException
@throws NoSuchPaddingException | [
"Sets",
"he",
"usage",
"of",
"AES",
"/",
"CBC",
"/",
"PKCS5Padding",
"with",
"pre",
"-",
"shared",
"IV",
"for",
"encryption",
"(",
"default",
"no",
")"
] | train | https://github.com/ggrandes/packer/blob/0b37b286a3d0555050eb2e65419dd74f8d8d3e78/src/main/java/org/javastack/packer/Packer.java#L329-L335 |
duracloud/duracloud | retrievaltool/src/main/java/org/duracloud/retrieval/mgmt/RetrievalWorker.java | RetrievalWorker.applyTimestamps | protected void applyTimestamps(ContentStream content, File localFile) {
"""
/*
Applies timestamps which are found in the content item's properties
to the retrieved file
"""
FileTime createTime =
convertDateToFileTime(content.getDateCreated());
FileTime lastAccessTime =
... | java | protected void applyTimestamps(ContentStream content, File localFile) {
FileTime createTime =
convertDateToFileTime(content.getDateCreated());
FileTime lastAccessTime =
convertDateToFileTime(content.getDateLastAccessed());
FileTime lastModTime =
convertDateToF... | [
"protected",
"void",
"applyTimestamps",
"(",
"ContentStream",
"content",
",",
"File",
"localFile",
")",
"{",
"FileTime",
"createTime",
"=",
"convertDateToFileTime",
"(",
"content",
".",
"getDateCreated",
"(",
")",
")",
";",
"FileTime",
"lastAccessTime",
"=",
"conv... | /*
Applies timestamps which are found in the content item's properties
to the retrieved file | [
"/",
"*",
"Applies",
"timestamps",
"which",
"are",
"found",
"in",
"the",
"content",
"item",
"s",
"properties",
"to",
"the",
"retrieved",
"file"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/retrievaltool/src/main/java/org/duracloud/retrieval/mgmt/RetrievalWorker.java#L275-L295 |
yan74/afplib | org.afplib/src/main/java/org/afplib/base/util/BaseValidator.java | BaseValidator.validateModcaString8_MaxLength | public boolean validateModcaString8_MaxLength(String modcaString8, DiagnosticChain diagnostics, Map<Object, Object> context) {
"""
Validates the MaxLength constraint of '<em>Modca String8</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated
"""
int length = modcaString8.length();
boolean resu... | java | public boolean validateModcaString8_MaxLength(String modcaString8, DiagnosticChain diagnostics, Map<Object, Object> context) {
int length = modcaString8.length();
boolean result = length <= 8;
if (!result && diagnostics != null)
reportMaxLengthViolation(BasePackage.Literals.MODCA_STRING8, modcaString8, length,... | [
"public",
"boolean",
"validateModcaString8_MaxLength",
"(",
"String",
"modcaString8",
",",
"DiagnosticChain",
"diagnostics",
",",
"Map",
"<",
"Object",
",",
"Object",
">",
"context",
")",
"{",
"int",
"length",
"=",
"modcaString8",
".",
"length",
"(",
")",
";",
... | Validates the MaxLength constraint of '<em>Modca String8</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"Validates",
"the",
"MaxLength",
"constraint",
"of",
"<em",
">",
"Modca",
"String8<",
"/",
"em",
">",
".",
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | train | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/base/util/BaseValidator.java#L239-L245 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ChartResources.java | ChartResources.updateChartPreferences | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/ {
"""
Updates an existing chart preferences.
@param req The HttpServlet request object. Cannot be null.
@param chartId The id of a chart. Cannot be null.
@param preferences Prefe... | java | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{chartId}/preferences")
@Description("Updates a chart preferences given the ID.")
public ChartDto updateChartPreferences(@Context HttpServletRequest req, @PathParam("chartId") BigInteger chartId, final Map<Strin... | [
"@",
"PUT",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/{chartId}/preferences\"",
")",
"@",
"Description",
"(",
"\"Updates a chart preferences given the ID.\"",... | Updates an existing chart preferences.
@param req The HttpServlet request object. Cannot be null.
@param chartId The id of a chart. Cannot be null.
@param preferences Preferences for chart object. Cannot be null.
@return Updated chart object with preferences.
@throws WebApplicationExc... | [
"Updates",
"an",
"existing",
"chart",
"preferences",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ChartResources.java#L307-L337 |
ozimov/cirneco | hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/collect/IsIterableContainingInOrder.java | IsIterableContainingInOrder.containsInOrder | public static <T> Matcher<Iterable<? extends T>> containsInOrder(final Iterable<T> items) {
"""
Creates a matcher for {@linkplain Iterable}s that matches when a single pass over the examined
{@linkplain Iterable} yields a series of items, each logically equal to the corresponding item in the specified
items. For... | java | public static <T> Matcher<Iterable<? extends T>> containsInOrder(final Iterable<T> items) {
final Collection<Matcher<? super T>> matchers = new ArrayList<>();
for (final T item : items) {
matchers.add(equalTo(item));
}
return new IsIterableContainingInOrder<T>(matchers);
... | [
"public",
"static",
"<",
"T",
">",
"Matcher",
"<",
"Iterable",
"<",
"?",
"extends",
"T",
">",
">",
"containsInOrder",
"(",
"final",
"Iterable",
"<",
"T",
">",
"items",
")",
"{",
"final",
"Collection",
"<",
"Matcher",
"<",
"?",
"super",
"T",
">",
">",... | Creates a matcher for {@linkplain Iterable}s that matches when a single pass over the examined
{@linkplain Iterable} yields a series of items, each logically equal to the corresponding item in the specified
items. For a positive match, the examined iterable must be of the same length as the number of specified items.
F... | [
"Creates",
"a",
"matcher",
"for",
"{",
"@linkplain",
"Iterable",
"}",
"s",
"that",
"matches",
"when",
"a",
"single",
"pass",
"over",
"the",
"examined",
"{",
"@linkplain",
"Iterable",
"}",
"yields",
"a",
"series",
"of",
"items",
"each",
"logically",
"equal",
... | train | https://github.com/ozimov/cirneco/blob/78ad782da0a2256634cfbebb2f97ed78c993b999/hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/collect/IsIterableContainingInOrder.java#L36-L43 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Shape.java | Shape.setDashArray | public T setDashArray(final double dash, final double... dashes) {
"""
Sets the dash array with individual dash lengths.
@param dash length of dash
@param dashes if specified, length of remaining dashes
@return this Line
"""
getAttributes().setDashArray(new DashArray(dash, dashes));
retur... | java | public T setDashArray(final double dash, final double... dashes)
{
getAttributes().setDashArray(new DashArray(dash, dashes));
return cast();
} | [
"public",
"T",
"setDashArray",
"(",
"final",
"double",
"dash",
",",
"final",
"double",
"...",
"dashes",
")",
"{",
"getAttributes",
"(",
")",
".",
"setDashArray",
"(",
"new",
"DashArray",
"(",
"dash",
",",
"dashes",
")",
")",
";",
"return",
"cast",
"(",
... | Sets the dash array with individual dash lengths.
@param dash length of dash
@param dashes if specified, length of remaining dashes
@return this Line | [
"Sets",
"the",
"dash",
"array",
"with",
"individual",
"dash",
"lengths",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L755-L760 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toNumber | public static Number toNumber(String str, Number defaultValue) {
"""
returns a number Object, this can be a BigDecimal,BigInteger,Long, Double, depending on the
input.
@param str
@return
@throws PageException
"""
try {
// float
if (str.indexOf('.') != -1) {
return new BigDecimal(str);
}... | java | public static Number toNumber(String str, Number defaultValue) {
try {
// float
if (str.indexOf('.') != -1) {
return new BigDecimal(str);
}
// integer
BigInteger bi = new BigInteger(str);
int l = bi.bitLength();
if (l < 32) return new Integer(bi.intValue());
if (l < 64) return... | [
"public",
"static",
"Number",
"toNumber",
"(",
"String",
"str",
",",
"Number",
"defaultValue",
")",
"{",
"try",
"{",
"// float",
"if",
"(",
"str",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"return",
"new",
"BigDecimal",
"(",
"str"... | returns a number Object, this can be a BigDecimal,BigInteger,Long, Double, depending on the
input.
@param str
@return
@throws PageException | [
"returns",
"a",
"number",
"Object",
"this",
"can",
"be",
"a",
"BigDecimal",
"BigInteger",
"Long",
"Double",
"depending",
"on",
"the",
"input",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L1433-L1450 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/Job.java | Job.withDefaultArguments | public Job withDefaultArguments(java.util.Map<String, String> defaultArguments) {
"""
<p>
The default arguments for this job, specified as name-value pairs.
</p>
<p>
You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue
itself consumes.
</p>
<p>
For ... | java | public Job withDefaultArguments(java.util.Map<String, String> defaultArguments) {
setDefaultArguments(defaultArguments);
return this;
} | [
"public",
"Job",
"withDefaultArguments",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"defaultArguments",
")",
"{",
"setDefaultArguments",
"(",
"defaultArguments",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The default arguments for this job, specified as name-value pairs.
</p>
<p>
You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue
itself consumes.
</p>
<p>
For information about how to specify and consume your own Job arguments, see the <a
href="http://docs.a... | [
"<p",
">",
"The",
"default",
"arguments",
"for",
"this",
"job",
"specified",
"as",
"name",
"-",
"value",
"pairs",
".",
"<",
"/",
"p",
">",
"<p",
">",
"You",
"can",
"specify",
"arguments",
"here",
"that",
"your",
"own",
"job",
"-",
"execution",
"script"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/Job.java#L644-L647 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/core/utils/ExternalPayloadStorageUtils.java | ExternalPayloadStorageUtils.downloadPayload | @SuppressWarnings("unchecked")
public Map<String, Object> downloadPayload(String path) {
"""
Download the payload from the given path
@param path the relative path of the payload in the {@link ExternalPayloadStorage}
@return the payload object
@throws ApplicationException in case of JSON parsing errors or... | java | @SuppressWarnings("unchecked")
public Map<String, Object> downloadPayload(String path) {
try (InputStream inputStream = externalPayloadStorage.download(path)) {
return objectMapper.readValue(IOUtils.toString(inputStream), Map.class);
} catch (IOException e) {
logger.error("Un... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"downloadPayload",
"(",
"String",
"path",
")",
"{",
"try",
"(",
"InputStream",
"inputStream",
"=",
"externalPayloadStorage",
".",
"download",
"(",
"path",
"... | Download the payload from the given path
@param path the relative path of the payload in the {@link ExternalPayloadStorage}
@return the payload object
@throws ApplicationException in case of JSON parsing errors or download errors | [
"Download",
"the",
"payload",
"from",
"the",
"given",
"path"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/utils/ExternalPayloadStorageUtils.java#L65-L73 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/LoggingConfigUtils.java | LoggingConfigUtils.getIntValue | public static int getIntValue(Object newValue, int defaultValue) {
"""
Read integer value from properties: begin by preserving the old value. If
the property is found, and the new value is an integer, the new value
will be returned.
@param newValue
New parameter value to parse/evaluate
@param defaultValue
... | java | public static int getIntValue(Object newValue, int defaultValue) {
if (newValue != null) {
if (newValue instanceof String) {
try {
return Integer.parseInt((String) newValue);
} catch (NumberFormatException ex) {
}
} else... | [
"public",
"static",
"int",
"getIntValue",
"(",
"Object",
"newValue",
",",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"newValue",
"!=",
"null",
")",
"{",
"if",
"(",
"newValue",
"instanceof",
"String",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"pars... | Read integer value from properties: begin by preserving the old value. If
the property is found, and the new value is an integer, the new value
will be returned.
@param newValue
New parameter value to parse/evaluate
@param defaultValue
Starting/Previous value
@return defaultValue if the newValue is null or is was badl... | [
"Read",
"integer",
"value",
"from",
"properties",
":",
"begin",
"by",
"preserving",
"the",
"old",
"value",
".",
"If",
"the",
"property",
"is",
"found",
"and",
"the",
"new",
"value",
"is",
"an",
"integer",
"the",
"new",
"value",
"will",
"be",
"returned",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/LoggingConfigUtils.java#L102-L114 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.getExpirationDate | public static Date getExpirationDate(Bundle bundle) {
"""
Gets the cached expiration date from a Bundle.
@param bundle
A Bundle in which the expiration date was stored.
@return the cached expiration date, or null.
@throws NullPointerException if the passed in Bundle is null
"""
Validate.notNull... | java | public static Date getExpirationDate(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return getDate(bundle, EXPIRATION_DATE_KEY);
} | [
"public",
"static",
"Date",
"getExpirationDate",
"(",
"Bundle",
"bundle",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"return",
"getDate",
"(",
"bundle",
",",
"EXPIRATION_DATE_KEY",
")",
";",
"}"
] | Gets the cached expiration date from a Bundle.
@param bundle
A Bundle in which the expiration date was stored.
@return the cached expiration date, or null.
@throws NullPointerException if the passed in Bundle is null | [
"Gets",
"the",
"cached",
"expiration",
"date",
"from",
"a",
"Bundle",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L185-L188 |
visallo/vertexium | security/src/main/java/org/vertexium/security/WritableComparator.java | WritableComparator.readVLong | public static long readVLong(byte[] bytes, int start) throws IOException {
"""
Reads a zero-compressed encoded long from a byte array and returns it.
@param bytes byte array with decode long
@param start starting index
@return deserialized long
@throws java.io.IOException
"""
int len = bytes[star... | java | public static long readVLong(byte[] bytes, int start) throws IOException {
int len = bytes[start];
if (len >= -112) {
return len;
}
boolean isNegative = (len < -120);
len = isNegative ? -(len + 120) : -(len + 112);
if (start + 1 + len > bytes.length) {
... | [
"public",
"static",
"long",
"readVLong",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"start",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"bytes",
"[",
"start",
"]",
";",
"if",
"(",
"len",
">=",
"-",
"112",
")",
"{",
"return",
"len",
";",... | Reads a zero-compressed encoded long from a byte array and returns it.
@param bytes byte array with decode long
@param start starting index
@return deserialized long
@throws java.io.IOException | [
"Reads",
"a",
"zero",
"-",
"compressed",
"encoded",
"long",
"from",
"a",
"byte",
"array",
"and",
"returns",
"it",
"."
] | train | https://github.com/visallo/vertexium/blob/bb132b5425ac168957667164e1409b78adbea769/security/src/main/java/org/vertexium/security/WritableComparator.java#L241-L257 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ReplyFactory.java | ReplyFactory.getReusableImageAttachment | public static AttachmentMessageBuilder getReusableImageAttachment(String attachmentId) {
"""
Get the reusable image attachment
@param attachmentId
the attachment id generated by the upload api
@return a builder for the response.
@see <a href=
"https://developers.facebook.com/docs/messenger-platform/send-api... | java | public static AttachmentMessageBuilder getReusableImageAttachment(String attachmentId) {
AttachmentPayload payload = new AttachmentPayload();
payload.setAttachmentId(attachmentId);
return new AttachmentMessageBuilder(AttachmentType.IMAGE, payload);
} | [
"public",
"static",
"AttachmentMessageBuilder",
"getReusableImageAttachment",
"(",
"String",
"attachmentId",
")",
"{",
"AttachmentPayload",
"payload",
"=",
"new",
"AttachmentPayload",
"(",
")",
";",
"payload",
".",
"setAttachmentId",
"(",
"attachmentId",
")",
";",
"re... | Get the reusable image attachment
@param attachmentId
the attachment id generated by the upload api
@return a builder for the response.
@see <a href=
"https://developers.facebook.com/docs/messenger-platform/send-api-reference/image-attachment"
> Facebook's Messenger Platform Image Attachment Documentation</a> | [
"Get",
"the",
"reusable",
"image",
"attachment"
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ReplyFactory.java#L139-L143 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXWriter.java | MPXWriter.stripLineBreaks | private String stripLineBreaks(String text, String replacement) {
"""
This method removes line breaks from a piece of text, and replaces
them with the supplied text.
@param text source text
@param replacement line break replacement text
@return text with line breaks removed.
"""
if (text.indexOf('\... | java | private String stripLineBreaks(String text, String replacement)
{
if (text.indexOf('\r') != -1 || text.indexOf('\n') != -1)
{
StringBuilder sb = new StringBuilder(text);
int index;
while ((index = sb.indexOf("\r\n")) != -1)
{
sb.replace(index, index + 2, ... | [
"private",
"String",
"stripLineBreaks",
"(",
"String",
"text",
",",
"String",
"replacement",
")",
"{",
"if",
"(",
"text",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
"||",
"text",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"... | This method removes line breaks from a piece of text, and replaces
them with the supplied text.
@param text source text
@param replacement line break replacement text
@return text with line breaks removed. | [
"This",
"method",
"removes",
"line",
"breaks",
"from",
"a",
"piece",
"of",
"text",
"and",
"replaces",
"them",
"with",
"the",
"supplied",
"text",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXWriter.java#L902-L934 |
documents4j/documents4j | documents4j-server-standalone/src/main/java/com/documents4j/builder/ConverterServerBuilder.java | ConverterServerBuilder.workerPool | public ConverterServerBuilder workerPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit) {
"""
Configures a worker pool for the converter.
@param corePoolSize The core pool size of the worker pool.
@param maximumPoolSize The maximum pool size of the worker pool.
@param keepAliveTi... | java | public ConverterServerBuilder workerPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit) {
assertNumericArgument(corePoolSize, true);
assertNumericArgument(maximumPoolSize, true);
assertNumericArgument(corePoolSize + maximumPoolSize, false);
assertNumericArgumen... | [
"public",
"ConverterServerBuilder",
"workerPool",
"(",
"int",
"corePoolSize",
",",
"int",
"maximumPoolSize",
",",
"long",
"keepAliveTime",
",",
"TimeUnit",
"unit",
")",
"{",
"assertNumericArgument",
"(",
"corePoolSize",
",",
"true",
")",
";",
"assertNumericArgument",
... | Configures a worker pool for the converter.
@param corePoolSize The core pool size of the worker pool.
@param maximumPoolSize The maximum pool size of the worker pool.
@param keepAliveTime The keep alive time of the worker pool.
@param unit The time unit of the specified keep alive time.
@return This b... | [
"Configures",
"a",
"worker",
"pool",
"for",
"the",
"converter",
"."
] | train | https://github.com/documents4j/documents4j/blob/eebb3ede43ffeb5fbfc85b3134f67a9c379a5594/documents4j-server-standalone/src/main/java/com/documents4j/builder/ConverterServerBuilder.java#L119-L128 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/managed_device.java | managed_device.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
managed_device_responses result = (managed_device_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
managed_device_responses result = (managed_device_responses) service.get_payload_formatter().string_to_resource(managed_device_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"managed_device_responses",
"result",
"=",
"(",
"managed_device_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/managed_device.java#L573-L590 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PickupUrl.java | PickupUrl.getAvailablePickupFulfillmentActionsUrl | public static MozuUrl getAvailablePickupFulfillmentActionsUrl(String orderId, String pickupId) {
"""
Get Resource Url for GetAvailablePickupFulfillmentActions
@param orderId Unique identifier of the order.
@param pickupId Unique identifier of the pickup to remove.
@return String Resource Url
"""
UrlFor... | java | public static MozuUrl getAvailablePickupFulfillmentActionsUrl(String orderId, String pickupId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/pickups/{pickupId}/actions");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("pickupId", pickupId);
return new MozuUrl(fo... | [
"public",
"static",
"MozuUrl",
"getAvailablePickupFulfillmentActionsUrl",
"(",
"String",
"orderId",
",",
"String",
"pickupId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{orderId}/pickups/{pickupId}/actions\"",
")",
";",
... | Get Resource Url for GetAvailablePickupFulfillmentActions
@param orderId Unique identifier of the order.
@param pickupId Unique identifier of the pickup to remove.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetAvailablePickupFulfillmentActions"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PickupUrl.java#L22-L28 |
alipay/sofa-rpc | extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/server/http/HttpServerHandler.java | HttpServerHandler.checkService | public boolean checkService(String serviceName, String methodName) {
"""
Check service exists
@param serviceName Service Name
@param methodName Method name
@return if service and method exists, return true.
"""
Invoker invoker = invokerMap.get(serviceName);
return invoker instanceof Provi... | java | public boolean checkService(String serviceName, String methodName) {
Invoker invoker = invokerMap.get(serviceName);
return invoker instanceof ProviderProxyInvoker && getMethod(serviceName, methodName) != null;
} | [
"public",
"boolean",
"checkService",
"(",
"String",
"serviceName",
",",
"String",
"methodName",
")",
"{",
"Invoker",
"invoker",
"=",
"invokerMap",
".",
"get",
"(",
"serviceName",
")",
";",
"return",
"invoker",
"instanceof",
"ProviderProxyInvoker",
"&&",
"getMethod... | Check service exists
@param serviceName Service Name
@param methodName Method name
@return if service and method exists, return true. | [
"Check",
"service",
"exists"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/server/http/HttpServerHandler.java#L130-L133 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java | KnowledgeSwitchYardScanner.toListenersModel | protected ListenersModel toListenersModel(Listener[] listenerAnnotations, KnowledgeNamespace knowledgeNamespace) {
"""
Converts listener annotations to listeners model.
@param listenerAnnotations annotations
@param knowledgeNamespace knowledgeNamespace
@return model
"""
if (listenerAnnotations == ... | java | protected ListenersModel toListenersModel(Listener[] listenerAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (listenerAnnotations == null || listenerAnnotations.length == 0) {
return null;
}
ListenersModel listenersModel = new V1ListenersModel(knowledgeNamespace.uri());
... | [
"protected",
"ListenersModel",
"toListenersModel",
"(",
"Listener",
"[",
"]",
"listenerAnnotations",
",",
"KnowledgeNamespace",
"knowledgeNamespace",
")",
"{",
"if",
"(",
"listenerAnnotations",
"==",
"null",
"||",
"listenerAnnotations",
".",
"length",
"==",
"0",
")",
... | Converts listener annotations to listeners model.
@param listenerAnnotations annotations
@param knowledgeNamespace knowledgeNamespace
@return model | [
"Converts",
"listener",
"annotations",
"to",
"listeners",
"model",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java#L163-L174 |
httl/httl | httl/src/main/java/httl/spi/codecs/json/JSONArray.java | JSONArray.getFloat | public float getFloat(int index, float def) {
"""
get float value.
@param index index.
@param def default value.
@return value or default value.
"""
Object tmp = mArray.get(index);
return tmp != null && tmp instanceof Number ? ((Number) tmp)
.floatValue() : def;
} | java | public float getFloat(int index, float def) {
Object tmp = mArray.get(index);
return tmp != null && tmp instanceof Number ? ((Number) tmp)
.floatValue() : def;
} | [
"public",
"float",
"getFloat",
"(",
"int",
"index",
",",
"float",
"def",
")",
"{",
"Object",
"tmp",
"=",
"mArray",
".",
"get",
"(",
"index",
")",
";",
"return",
"tmp",
"!=",
"null",
"&&",
"tmp",
"instanceof",
"Number",
"?",
"(",
"(",
"Number",
")",
... | get float value.
@param index index.
@param def default value.
@return value or default value. | [
"get",
"float",
"value",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/codecs/json/JSONArray.java#L88-L92 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.retrieveCertificateEmailHistoryAsync | public Observable<List<CertificateEmailInner>> retrieveCertificateEmailHistoryAsync(String resourceGroupName, String name) {
"""
Retrieve email history.
Retrieve email history.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the certificate order.
@throw... | java | public Observable<List<CertificateEmailInner>> retrieveCertificateEmailHistoryAsync(String resourceGroupName, String name) {
return retrieveCertificateEmailHistoryWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<List<CertificateEmailInner>>, List<CertificateEmailInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"CertificateEmailInner",
">",
">",
"retrieveCertificateEmailHistoryAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"retrieveCertificateEmailHistoryWithServiceResponseAsync",
"(",
"resourceGroupNa... | Retrieve email history.
Retrieve email history.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the certificate order.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<CertificateEmailInner> object | [
"Retrieve",
"email",
"history",
".",
"Retrieve",
"email",
"history",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L2351-L2358 |
mapbox/mapbox-events-android | liblocation/src/main/java/com/mapbox/android/core/permissions/PermissionsManager.java | PermissionsManager.onRequestPermissionsResult | public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
"""
You should call this method from your activity onRequestPermissionsResult.
@param requestCode The request code passed in requestPermissions(android.app.Activity, String[], int)
@param permissions The reque... | java | public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
switch (requestCode) {
case REQUEST_PERMISSIONS_CODE:
if (listener != null) {
boolean granted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED;
liste... | [
"public",
"void",
"onRequestPermissionsResult",
"(",
"int",
"requestCode",
",",
"String",
"[",
"]",
"permissions",
",",
"int",
"[",
"]",
"grantResults",
")",
"{",
"switch",
"(",
"requestCode",
")",
"{",
"case",
"REQUEST_PERMISSIONS_CODE",
":",
"if",
"(",
"list... | You should call this method from your activity onRequestPermissionsResult.
@param requestCode The request code passed in requestPermissions(android.app.Activity, String[], int)
@param permissions The requested permissions. Never null.
@param grantResults The grant results for the corresponding permissions which is e... | [
"You",
"should",
"call",
"this",
"method",
"from",
"your",
"activity",
"onRequestPermissionsResult",
"."
] | train | https://github.com/mapbox/mapbox-events-android/blob/5b5ca7e04cb8fab31a8dc040b6e7521f930a58a4/liblocation/src/main/java/com/mapbox/android/core/permissions/PermissionsManager.java#L95-L106 |
jscep/jscep | src/main/java/org/jscep/client/Client.java | Client.getCertificate | public CertStore getCertificate(final X509Certificate identity,
final PrivateKey key, final BigInteger serial, final String profile)
throws OperationFailureException, ClientException {
"""
Retrieves the certificate corresponding to the provided serial number.
<p>
This request relates only... | java | public CertStore getCertificate(final X509Certificate identity,
final PrivateKey key, final BigInteger serial, final String profile)
throws OperationFailureException, ClientException {
LOGGER.debug("Retriving certificate from CA");
// TRANSACTIONAL
// Certificate query
... | [
"public",
"CertStore",
"getCertificate",
"(",
"final",
"X509Certificate",
"identity",
",",
"final",
"PrivateKey",
"key",
",",
"final",
"BigInteger",
"serial",
",",
"final",
"String",
"profile",
")",
"throws",
"OperationFailureException",
",",
"ClientException",
"{",
... | Retrieves the certificate corresponding to the provided serial number.
<p>
This request relates only to the current CA certificate. If the CA
certificate has changed since the requested certificate was issued, this
operation will fail.
<p>
This method provides support for SCEP servers with multiple profiles.
@param id... | [
"Retrieves",
"the",
"certificate",
"corresponding",
"to",
"the",
"provided",
"serial",
"number",
".",
"<p",
">",
"This",
"request",
"relates",
"only",
"to",
"the",
"current",
"CA",
"certificate",
".",
"If",
"the",
"CA",
"certificate",
"has",
"changed",
"since"... | train | https://github.com/jscep/jscep/blob/d2c602f8b3adb774704c24eaf62f6b8654a40e35/src/main/java/org/jscep/client/Client.java#L524-L555 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java | Generators.findFirst | public static Token findFirst(final String name, final List<Token> tokens, final int index) {
"""
Find the first token with a given name from an index inclusive.
@param name to search for.
@param tokens to search.
@param index from which to search.
@return first found {@link Token} or throw a {@link Illeg... | java | public static Token findFirst(final String name, final List<Token> tokens, final int index)
{
for (int i = index, size = tokens.size(); i < size; i++)
{
final Token token = tokens.get(i);
if (token.name().equals(name))
{
return token;
}... | [
"public",
"static",
"Token",
"findFirst",
"(",
"final",
"String",
"name",
",",
"final",
"List",
"<",
"Token",
">",
"tokens",
",",
"final",
"int",
"index",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"index",
",",
"size",
"=",
"tokens",
".",
"size",
"(",
... | Find the first token with a given name from an index inclusive.
@param name to search for.
@param tokens to search.
@param index from which to search.
@return first found {@link Token} or throw a {@link IllegalStateException} if not found. | [
"Find",
"the",
"first",
"token",
"with",
"a",
"given",
"name",
"from",
"an",
"index",
"inclusive",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java#L91-L103 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.deleteSession | public DeleteSessionResponse deleteSession(DeleteSessionRequest request) {
"""
Delete your live session by live session id.
@param request The request object containing all parameters for deleting live session.
@return the response
"""
checkNotNull(request, "The parameter request should NOT be null... | java | public DeleteSessionResponse deleteSession(DeleteSessionRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getSessionId(), "The parameter sessionId should NOT be null or empty string.");
InternalRequest internalRequest = createReque... | [
"public",
"DeleteSessionResponse",
"deleteSession",
"(",
"DeleteSessionRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getSessionId",
"(",
")",
",",... | Delete your live session by live session id.
@param request The request object containing all parameters for deleting live session.
@return the response | [
"Delete",
"your",
"live",
"session",
"by",
"live",
"session",
"id",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L745-L751 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceClient.java | TraceServiceClient.patchTraces | public final void patchTraces(String projectId, Traces traces) {
"""
Sends new traces to Stackdriver Trace or updates existing traces. If the ID of a trace that you
send matches that of an existing trace, any fields in the existing trace and its spans are
overwritten by the provided values, and any new fields pr... | java | public final void patchTraces(String projectId, Traces traces) {
PatchTracesRequest request =
PatchTracesRequest.newBuilder().setProjectId(projectId).setTraces(traces).build();
patchTraces(request);
} | [
"public",
"final",
"void",
"patchTraces",
"(",
"String",
"projectId",
",",
"Traces",
"traces",
")",
"{",
"PatchTracesRequest",
"request",
"=",
"PatchTracesRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",
"setTraces",
"(",
... | Sends new traces to Stackdriver Trace or updates existing traces. If the ID of a trace that you
send matches that of an existing trace, any fields in the existing trace and its spans are
overwritten by the provided values, and any new fields provided are merged with the existing
trace data. If the ID does not match, a ... | [
"Sends",
"new",
"traces",
"to",
"Stackdriver",
"Trace",
"or",
"updates",
"existing",
"traces",
".",
"If",
"the",
"ID",
"of",
"a",
"trace",
"that",
"you",
"send",
"matches",
"that",
"of",
"an",
"existing",
"trace",
"any",
"fields",
"in",
"the",
"existing",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceClient.java#L187-L192 |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeOctetString | public static int encodeOctetString(short[] octets, ByteBuffer buf) {
"""
Encode an ASN.1 OCTET STRING.
@param octets
the octets
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data
"""
if (octets == null) {
... | java | public static int encodeOctetString(short[] octets, ByteBuffer buf) {
if (octets == null) {
octets = new short[0];
}
int pos = buf.position();
for (int i = octets.length - 1; i >= 0; i--) {
pos--;
buf.put(pos, (byte) octets[i]);
}
buf.p... | [
"public",
"static",
"int",
"encodeOctetString",
"(",
"short",
"[",
"]",
"octets",
",",
"ByteBuffer",
"buf",
")",
"{",
"if",
"(",
"octets",
"==",
"null",
")",
"{",
"octets",
"=",
"new",
"short",
"[",
"0",
"]",
";",
"}",
"int",
"pos",
"=",
"buf",
"."... | Encode an ASN.1 OCTET STRING.
@param octets
the octets
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"OCTET",
"STRING",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L354-L367 |
wkgcass/Style | src/main/java/net/cassite/style/aggregation/ListFuncSup.java | ListFuncSup.forEach | @SuppressWarnings("unchecked")
public <R> R forEach(VFunc2<T, IteratorInfo<R>> func, int index) {
"""
define a function to deal with each element in the list with given
start index
@param func
a function takes in each element from list and
iterator info
@param index
the index where to start iterati... | java | @SuppressWarnings("unchecked")
public <R> R forEach(VFunc2<T, IteratorInfo<R>> func, int index) {
return (R) forEach($(func), index);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"R",
">",
"R",
"forEach",
"(",
"VFunc2",
"<",
"T",
",",
"IteratorInfo",
"<",
"R",
">",
">",
"func",
",",
"int",
"index",
")",
"{",
"return",
"(",
"R",
")",
"forEach",
"(",
"$",
"(",... | define a function to deal with each element in the list with given
start index
@param func
a function takes in each element from list and
iterator info
@param index
the index where to start iteration
@return return 'last loop value'.<br>
check
<a href="https://github.com/wkgcass/Style/">tutorial</a> for
more info abou... | [
"define",
"a",
"function",
"to",
"deal",
"with",
"each",
"element",
"in",
"the",
"list",
"with",
"given",
"start",
"index"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/aggregation/ListFuncSup.java#L84-L87 |
windup/windup | rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/packagemapping/PackageNameMapping.java | PackageNameMapping.getOrganizationForPackage | public static String getOrganizationForPackage(GraphRewrite event, String pkg) {
"""
Gets the organization for the given package (or Maven group id).
"""
final String pkgComparison = pkg + ".";
String organization = null;
for (Map.Entry<String, String> entry : getMappings(event).entrySe... | java | public static String getOrganizationForPackage(GraphRewrite event, String pkg)
{
final String pkgComparison = pkg + ".";
String organization = null;
for (Map.Entry<String, String> entry : getMappings(event).entrySet())
{
final String pkgPattern = entry.getKey() + ".";
... | [
"public",
"static",
"String",
"getOrganizationForPackage",
"(",
"GraphRewrite",
"event",
",",
"String",
"pkg",
")",
"{",
"final",
"String",
"pkgComparison",
"=",
"pkg",
"+",
"\".\"",
";",
"String",
"organization",
"=",
"null",
";",
"for",
"(",
"Map",
".",
"E... | Gets the organization for the given package (or Maven group id). | [
"Gets",
"the",
"organization",
"for",
"the",
"given",
"package",
"(",
"or",
"Maven",
"group",
"id",
")",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/packagemapping/PackageNameMapping.java#L38-L56 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java | PatternsImpl.batchAddPatternsAsync | public Observable<List<PatternRuleInfo>> batchAddPatternsAsync(UUID appId, String versionId, List<PatternRuleCreateObject> patterns) {
"""
Adds a batch of patterns to the specified application.
@param appId The application ID.
@param versionId The version ID.
@param patterns A JSON array containing patterns.
... | java | public Observable<List<PatternRuleInfo>> batchAddPatternsAsync(UUID appId, String versionId, List<PatternRuleCreateObject> patterns) {
return batchAddPatternsWithServiceResponseAsync(appId, versionId, patterns).map(new Func1<ServiceResponse<List<PatternRuleInfo>>, List<PatternRuleInfo>>() {
@Overrid... | [
"public",
"Observable",
"<",
"List",
"<",
"PatternRuleInfo",
">",
">",
"batchAddPatternsAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"List",
"<",
"PatternRuleCreateObject",
">",
"patterns",
")",
"{",
"return",
"batchAddPatternsWithServiceResponseAsyn... | Adds a batch of patterns to the specified application.
@param appId The application ID.
@param versionId The version ID.
@param patterns A JSON array containing patterns.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<PatternRuleInfo> object | [
"Adds",
"a",
"batch",
"of",
"patterns",
"to",
"the",
"specified",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java#L503-L510 |
aws/aws-sdk-java | aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/UpdateBranchRequest.java | UpdateBranchRequest.withEnvironmentVariables | public UpdateBranchRequest withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
"""
<p>
Environment Variables for the branch.
</p>
@param environmentVariables
Environment Variables for the branch.
@return Returns a reference to this object so that method calls can be chained togeth... | java | public UpdateBranchRequest withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
setEnvironmentVariables(environmentVariables);
return this;
} | [
"public",
"UpdateBranchRequest",
"withEnvironmentVariables",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"environmentVariables",
")",
"{",
"setEnvironmentVariables",
"(",
"environmentVariables",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Environment Variables for the branch.
</p>
@param environmentVariables
Environment Variables for the branch.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Environment",
"Variables",
"for",
"the",
"branch",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/UpdateBranchRequest.java#L462-L465 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/traverson/Traverson.java | Traverson.streamAs | @SuppressWarnings("unchecked")
public <T extends HalRepresentation> Stream<T> streamAs(final Class<T> type,
final EmbeddedTypeInfo embeddedTypeInfo,
final EmbeddedTypeInfo... moreEmbeddedTypeInfos... | java | @SuppressWarnings("unchecked")
public <T extends HalRepresentation> Stream<T> streamAs(final Class<T> type,
final EmbeddedTypeInfo embeddedTypeInfo,
final EmbeddedTypeInfo... moreEmbeddedTypeInfos... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"HalRepresentation",
">",
"Stream",
"<",
"T",
">",
"streamAs",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"EmbeddedTypeInfo",
"embeddedTypeInfo",
",",
"final",
... | Follow the {@link Link}s of the current resource, selected by its link-relation type and returns a {@link Stream}
containing the returned {@link HalRepresentation HalRepresentations}.
<p>
The EmbeddedTypeInfo is used to define the specific type of embedded items.
</p>
<p>
Templated links are expanded to URIs using the ... | [
"Follow",
"the",
"{"
] | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/traverson/Traverson.java#L1031-L1043 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DisasterRecoveryConfigurationsInner.java | DisasterRecoveryConfigurationsInner.createOrUpdate | public DisasterRecoveryConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String disasterRecoveryConfigurationName) {
"""
Creates or updates a disaster recovery configuration.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this valu... | java | public DisasterRecoveryConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String disasterRecoveryConfigurationName) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, disasterRecoveryConfigurationName).toBlocking().last().body();
} | [
"public",
"DisasterRecoveryConfigurationInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"disasterRecoveryConfigurationName",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"s... | Creates or updates a disaster recovery configuration.
@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 disasterRecoveryConfigurationName The name of the disas... | [
"Creates",
"or",
"updates",
"a",
"disaster",
"recovery",
"configuration",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DisasterRecoveryConfigurationsInner.java#L371-L373 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.setParam | @Override
public void setParam(String key, INDArray val) {
"""
Set the values of a single parameter. See {@link #setParamTable(Map)} and {@link #getParam(String)} for more
details.
@param key the key of the parameter to set
@param val the new values for the parameter
"""
//Set params for MultiLa... | java | @Override
public void setParam(String key, INDArray val) {
//Set params for MultiLayerNetwork sub layers.
int idx = key.indexOf('_');
if (idx == -1)
throw new IllegalStateException("Invalid param key: not have layer separator: \"" + key + "\"");
int layerIdx = Integer.par... | [
"@",
"Override",
"public",
"void",
"setParam",
"(",
"String",
"key",
",",
"INDArray",
"val",
")",
"{",
"//Set params for MultiLayerNetwork sub layers.",
"int",
"idx",
"=",
"key",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"idx",
"==",
"-",
"1",
... | Set the values of a single parameter. See {@link #setParamTable(Map)} and {@link #getParam(String)} for more
details.
@param key the key of the parameter to set
@param val the new values for the parameter | [
"Set",
"the",
"values",
"of",
"a",
"single",
"parameter",
".",
"See",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L567-L577 |
calimero-project/calimero-core | src/tuwien/auto/calimero/mgmt/TransportLayerImpl.java | TransportLayerImpl.createDestination | @Override
public Destination createDestination(final IndividualAddress remote,
final boolean connectionOriented) {
"""
{@inheritDoc} Only one destination can be created per remote address. If a
destination with the supplied remote address already exists for this transport
layer, a {@link KNXIllegalArgumentExc... | java | @Override
public Destination createDestination(final IndividualAddress remote,
final boolean connectionOriented)
{
return createDestination(remote, connectionOriented, false, false);
} | [
"@",
"Override",
"public",
"Destination",
"createDestination",
"(",
"final",
"IndividualAddress",
"remote",
",",
"final",
"boolean",
"connectionOriented",
")",
"{",
"return",
"createDestination",
"(",
"remote",
",",
"connectionOriented",
",",
"false",
",",
"false",
... | {@inheritDoc} Only one destination can be created per remote address. If a
destination with the supplied remote address already exists for this transport
layer, a {@link KNXIllegalArgumentException} is thrown.<br>
A transport layer can only handle one connection per destination, because it can't
distinguish incoming me... | [
"{"
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/TransportLayerImpl.java#L219-L224 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java | WSRdbManagedConnectionImpl.getSQLJConnectionContext | public final Object getSQLJConnectionContext(Class<?> DefaultContext, WSConnectionManager cm) throws SQLException {
"""
This method returns the SQLJ ConnectionContext. This method is only called by
the WSJccConnection class. The ConnectionContext caches all the RTStatements
@param DefaultContext the sqlj.runti... | java | public final Object getSQLJConnectionContext(Class<?> DefaultContext, WSConnectionManager cm) throws SQLException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(this, tc, "getSQLJConnectionContext");
if (sqljContext ... | [
"public",
"final",
"Object",
"getSQLJConnectionContext",
"(",
"Class",
"<",
"?",
">",
"DefaultContext",
",",
"WSConnectionManager",
"cm",
")",
"throws",
"SQLException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")"... | This method returns the SQLJ ConnectionContext. This method is only called by
the WSJccConnection class. The ConnectionContext caches all the RTStatements
@param DefaultContext the sqlj.runtime.ref.DefaultContext class
@return sqlj.runtime.ref.DefaultContext
@exception SQLException - failed to create SQLJ Connection C... | [
"This",
"method",
"returns",
"the",
"SQLJ",
"ConnectionContext",
".",
"This",
"method",
"is",
"only",
"called",
"by",
"the",
"WSJccConnection",
"class",
".",
"The",
"ConnectionContext",
"caches",
"all",
"the",
"RTStatements"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java#L4202-L4222 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.awaitReceivedResponses | public static void awaitReceivedResponses(final SipCall call, final int count) {
"""
Await until a the size of {@link SipCall#getAllReceivedResponses()} is equal to count.
@param call the {@link SipCall} under test
@param count the expected amount of responses
@throws ConditionTimeoutException If condition wa... | java | public static void awaitReceivedResponses(final SipCall call, final int count) {
await().until(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return call.getAllReceivedResponses().size();
}
}, is(count));
} | [
"public",
"static",
"void",
"awaitReceivedResponses",
"(",
"final",
"SipCall",
"call",
",",
"final",
"int",
"count",
")",
"{",
"await",
"(",
")",
".",
"until",
"(",
"new",
"Callable",
"<",
"Integer",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Intege... | Await until a the size of {@link SipCall#getAllReceivedResponses()} is equal to count.
@param call the {@link SipCall} under test
@param count the expected amount of responses
@throws ConditionTimeoutException If condition was not fulfilled within the default time
period. | [
"Await",
"until",
"a",
"the",
"size",
"of",
"{",
"@link",
"SipCall#getAllReceivedResponses",
"()",
"}",
"is",
"equal",
"to",
"count",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L285-L293 |
outbrain/ob1k | ob1k-cache/src/main/java/com/outbrain/ob1k/cache/memcache/folsom/MemcachedClientBuilder.java | MemcachedClientBuilder.newMessagePackClient | public static <T> MemcachedClientBuilder<T> newMessagePackClient(final MessagePack messagePack, final Type valueType) {
"""
Create a client builder for MessagePack values.
@return The builder
"""
return newClient(new MessagePackTranscoder<>(messagePack, valueType));
} | java | public static <T> MemcachedClientBuilder<T> newMessagePackClient(final MessagePack messagePack, final Type valueType) {
return newClient(new MessagePackTranscoder<>(messagePack, valueType));
} | [
"public",
"static",
"<",
"T",
">",
"MemcachedClientBuilder",
"<",
"T",
">",
"newMessagePackClient",
"(",
"final",
"MessagePack",
"messagePack",
",",
"final",
"Type",
"valueType",
")",
"{",
"return",
"newClient",
"(",
"new",
"MessagePackTranscoder",
"<>",
"(",
"m... | Create a client builder for MessagePack values.
@return The builder | [
"Create",
"a",
"client",
"builder",
"for",
"MessagePack",
"values",
"."
] | train | https://github.com/outbrain/ob1k/blob/9e43ab39230c5787065053da0f766d822d0fe4e7/ob1k-cache/src/main/java/com/outbrain/ob1k/cache/memcache/folsom/MemcachedClientBuilder.java#L80-L82 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsVfsSitemapService.java | CmsVfsSitemapService.createClientProperty | public static CmsClientProperty createClientProperty(CmsProperty prop, boolean preserveOrigin) {
"""
Creates a client property bean from a server-side property.<p>
@param prop the property from which to create the client property
@param preserveOrigin if true, the origin will be copied into the new object
@... | java | public static CmsClientProperty createClientProperty(CmsProperty prop, boolean preserveOrigin) {
CmsClientProperty result = new CmsClientProperty(
prop.getName(),
prop.getStructureValue(),
prop.getResourceValue());
if (preserveOrigin) {
result.setOrigin(p... | [
"public",
"static",
"CmsClientProperty",
"createClientProperty",
"(",
"CmsProperty",
"prop",
",",
"boolean",
"preserveOrigin",
")",
"{",
"CmsClientProperty",
"result",
"=",
"new",
"CmsClientProperty",
"(",
"prop",
".",
"getName",
"(",
")",
",",
"prop",
".",
"getSt... | Creates a client property bean from a server-side property.<p>
@param prop the property from which to create the client property
@param preserveOrigin if true, the origin will be copied into the new object
@return the new client property | [
"Creates",
"a",
"client",
"property",
"bean",
"from",
"a",
"server",
"-",
"side",
"property",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsVfsSitemapService.java#L292-L302 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java | AbstractTreeWriter.addTree | protected void addTree(List<ClassDoc> list, String heading, Content div) {
"""
Add the heading for the tree depending upon tree type if it's a
Class Tree or Interface tree.
@param list List of classes which are at the most base level, all the
other classes in this run will derive from these classes
@param he... | java | protected void addTree(List<ClassDoc> list, String heading, Content div) {
if (list.size() > 0) {
ClassDoc firstClassDoc = list.get(0);
Content headingContent = getResource(heading);
div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
head... | [
"protected",
"void",
"addTree",
"(",
"List",
"<",
"ClassDoc",
">",
"list",
",",
"String",
"heading",
",",
"Content",
"div",
")",
"{",
"if",
"(",
"list",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"ClassDoc",
"firstClassDoc",
"=",
"list",
".",
"get",
... | Add the heading for the tree depending upon tree type if it's a
Class Tree or Interface tree.
@param list List of classes which are at the most base level, all the
other classes in this run will derive from these classes
@param heading heading for the tree
@param div the content tree to which the tree will be added | [
"Add",
"the",
"heading",
"for",
"the",
"tree",
"depending",
"upon",
"tree",
"type",
"if",
"it",
"s",
"a",
"Class",
"Tree",
"or",
"Interface",
"tree",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java#L113-L122 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/utils/Crc32.java | Crc32.bytes | public static long bytes(byte[] data, int offset, int length) {
"""
计算二进制字节校验码
@param data 二进制数据
@param offset 起始字节索引
@param length 校验字节长度
@return 校验码
"""
CRC32 crc32 = new CRC32();
crc32.update(data, offset, length);
return crc32.getValue();
} | java | public static long bytes(byte[] data, int offset, int length) {
CRC32 crc32 = new CRC32();
crc32.update(data, offset, length);
return crc32.getValue();
} | [
"public",
"static",
"long",
"bytes",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"CRC32",
"crc32",
"=",
"new",
"CRC32",
"(",
")",
";",
"crc32",
".",
"update",
"(",
"data",
",",
"offset",
",",
"length",
")",
... | 计算二进制字节校验码
@param data 二进制数据
@param offset 起始字节索引
@param length 校验字节长度
@return 校验码 | [
"计算二进制字节校验码"
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/utils/Crc32.java#L21-L25 |
mapbox/mapbox-events-android | libcore/src/main/java/com/mapbox/android/core/FileUtils.java | FileUtils.getFile | @NonNull
public static File getFile(@NonNull Context context, @NonNull String fileName) {
"""
Return file from context.getFilesDir()/fileName
@param context application context
@param fileName path to the file
@return instance of the file object.
"""
return new File(context.getFilesDir(), fileName)... | java | @NonNull
public static File getFile(@NonNull Context context, @NonNull String fileName) {
return new File(context.getFilesDir(), fileName);
} | [
"@",
"NonNull",
"public",
"static",
"File",
"getFile",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"String",
"fileName",
")",
"{",
"return",
"new",
"File",
"(",
"context",
".",
"getFilesDir",
"(",
")",
",",
"fileName",
")",
";",
"}"
] | Return file from context.getFilesDir()/fileName
@param context application context
@param fileName path to the file
@return instance of the file object. | [
"Return",
"file",
"from",
"context",
".",
"getFilesDir",
"()",
"/",
"fileName"
] | train | https://github.com/mapbox/mapbox-events-android/blob/5b5ca7e04cb8fab31a8dc040b6e7521f930a58a4/libcore/src/main/java/com/mapbox/android/core/FileUtils.java#L37-L40 |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/SmbFile.java | SmbFile.listFiles | public SmbFile[] listFiles( String wildcard ) throws SmbException {
"""
The CIFS protocol provides for DOS "wildcards" to be used as
a performance enhancement. The client does not have to filter
the names and the server does not have to return all directory
entries.
<p>
The wildcard expression may consist of ... | java | public SmbFile[] listFiles( String wildcard ) throws SmbException {
return listFiles( wildcard, ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, null, null );
} | [
"public",
"SmbFile",
"[",
"]",
"listFiles",
"(",
"String",
"wildcard",
")",
"throws",
"SmbException",
"{",
"return",
"listFiles",
"(",
"wildcard",
",",
"ATTR_DIRECTORY",
"|",
"ATTR_HIDDEN",
"|",
"ATTR_SYSTEM",
",",
"null",
",",
"null",
")",
";",
"}"
] | The CIFS protocol provides for DOS "wildcards" to be used as
a performance enhancement. The client does not have to filter
the names and the server does not have to return all directory
entries.
<p>
The wildcard expression may consist of two special meta
characters in addition to the normal filename characters. The '*'... | [
"The",
"CIFS",
"protocol",
"provides",
"for",
"DOS",
"wildcards",
"to",
"be",
"used",
"as",
"a",
"performance",
"enhancement",
".",
"The",
"client",
"does",
"not",
"have",
"to",
"filter",
"the",
"names",
"and",
"the",
"server",
"does",
"not",
"have",
"to",... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/SmbFile.java#L1684-L1686 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Sheet.java | Sheet.swapRows | public void swapRows(Object rowKeyA, Object rowKeyB) {
"""
Swap the positions of the two specified rows.
@param rowKeyA
@param rowKeyB
"""
checkFrozen();
final int rowIndexA = this.getRowIndex(rowKeyA);
final int rowIndexB = this.getRowIndex(rowKeyB);
final List<R> t... | java | public void swapRows(Object rowKeyA, Object rowKeyB) {
checkFrozen();
final int rowIndexA = this.getRowIndex(rowKeyA);
final int rowIndexB = this.getRowIndex(rowKeyB);
final List<R> tmp = new ArrayList<>(rowLength());
tmp.addAll(_rowKeySet);
final R tmpRowKeyA =... | [
"public",
"void",
"swapRows",
"(",
"Object",
"rowKeyA",
",",
"Object",
"rowKeyB",
")",
"{",
"checkFrozen",
"(",
")",
";",
"final",
"int",
"rowIndexA",
"=",
"this",
".",
"getRowIndex",
"(",
"rowKeyA",
")",
";",
"final",
"int",
"rowIndexB",
"=",
"this",
".... | Swap the positions of the two specified rows.
@param rowKeyA
@param rowKeyB | [
"Swap",
"the",
"positions",
"of",
"the",
"two",
"specified",
"rows",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Sheet.java#L582-L609 |
jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractItem.java | AbstractItem.doDoDelete | @RequirePOST
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
"""
Deletes this item.
Note on the funny name: for reasons of historical compatibility, this URL is {@code /doDelete}
since it predates {@code <l:confirmationLink>}. {@c... | java | @RequirePOST
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
delete();
if (req == null || rsp == null) { // CLI
return;
}
List<Ancestor> ancestors = req.getAncestors();
ListIterator<Anc... | [
"@",
"RequirePOST",
"public",
"void",
"doDoDelete",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
",",
"ServletException",
",",
"InterruptedException",
"{",
"delete",
"(",
")",
";",
"if",
"(",
"req",
"==",
"null",
"... | Deletes this item.
Note on the funny name: for reasons of historical compatibility, this URL is {@code /doDelete}
since it predates {@code <l:confirmationLink>}. {@code /delete} goes to a Jelly page
which should now be unused by core but is left in case plugins are still using it. | [
"Deletes",
"this",
"item",
".",
"Note",
"on",
"the",
"funny",
"name",
":",
"for",
"reasons",
"of",
"historical",
"compatibility",
"this",
"URL",
"is",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractItem.java#L643-L663 |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/hello/HelloREEFStandalone.java | HelloREEFStandalone.main | public static void main(final String[] args) throws BindException, InjectionException {
"""
Start Hello REEF job.
@param args command line parameters.
@throws BindException configuration error.
@throws InjectionException configuration error.
"""
final Tang tang = Tang.Factory.getTang();
fin... | java | public static void main(final String[] args) throws BindException, InjectionException {
final Tang tang = Tang.Factory.getTang();
final JavaConfigurationBuilder cb = tang.newConfigurationBuilder();
try{
new CommandLine(cb)
.registerShortNameOfClass(NodeListFilePath.class)
.regis... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"BindException",
",",
"InjectionException",
"{",
"final",
"Tang",
"tang",
"=",
"Tang",
".",
"Factory",
".",
"getTang",
"(",
")",
";",
"final",
"JavaConfigurationBuil... | Start Hello REEF job.
@param args command line parameters.
@throws BindException configuration error.
@throws InjectionException configuration error. | [
"Start",
"Hello",
"REEF",
"job",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/hello/HelloREEFStandalone.java#L87-L115 |
landawn/AbacusUtil | src/com/landawn/abacus/util/URLEncodedUtil.java | URLEncodedUtil.encPath | static void encPath(final StringBuilder sb, final String content, final Charset charset) {
"""
Encode a String using the {@link #PATHSAFE} set of characters.
<p>
Used by URIBuilder to encode path segments.
@param content
the string to encode, does not convert space to '+'
@param charset
the charset to use
... | java | static void encPath(final StringBuilder sb, final String content, final Charset charset) {
urlEncode(sb, content, charset, PATHSAFE, false);
} | [
"static",
"void",
"encPath",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"String",
"content",
",",
"final",
"Charset",
"charset",
")",
"{",
"urlEncode",
"(",
"sb",
",",
"content",
",",
"charset",
",",
"PATHSAFE",
",",
"false",
")",
";",
"}"
] | Encode a String using the {@link #PATHSAFE} set of characters.
<p>
Used by URIBuilder to encode path segments.
@param content
the string to encode, does not convert space to '+'
@param charset
the charset to use
@return the encoded string | [
"Encode",
"a",
"String",
"using",
"the",
"{",
"@link",
"#PATHSAFE",
"}",
"set",
"of",
"characters",
".",
"<p",
">",
"Used",
"by",
"URIBuilder",
"to",
"encode",
"path",
"segments",
".",
"@param",
"content",
"the",
"string",
"to",
"encode",
"does",
"not",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/URLEncodedUtil.java#L544-L546 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.unrotateAndScalePoint | public Point unrotateAndScalePoint(int x, int y, Point reuse) {
"""
This will revert the current map's scaling and rotation for a point. This can be useful when
drawing to a fixed location on the screen.
"""
return applyMatrixToPoint(x, y, reuse, mUnrotateAndScaleMatrix, mOrientation != 0);
} | java | public Point unrotateAndScalePoint(int x, int y, Point reuse) {
return applyMatrixToPoint(x, y, reuse, mUnrotateAndScaleMatrix, mOrientation != 0);
} | [
"public",
"Point",
"unrotateAndScalePoint",
"(",
"int",
"x",
",",
"int",
"y",
",",
"Point",
"reuse",
")",
"{",
"return",
"applyMatrixToPoint",
"(",
"x",
",",
"y",
",",
"reuse",
",",
"mUnrotateAndScaleMatrix",
",",
"mOrientation",
"!=",
"0",
")",
";",
"}"
] | This will revert the current map's scaling and rotation for a point. This can be useful when
drawing to a fixed location on the screen. | [
"This",
"will",
"revert",
"the",
"current",
"map",
"s",
"scaling",
"and",
"rotation",
"for",
"a",
"point",
".",
"This",
"can",
"be",
"useful",
"when",
"drawing",
"to",
"a",
"fixed",
"location",
"on",
"the",
"screen",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L366-L368 |
tvesalainen/lpg | src/main/java/org/vesalainen/parser/util/Input.java | Input.getInstance | public static <T> InputReader getInstance(T input, int size, String cs) throws IOException {
"""
Returns InputReader for input
@param <T>
@param input Any supported input type
@param size Ring-buffer size
@param cs Character set
@return
@throws IOException
"""
return getInstance(input, size, Char... | java | public static <T> InputReader getInstance(T input, int size, String cs) throws IOException
{
return getInstance(input, size, Charset.forName(cs), NO_FEATURES);
} | [
"public",
"static",
"<",
"T",
">",
"InputReader",
"getInstance",
"(",
"T",
"input",
",",
"int",
"size",
",",
"String",
"cs",
")",
"throws",
"IOException",
"{",
"return",
"getInstance",
"(",
"input",
",",
"size",
",",
"Charset",
".",
"forName",
"(",
"cs",... | Returns InputReader for input
@param <T>
@param input Any supported input type
@param size Ring-buffer size
@param cs Character set
@return
@throws IOException | [
"Returns",
"InputReader",
"for",
"input"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/parser/util/Input.java#L191-L194 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.toSpreadMap | public static SpreadMap toSpreadMap(Object[] self) {
"""
Creates a spreadable map from this array.
<p>
@param self an object array
@return a newly created SpreadMap
@see groovy.lang.SpreadMap#SpreadMap(java.lang.Object[])
@see #toSpreadMap(java.util.Map)
@since 1.0
"""
if (self == null)
... | java | public static SpreadMap toSpreadMap(Object[] self) {
if (self == null)
throw new GroovyRuntimeException("Fail to convert Object[] to SpreadMap, because it is null.");
else if (self.length % 2 != 0)
throw new GroovyRuntimeException("Fail to convert Object[] to SpreadMap, because i... | [
"public",
"static",
"SpreadMap",
"toSpreadMap",
"(",
"Object",
"[",
"]",
"self",
")",
"{",
"if",
"(",
"self",
"==",
"null",
")",
"throw",
"new",
"GroovyRuntimeException",
"(",
"\"Fail to convert Object[] to SpreadMap, because it is null.\"",
")",
";",
"else",
"if",
... | Creates a spreadable map from this array.
<p>
@param self an object array
@return a newly created SpreadMap
@see groovy.lang.SpreadMap#SpreadMap(java.lang.Object[])
@see #toSpreadMap(java.util.Map)
@since 1.0 | [
"Creates",
"a",
"spreadable",
"map",
"from",
"this",
"array",
".",
"<p",
">"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8541-L8548 |
JavaMoney/jsr354-ri | moneta-core/src/main/java/org/javamoney/moneta/CurrencyUnitBuilder.java | CurrencyUnitBuilder.of | public static CurrencyUnitBuilder of(String currencyCode, String providerName) {
"""
Creates a new CurrencyUnitBuilder, creates a simple CurrencyContext using the given provider name.
@param currencyCode the (unique) and identifying currency code, not null.
@param providerName the currency provider, not null.
... | java | public static CurrencyUnitBuilder of(String currencyCode, String providerName) {
return new CurrencyUnitBuilder(currencyCode, CurrencyContextBuilder.of(providerName).build());
} | [
"public",
"static",
"CurrencyUnitBuilder",
"of",
"(",
"String",
"currencyCode",
",",
"String",
"providerName",
")",
"{",
"return",
"new",
"CurrencyUnitBuilder",
"(",
"currencyCode",
",",
"CurrencyContextBuilder",
".",
"of",
"(",
"providerName",
")",
".",
"build",
... | Creates a new CurrencyUnitBuilder, creates a simple CurrencyContext using the given provider name.
@param currencyCode the (unique) and identifying currency code, not null.
@param providerName the currency provider, not null. | [
"Creates",
"a",
"new",
"CurrencyUnitBuilder",
"creates",
"a",
"simple",
"CurrencyContext",
"using",
"the",
"given",
"provider",
"name",
"."
] | train | https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/CurrencyUnitBuilder.java#L70-L72 |
jbundle/webapp | base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java | HttpServiceTracker.addURLPath | public static String addURLPath(String basePath, String path) {
"""
Add the base path to get an http path (**Move this to Util?**)
@param basePath
@param path
@return
"""
if (basePath == null)
basePath = "";
if ((!basePath.endsWith("/")) && (!path.startsWith("/")))
... | java | public static String addURLPath(String basePath, String path) {
if (basePath == null)
basePath = "";
if ((!basePath.endsWith("/")) && (!path.startsWith("/")))
path = "/" + path;
if (basePath.length() > 0)
path = basePath + path;
if (path.length() == 0)... | [
"public",
"static",
"String",
"addURLPath",
"(",
"String",
"basePath",
",",
"String",
"path",
")",
"{",
"if",
"(",
"basePath",
"==",
"null",
")",
"basePath",
"=",
"\"\"",
";",
"if",
"(",
"(",
"!",
"basePath",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
... | Add the base path to get an http path (**Move this to Util?**)
@param basePath
@param path
@return | [
"Add",
"the",
"base",
"path",
"to",
"get",
"an",
"http",
"path",
"(",
"**",
"Move",
"this",
"to",
"Util?",
"**",
")"
] | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L207-L219 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/route/Route.java | Route.HEAD | public static Route HEAD(String uriPattern, RouteHandler routeHandler) {
"""
Create a {@code HEAD} route.
@param uriPattern
@param routeHandler
@return
"""
return new Route(HttpConstants.Method.HEAD, uriPattern, routeHandler);
} | java | public static Route HEAD(String uriPattern, RouteHandler routeHandler) {
return new Route(HttpConstants.Method.HEAD, uriPattern, routeHandler);
} | [
"public",
"static",
"Route",
"HEAD",
"(",
"String",
"uriPattern",
",",
"RouteHandler",
"routeHandler",
")",
"{",
"return",
"new",
"Route",
"(",
"HttpConstants",
".",
"Method",
".",
"HEAD",
",",
"uriPattern",
",",
"routeHandler",
")",
";",
"}"
] | Create a {@code HEAD} route.
@param uriPattern
@param routeHandler
@return | [
"Create",
"a",
"{",
"@code",
"HEAD",
"}",
"route",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/route/Route.java#L103-L105 |
twilio/twilio-java | src/main/java/com/twilio/rest/monitor/v1/AlertReader.java | AlertReader.nextPage | @Override
public Page<Alert> nextPage(final Page<Alert> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page
"""
Request r... | java | @Override
public Page<Alert> nextPage(final Page<Alert> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.MONITOR.toString(),
client.getRegion()
... | [
"@",
"Override",
"public",
"Page",
"<",
"Alert",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"Alert",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
",",
"pag... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/monitor/v1/AlertReader.java#L127-L138 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/DoubleRangeRandomizer.java | DoubleRangeRandomizer.aNewDoubleRangeRandomizer | public static DoubleRangeRandomizer aNewDoubleRangeRandomizer(final Double min, final Double max, final long seed) {
"""
Create a new {@link DoubleRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link DoubleRangeRandomizer}.
"""
return new Dou... | java | public static DoubleRangeRandomizer aNewDoubleRangeRandomizer(final Double min, final Double max, final long seed) {
return new DoubleRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"DoubleRangeRandomizer",
"aNewDoubleRangeRandomizer",
"(",
"final",
"Double",
"min",
",",
"final",
"Double",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"DoubleRangeRandomizer",
"(",
"min",
",",
"max",
",",
"seed",
")",
... | Create a new {@link DoubleRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link DoubleRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"DoubleRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/DoubleRangeRandomizer.java#L90-L92 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/event/push/subscriptions/EventDeliverySummaryUrl.java | EventDeliverySummaryUrl.getDeliveryAttemptSummaryUrl | public static MozuUrl getDeliveryAttemptSummaryUrl(Integer processId, String responseFields, String subscriptionId) {
"""
Get Resource Url for GetDeliveryAttemptSummary
@param processId
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSO... | java | public static MozuUrl getDeliveryAttemptSummaryUrl(Integer processId, String responseFields, String subscriptionId)
{
UrlFormatter formatter = new UrlFormatter("/api/event/push/subscriptions/{subscriptionId}/deliveryattempts/{id}?responseFields={responseFields}");
formatter.formatUrl("processId", processId);
... | [
"public",
"static",
"MozuUrl",
"getDeliveryAttemptSummaryUrl",
"(",
"Integer",
"processId",
",",
"String",
"responseFields",
",",
"String",
"subscriptionId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/event/push/subscriptions/{subscripti... | Get Resource Url for GetDeliveryAttemptSummary
@param processId
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss... | [
"Get",
"Resource",
"Url",
"for",
"GetDeliveryAttemptSummary"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/event/push/subscriptions/EventDeliverySummaryUrl.java#L23-L30 |
JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.forID | @FromString
public static DateTimeZone forID(String id) {
"""
Gets a time zone instance for the specified time zone id.
<p>
The time zone id may be one of those returned by getAvailableIDs.
Short ids, as accepted by {@link java.util.TimeZone}, are not accepted.
All IDs must be specified in the long format.... | java | @FromString
public static DateTimeZone forID(String id) {
if (id == null) {
return getDefault();
}
if (id.equals("UTC")) {
return DateTimeZone.UTC;
}
DateTimeZone zone = getProvider().getZone(id);
if (zone != null) {
return zone;
... | [
"@",
"FromString",
"public",
"static",
"DateTimeZone",
"forID",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"getDefault",
"(",
")",
";",
"}",
"if",
"(",
"id",
".",
"equals",
"(",
"\"UTC\"",
")",
")",
"{",
"retu... | Gets a time zone instance for the specified time zone id.
<p>
The time zone id may be one of those returned by getAvailableIDs.
Short ids, as accepted by {@link java.util.TimeZone}, are not accepted.
All IDs must be specified in the long format.
The exception is UTC, which is an acceptable id.
<p>
Alternatively a local... | [
"Gets",
"a",
"time",
"zone",
"instance",
"for",
"the",
"specified",
"time",
"zone",
"id",
".",
"<p",
">",
"The",
"time",
"zone",
"id",
"may",
"be",
"one",
"of",
"those",
"returned",
"by",
"getAvailableIDs",
".",
"Short",
"ids",
"as",
"accepted",
"by",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L213-L235 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java | CPMeasurementUnitPersistenceImpl.findByUUID_G | @Override
public CPMeasurementUnit findByUUID_G(String uuid, long groupId)
throws NoSuchCPMeasurementUnitException {
"""
Returns the cp measurement unit where uuid = ? and groupId = ? or throws a {@link NoSuchCPMeasurementUnitException} if it could not be found.
@param uuid the uuid
@param groupId t... | java | @Override
public CPMeasurementUnit findByUUID_G(String uuid, long groupId)
throws NoSuchCPMeasurementUnitException {
CPMeasurementUnit cpMeasurementUnit = fetchByUUID_G(uuid, groupId);
if (cpMeasurementUnit == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg... | [
"@",
"Override",
"public",
"CPMeasurementUnit",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPMeasurementUnitException",
"{",
"CPMeasurementUnit",
"cpMeasurementUnit",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";"... | Returns the cp measurement unit where uuid = ? and groupId = ? or throws a {@link NoSuchCPMeasurementUnitException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp measurement unit
@throws NoSuchCPMeasurementUnitException if a matching cp measurement unit coul... | [
"Returns",
"the",
"cp",
"measurement",
"unit",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPMeasurementUnitException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java#L668-L694 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.readLines | public static void readLines(Reader reader, LineHandler lineHandler) throws IORuntimeException {
"""
按行读取数据,针对每行的数据做处理<br>
{@link Reader}自带编码定义,因此读取数据的编码跟随其编码。
@param reader {@link Reader}
@param lineHandler 行处理接口,实现handle方法用于编辑一行的数据后入到指定地方
@throws IORuntimeException IO异常
"""
Assert.notNull(reader);
... | java | public static void readLines(Reader reader, LineHandler lineHandler) throws IORuntimeException {
Assert.notNull(reader);
Assert.notNull(lineHandler);
// 从返回的内容中读取所需内容
final BufferedReader bReader = getReader(reader);
String line = null;
try {
while ((line = bReader.readLine()) != null) {
li... | [
"public",
"static",
"void",
"readLines",
"(",
"Reader",
"reader",
",",
"LineHandler",
"lineHandler",
")",
"throws",
"IORuntimeException",
"{",
"Assert",
".",
"notNull",
"(",
"reader",
")",
";",
"Assert",
".",
"notNull",
"(",
"lineHandler",
")",
";",
"// 从返回的内容... | 按行读取数据,针对每行的数据做处理<br>
{@link Reader}自带编码定义,因此读取数据的编码跟随其编码。
@param reader {@link Reader}
@param lineHandler 行处理接口,实现handle方法用于编辑一行的数据后入到指定地方
@throws IORuntimeException IO异常 | [
"按行读取数据,针对每行的数据做处理<br",
">",
"{",
"@link",
"Reader",
"}",
"自带编码定义,因此读取数据的编码跟随其编码。"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L714-L728 |
JM-Lab/utils-elasticsearch | src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java | JMElasticsearchSearchAndCount.searchAllWithTargetCount | public SearchResponse searchAllWithTargetCount(String index, String type,
QueryBuilder filterQueryBuilder) {
"""
Search all with target count search response.
@param index the index
@param type the type
@param filterQueryBuilder the filter query builder
@return the sear... | java | public SearchResponse searchAllWithTargetCount(String index, String type,
QueryBuilder filterQueryBuilder) {
return searchAllWithTargetCount(index, type, filterQueryBuilder, null);
} | [
"public",
"SearchResponse",
"searchAllWithTargetCount",
"(",
"String",
"index",
",",
"String",
"type",
",",
"QueryBuilder",
"filterQueryBuilder",
")",
"{",
"return",
"searchAllWithTargetCount",
"(",
"index",
",",
"type",
",",
"filterQueryBuilder",
",",
"null",
")",
... | Search all with target count search response.
@param index the index
@param type the type
@param filterQueryBuilder the filter query builder
@return the search response | [
"Search",
"all",
"with",
"target",
"count",
"search",
"response",
"."
] | train | https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java#L651-L654 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java | DatabasesInner.beginUpdate | public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) {
"""
Updates a database.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName T... | java | public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body();
} | [
"public",
"DatabaseInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
",",
"DatabaseUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clust... | Updates a database.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@param parameters The database parameters supplied to the Update operation.
@throws IllegalArgum... | [
"Updates",
"a",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java#L676-L678 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.getOnlineLink | public String getOnlineLink(CmsObject cms, String resourceName, boolean forceSecure) {
"""
Returns the online link for the given resource, with full server prefix.<p>
Like <code>http://site.enterprise.com:8080/index.html</code>.<p>
In case the resource name is a full root path, the site from the root path wi... | java | public String getOnlineLink(CmsObject cms, String resourceName, boolean forceSecure) {
String result = "";
try {
CmsProject currentProject = cms.getRequestContext().getCurrentProject();
try {
cms.getRequestContext().setCurrentProject(cms.readProject(CmsProject.ON... | [
"public",
"String",
"getOnlineLink",
"(",
"CmsObject",
"cms",
",",
"String",
"resourceName",
",",
"boolean",
"forceSecure",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"try",
"{",
"CmsProject",
"currentProject",
"=",
"cms",
".",
"getRequestContext",
"(",
"... | Returns the online link for the given resource, with full server prefix.<p>
Like <code>http://site.enterprise.com:8080/index.html</code>.<p>
In case the resource name is a full root path, the site from the root path will be used.
Otherwise the resource is assumed to be in the current site set be the OpenCms user cont... | [
"Returns",
"the",
"online",
"link",
"for",
"the",
"given",
"resource",
"with",
"full",
"server",
"prefix",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L333-L353 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java | WebSiteManagementClientImpl.checkNameAvailabilityAsync | public Observable<ResourceNameAvailabilityInner> checkNameAvailabilityAsync(String name, CheckNameResourceTypes type, Boolean isFqdn) {
"""
Check if a resource name is available.
Check if a resource name is available.
@param name Resource name to verify.
@param type Resource type used for verification. Possib... | java | public Observable<ResourceNameAvailabilityInner> checkNameAvailabilityAsync(String name, CheckNameResourceTypes type, Boolean isFqdn) {
return checkNameAvailabilityWithServiceResponseAsync(name, type, isFqdn).map(new Func1<ServiceResponse<ResourceNameAvailabilityInner>, ResourceNameAvailabilityInner>() {
... | [
"public",
"Observable",
"<",
"ResourceNameAvailabilityInner",
">",
"checkNameAvailabilityAsync",
"(",
"String",
"name",
",",
"CheckNameResourceTypes",
"type",
",",
"Boolean",
"isFqdn",
")",
"{",
"return",
"checkNameAvailabilityWithServiceResponseAsync",
"(",
"name",
",",
... | Check if a resource name is available.
Check if a resource name is available.
@param name Resource name to verify.
@param type Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', 'Microsoft.Web/hosting... | [
"Check",
"if",
"a",
"resource",
"name",
"is",
"available",
".",
"Check",
"if",
"a",
"resource",
"name",
"is",
"available",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java#L1278-L1285 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java | ApiOvhCaasregistry.serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE | public void serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE(String serviceName, String namespaceId, String imageId, String permissionId) throws IOException {
"""
Delete image permissions.
REST: DELETE /caas/registry/{serviceName}/namespaces/{namespaceId}/images/{imageId}/permis... | java | public void serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE(String serviceName, String namespaceId, String imageId, String permissionId) throws IOException {
String qPath = "/caas/registry/{serviceName}/namespaces/{namespaceId}/images/{imageId}/permissions/{permissionId}";
StringBu... | [
"public",
"void",
"serviceName_namespaces_namespaceId_images_imageId_permissions_permissionId_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"namespaceId",
",",
"String",
"imageId",
",",
"String",
"permissionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
... | Delete image permissions.
REST: DELETE /caas/registry/{serviceName}/namespaces/{namespaceId}/images/{imageId}/permissions/{permissionId}
@param imageId [required] Image id
@param namespaceId [required] Namespace id
@param permissionId [required] Permission id
@param serviceName [required] Service name
API beta | [
"Delete",
"image",
"permissions",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java#L304-L308 |
JOML-CI/JOML | src/org/joml/Vector4d.java | Vector4d.fma | public Vector4d fma(Vector4dc a, Vector4dc b) {
"""
Add the component-wise multiplication of <code>a * b</code> to this vector.
@param a
the first multiplicand
@param b
the second multiplicand
@return a vector holding the result
"""
return fma(a, b, thisOrNew());
} | java | public Vector4d fma(Vector4dc a, Vector4dc b) {
return fma(a, b, thisOrNew());
} | [
"public",
"Vector4d",
"fma",
"(",
"Vector4dc",
"a",
",",
"Vector4dc",
"b",
")",
"{",
"return",
"fma",
"(",
"a",
",",
"b",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Add the component-wise multiplication of <code>a * b</code> to this vector.
@param a
the first multiplicand
@param b
the second multiplicand
@return a vector holding the result | [
"Add",
"the",
"component",
"-",
"wise",
"multiplication",
"of",
"<code",
">",
"a",
"*",
"b<",
"/",
"code",
">",
"to",
"this",
"vector",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4d.java#L797-L799 |
oasp/oasp4j | modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java | RestServiceExceptionFacade.toResponse | protected Response toResponse(Throwable exception, Throwable catched) {
"""
@see #toResponse(Throwable)
@param exception the exception to handle
@param catched the original exception that was cached. Either same as {@code error} or a (child-)
{@link Throwable#getCause() cause} of it.
@return the response bui... | java | protected Response toResponse(Throwable exception, Throwable catched) {
if (exception instanceof ValidationException) {
return handleValidationException(exception, catched);
} else if (exception instanceof ValidationErrorUserException) {
return createResponse(exception, (ValidationErrorUserExceptio... | [
"protected",
"Response",
"toResponse",
"(",
"Throwable",
"exception",
",",
"Throwable",
"catched",
")",
"{",
"if",
"(",
"exception",
"instanceof",
"ValidationException",
")",
"{",
"return",
"handleValidationException",
"(",
"exception",
",",
"catched",
")",
";",
"... | @see #toResponse(Throwable)
@param exception the exception to handle
@param catched the original exception that was cached. Either same as {@code error} or a (child-)
{@link Throwable#getCause() cause} of it.
@return the response build from the exception. | [
"@see",
"#toResponse",
"(",
"Throwable",
")"
] | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java#L226-L241 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/lang/URIUtils.java | URIUtils.newURI | public static String newURI(String scheme, String server, int port, String path, String query) {
"""
Create a new URI from the arguments, handling IPv6 host encoding and default ports
@param scheme the URI scheme
@param server the URI server
@param port the URI port
@param path the URI path
@param query... | java | public static String newURI(String scheme, String server, int port, String path, String query) {
StringBuilder builder = newURIBuilder(scheme, server, port);
builder.append(path);
if (query != null && query.length() > 0)
builder.append('?').append(query);
return builder.toStr... | [
"public",
"static",
"String",
"newURI",
"(",
"String",
"scheme",
",",
"String",
"server",
",",
"int",
"port",
",",
"String",
"path",
",",
"String",
"query",
")",
"{",
"StringBuilder",
"builder",
"=",
"newURIBuilder",
"(",
"scheme",
",",
"server",
",",
"por... | Create a new URI from the arguments, handling IPv6 host encoding and default ports
@param scheme the URI scheme
@param server the URI server
@param port the URI port
@param path the URI path
@param query the URI query
@return A String URI | [
"Create",
"a",
"new",
"URI",
"from",
"the",
"arguments",
"handling",
"IPv6",
"host",
"encoding",
"and",
"default",
"ports"
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/lang/URIUtils.java#L838-L844 |
gallandarakhneorg/afc | advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/StandardRoadConnection.java | StandardRoadConnection.computeAngle | private double computeAngle(RoadPolyline segment, boolean fromStartPoint) {
"""
Compute the angle of the given road segment according
to the vector (1,0).
@return the angle between the vector (<code>RoadConnection.this</code>,<var>segment</var>)
and (1,0).
"""
double angle = Double.NaN;
Point2d p1 = n... | java | private double computeAngle(RoadPolyline segment, boolean fromStartPoint) {
double angle = Double.NaN;
Point2d p1 = null;
Point2d p2 = null;
if (segment.getPointCount() > 1) {
if (fromStartPoint) {
final RoadConnection startPoint = segment.getBeginPoint(StandardRoadConnection.class);
if (startPoint =... | [
"private",
"double",
"computeAngle",
"(",
"RoadPolyline",
"segment",
",",
"boolean",
"fromStartPoint",
")",
"{",
"double",
"angle",
"=",
"Double",
".",
"NaN",
";",
"Point2d",
"p1",
"=",
"null",
";",
"Point2d",
"p2",
"=",
"null",
";",
"if",
"(",
"segment",
... | Compute the angle of the given road segment according
to the vector (1,0).
@return the angle between the vector (<code>RoadConnection.this</code>,<var>segment</var>)
and (1,0). | [
"Compute",
"the",
"angle",
"of",
"the",
"given",
"road",
"segment",
"according",
"to",
"the",
"vector",
"(",
"1",
"0",
")",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/StandardRoadConnection.java#L236-L293 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_firewall_GET | public ArrayList<String> ip_firewall_GET(String ip, Boolean enabled, OvhFirewallStateEnum state) throws IOException {
"""
Ip under firewall
REST: GET /ip/{ip}/firewall
@param enabled [required] Filter the value of enabled property (=)
@param state [required] Filter the value of state property (=)
@param ip [... | java | public ArrayList<String> ip_firewall_GET(String ip, Boolean enabled, OvhFirewallStateEnum state) throws IOException {
String qPath = "/ip/{ip}/firewall";
StringBuilder sb = path(qPath, ip);
query(sb, "enabled", enabled);
query(sb, "state", state);
String resp = exec(qPath, "GET", sb.toString(), null);
retur... | [
"public",
"ArrayList",
"<",
"String",
">",
"ip_firewall_GET",
"(",
"String",
"ip",
",",
"Boolean",
"enabled",
",",
"OvhFirewallStateEnum",
"state",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/firewall\"",
";",
"StringBuilder",
"sb",
"=",... | Ip under firewall
REST: GET /ip/{ip}/firewall
@param enabled [required] Filter the value of enabled property (=)
@param state [required] Filter the value of state property (=)
@param ip [required] | [
"Ip",
"under",
"firewall"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L973-L980 |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/JacksonUtils.java | JacksonUtils.stringToJsonNode | public static JsonNode stringToJsonNode(String paramName, String val) {
"""
Converts a String containing a JSON document into a {@link JsonNode}.
@param paramName Param name to use in exception message.
@param val String JSON document.
@return JsonNode representing document.
"""
if (val == null) {... | java | public static JsonNode stringToJsonNode(String paramName, String val) {
if (val == null) {
return null;
}
try {
return MAPPER.readTree(val);
} catch (IOException e) {
throw new SdkClientException(paramName + " must be a valid JSON document", e);
... | [
"public",
"static",
"JsonNode",
"stringToJsonNode",
"(",
"String",
"paramName",
",",
"String",
"val",
")",
"{",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"MAPPER",
".",
"readTree",
"(",
"val",
")",
";",... | Converts a String containing a JSON document into a {@link JsonNode}.
@param paramName Param name to use in exception message.
@param val String JSON document.
@return JsonNode representing document. | [
"Converts",
"a",
"String",
"containing",
"a",
"JSON",
"document",
"into",
"a",
"{",
"@link",
"JsonNode",
"}",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/JacksonUtils.java#L65-L74 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.