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 |
|---|---|---|---|---|---|---|---|---|---|---|
duracloud/duracloud | s3storageprovider/src/main/java/org/duracloud/s3task/streaming/BaseStreamingTaskRunner.java | BaseStreamingTaskRunner.setDistributionState | protected void setDistributionState(String distId, boolean enabled) {
"""
Enables or disables an existing distribution
@param distId the ID of the distribution
@param enabled true to enable, false to disable
"""
GetStreamingDistributionConfigResult result =
cfClient.getStreamingDistrib... | java | protected void setDistributionState(String distId, boolean enabled) {
GetStreamingDistributionConfigResult result =
cfClient.getStreamingDistributionConfig(
new GetStreamingDistributionConfigRequest(distId));
StreamingDistributionConfig distConfig =
result.getStr... | [
"protected",
"void",
"setDistributionState",
"(",
"String",
"distId",
",",
"boolean",
"enabled",
")",
"{",
"GetStreamingDistributionConfigResult",
"result",
"=",
"cfClient",
".",
"getStreamingDistributionConfig",
"(",
"new",
"GetStreamingDistributionConfigRequest",
"(",
"di... | Enables or disables an existing distribution
@param distId the ID of the distribution
@param enabled true to enable, false to disable | [
"Enables",
"or",
"disables",
"an",
"existing",
"distribution"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3task/streaming/BaseStreamingTaskRunner.java#L120-L134 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java | PoiUtil.searchCell | public static Cell searchCell(Sheet sheet, String searchKey) {
"""
查找单元格。
@param sheet 表单
@param searchKey 单元格中包含的关键字
@return 单元格,没有找到时返回null
"""
if (StringUtils.isEmpty(searchKey)) return null;
for (int i = sheet.getFirstRowNum(), ii = sheet.getLastRowNum(); i < ii; ++i) {
... | java | public static Cell searchCell(Sheet sheet, String searchKey) {
if (StringUtils.isEmpty(searchKey)) return null;
for (int i = sheet.getFirstRowNum(), ii = sheet.getLastRowNum(); i < ii; ++i) {
Cell cell = searchRow(sheet.getRow(i), searchKey);
if (cell != null) return cell;
... | [
"public",
"static",
"Cell",
"searchCell",
"(",
"Sheet",
"sheet",
",",
"String",
"searchKey",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"searchKey",
")",
")",
"return",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"sheet",
".",
"getFirstRowNum... | 查找单元格。
@param sheet 表单
@param searchKey 单元格中包含的关键字
@return 单元格,没有找到时返回null | [
"查找单元格。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java#L361-L370 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java | XmlUtil.writeObjectAsXml | public static void writeObjectAsXml(File dest, Object bean) throws IOException {
"""
将可序列化的对象转换为XML写入文件,已经存在的文件将被覆盖<br>
Writes serializable object to a XML file. Existing file will be overwritten
@param dest 目标文件
@param bean 对象
@throws IOException IO异常
"""
XMLEncoder xmlenc = null;
try {
xmlenc... | java | public static void writeObjectAsXml(File dest, Object bean) throws IOException {
XMLEncoder xmlenc = null;
try {
xmlenc = new XMLEncoder(FileUtil.getOutputStream(dest));
xmlenc.writeObject(bean);
} finally {
// 关闭XMLEncoder会相应关闭OutputStream
IoUtil.close(xmlenc);
}
} | [
"public",
"static",
"void",
"writeObjectAsXml",
"(",
"File",
"dest",
",",
"Object",
"bean",
")",
"throws",
"IOException",
"{",
"XMLEncoder",
"xmlenc",
"=",
"null",
";",
"try",
"{",
"xmlenc",
"=",
"new",
"XMLEncoder",
"(",
"FileUtil",
".",
"getOutputStream",
... | 将可序列化的对象转换为XML写入文件,已经存在的文件将被覆盖<br>
Writes serializable object to a XML file. Existing file will be overwritten
@param dest 目标文件
@param bean 对象
@throws IOException IO异常 | [
"将可序列化的对象转换为XML写入文件,已经存在的文件将被覆盖<br",
">",
"Writes",
"serializable",
"object",
"to",
"a",
"XML",
"file",
".",
"Existing",
"file",
"will",
"be",
"overwritten"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L541-L550 |
apache/spark | common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java | YarnShuffleService.initRecoveryDb | protected File initRecoveryDb(String dbName) {
"""
Figure out the recovery path and handle moving the DB if YARN NM recovery gets enabled
and DB exists in the local dir of NM by old version of shuffle service.
"""
Preconditions.checkNotNull(_recoveryPath,
"recovery path should not be null if NM reco... | java | protected File initRecoveryDb(String dbName) {
Preconditions.checkNotNull(_recoveryPath,
"recovery path should not be null if NM recovery is enabled");
File recoveryFile = new File(_recoveryPath.toUri().getPath(), dbName);
if (recoveryFile.exists()) {
return recoveryFile;
}
// db doesn... | [
"protected",
"File",
"initRecoveryDb",
"(",
"String",
"dbName",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"_recoveryPath",
",",
"\"recovery path should not be null if NM recovery is enabled\"",
")",
";",
"File",
"recoveryFile",
"=",
"new",
"File",
"(",
"_reco... | Figure out the recovery path and handle moving the DB if YARN NM recovery gets enabled
and DB exists in the local dir of NM by old version of shuffle service. | [
"Figure",
"out",
"the",
"recovery",
"path",
"and",
"handle",
"moving",
"the",
"DB",
"if",
"YARN",
"NM",
"recovery",
"gets",
"enabled",
"and",
"DB",
"exists",
"in",
"the",
"local",
"dir",
"of",
"NM",
"by",
"old",
"version",
"of",
"shuffle",
"service",
"."... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java#L363-L401 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/LightWeightLinkedSet.java | LightWeightLinkedSet.addElem | protected boolean addElem(final T element) {
"""
Add given element to the hash table
@return true if the element was not present in the table, false otherwise
"""
// validate element
if (element == null) {
throw new IllegalArgumentException("Null element is not supported.");
}
// find ... | java | protected boolean addElem(final T element) {
// validate element
if (element == null) {
throw new IllegalArgumentException("Null element is not supported.");
}
// find hashCode & index
final int hashCode = element.hashCode();
final int index = getIndex(hashCode);
// return false if alr... | [
"protected",
"boolean",
"addElem",
"(",
"final",
"T",
"element",
")",
"{",
"// validate element",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null element is not supported.\"",
")",
";",
"}",
"// find hashCode & ... | Add given element to the hash table
@return true if the element was not present in the table, false otherwise | [
"Add",
"given",
"element",
"to",
"the",
"hash",
"table"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightLinkedSet.java#L82-L114 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/io/SynchronizedIO.java | SynchronizedIO.writeFile | public void writeFile(String aFilePath, byte[] aData, boolean append) throws IOException {
"""
Write binary file data
@param aFilePath the file path to write
@param aData the data to write
@param append to append or not
@throws IOException when an IO error occurs
"""
Object lock = retrieveLock(aFi... | java | public void writeFile(String aFilePath, byte[] aData, boolean append) throws IOException
{
Object lock = retrieveLock(aFilePath);
synchronized (lock)
{
IO.writeFile(aFilePath, aData,append);
}
} | [
"public",
"void",
"writeFile",
"(",
"String",
"aFilePath",
",",
"byte",
"[",
"]",
"aData",
",",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"Object",
"lock",
"=",
"retrieveLock",
"(",
"aFilePath",
")",
";",
"synchronized",
"(",
"lock",
")",
"{"... | Write binary file data
@param aFilePath the file path to write
@param aData the data to write
@param append to append or not
@throws IOException when an IO error occurs | [
"Write",
"binary",
"file",
"data"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/io/SynchronizedIO.java#L102-L110 |
motown-io/motown | vas/view-model/src/main/java/io/motown/vas/viewmodel/VasEventHandler.java | VasEventHandler.updateLocationForChargingStation | private void updateLocationForChargingStation(ChargingStationId chargingStationId, Coordinates coordinates, Address address, Accessibility accessibility) {
"""
Updates the location of the charging station to either new lat/long coordinates or a geographical address (or both).
If the charging station cannot be fou... | java | private void updateLocationForChargingStation(ChargingStationId chargingStationId, Coordinates coordinates, Address address, Accessibility accessibility) {
ChargingStation chargingStation = getChargingStation(chargingStationId);
if (chargingStation != null) {
if (coordinates != null) {
... | [
"private",
"void",
"updateLocationForChargingStation",
"(",
"ChargingStationId",
"chargingStationId",
",",
"Coordinates",
"coordinates",
",",
"Address",
"address",
",",
"Accessibility",
"accessibility",
")",
"{",
"ChargingStation",
"chargingStation",
"=",
"getChargingStation"... | Updates the location of the charging station to either new lat/long coordinates or a geographical address (or both).
If the charging station cannot be found in the repository an error is logged.
@param chargingStationId charging station identifier.
@param coordinates the lat/long coordinates of the charging stat... | [
"Updates",
"the",
"location",
"of",
"the",
"charging",
"station",
"to",
"either",
"new",
"lat",
"/",
"long",
"coordinates",
"or",
"a",
"geographical",
"address",
"(",
"or",
"both",
")",
".",
"If",
"the",
"charging",
"station",
"cannot",
"be",
"found",
"in"... | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/vas/view-model/src/main/java/io/motown/vas/viewmodel/VasEventHandler.java#L269-L291 |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/AbstractPlanNode.java | AbstractPlanNode.replaceChild | public boolean replaceChild(AbstractPlanNode oldChild, AbstractPlanNode newChild) {
"""
Replace an existing child with a new one preserving the child's position.
@param oldChild The node to replace.
@param newChild The new node.
@return true if the child was replaced
"""
assert(oldChild != null);
... | java | public boolean replaceChild(AbstractPlanNode oldChild, AbstractPlanNode newChild) {
assert(oldChild != null);
assert(newChild != null);
int idx = 0;
for (AbstractPlanNode child : m_children) {
if (child.equals(oldChild)) {
oldChild.m_parents.clear();
... | [
"public",
"boolean",
"replaceChild",
"(",
"AbstractPlanNode",
"oldChild",
",",
"AbstractPlanNode",
"newChild",
")",
"{",
"assert",
"(",
"oldChild",
"!=",
"null",
")",
";",
"assert",
"(",
"newChild",
"!=",
"null",
")",
";",
"int",
"idx",
"=",
"0",
";",
"for... | Replace an existing child with a new one preserving the child's position.
@param oldChild The node to replace.
@param newChild The new node.
@return true if the child was replaced | [
"Replace",
"an",
"existing",
"child",
"with",
"a",
"new",
"one",
"preserving",
"the",
"child",
"s",
"position",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/AbstractPlanNode.java#L660-L673 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.listSwaggerAsync | public Observable<Object> listSwaggerAsync(String resourceGroupName, String workflowName) {
"""
Gets an OpenAPI definition for the workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@throws IllegalArgumentException thrown if parameters fail the validation
@retu... | java | public Observable<Object> listSwaggerAsync(String resourceGroupName, String workflowName) {
return listSwaggerWithServiceResponseAsync(resourceGroupName, workflowName).map(new Func1<ServiceResponse<Object>, Object>() {
@Override
public Object call(ServiceResponse<Object> response) {
... | [
"public",
"Observable",
"<",
"Object",
">",
"listSwaggerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
")",
"{",
"return",
"listSwaggerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
")",
".",
"map",
"(",
"new",
... | Gets an OpenAPI definition for the workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Object object | [
"Gets",
"an",
"OpenAPI",
"definition",
"for",
"the",
"workflow",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L1431-L1438 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.withdrawal_withdrawalId_details_withdrawalDetailId_GET | public OvhWithdrawalDetail withdrawal_withdrawalId_details_withdrawalDetailId_GET(String withdrawalId, String withdrawalDetailId) throws IOException {
"""
Get this object properties
REST: GET /me/withdrawal/{withdrawalId}/details/{withdrawalDetailId}
@param withdrawalId [required]
@param withdrawalDetailId [r... | java | public OvhWithdrawalDetail withdrawal_withdrawalId_details_withdrawalDetailId_GET(String withdrawalId, String withdrawalDetailId) throws IOException {
String qPath = "/me/withdrawal/{withdrawalId}/details/{withdrawalDetailId}";
StringBuilder sb = path(qPath, withdrawalId, withdrawalDetailId);
String resp = exec(q... | [
"public",
"OvhWithdrawalDetail",
"withdrawal_withdrawalId_details_withdrawalDetailId_GET",
"(",
"String",
"withdrawalId",
",",
"String",
"withdrawalDetailId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/withdrawal/{withdrawalId}/details/{withdrawalDetailId}\"",
... | Get this object properties
REST: GET /me/withdrawal/{withdrawalId}/details/{withdrawalDetailId}
@param withdrawalId [required]
@param withdrawalDetailId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L4306-L4311 |
apache/incubator-gobblin | gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleDriveSource.java | GoogleDriveSource.initFileSystemHelper | @Override
public synchronized void initFileSystemHelper(State state) throws FileBasedHelperException {
"""
Initialize file system helper at most once for this instance.
{@inheritDoc}
@see org.apache.gobblin.source.extractor.filebased.FileBasedSource#initFileSystemHelper(org.apache.gobblin.configuration.State)
... | java | @Override
public synchronized void initFileSystemHelper(State state) throws FileBasedHelperException {
if (fsHelper == null) {
Credential credential = new GoogleCommon.CredentialBuilder(state.getProp(SOURCE_CONN_PRIVATE_KEY), state.getPropAsList(API_SCOPES))
.fi... | [
"@",
"Override",
"public",
"synchronized",
"void",
"initFileSystemHelper",
"(",
"State",
"state",
")",
"throws",
"FileBasedHelperException",
"{",
"if",
"(",
"fsHelper",
"==",
"null",
")",
"{",
"Credential",
"credential",
"=",
"new",
"GoogleCommon",
".",
"Credentia... | Initialize file system helper at most once for this instance.
{@inheritDoc}
@see org.apache.gobblin.source.extractor.filebased.FileBasedSource#initFileSystemHelper(org.apache.gobblin.configuration.State) | [
"Initialize",
"file",
"system",
"helper",
"at",
"most",
"once",
"for",
"this",
"instance",
".",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleDriveSource.java#L77-L94 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imageutils/BitmapUtil.java | BitmapUtil.decodeDimensionsAndColorSpace | public static ImageMetaData decodeDimensionsAndColorSpace(InputStream is) {
"""
Decodes the bounds of an image and returns its width and height or null if the size can't be
determined. It also recovers the color space of the image, or null if it can't be determined.
@param is the InputStream containing the ima... | java | public static ImageMetaData decodeDimensionsAndColorSpace(InputStream is) {
Preconditions.checkNotNull(is);
ByteBuffer byteBuffer = DECODE_BUFFERS.acquire();
if (byteBuffer == null) {
byteBuffer = ByteBuffer.allocate(DECODE_BUFFER_SIZE);
}
BitmapFactory.Options options = new BitmapFactory.Opti... | [
"public",
"static",
"ImageMetaData",
"decodeDimensionsAndColorSpace",
"(",
"InputStream",
"is",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"is",
")",
";",
"ByteBuffer",
"byteBuffer",
"=",
"DECODE_BUFFERS",
".",
"acquire",
"(",
")",
";",
"if",
"(",
"byt... | Decodes the bounds of an image and returns its width and height or null if the size can't be
determined. It also recovers the color space of the image, or null if it can't be determined.
@param is the InputStream containing the image data
@return the metadata of the image | [
"Decodes",
"the",
"bounds",
"of",
"an",
"image",
"and",
"returns",
"its",
"width",
"and",
"height",
"or",
"null",
"if",
"the",
"size",
"can",
"t",
"be",
"determined",
".",
"It",
"also",
"recovers",
"the",
"color",
"space",
"of",
"the",
"image",
"or",
"... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imageutils/BitmapUtil.java#L134-L154 |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.withPathParamSerializer | public Descriptor withPathParamSerializer(Type pathParamType, PathParamSerializer<?> pathParamSerializer) {
"""
Provide a custom path param serializer for the given path param type.
@param pathParamType The path param type.
@param pathParamSerializer The path param serializer.
@return A copy of this descripto... | java | public Descriptor withPathParamSerializer(Type pathParamType, PathParamSerializer<?> pathParamSerializer) {
return replaceAllPathParamSerializers(pathParamSerializers.plus(pathParamType, pathParamSerializer));
} | [
"public",
"Descriptor",
"withPathParamSerializer",
"(",
"Type",
"pathParamType",
",",
"PathParamSerializer",
"<",
"?",
">",
"pathParamSerializer",
")",
"{",
"return",
"replaceAllPathParamSerializers",
"(",
"pathParamSerializers",
".",
"plus",
"(",
"pathParamType",
",",
... | Provide a custom path param serializer for the given path param type.
@param pathParamType The path param type.
@param pathParamSerializer The path param serializer.
@return A copy of this descriptor. | [
"Provide",
"a",
"custom",
"path",
"param",
"serializer",
"for",
"the",
"given",
"path",
"param",
"type",
"."
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L678-L680 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/BytesWritable.java | BytesWritable.copyTo | public int copyTo(byte[] dest, int start)
throws BufferTooSmallException {
"""
copy the byte array to the dest array, and return the number of bytes
copied.
@param dest
@param maxLen
@param start
@return
"""
if (size > (dest.length - start)) {
throw new BufferTooSmallException("size is "... | java | public int copyTo(byte[] dest, int start)
throws BufferTooSmallException {
if (size > (dest.length - start)) {
throw new BufferTooSmallException("size is " + size
+ ", buffer availabe size is " + (dest.length - start));
}
if (size > 0) {
System.arraycopy(bytes, 0, dest, start, si... | [
"public",
"int",
"copyTo",
"(",
"byte",
"[",
"]",
"dest",
",",
"int",
"start",
")",
"throws",
"BufferTooSmallException",
"{",
"if",
"(",
"size",
">",
"(",
"dest",
".",
"length",
"-",
"start",
")",
")",
"{",
"throw",
"new",
"BufferTooSmallException",
"(",... | copy the byte array to the dest array, and return the number of bytes
copied.
@param dest
@param maxLen
@param start
@return | [
"copy",
"the",
"byte",
"array",
"to",
"the",
"dest",
"array",
"and",
"return",
"the",
"number",
"of",
"bytes",
"copied",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BytesWritable.java#L74-L84 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/internal/JsonPolicyWriter.java | JsonPolicyWriter.writePolicyToString | public String writePolicyToString(Policy policy) {
"""
Converts the specified AWS policy object to a JSON string, suitable for
passing to an AWS service.
@param policy
The AWS policy object to convert to a JSON string.
@return The JSON string representation of the specified policy object.
@throws Illega... | java | public String writePolicyToString(Policy policy) {
if(!isNotNull(policy))
throw new IllegalArgumentException("Policy cannot be null");
try {
return jsonStringOf(policy);
} catch (Exception e) {
String message = "Unable to serialize policy to JSON string: "
... | [
"public",
"String",
"writePolicyToString",
"(",
"Policy",
"policy",
")",
"{",
"if",
"(",
"!",
"isNotNull",
"(",
"policy",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Policy cannot be null\"",
")",
";",
"try",
"{",
"return",
"jsonStringOf",
"(",... | Converts the specified AWS policy object to a JSON string, suitable for
passing to an AWS service.
@param policy
The AWS policy object to convert to a JSON string.
@return The JSON string representation of the specified policy object.
@throws IllegalArgumentException
If the specified policy is null or invalid and ca... | [
"Converts",
"the",
"specified",
"AWS",
"policy",
"object",
"to",
"a",
"JSON",
"string",
"suitable",
"for",
"passing",
"to",
"an",
"AWS",
"service",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/internal/JsonPolicyWriter.java#L83-L97 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_outlookAvailability_GET | public ArrayList<OvhOutlookVersions> organizationName_service_exchangeService_outlookAvailability_GET(String organizationName, String exchangeService, OvhLanguageEnum outlookLanguage, OvhOutlookVersionEnum outlookVersion) throws IOException {
"""
Show available outlooks
REST: GET /email/exchange/{organizationNa... | java | public ArrayList<OvhOutlookVersions> organizationName_service_exchangeService_outlookAvailability_GET(String organizationName, String exchangeService, OvhLanguageEnum outlookLanguage, OvhOutlookVersionEnum outlookVersion) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService... | [
"public",
"ArrayList",
"<",
"OvhOutlookVersions",
">",
"organizationName_service_exchangeService_outlookAvailability_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"OvhLanguageEnum",
"outlookLanguage",
",",
"OvhOutlookVersionEnum",
"outlookVersion",... | Show available outlooks
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/outlookAvailability
@param outlookLanguage [required] Language version of outlook
@param outlookVersion [required] OS version of outlook
@param organizationName [required] The internal name of your exchange organization
@par... | [
"Show",
"available",
"outlooks"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L2387-L2394 |
sporniket/p3 | src/main/java/com/sporniket/libre/p3/P3.java | P3.executeProgram | @SuppressWarnings("PMD.UnusedFormalParameter")
private void executeProgram(String name, String source) throws Exception {
"""
The processor for extracting directives.
@param name
property name, unused.
@param source
the directives.
@throws Exception
when there is a problem.
"""
List<Statement> _dire... | java | @SuppressWarnings("PMD.UnusedFormalParameter")
private void executeProgram(String name, String source) throws Exception
{
List<Statement> _directives = executeProgram__compile(source);
boolean _canProceed = !isAllowedOverrideRequired() || isAllowingOverride();
if (_canProceed && !_directives.isEmpty())
{
e... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.UnusedFormalParameter\"",
")",
"private",
"void",
"executeProgram",
"(",
"String",
"name",
",",
"String",
"source",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Statement",
">",
"_directives",
"=",
"executeProgram__compile",
"(... | The processor for extracting directives.
@param name
property name, unused.
@param source
the directives.
@throws Exception
when there is a problem. | [
"The",
"processor",
"for",
"extracting",
"directives",
"."
] | train | https://github.com/sporniket/p3/blob/fc20b3066dc4a9cd759090adae0a6b02508df135/src/main/java/com/sporniket/libre/p3/P3.java#L536-L546 |
cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/QueryChemObject.java | QueryChemObject.addProperties | @Override
public void addProperties(Map<Object, Object> properties) {
"""
Sets the properties of this object.
@param properties a Hashtable specifying the property values
@see #getProperties
"""
if (properties == null) return;
lazyProperties().putAll(properties);
... | java | @Override
public void addProperties(Map<Object, Object> properties) {
if (properties == null) return;
lazyProperties().putAll(properties);
notifyChanged();
} | [
"@",
"Override",
"public",
"void",
"addProperties",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"return",
";",
"lazyProperties",
"(",
")",
".",
"putAll",
"(",
"properties",
")",
";",
... | Sets the properties of this object.
@param properties a Hashtable specifying the property values
@see #getProperties | [
"Sets",
"the",
"properties",
"of",
"this",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/QueryChemObject.java#L321-L326 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java | VpnTunnelClient.insertVpnTunnel | @BetaApi
public final Operation insertVpnTunnel(ProjectRegionName region, VpnTunnel vpnTunnelResource) {
"""
Creates a VpnTunnel resource in the specified project and region using the data included in the
request.
<p>Sample code:
<pre><code>
try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()... | java | @BetaApi
public final Operation insertVpnTunnel(ProjectRegionName region, VpnTunnel vpnTunnelResource) {
InsertVpnTunnelHttpRequest request =
InsertVpnTunnelHttpRequest.newBuilder()
.setRegion(region == null ? null : region.toString())
.setVpnTunnelResource(vpnTunnelResource)
... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertVpnTunnel",
"(",
"ProjectRegionName",
"region",
",",
"VpnTunnel",
"vpnTunnelResource",
")",
"{",
"InsertVpnTunnelHttpRequest",
"request",
"=",
"InsertVpnTunnelHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setRegi... | Creates a VpnTunnel resource in the specified project and region using the data included in the
request.
<p>Sample code:
<pre><code>
try (VpnTunnelClient vpnTunnelClient = VpnTunnelClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
VpnTunnel vpnTunnelResource = VpnTunnel.newB... | [
"Creates",
"a",
"VpnTunnel",
"resource",
"in",
"the",
"specified",
"project",
"and",
"region",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/VpnTunnelClient.java#L511-L520 |
google/closure-compiler | src/com/google/javascript/jscomp/ControlFlowAnalysis.java | ControlFlowAnalysis.prioritizeFromEntryNode | private void prioritizeFromEntryNode(DiGraphNode<Node, Branch> entry) {
"""
Given an entry node, find all the nodes reachable from that node
and prioritize them.
"""
PriorityQueue<DiGraphNode<Node, Branch>> worklist =
new PriorityQueue<>(10, priorityComparator);
worklist.add(entry);
while... | java | private void prioritizeFromEntryNode(DiGraphNode<Node, Branch> entry) {
PriorityQueue<DiGraphNode<Node, Branch>> worklist =
new PriorityQueue<>(10, priorityComparator);
worklist.add(entry);
while (!worklist.isEmpty()) {
DiGraphNode<Node, Branch> current = worklist.remove();
if (nodePrio... | [
"private",
"void",
"prioritizeFromEntryNode",
"(",
"DiGraphNode",
"<",
"Node",
",",
"Branch",
">",
"entry",
")",
"{",
"PriorityQueue",
"<",
"DiGraphNode",
"<",
"Node",
",",
"Branch",
">",
">",
"worklist",
"=",
"new",
"PriorityQueue",
"<>",
"(",
"10",
",",
... | Given an entry node, find all the nodes reachable from that node
and prioritize them. | [
"Given",
"an",
"entry",
"node",
"find",
"all",
"the",
"nodes",
"reachable",
"from",
"that",
"node",
"and",
"prioritize",
"them",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ControlFlowAnalysis.java#L196-L212 |
apollographql/apollo-android | apollo-runtime/src/main/java/com/apollographql/apollo/internal/ApolloCallTracker.java | ApolloCallTracker.activeQueryCalls | @NotNull Set<ApolloQueryCall> activeQueryCalls(@NotNull OperationName operationName) {
"""
Returns currently active {@link ApolloQueryCall} calls by operation name.
@param operationName query operation name
@return set of active query calls
"""
return activeCalls(activeQueryCalls, operationName);
} | java | @NotNull Set<ApolloQueryCall> activeQueryCalls(@NotNull OperationName operationName) {
return activeCalls(activeQueryCalls, operationName);
} | [
"@",
"NotNull",
"Set",
"<",
"ApolloQueryCall",
">",
"activeQueryCalls",
"(",
"@",
"NotNull",
"OperationName",
"operationName",
")",
"{",
"return",
"activeCalls",
"(",
"activeQueryCalls",
",",
"operationName",
")",
";",
"}"
] | Returns currently active {@link ApolloQueryCall} calls by operation name.
@param operationName query operation name
@return set of active query calls | [
"Returns",
"currently",
"active",
"{",
"@link",
"ApolloQueryCall",
"}",
"calls",
"by",
"operation",
"name",
"."
] | train | https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-runtime/src/main/java/com/apollographql/apollo/internal/ApolloCallTracker.java#L150-L152 |
SonarSource/sonarqube | server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationHandler.java | ChangesOnMyIssueNotificationHandler.toEmailDeliveryRequest | @CheckForNull
private static EmailDeliveryRequest toEmailDeliveryRequest(NotificationWithProjectKeys notification, EmailRecipient recipient, Set<String> subscribedProjectKeys) {
"""
Creates the {@link EmailDeliveryRequest} for the specified {@code recipient} with issues from the
specified {@code notification} i... | java | @CheckForNull
private static EmailDeliveryRequest toEmailDeliveryRequest(NotificationWithProjectKeys notification, EmailRecipient recipient, Set<String> subscribedProjectKeys) {
Set<ChangedIssue> recipientIssuesByProject = notification.getIssues().stream()
.filter(issue -> issue.getAssignee().filter(assigne... | [
"@",
"CheckForNull",
"private",
"static",
"EmailDeliveryRequest",
"toEmailDeliveryRequest",
"(",
"NotificationWithProjectKeys",
"notification",
",",
"EmailRecipient",
"recipient",
",",
"Set",
"<",
"String",
">",
"subscribedProjectKeys",
")",
"{",
"Set",
"<",
"ChangedIssue... | Creates the {@link EmailDeliveryRequest} for the specified {@code recipient} with issues from the
specified {@code notification} it is the assignee of.
@return {@code null} when the recipient is the assignee of no issue in {@code notification}. | [
"Creates",
"the",
"{",
"@link",
"EmailDeliveryRequest",
"}",
"for",
"the",
"specified",
"{",
"@code",
"recipient",
"}",
"with",
"issues",
"from",
"the",
"specified",
"{",
"@code",
"notification",
"}",
"it",
"is",
"the",
"assignee",
"of",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationHandler.java#L156-L168 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayLanguageWithDialect | public static String getDisplayLanguageWithDialect(String localeID, ULocale displayLocale) {
"""
<strong>[icu]</strong> Returns a locale's language localized for display in the provided locale.
If a dialect name is present in the data, then it is returned.
This is a cover for the ICU4C API.
@param localeID the ... | java | public static String getDisplayLanguageWithDialect(String localeID, ULocale displayLocale) {
return getDisplayLanguageInternal(new ULocale(localeID), displayLocale, true);
} | [
"public",
"static",
"String",
"getDisplayLanguageWithDialect",
"(",
"String",
"localeID",
",",
"ULocale",
"displayLocale",
")",
"{",
"return",
"getDisplayLanguageInternal",
"(",
"new",
"ULocale",
"(",
"localeID",
")",
",",
"displayLocale",
",",
"true",
")",
";",
"... | <strong>[icu]</strong> Returns a locale's language localized for display in the provided locale.
If a dialect name is present in the data, then it is returned.
This is a cover for the ICU4C API.
@param localeID the id of the locale whose language will be displayed.
@param displayLocale the locale in which to display th... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"a",
"locale",
"s",
"language",
"localized",
"for",
"display",
"in",
"the",
"provided",
"locale",
".",
"If",
"a",
"dialect",
"name",
"is",
"present",
"in",
"the",
"data",
"then",
"it"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1449-L1451 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java | XSLTAttributeDef.processAVT | AVT processAVT(
StylesheetHandler handler, String uri, String name, String rawName, String value,
ElemTemplateElement owner)
throws org.xml.sax.SAXException {
"""
Process an attribute string of type T_AVT into
a AVT value.
@param handler non-null reference to current StylesheetH... | java | AVT processAVT(
StylesheetHandler handler, String uri, String name, String rawName, String value,
ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
try
{
AVT avt = new AVT(handler, uri, name, rawName, value, owner);
return avt;
}
catch (Transfor... | [
"AVT",
"processAVT",
"(",
"StylesheetHandler",
"handler",
",",
"String",
"uri",
",",
"String",
"name",
",",
"String",
"rawName",
",",
"String",
"value",
",",
"ElemTemplateElement",
"owner",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"... | Process an attribute string of type T_AVT into
a AVT value.
@param handler non-null reference to current StylesheetHandler that is constructing the Templates.
@param uri The Namespace URI, or an empty string.
@param name The local name (without prefix), or empty string if not namespace processing.
@param rawName The q... | [
"Process",
"an",
"attribute",
"string",
"of",
"type",
"T_AVT",
"into",
"a",
"AVT",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java#L512-L528 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.jpa/src/com/ibm/ws/ejbcontainer/jpa/injection/factory/HybridJPAObjectFactory.java | HybridJPAObjectFactory.checkSFSBAccess | @Override
protected boolean checkSFSBAccess( JPAJndiLookupInfo info, boolean isSFSB )
throws InjectionException {
"""
Checks access to the specified JPA reference and returns true if the
current call to {@link #getObjectInstance} is in the context of a
Stateful Session bean. <p>
By default, this... | java | @Override
protected boolean checkSFSBAccess( JPAJndiLookupInfo info, boolean isSFSB )
throws InjectionException
{
ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled... | [
"@",
"Override",
"protected",
"boolean",
"checkSFSBAccess",
"(",
"JPAJndiLookupInfo",
"info",
",",
"boolean",
"isSFSB",
")",
"throws",
"InjectionException",
"{",
"ComponentMetaData",
"cmd",
"=",
"ComponentMetaDataAccessorImpl",
".",
"getComponentMetaDataAccessor",
"(",
")... | Checks access to the specified JPA reference and returns true if the
current call to {@link #getObjectInstance} is in the context of a
Stateful Session bean. <p>
By default, this method will return what is stored in the info object as
passed by the isSFSB parameter, which will be the correct answer for EJB
modules and... | [
"Checks",
"access",
"to",
"the",
"specified",
"JPA",
"reference",
"and",
"returns",
"true",
"if",
"the",
"current",
"call",
"to",
"{",
"@link",
"#getObjectInstance",
"}",
"is",
"in",
"the",
"context",
"of",
"a",
"Stateful",
"Session",
"bean",
".",
"<p",
">... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.jpa/src/com/ibm/ws/ejbcontainer/jpa/injection/factory/HybridJPAObjectFactory.java#L65-L112 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/dbhandling/TorqueDBHandling.java | TorqueDBHandling.addDBDefinitionFiles | public void addDBDefinitionFiles(String srcDir, String listOfFilenames) throws IOException {
"""
Adds the input files (in our case torque schema files) to use.
@param srcDir The directory containing the files
@param listOfFilenames The filenames in a comma-separated list
"""
StringTokeniz... | java | public void addDBDefinitionFiles(String srcDir, String listOfFilenames) throws IOException
{
StringTokenizer tokenizer = new StringTokenizer(listOfFilenames, ",");
File dir = new File(srcDir);
String filename;
while (tokenizer.hasMoreTokens())... | [
"public",
"void",
"addDBDefinitionFiles",
"(",
"String",
"srcDir",
",",
"String",
"listOfFilenames",
")",
"throws",
"IOException",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"listOfFilenames",
",",
"\",\"",
")",
";",
"File",
"dir",
"=... | Adds the input files (in our case torque schema files) to use.
@param srcDir The directory containing the files
@param listOfFilenames The filenames in a comma-separated list | [
"Adds",
"the",
"input",
"files",
"(",
"in",
"our",
"case",
"torque",
"schema",
"files",
")",
"to",
"use",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/dbhandling/TorqueDBHandling.java#L146-L161 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getWvWMatchInfo | public WvWMatch getWvWMatchInfo(int worldID, WvWMatch.Endpoint type) throws GuildWars2Exception {
"""
For more info on WvW matches API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/matches">here</a><br/>
Get wvw match info using world id
@param worldID {@link World#id}
@param type endpoint type
@... | java | public WvWMatch getWvWMatchInfo(int worldID, WvWMatch.Endpoint type) throws GuildWars2Exception {
if (type == null) return getWvWMatchInfoUsingWorld(worldID);
try {
switch (type) {
case All:
return getWvWMatchInfoUsingWorld(worldID);
case Overview:
Response<WvWMatchOverview> overview = gw2API.g... | [
"public",
"WvWMatch",
"getWvWMatchInfo",
"(",
"int",
"worldID",
",",
"WvWMatch",
".",
"Endpoint",
"type",
")",
"throws",
"GuildWars2Exception",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"return",
"getWvWMatchInfoUsingWorld",
"(",
"worldID",
")",
";",
"try",
"... | For more info on WvW matches API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/matches">here</a><br/>
Get wvw match info using world id
@param worldID {@link World#id}
@param type endpoint type
@return wvw match info, exact class depend on endpoint type
@throws GuildWars2Exception see {@link ErrorCode} for... | [
"For",
"more",
"info",
"on",
"WvW",
"matches",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"wvw",
"/",
"matches",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L3536-L3560 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/sshare/api/OctTreeQuantizer.java | OctTreeQuantizer.addPixels | @Override
public void addPixels(int[] pixels, int offset, int count) {
"""
Add pixels to the quantizer.
@param pixels the array of ARGB pixels
@param offset the offset into the array
@param count the count of pixels
"""
for (int i = 0; i < count; i++) {
insertColor(pixels[i + offset]... | java | @Override
public void addPixels(int[] pixels, int offset, int count) {
for (int i = 0; i < count; i++) {
insertColor(pixels[i + offset]);
if (colors > reduceColors)
reduceTree(reduceColors);
}
} | [
"@",
"Override",
"public",
"void",
"addPixels",
"(",
"int",
"[",
"]",
"pixels",
",",
"int",
"offset",
",",
"int",
"count",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"insertColor",
"(",
"pixels",... | Add pixels to the quantizer.
@param pixels the array of ARGB pixels
@param offset the offset into the array
@param count the count of pixels | [
"Add",
"pixels",
"to",
"the",
"quantizer",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/sshare/api/OctTreeQuantizer.java#L102-L109 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/LocalEntityResolver.java | LocalEntityResolver.resolveEntity | @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
"""
Allow the application to resolve external entities.
<p/>
<p>The Parser will call this method before opening any external entity except the top-level document entity
including the external DTD ... | java | @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
{
InputSource source = null;
try {
URI uri = new URI(systemId);
if ("http".equals(uri.getScheme()) || "file".equals(uri.getScheme())) {
String f... | [
"@",
"Override",
"public",
"InputSource",
"resolveEntity",
"(",
"String",
"publicId",
",",
"String",
"systemId",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"InputSource",
"source",
"=",
"null",
";",
"try",
"{",
"URI",
"uri",
"=",
"new",
"URI",
"... | Allow the application to resolve external entities.
<p/>
<p>The Parser will call this method before opening any external entity except the top-level document entity
including the external DTD subset, external entities referenced within the DTD, and external entities referenced
within the document element): the applicat... | [
"Allow",
"the",
"application",
"to",
"resolve",
"external",
"entities",
".",
"<p",
"/",
">",
"<p",
">",
"The",
"Parser",
"will",
"call",
"this",
"method",
"before",
"opening",
"any",
"external",
"entity",
"except",
"the",
"top",
"-",
"level",
"document",
"... | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/LocalEntityResolver.java#L78-L118 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutorUtils.java | ExecutorUtils.getMaxConcurrentRunsForFlow | public static int getMaxConcurrentRunsForFlow(String projectName, String flowName,
int defaultMaxConcurrentRuns, Map<Pair<String, String>, Integer> maxConcurrentRunsFlowMap) {
"""
Get the maximum number of concurrent runs for the specified flow, using the value in
azkaban.concurrent.runs.oneflow.whitelist i... | java | public static int getMaxConcurrentRunsForFlow(String projectName, String flowName,
int defaultMaxConcurrentRuns, Map<Pair<String, String>, Integer> maxConcurrentRunsFlowMap) {
return maxConcurrentRunsFlowMap.getOrDefault(new Pair(projectName, flowName),
defaultMaxConcurrentRuns);
} | [
"public",
"static",
"int",
"getMaxConcurrentRunsForFlow",
"(",
"String",
"projectName",
",",
"String",
"flowName",
",",
"int",
"defaultMaxConcurrentRuns",
",",
"Map",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
",",
"Integer",
">",
"maxConcurrentRunsFlowMap",
... | Get the maximum number of concurrent runs for the specified flow, using the value in
azkaban.concurrent.runs.oneflow.whitelist if explictly specified for the flow, and otherwise
azkaban.max.concurrent.runs.oneflow or the default.
@param projectName project name
@param flowName flow name
@param defaultMaxConcurrentRuns... | [
"Get",
"the",
"maximum",
"number",
"of",
"concurrent",
"runs",
"for",
"the",
"specified",
"flow",
"using",
"the",
"value",
"in",
"azkaban",
".",
"concurrent",
".",
"runs",
".",
"oneflow",
".",
"whitelist",
"if",
"explictly",
"specified",
"for",
"the",
"flow"... | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorUtils.java#L75-L79 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/common/NodeEntryImpl.java | NodeEntryImpl.setAttribute | public String setAttribute(final String name, final String value) {
"""
Set the value for a specific attribute
@param name attribute name
@param value attribute value
@return value
"""
if(null!=value){
return getAttributes().put(name, value);
}else{
getAttributes()... | java | public String setAttribute(final String name, final String value) {
if(null!=value){
return getAttributes().put(name, value);
}else{
getAttributes().remove(name);
return value;
}
} | [
"public",
"String",
"setAttribute",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"null",
"!=",
"value",
")",
"{",
"return",
"getAttributes",
"(",
")",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}",
"els... | Set the value for a specific attribute
@param name attribute name
@param value attribute value
@return value | [
"Set",
"the",
"value",
"for",
"a",
"specific",
"attribute"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/NodeEntryImpl.java#L411-L418 |
playn/playn | scene/src/playn/scene/LayerUtil.java | LayerUtil.screenToLayer | public static Point screenToLayer(Layer layer, XY point, Point into) {
"""
Converts the supplied point from screen coordinates to coordinates
relative to the specified layer. The results are stored into {@code into}
, which is returned for convenience.
"""
Layer parent = layer.parent();
XY cur = (par... | java | public static Point screenToLayer(Layer layer, XY point, Point into) {
Layer parent = layer.parent();
XY cur = (parent == null) ? point : screenToLayer(parent, point, into);
return parentToLayer(layer, cur, into);
} | [
"public",
"static",
"Point",
"screenToLayer",
"(",
"Layer",
"layer",
",",
"XY",
"point",
",",
"Point",
"into",
")",
"{",
"Layer",
"parent",
"=",
"layer",
".",
"parent",
"(",
")",
";",
"XY",
"cur",
"=",
"(",
"parent",
"==",
"null",
")",
"?",
"point",
... | Converts the supplied point from screen coordinates to coordinates
relative to the specified layer. The results are stored into {@code into}
, which is returned for convenience. | [
"Converts",
"the",
"supplied",
"point",
"from",
"screen",
"coordinates",
"to",
"coordinates",
"relative",
"to",
"the",
"specified",
"layer",
".",
"The",
"results",
"are",
"stored",
"into",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/LayerUtil.java#L84-L88 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.tryGetSegmentUpdateTransaction | private SegmentMetadataUpdateTransaction tryGetSegmentUpdateTransaction(long segmentId) {
"""
Attempts to get a SegmentMetadataUpdateTransaction for an existing or new Segment.
@param segmentId The Id of the Segment to retrieve.
@return An instance of SegmentMetadataUpdateTransaction, or null if no such segmen... | java | private SegmentMetadataUpdateTransaction tryGetSegmentUpdateTransaction(long segmentId) {
SegmentMetadataUpdateTransaction sm = this.segmentUpdates.getOrDefault(segmentId, null);
if (sm == null) {
SegmentMetadata baseSegmentMetadata = this.baseMetadata.getStreamSegmentMetadata(segmentId);
... | [
"private",
"SegmentMetadataUpdateTransaction",
"tryGetSegmentUpdateTransaction",
"(",
"long",
"segmentId",
")",
"{",
"SegmentMetadataUpdateTransaction",
"sm",
"=",
"this",
".",
"segmentUpdates",
".",
"getOrDefault",
"(",
"segmentId",
",",
"null",
")",
";",
"if",
"(",
... | Attempts to get a SegmentMetadataUpdateTransaction for an existing or new Segment.
@param segmentId The Id of the Segment to retrieve.
@return An instance of SegmentMetadataUpdateTransaction, or null if no such segment exists. | [
"Attempts",
"to",
"get",
"a",
"SegmentMetadataUpdateTransaction",
"for",
"an",
"existing",
"or",
"new",
"Segment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L542-L557 |
Omertron/api-rottentomatoes | src/main/java/com/omertron/rottentomatoesapi/RottenTomatoesApi.java | RottenTomatoesApi.getMoviesSearch | public List<RTMovie> getMoviesSearch(String query) throws RottenTomatoesException {
"""
The movies search endpoint for plain text queries. Let's you search for
movies!
@param query
@return
@throws RottenTomatoesException
"""
return getMoviesSearch(query, DEFAULT_PAGE_LIMIT, DEFAULT_PAGE);
} | java | public List<RTMovie> getMoviesSearch(String query) throws RottenTomatoesException {
return getMoviesSearch(query, DEFAULT_PAGE_LIMIT, DEFAULT_PAGE);
} | [
"public",
"List",
"<",
"RTMovie",
">",
"getMoviesSearch",
"(",
"String",
"query",
")",
"throws",
"RottenTomatoesException",
"{",
"return",
"getMoviesSearch",
"(",
"query",
",",
"DEFAULT_PAGE_LIMIT",
",",
"DEFAULT_PAGE",
")",
";",
"}"
] | The movies search endpoint for plain text queries. Let's you search for
movies!
@param query
@return
@throws RottenTomatoesException | [
"The",
"movies",
"search",
"endpoint",
"for",
"plain",
"text",
"queries",
".",
"Let",
"s",
"you",
"search",
"for",
"movies!"
] | train | https://github.com/Omertron/api-rottentomatoes/blob/abaf1833acafc6ada593d52b14ff1bacb4e441ee/src/main/java/com/omertron/rottentomatoesapi/RottenTomatoesApi.java#L710-L712 |
stapler/stapler | core/example/src/example/BookStore.java | BookStore.doHello | public void doHello( StaplerRequest request, StaplerResponse response ) throws IOException, ServletException {
"""
Define an action method that handles requests to "/hello"
(and below, like "/hello/foo/bar")
<p>
Action methods are useful to perform some operations in Java.
"""
System.out.println("... | java | public void doHello( StaplerRequest request, StaplerResponse response ) throws IOException, ServletException {
System.out.println("Hello operation");
request.setAttribute("systemTime",new Long(System.currentTimeMillis()));
// it can generate the response by itself, just like
// servlets... | [
"public",
"void",
"doHello",
"(",
"StaplerRequest",
"request",
",",
"StaplerResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Hello operation\"",
")",
";",
"request",
".",
"setAttribute... | Define an action method that handles requests to "/hello"
(and below, like "/hello/foo/bar")
<p>
Action methods are useful to perform some operations in Java. | [
"Define",
"an",
"action",
"method",
"that",
"handles",
"requests",
"to",
"/",
"hello",
"(",
"and",
"below",
"like",
"/",
"hello",
"/",
"foo",
"/",
"bar",
")"
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/example/src/example/BookStore.java#L64-L76 |
sagiegurari/fax4j | src/main/java/org/fax4j/common/AbstractLogger.java | AbstractLogger.logError | public void logError(Object[] message,Throwable throwable) {
"""
Logs the provided data at the error level.
@param message
The message parts (may be null)
@param throwable
The error (may be null)
"""
this.log(LogLevel.ERROR,message,throwable);
} | java | public void logError(Object[] message,Throwable throwable)
{
this.log(LogLevel.ERROR,message,throwable);
} | [
"public",
"void",
"logError",
"(",
"Object",
"[",
"]",
"message",
",",
"Throwable",
"throwable",
")",
"{",
"this",
".",
"log",
"(",
"LogLevel",
".",
"ERROR",
",",
"message",
",",
"throwable",
")",
";",
"}"
] | Logs the provided data at the error level.
@param message
The message parts (may be null)
@param throwable
The error (may be null) | [
"Logs",
"the",
"provided",
"data",
"at",
"the",
"error",
"level",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/common/AbstractLogger.java#L196-L199 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/ConnectorService.java | ConnectorService.logMessage | public static final void logMessage(Level level, String key, Object... args) {
"""
Logs a message from the J2CAMessages file.
@param key message key.
@param args message parameters
"""
if (WsLevel.AUDIT.equals(level))
Tr.audit(tc, key, args);
else if (WsLevel.ERROR.equals(level)... | java | public static final void logMessage(Level level, String key, Object... args) {
if (WsLevel.AUDIT.equals(level))
Tr.audit(tc, key, args);
else if (WsLevel.ERROR.equals(level))
Tr.error(tc, key, args);
else if (Level.INFO.equals(level))
Tr.info(tc, key, args);
... | [
"public",
"static",
"final",
"void",
"logMessage",
"(",
"Level",
"level",
",",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"WsLevel",
".",
"AUDIT",
".",
"equals",
"(",
"level",
")",
")",
"Tr",
".",
"audit",
"(",
"tc",
",",
"... | Logs a message from the J2CAMessages file.
@param key message key.
@param args message parameters | [
"Logs",
"a",
"message",
"from",
"the",
"J2CAMessages",
"file",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/ConnectorService.java#L118-L129 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/route/Route.java | Route.DELETE | public static Route DELETE(String uriPattern, RouteHandler routeHandler) {
"""
Create a {@code DELETE} route.
@param uriPattern
@param routeHandler
@return
"""
return new Route(HttpConstants.Method.DELETE, uriPattern, routeHandler);
} | java | public static Route DELETE(String uriPattern, RouteHandler routeHandler) {
return new Route(HttpConstants.Method.DELETE, uriPattern, routeHandler);
} | [
"public",
"static",
"Route",
"DELETE",
"(",
"String",
"uriPattern",
",",
"RouteHandler",
"routeHandler",
")",
"{",
"return",
"new",
"Route",
"(",
"HttpConstants",
".",
"Method",
".",
"DELETE",
",",
"uriPattern",
",",
"routeHandler",
")",
";",
"}"
] | Create a {@code DELETE} route.
@param uriPattern
@param routeHandler
@return | [
"Create",
"a",
"{",
"@code",
"DELETE",
"}",
"route",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/route/Route.java#L92-L94 |
ZuInnoTe/hadoopcryptoledger | inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumBlockReader.java | EthereumBlockReader.readBlock | public EthereumBlock readBlock() throws IOException, EthereumBlockReadException {
"""
/*
Read a block into a Java object of the class Ethereum Block. This makes analysis very easy, but might be slower for some type of analytics where you are only interested in small parts of the block. In this case it is recomm... | java | public EthereumBlock readBlock() throws IOException, EthereumBlockReadException {
ByteBuffer rawBlock = this.readRawBlock();
if (rawBlock==null) {
return null;
}
RLPObject blockObject = EthereumUtil.rlpDecodeNextItem(rawBlock);
if ((blockObject==null) || (!(blockObject instanceof RLPList))){
throw new ... | [
"public",
"EthereumBlock",
"readBlock",
"(",
")",
"throws",
"IOException",
",",
"EthereumBlockReadException",
"{",
"ByteBuffer",
"rawBlock",
"=",
"this",
".",
"readRawBlock",
"(",
")",
";",
"if",
"(",
"rawBlock",
"==",
"null",
")",
"{",
"return",
"null",
";",
... | /*
Read a block into a Java object of the class Ethereum Block. This makes analysis very easy, but might be slower for some type of analytics where you are only interested in small parts of the block. In this case it is recommended to use {@link #readRawBlock}
Basically, one raw Ethereum Block contains an RLP encoded ... | [
"/",
"*"
] | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumBlockReader.java#L87-L108 |
OpenLiberty/open-liberty | dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractor.java | SelfExtractor.argIsOption | protected static boolean argIsOption(String arg, String option) {
"""
Test if the argument is an option. Allow single or double leading -, be
case insensitive.
@param arg
User specified argument
@param option
Option for test/comparison
@return true if the argument matches the option
"""
return ... | java | protected static boolean argIsOption(String arg, String option) {
return arg.equalsIgnoreCase(option) || arg.equalsIgnoreCase('-' + option);
} | [
"protected",
"static",
"boolean",
"argIsOption",
"(",
"String",
"arg",
",",
"String",
"option",
")",
"{",
"return",
"arg",
".",
"equalsIgnoreCase",
"(",
"option",
")",
"||",
"arg",
".",
"equalsIgnoreCase",
"(",
"'",
"'",
"+",
"option",
")",
";",
"}"
] | Test if the argument is an option. Allow single or double leading -, be
case insensitive.
@param arg
User specified argument
@param option
Option for test/comparison
@return true if the argument matches the option | [
"Test",
"if",
"the",
"argument",
"is",
"an",
"option",
".",
"Allow",
"single",
"or",
"double",
"leading",
"-",
"be",
"case",
"insensitive",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractor.java#L1334-L1336 |
networknt/light-4j | client/src/main/java/com/networknt/client/oauth/OauthHelper.java | OauthHelper.setScope | private static void setScope(TokenRequest tokenRequest, Jwt jwt) {
"""
if scopes in jwt.getKey() has value, use this scope
otherwise remains the default scope value which already inside tokenRequest when create ClientCredentialsRequest;
@param tokenRequest
@param jwt
"""
if(jwt.getKey() != null && !... | java | private static void setScope(TokenRequest tokenRequest, Jwt jwt) {
if(jwt.getKey() != null && !jwt.getKey().getScopes().isEmpty()) {
tokenRequest.setScope(new ArrayList<String>() {{ addAll(jwt.getKey().getScopes()); }});
}
} | [
"private",
"static",
"void",
"setScope",
"(",
"TokenRequest",
"tokenRequest",
",",
"Jwt",
"jwt",
")",
"{",
"if",
"(",
"jwt",
".",
"getKey",
"(",
")",
"!=",
"null",
"&&",
"!",
"jwt",
".",
"getKey",
"(",
")",
".",
"getScopes",
"(",
")",
".",
"isEmpty",... | if scopes in jwt.getKey() has value, use this scope
otherwise remains the default scope value which already inside tokenRequest when create ClientCredentialsRequest;
@param tokenRequest
@param jwt | [
"if",
"scopes",
"in",
"jwt",
".",
"getKey",
"()",
"has",
"value",
"use",
"this",
"scope",
"otherwise",
"remains",
"the",
"default",
"scope",
"value",
"which",
"already",
"inside",
"tokenRequest",
"when",
"create",
"ClientCredentialsRequest",
";"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/oauth/OauthHelper.java#L670-L674 |
google/closure-compiler | src/com/google/javascript/jscomp/GlobalNamespace.java | GlobalNamespace.isGlobalVarReference | private boolean isGlobalVarReference(String name, Scope s) {
"""
Determines whether a variable name reference in a particular scope is a global variable
reference.
@param name A variable name (e.g. "a")
@param s The scope in which the name is referenced
@return Whether the name reference is a global variable... | java | private boolean isGlobalVarReference(String name, Scope s) {
Var v = s.getVar(name);
if (v == null && externsScope != null) {
v = externsScope.getVar(name);
}
return v != null && !v.isLocal();
} | [
"private",
"boolean",
"isGlobalVarReference",
"(",
"String",
"name",
",",
"Scope",
"s",
")",
"{",
"Var",
"v",
"=",
"s",
".",
"getVar",
"(",
"name",
")",
";",
"if",
"(",
"v",
"==",
"null",
"&&",
"externsScope",
"!=",
"null",
")",
"{",
"v",
"=",
"ext... | Determines whether a variable name reference in a particular scope is a global variable
reference.
@param name A variable name (e.g. "a")
@param s The scope in which the name is referenced
@return Whether the name reference is a global variable reference | [
"Determines",
"whether",
"a",
"variable",
"name",
"reference",
"in",
"a",
"particular",
"scope",
"is",
"a",
"global",
"variable",
"reference",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/GlobalNamespace.java#L304-L310 |
cdapio/tephra | tephra-core/src/main/java/co/cask/tephra/snapshot/SnapshotCodecProvider.java | SnapshotCodecProvider.getCodecForVersion | @Nonnull
@VisibleForTesting
SnapshotCodec getCodecForVersion(int version) {
"""
Retrieve the codec for a particular version of the encoding.
@param version the version of interest
@return the corresponding codec
@throws java.lang.IllegalArgumentException if the version is not known
"""
SnapshotCodec... | java | @Nonnull
@VisibleForTesting
SnapshotCodec getCodecForVersion(int version) {
SnapshotCodec codec = codecs.get(version);
if (codec == null) {
throw new IllegalArgumentException(String.format("Version %d of snapshot encoding is not supported", version));
}
return codec;
} | [
"@",
"Nonnull",
"@",
"VisibleForTesting",
"SnapshotCodec",
"getCodecForVersion",
"(",
"int",
"version",
")",
"{",
"SnapshotCodec",
"codec",
"=",
"codecs",
".",
"get",
"(",
"version",
")",
";",
"if",
"(",
"codec",
"==",
"null",
")",
"{",
"throw",
"new",
"Il... | Retrieve the codec for a particular version of the encoding.
@param version the version of interest
@return the corresponding codec
@throws java.lang.IllegalArgumentException if the version is not known | [
"Retrieve",
"the",
"codec",
"for",
"a",
"particular",
"version",
"of",
"the",
"encoding",
"."
] | train | https://github.com/cdapio/tephra/blob/082c56c15c6ece15002631ff6f89206a00d8915c/tephra-core/src/main/java/co/cask/tephra/snapshot/SnapshotCodecProvider.java#L91-L99 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.createPrimaryKeyValue | protected DependantValue createPrimaryKeyValue(InFlightMetadataCollector mappings, PersistentProperty property,
Collection collection, Map<?, ?> persistentClasses) {
"""
Creates the DependentValue object that forms a primary key reference for the collection.
@p... | java | protected DependantValue createPrimaryKeyValue(InFlightMetadataCollector mappings, PersistentProperty property,
Collection collection, Map<?, ?> persistentClasses) {
KeyValue keyValue;
DependantValue key;
String propertyRef = collection.getRefer... | [
"protected",
"DependantValue",
"createPrimaryKeyValue",
"(",
"InFlightMetadataCollector",
"mappings",
",",
"PersistentProperty",
"property",
",",
"Collection",
"collection",
",",
"Map",
"<",
"?",
",",
"?",
">",
"persistentClasses",
")",
"{",
"KeyValue",
"keyValue",
";... | Creates the DependentValue object that forms a primary key reference for the collection.
@param mappings
@param property The grails property
@param collection The collection object
@param persistentClasses
@return The DependantValue (key) | [
"Creates",
"the",
"DependentValue",
"object",
"that",
"forms",
"a",
"primary",
"key",
"reference",
"for",
"the",
"collection",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L886-L908 |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/executor/SQLExecuteCallbackFactory.java | SQLExecuteCallbackFactory.getPreparedSQLExecuteCallback | public static SQLExecuteCallback<Boolean> getPreparedSQLExecuteCallback(final DatabaseType databaseType, final boolean isExceptionThrown) {
"""
Get execute callback.
@param databaseType database type
@param isExceptionThrown is exception thrown
@return execute callback
"""
return new SQLExecuteCal... | java | public static SQLExecuteCallback<Boolean> getPreparedSQLExecuteCallback(final DatabaseType databaseType, final boolean isExceptionThrown) {
return new SQLExecuteCallback<Boolean>(databaseType, isExceptionThrown) {
@Override
protected Boolean executeSQL(final RouteUnit routeU... | [
"public",
"static",
"SQLExecuteCallback",
"<",
"Boolean",
">",
"getPreparedSQLExecuteCallback",
"(",
"final",
"DatabaseType",
"databaseType",
",",
"final",
"boolean",
"isExceptionThrown",
")",
"{",
"return",
"new",
"SQLExecuteCallback",
"<",
"Boolean",
">",
"(",
"data... | Get execute callback.
@param databaseType database type
@param isExceptionThrown is exception thrown
@return execute callback | [
"Get",
"execute",
"callback",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/executor/SQLExecuteCallbackFactory.java#L60-L68 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/SybaseHelper.java | SybaseHelper.setReadOnly | @Override
public void setReadOnly(WSRdbManagedConnectionImpl managedConn, boolean readOnly, boolean externalCall)
throws SQLException {
"""
<p>This method is used to do special handling when method setReadOnly is called.
If setReadOnly is called, we ignore it and log an informational messa... | java | @Override
public void setReadOnly(WSRdbManagedConnectionImpl managedConn, boolean readOnly, boolean externalCall)
throws SQLException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "setReadOnly", managedConn, readOnly, externalCall)... | [
"@",
"Override",
"public",
"void",
"setReadOnly",
"(",
"WSRdbManagedConnectionImpl",
"managedConn",
",",
"boolean",
"readOnly",
",",
"boolean",
"externalCall",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&... | <p>This method is used to do special handling when method setReadOnly is called.
If setReadOnly is called, we ignore it and log an informational message.</p>
@param managedConn WSRdbManagedConnectionImpl object
@param readOnly The readOnly value going to be set
@param externalCall indicates if the call is done by WAS,... | [
"<p",
">",
"This",
"method",
"is",
"used",
"to",
"do",
"special",
"handling",
"when",
"method",
"setReadOnly",
"is",
"called",
".",
"If",
"setReadOnly",
"is",
"called",
"we",
"ignore",
"it",
"and",
"log",
"an",
"informational",
"message",
".",
"<",
"/",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/SybaseHelper.java#L245-L262 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.listUpgradeNotifications | public NotificationListResponseInner listUpgradeNotifications(String resourceGroupName, String name, double history) {
"""
Gets any upgrade notifications for a Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param history how many minutes in past... | java | public NotificationListResponseInner listUpgradeNotifications(String resourceGroupName, String name, double history) {
return listUpgradeNotificationsWithServiceResponseAsync(resourceGroupName, name, history).toBlocking().single().body();
} | [
"public",
"NotificationListResponseInner",
"listUpgradeNotifications",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"double",
"history",
")",
"{",
"return",
"listUpgradeNotificationsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"h... | Gets any upgrade notifications for a Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param history how many minutes in past to look for upgrade notifications
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException ... | [
"Gets",
"any",
"upgrade",
"notifications",
"for",
"a",
"Redis",
"cache",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L245-L247 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageListener.java | BaseMessageListener.init | public void init(BaseMessageReceiver messageReceiver, BaseMessageFilter messageFilter) {
"""
Constructor.
@param messageReceiver The message receiver that this listener is added to.
@param messageFilter The filter for this message listener.
"""
if (messageFilter == null)
{
if (mes... | java | public void init(BaseMessageReceiver messageReceiver, BaseMessageFilter messageFilter)
{
if (messageFilter == null)
{
if (messageReceiver != null)
{
messageFilter = messageReceiver.createDefaultFilter(this); // Add filter to handler
return; ... | [
"public",
"void",
"init",
"(",
"BaseMessageReceiver",
"messageReceiver",
",",
"BaseMessageFilter",
"messageFilter",
")",
"{",
"if",
"(",
"messageFilter",
"==",
"null",
")",
"{",
"if",
"(",
"messageReceiver",
"!=",
"null",
")",
"{",
"messageFilter",
"=",
"message... | Constructor.
@param messageReceiver The message receiver that this listener is added to.
@param messageFilter The filter for this message listener. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageListener.java#L52-L64 |
docker-java/docker-java | src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java | DefaultDockerClientConfig.overrideDockerPropertiesWithSystemProperties | private static Properties overrideDockerPropertiesWithSystemProperties(Properties p, Properties systemProperties) {
"""
Creates a new Properties object containing values overridden from the System properties
@param p
The original set of properties to override
@return A copy of the original Properties with ove... | java | private static Properties overrideDockerPropertiesWithSystemProperties(Properties p, Properties systemProperties) {
Properties overriddenProperties = new Properties();
overriddenProperties.putAll(p);
for (String key : CONFIG_KEYS) {
if (systemProperties.containsKey(key)) {
... | [
"private",
"static",
"Properties",
"overrideDockerPropertiesWithSystemProperties",
"(",
"Properties",
"p",
",",
"Properties",
"systemProperties",
")",
"{",
"Properties",
"overriddenProperties",
"=",
"new",
"Properties",
"(",
")",
";",
"overriddenProperties",
".",
"putAll"... | Creates a new Properties object containing values overridden from the System properties
@param p
The original set of properties to override
@return A copy of the original Properties with overridden values | [
"Creates",
"a",
"new",
"Properties",
"object",
"containing",
"values",
"overridden",
"from",
"the",
"System",
"properties"
] | train | https://github.com/docker-java/docker-java/blob/c5c89327108abdc50aa41d7711d4743b8bac75fe/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java#L179-L189 |
allengeorge/libraft | libraft-samples/kayvee/src/main/java/io/libraft/kayvee/store/LocalStore.java | LocalStore.loadState | synchronized void loadState(long lastAppliedIndex, InputStream snapshotInputStream) throws IOException {
"""
Flushes all {@code key=>value} pairs and replaces them with
the values read from the given {@code snapshotInputStream}.
This implementation expects the {@code InputStream} to contain
a sequence of JSON {... | java | synchronized void loadState(long lastAppliedIndex, InputStream snapshotInputStream) throws IOException {
try {
// read values from the snapshot into a temporary map
Map<String, String> snapshotEntries = Maps.newHashMap();
ObjectMapper mapper = new ObjectMapper();
... | [
"synchronized",
"void",
"loadState",
"(",
"long",
"lastAppliedIndex",
",",
"InputStream",
"snapshotInputStream",
")",
"throws",
"IOException",
"{",
"try",
"{",
"// read values from the snapshot into a temporary map",
"Map",
"<",
"String",
",",
"String",
">",
"snapshotEntr... | Flushes all {@code key=>value} pairs and replaces them with
the values read from the given {@code snapshotInputStream}.
This implementation expects the {@code InputStream} to contain
a sequence of JSON {@link KeyValue} instances.
@param lastAppliedIndex log index >= 0 of the last change contained in this snapshot
@par... | [
"Flushes",
"all",
"{",
"@code",
"key",
"=",
">",
"value",
"}",
"pairs",
"and",
"replaces",
"them",
"with",
"the",
"values",
"read",
"from",
"the",
"given",
"{",
"@code",
"snapshotInputStream",
"}",
".",
"This",
"implementation",
"expects",
"the",
"{",
"@co... | train | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-samples/kayvee/src/main/java/io/libraft/kayvee/store/LocalStore.java#L292-L314 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/location/GeoLocationUtil.java | GeoLocationUtil.epsilonEqualsDistance | @Pure
public static boolean epsilonEqualsDistance(Point3D<?, ?> p1, Point3D<?, ?> p2) {
"""
Replies if the specified points are approximatively equal.
This function uses the distance precision.
@param p1 the first point.
@param p2 the second point.
@return <code>true</code> if both points are equal, otherwi... | java | @Pure
public static boolean epsilonEqualsDistance(Point3D<?, ?> p1, Point3D<?, ?> p2) {
final double distance = p1.getDistance(p2);
return distance >= -distancePrecision && distance <= distancePrecision;
} | [
"@",
"Pure",
"public",
"static",
"boolean",
"epsilonEqualsDistance",
"(",
"Point3D",
"<",
"?",
",",
"?",
">",
"p1",
",",
"Point3D",
"<",
"?",
",",
"?",
">",
"p2",
")",
"{",
"final",
"double",
"distance",
"=",
"p1",
".",
"getDistance",
"(",
"p2",
")",... | Replies if the specified points are approximatively equal.
This function uses the distance precision.
@param p1 the first point.
@param p2 the second point.
@return <code>true</code> if both points are equal, otherwise <code>false</code> | [
"Replies",
"if",
"the",
"specified",
"points",
"are",
"approximatively",
"equal",
".",
"This",
"function",
"uses",
"the",
"distance",
"precision",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/location/GeoLocationUtil.java#L108-L112 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/AbstractRectangularShape1dfx.java | AbstractRectangularShape1dfx.maxYProperty | @Pure
public DoubleProperty maxYProperty() {
"""
Replies the property that is the maximum y coordinate of the box.
@return the maxY property.
"""
if (this.maxY == null) {
this.maxY = new SimpleDoubleProperty(this, MathFXAttributeNames.MAXIMUM_Y) {
@Override
protected void invalidated() {
... | java | @Pure
public DoubleProperty maxYProperty() {
if (this.maxY == null) {
this.maxY = new SimpleDoubleProperty(this, MathFXAttributeNames.MAXIMUM_Y) {
@Override
protected void invalidated() {
final double currentMax = get();
final double currentMin = getMinY();
if (currentMin > currentMax) {
... | [
"@",
"Pure",
"public",
"DoubleProperty",
"maxYProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"maxY",
"==",
"null",
")",
"{",
"this",
".",
"maxY",
"=",
"new",
"SimpleDoubleProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"MAXIMUM_Y",
")",
"{",
... | Replies the property that is the maximum y coordinate of the box.
@return the maxY property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"maximum",
"y",
"coordinate",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/AbstractRectangularShape1dfx.java#L247-L263 |
ACRA/acra | acra-http/src/main/java/org/acra/config/BaseHttpConfigurationBuilder.java | BaseHttpConfigurationBuilder.setHttpHeaders | @BuilderMethod
public void setHttpHeaders(@NonNull Map<String, String> headers) {
"""
Set custom HTTP headers to be sent by the provided {@link org.acra.sender.HttpSender}
This should be used also by third party senders.
@param headers A map associating HTTP header names to their values.
"""
th... | java | @BuilderMethod
public void setHttpHeaders(@NonNull Map<String, String> headers) {
this.httpHeaders.clear();
this.httpHeaders.putAll(headers);
} | [
"@",
"BuilderMethod",
"public",
"void",
"setHttpHeaders",
"(",
"@",
"NonNull",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"this",
".",
"httpHeaders",
".",
"clear",
"(",
")",
";",
"this",
".",
"httpHeaders",
".",
"putAll",
"(",
"header... | Set custom HTTP headers to be sent by the provided {@link org.acra.sender.HttpSender}
This should be used also by third party senders.
@param headers A map associating HTTP header names to their values. | [
"Set",
"custom",
"HTTP",
"headers",
"to",
"be",
"sent",
"by",
"the",
"provided",
"{",
"@link",
"org",
".",
"acra",
".",
"sender",
".",
"HttpSender",
"}",
"This",
"should",
"be",
"used",
"also",
"by",
"third",
"party",
"senders",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-http/src/main/java/org/acra/config/BaseHttpConfigurationBuilder.java#L45-L49 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/RDBMEntityLockStore.java | RDBMEntityLockStore.find | @Override
public IEntityLock[] find(
Class entityType, String entityKey, Integer lockType, Date expiration, String lockOwner)
throws LockingException {
"""
Retrieve IEntityLocks from the underlying store. Any or all of the parameters may be null.
@param entityType Class
@param entit... | java | @Override
public IEntityLock[] find(
Class entityType, String entityKey, Integer lockType, Date expiration, String lockOwner)
throws LockingException {
return select(entityType, entityKey, lockType, expiration, lockOwner);
} | [
"@",
"Override",
"public",
"IEntityLock",
"[",
"]",
"find",
"(",
"Class",
"entityType",
",",
"String",
"entityKey",
",",
"Integer",
"lockType",
",",
"Date",
"expiration",
",",
"String",
"lockOwner",
")",
"throws",
"LockingException",
"{",
"return",
"select",
"... | Retrieve IEntityLocks from the underlying store. Any or all of the parameters may be null.
@param entityType Class
@param entityKey String
@param lockType Integer - so we can accept a null value.
@param expiration Date
@param lockOwner String
@exception LockingException - wraps an Exception specific to the store. | [
"Retrieve",
"IEntityLocks",
"from",
"the",
"underlying",
"store",
".",
"Any",
"or",
"all",
"of",
"the",
"parameters",
"may",
"be",
"null",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/RDBMEntityLockStore.java#L183-L188 |
openbase/jul | communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractRemoteClient.java | AbstractRemoteClient.activate | @Override
public void activate() throws InterruptedException, CouldNotPerformException {
"""
{@inheritDoc}
@throws InterruptedException {@inheritDoc}
@throws CouldNotPerformException {@inheritDoc}
"""
synchronized (maintainerLock) {
// Duplicated activation filter.
... | java | @Override
public void activate() throws InterruptedException, CouldNotPerformException {
synchronized (maintainerLock) {
// Duplicated activation filter.
if (isActive()) {
return;
}
try {
verifyMaintainability();
... | [
"@",
"Override",
"public",
"void",
"activate",
"(",
")",
"throws",
"InterruptedException",
",",
"CouldNotPerformException",
"{",
"synchronized",
"(",
"maintainerLock",
")",
"{",
"// Duplicated activation filter.",
"if",
"(",
"isActive",
"(",
")",
")",
"{",
"return",... | {@inheritDoc}
@throws InterruptedException {@inheritDoc}
@throws CouldNotPerformException {@inheritDoc} | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractRemoteClient.java#L376-L395 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRContext.java | GVRContext.startDebugServer | public synchronized DebugServer startDebugServer(int port, int maxClients) {
"""
Start a debug server on a specified TCP/IP port, allowing a specified number
of concurrent clients.
@param port
The port number for the TCP/IP server.
@param maxClients
The maximum number of concurrent clients.
"""
... | java | public synchronized DebugServer startDebugServer(int port, int maxClients) {
if (mDebugServer != null) {
Log.e(TAG, "Debug server has already been started.");
return mDebugServer;
}
mDebugServer = new DebugServer(this, port, maxClients);
Threads.spawn(mDebugServe... | [
"public",
"synchronized",
"DebugServer",
"startDebugServer",
"(",
"int",
"port",
",",
"int",
"maxClients",
")",
"{",
"if",
"(",
"mDebugServer",
"!=",
"null",
")",
"{",
"Log",
".",
"e",
"(",
"TAG",
",",
"\"Debug server has already been started.\"",
")",
";",
"r... | Start a debug server on a specified TCP/IP port, allowing a specified number
of concurrent clients.
@param port
The port number for the TCP/IP server.
@param maxClients
The maximum number of concurrent clients. | [
"Start",
"a",
"debug",
"server",
"on",
"a",
"specified",
"TCP",
"/",
"IP",
"port",
"allowing",
"a",
"specified",
"number",
"of",
"concurrent",
"clients",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRContext.java#L331-L340 |
scireum/s3ninja | src/main/java/ninja/S3Dispatcher.java | S3Dispatcher.listObjects | private void listObjects(WebContext ctx, Bucket bucket) {
"""
Handles GET /bucket
@param ctx the context describing the current request
@param bucket the bucket of which the contents should be listed
"""
int maxKeys = ctx.get("max-keys").asInt(1000);
String marker = ctx.get("marker").asS... | java | private void listObjects(WebContext ctx, Bucket bucket) {
int maxKeys = ctx.get("max-keys").asInt(1000);
String marker = ctx.get("marker").asString();
String prefix = ctx.get("prefix").asString();
Response response = ctx.respondWith();
response.setHeader(HTTP_HEADER_NAME_CONTENT... | [
"private",
"void",
"listObjects",
"(",
"WebContext",
"ctx",
",",
"Bucket",
"bucket",
")",
"{",
"int",
"maxKeys",
"=",
"ctx",
".",
"get",
"(",
"\"max-keys\"",
")",
".",
"asInt",
"(",
"1000",
")",
";",
"String",
"marker",
"=",
"ctx",
".",
"get",
"(",
"... | Handles GET /bucket
@param ctx the context describing the current request
@param bucket the bucket of which the contents should be listed | [
"Handles",
"GET",
"/",
"bucket"
] | train | https://github.com/scireum/s3ninja/blob/445eec55c91780267a7f987818b3fedecae009c5/src/main/java/ninja/S3Dispatcher.java#L459-L468 |
tvesalainen/util | util/src/main/java/org/vesalainen/util/navi/Angle.java | Angle.inSector | public final boolean inSector(Angle start, Angle end) {
"""
Sector is less than 180 degrees delimited by start and end
@param start
@param end
@return If this is between start - end
"""
if (start.clockwise(end))
{
return !clockwise(start) && clockwise(end);
}
... | java | public final boolean inSector(Angle start, Angle end)
{
if (start.clockwise(end))
{
return !clockwise(start) && clockwise(end);
}
else
{
return clockwise(start) && !clockwise(end);
}
} | [
"public",
"final",
"boolean",
"inSector",
"(",
"Angle",
"start",
",",
"Angle",
"end",
")",
"{",
"if",
"(",
"start",
".",
"clockwise",
"(",
"end",
")",
")",
"{",
"return",
"!",
"clockwise",
"(",
"start",
")",
"&&",
"clockwise",
"(",
"end",
")",
";",
... | Sector is less than 180 degrees delimited by start and end
@param start
@param end
@return If this is between start - end | [
"Sector",
"is",
"less",
"than",
"180",
"degrees",
"delimited",
"by",
"start",
"and",
"end"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/navi/Angle.java#L168-L178 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControlProvider.java | LocalExecutionControlProvider.generate | @Override
public ExecutionControl generate(ExecutionEnv env, Map<String, String> parameters) {
"""
Create and return a locally executing {@code ExecutionControl} instance.
@param env the execution environment, provided by JShell
@param parameters the {@linkplain #defaultParameters() default} or
modified ... | java | @Override
public ExecutionControl generate(ExecutionEnv env, Map<String, String> parameters) {
return new LocalExecutionControl();
} | [
"@",
"Override",
"public",
"ExecutionControl",
"generate",
"(",
"ExecutionEnv",
"env",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"return",
"new",
"LocalExecutionControl",
"(",
")",
";",
"}"
] | Create and return a locally executing {@code ExecutionControl} instance.
@param env the execution environment, provided by JShell
@param parameters the {@linkplain #defaultParameters() default} or
modified parameter map.
@return the execution engine | [
"Create",
"and",
"return",
"a",
"locally",
"executing",
"{",
"@code",
"ExecutionControl",
"}",
"instance",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControlProvider.java#L79-L82 |
drinkjava2/jDialects | core/src/main/java/com/github/drinkjava2/jdialects/springsrc/utils/ClassUtils.java | ClassUtils.getQualifiedMethodName | public static String getQualifiedMethodName(Method method, Class<?> clazz) {
"""
Return the qualified name of the given method, consisting of
fully qualified interface/class name + "." + method name.
@param method the method
@param clazz the clazz that the method is being invoked on
(may be {@code null} to ind... | java | public static String getQualifiedMethodName(Method method, Class<?> clazz) {
Assert.notNull(method, "Method must not be null");
return (clazz != null ? clazz : method.getDeclaringClass()).getName() + '.' + method.getName();
} | [
"public",
"static",
"String",
"getQualifiedMethodName",
"(",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Assert",
".",
"notNull",
"(",
"method",
",",
"\"Method must not be null\"",
")",
";",
"return",
"(",
"clazz",
"!=",
"null",
"?",... | Return the qualified name of the given method, consisting of
fully qualified interface/class name + "." + method name.
@param method the method
@param clazz the clazz that the method is being invoked on
(may be {@code null} to indicate the method's declaring class)
@return the qualified name of the method
@since 4.3.4 | [
"Return",
"the",
"qualified",
"name",
"of",
"the",
"given",
"method",
"consisting",
"of",
"fully",
"qualified",
"interface",
"/",
"class",
"name",
"+",
".",
"+",
"method",
"name",
"."
] | train | https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/springsrc/utils/ClassUtils.java#L528-L531 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/classfile/ConstantInterfaceMethodInfo.java | ConstantInterfaceMethodInfo.make | static ConstantInterfaceMethodInfo make
(ConstantPool cp,
ConstantClassInfo parentClass,
ConstantNameAndTypeInfo nameAndType) {
"""
Will return either a new ConstantInterfaceMethodInfo object or
one already in the constant pool.
If it is a new ConstantInterfaceMethodInfo, it will be ins... | java | static ConstantInterfaceMethodInfo make
(ConstantPool cp,
ConstantClassInfo parentClass,
ConstantNameAndTypeInfo nameAndType) {
ConstantInfo ci =
new ConstantInterfaceMethodInfo(parentClass, nameAndType);
return (ConstantInterfaceMethodInfo)cp.addConstant(... | [
"static",
"ConstantInterfaceMethodInfo",
"make",
"(",
"ConstantPool",
"cp",
",",
"ConstantClassInfo",
"parentClass",
",",
"ConstantNameAndTypeInfo",
"nameAndType",
")",
"{",
"ConstantInfo",
"ci",
"=",
"new",
"ConstantInterfaceMethodInfo",
"(",
"parentClass",
",",
"nameAnd... | Will return either a new ConstantInterfaceMethodInfo object or
one already in the constant pool.
If it is a new ConstantInterfaceMethodInfo, it will be inserted
into the pool. | [
"Will",
"return",
"either",
"a",
"new",
"ConstantInterfaceMethodInfo",
"object",
"or",
"one",
"already",
"in",
"the",
"constant",
"pool",
".",
"If",
"it",
"is",
"a",
"new",
"ConstantInterfaceMethodInfo",
"it",
"will",
"be",
"inserted",
"into",
"the",
"pool",
"... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/ConstantInterfaceMethodInfo.java#L37-L45 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/Util.java | Util.iterateUntil | public static int iterateUntil(short[] array, int pos, int length, int min) {
"""
Find the smallest integer larger than pos such that array[pos]>= min. If none can be found,
return length.
@param array array to search within
@param pos starting position of the search
@param length length of the array to s... | java | public static int iterateUntil(short[] array, int pos, int length, int min) {
while (pos < length && toIntUnsigned(array[pos]) < min) {
pos++;
}
return pos;
} | [
"public",
"static",
"int",
"iterateUntil",
"(",
"short",
"[",
"]",
"array",
",",
"int",
"pos",
",",
"int",
"length",
",",
"int",
"min",
")",
"{",
"while",
"(",
"pos",
"<",
"length",
"&&",
"toIntUnsigned",
"(",
"array",
"[",
"pos",
"]",
")",
"<",
"m... | Find the smallest integer larger than pos such that array[pos]>= min. If none can be found,
return length.
@param array array to search within
@param pos starting position of the search
@param length length of the array to search
@param min minimum value
@return x greater than pos such that array[pos] is at least a... | [
"Find",
"the",
"smallest",
"integer",
"larger",
"than",
"pos",
"such",
"that",
"array",
"[",
"pos",
"]",
">",
";",
"=",
"min",
".",
"If",
"none",
"can",
"be",
"found",
"return",
"length",
"."
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/Util.java#L170-L175 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java | HystrixCommandExecutionHook.onFallbackError | @Deprecated
public <T> Exception onFallbackError(HystrixCommand<T> commandInstance, Exception e) {
"""
DEPRECATED: Change usages of this to {@link #onFallbackError}.
Invoked after failed execution of {@link HystrixCommand#getFallback()} with thrown exception.
@param commandInstance
The executing Hystrix... | java | @Deprecated
public <T> Exception onFallbackError(HystrixCommand<T> commandInstance, Exception e) {
// pass-thru by default
return e;
} | [
"@",
"Deprecated",
"public",
"<",
"T",
">",
"Exception",
"onFallbackError",
"(",
"HystrixCommand",
"<",
"T",
">",
"commandInstance",
",",
"Exception",
"e",
")",
"{",
"// pass-thru by default",
"return",
"e",
";",
"}"
] | DEPRECATED: Change usages of this to {@link #onFallbackError}.
Invoked after failed execution of {@link HystrixCommand#getFallback()} with thrown exception.
@param commandInstance
The executing HystrixCommand instance.
@param e
Exception thrown by {@link HystrixCommand#getFallback()}
@return Exception that can be dec... | [
"DEPRECATED",
":",
"Change",
"usages",
"of",
"this",
"to",
"{",
"@link",
"#onFallbackError",
"}",
"."
] | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java#L410-L414 |
knowm/XChange | xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAdapters.java | BitstampAdapters.adaptTrades | public static Trades adaptTrades(BitstampTransaction[] transactions, CurrencyPair currencyPair) {
"""
Adapts a Transaction[] to a Trades Object
@param transactions The Bitstamp transactions
@param currencyPair (e.g. BTC/USD)
@return The XChange Trades
"""
List<Trade> trades = new ArrayList<>();
l... | java | public static Trades adaptTrades(BitstampTransaction[] transactions, CurrencyPair currencyPair) {
List<Trade> trades = new ArrayList<>();
long lastTradeId = 0;
for (BitstampTransaction tx : transactions) {
final long tradeId = tx.getTid();
if (tradeId > lastTradeId) {
lastTradeId = trad... | [
"public",
"static",
"Trades",
"adaptTrades",
"(",
"BitstampTransaction",
"[",
"]",
"transactions",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"List",
"<",
"Trade",
">",
"trades",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"long",
"lastTradeId",
"=",
"... | Adapts a Transaction[] to a Trades Object
@param transactions The Bitstamp transactions
@param currencyPair (e.g. BTC/USD)
@return The XChange Trades | [
"Adapts",
"a",
"Transaction",
"[]",
"to",
"a",
"Trades",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAdapters.java#L124-L137 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.updateAccount | public Account updateAccount(final String accountCode, final Account account) {
"""
Update Account
<p>
Updates an existing account.
@param accountCode recurly account id
@param account account object
@return the updated account object on success, null otherwise
"""
return doPUT(Account.ACCOU... | java | public Account updateAccount(final String accountCode, final Account account) {
return doPUT(Account.ACCOUNT_RESOURCE + "/" + accountCode, account, Account.class);
} | [
"public",
"Account",
"updateAccount",
"(",
"final",
"String",
"accountCode",
",",
"final",
"Account",
"account",
")",
"{",
"return",
"doPUT",
"(",
"Account",
".",
"ACCOUNT_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
",",
"account",
",",
"Account",
".",
"class... | Update Account
<p>
Updates an existing account.
@param accountCode recurly account id
@param account account object
@return the updated account object on success, null otherwise | [
"Update",
"Account",
"<p",
">",
"Updates",
"an",
"existing",
"account",
"."
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L325-L327 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java | AvatarZooKeeperClient.getPrimaryLastTxId | public ZookeeperTxId getPrimaryLastTxId(String address, boolean sync)
throws IOException,
KeeperException, InterruptedException, ClassNotFoundException {
"""
Retrieves the last transaction id of the primary from zookeeper.
@param address
the address of the cluster
@param sync
whether or not to pe... | java | public ZookeeperTxId getPrimaryLastTxId(String address, boolean sync)
throws IOException,
KeeperException, InterruptedException, ClassNotFoundException {
Stat stat = new Stat();
String node = getLastTxIdNode(address);
byte[] data = getNodeData(node, stat, false, sync);
if (data == null) {
... | [
"public",
"ZookeeperTxId",
"getPrimaryLastTxId",
"(",
"String",
"address",
",",
"boolean",
"sync",
")",
"throws",
"IOException",
",",
"KeeperException",
",",
"InterruptedException",
",",
"ClassNotFoundException",
"{",
"Stat",
"stat",
"=",
"new",
"Stat",
"(",
")",
... | Retrieves the last transaction id of the primary from zookeeper.
@param address
the address of the cluster
@param sync
whether or not to perform a sync before read
@throws IOException
@throws KeeperException
@throws InterruptedException | [
"Retrieves",
"the",
"last",
"transaction",
"id",
"of",
"the",
"primary",
"from",
"zookeeper",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java#L351-L361 |
eclipse/xtext-core | org.eclipse.xtext/src-gen/org/eclipse/xtext/serializer/XtextSemanticSequencer.java | XtextSemanticSequencer.sequence_Disjunction | protected void sequence_Disjunction(ISerializationContext context, Disjunction semanticObject) {
"""
Contexts:
Disjunction returns Disjunction
Disjunction.Disjunction_1_0 returns Disjunction
Conjunction returns Disjunction
Conjunction.Conjunction_1_0 returns Disjunction
Negation returns Disjunction
Atom retu... | java | protected void sequence_Disjunction(ISerializationContext context, Disjunction semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XtextPackage.Literals.COMPOSITE_CONDITION__LEFT) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMi... | [
"protected",
"void",
"sequence_Disjunction",
"(",
"ISerializationContext",
"context",
",",
"Disjunction",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
"semanticObject",
",... | Contexts:
Disjunction returns Disjunction
Disjunction.Disjunction_1_0 returns Disjunction
Conjunction returns Disjunction
Conjunction.Conjunction_1_0 returns Disjunction
Negation returns Disjunction
Atom returns Disjunction
ParenthesizedCondition returns Disjunction
Constraint:
(left=Disjunction_Disjunction_1_0 right=... | [
"Contexts",
":",
"Disjunction",
"returns",
"Disjunction",
"Disjunction",
".",
"Disjunction_1_0",
"returns",
"Disjunction",
"Conjunction",
"returns",
"Disjunction",
"Conjunction",
".",
"Conjunction_1_0",
"returns",
"Disjunction",
"Negation",
"returns",
"Disjunction",
"Atom",... | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src-gen/org/eclipse/xtext/serializer/XtextSemanticSequencer.java#L716-L727 |
apache/groovy | subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java | SwingGroovyMethods.putAt | public static void putAt(DefaultTableModel self, int index, Object row) {
"""
Allow DefaultTableModel to work with subscript operators.<p>
<b>WARNING:</b> this operation does not replace the item at the
specified index, rather it inserts the item at that index, thus
increasing the size of the model by 1.<p>
<p... | java | public static void putAt(DefaultTableModel self, int index, Object row) {
if (row == null) {
// adds an empty row
self.insertRow(index, (Object[]) null);
return;
}
self.insertRow(index, buildRowData(self, row));
} | [
"public",
"static",
"void",
"putAt",
"(",
"DefaultTableModel",
"self",
",",
"int",
"index",
",",
"Object",
"row",
")",
"{",
"if",
"(",
"row",
"==",
"null",
")",
"{",
"// adds an empty row",
"self",
".",
"insertRow",
"(",
"index",
",",
"(",
"Object",
"[",... | Allow DefaultTableModel to work with subscript operators.<p>
<b>WARNING:</b> this operation does not replace the item at the
specified index, rather it inserts the item at that index, thus
increasing the size of the model by 1.<p>
<p>
if row.size < model.size -> row will be padded with nulls<br>
if row.size > ... | [
"Allow",
"DefaultTableModel",
"to",
"work",
"with",
"subscript",
"operators",
".",
"<p",
">",
"<b",
">",
"WARNING",
":",
"<",
"/",
"b",
">",
"this",
"operation",
"does",
"not",
"replace",
"the",
"item",
"at",
"the",
"specified",
"index",
"rather",
"it",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L486-L493 |
jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractItem.java | AbstractItem.movedTo | public void movedTo(DirectlyModifiableTopLevelItemGroup destination, AbstractItem newItem, File destDir) throws IOException {
"""
Notify this item it's been moved to another location, replaced by newItem (might be the same object, but not guaranteed).
This method is executed <em>after</em> the item root directory... | java | public void movedTo(DirectlyModifiableTopLevelItemGroup destination, AbstractItem newItem, File destDir) throws IOException {
newItem.onLoad(destination, name);
} | [
"public",
"void",
"movedTo",
"(",
"DirectlyModifiableTopLevelItemGroup",
"destination",
",",
"AbstractItem",
"newItem",
",",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"newItem",
".",
"onLoad",
"(",
"destination",
",",
"name",
")",
";",
"}"
] | Notify this item it's been moved to another location, replaced by newItem (might be the same object, but not guaranteed).
This method is executed <em>after</em> the item root directory has been moved to it's new location.
<p>
Derived classes can override this method to add some specific behavior on move, but have to ca... | [
"Notify",
"this",
"item",
"it",
"s",
"been",
"moved",
"to",
"another",
"location",
"replaced",
"by",
"newItem",
"(",
"might",
"be",
"the",
"same",
"object",
"but",
"not",
"guaranteed",
")",
".",
"This",
"method",
"is",
"executed",
"<em",
">",
"after<",
"... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractItem.java#L457-L459 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectDirectEditButtonStyle | public String buildSelectDirectEditButtonStyle(String htmlAttributes) {
"""
Builds the html for the direct edit button style select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the direct edit button style select box
"""
int selectedIndex ... | java | public String buildSelectDirectEditButtonStyle(String htmlAttributes) {
int selectedIndex = Integer.parseInt(getParamTabEdDirectEditButtonStyle());
return buildSelectButtonStyle(htmlAttributes, selectedIndex);
} | [
"public",
"String",
"buildSelectDirectEditButtonStyle",
"(",
"String",
"htmlAttributes",
")",
"{",
"int",
"selectedIndex",
"=",
"Integer",
".",
"parseInt",
"(",
"getParamTabEdDirectEditButtonStyle",
"(",
")",
")",
";",
"return",
"buildSelectButtonStyle",
"(",
"htmlAttri... | Builds the html for the direct edit button style select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the direct edit button style select box | [
"Builds",
"the",
"html",
"for",
"the",
"direct",
"edit",
"button",
"style",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L645-L649 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeWord2VecModel | public static void writeWord2VecModel(Word2Vec vectors, File file) {
"""
This method saves Word2Vec model into compressed zip file and sends it to output stream
PLEASE NOTE: This method saves FULL model, including syn0 AND syn1
"""
try (FileOutputStream fos = new FileOutputStream(file);
B... | java | public static void writeWord2VecModel(Word2Vec vectors, File file) {
try (FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream stream = new BufferedOutputStream(fos)) {
writeWord2VecModel(vectors, stream);
} catch (Exception e) {
throw new RuntimeE... | [
"public",
"static",
"void",
"writeWord2VecModel",
"(",
"Word2Vec",
"vectors",
",",
"File",
"file",
")",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"BufferedOutputStream",
"stream",
"=",
"new",
"BufferedOutp... | This method saves Word2Vec model into compressed zip file and sends it to output stream
PLEASE NOTE: This method saves FULL model, including syn0 AND syn1 | [
"This",
"method",
"saves",
"Word2Vec",
"model",
"into",
"compressed",
"zip",
"file",
"and",
"sends",
"it",
"to",
"output",
"stream",
"PLEASE",
"NOTE",
":",
"This",
"method",
"saves",
"FULL",
"model",
"including",
"syn0",
"AND",
"syn1"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L428-L435 |
dadoonet/fscrawler | core/src/main/java/fr/pilato/elasticsearch/crawler/fs/FsParserAbstract.java | FsParserAbstract.indexDirectory | private void indexDirectory(String id, fr.pilato.elasticsearch.crawler.fs.beans.Path path) throws Exception {
"""
Index a Path object (AKA a folder) in elasticsearch
@param id id of the path
@param path path object
@throws Exception in case of error
"""
esIndex(fsSettings.getElasticsearch().getI... | java | private void indexDirectory(String id, fr.pilato.elasticsearch.crawler.fs.beans.Path path) throws Exception {
esIndex(fsSettings.getElasticsearch().getIndexFolder(),
id,
PathParser.toJson(path),
null);
} | [
"private",
"void",
"indexDirectory",
"(",
"String",
"id",
",",
"fr",
".",
"pilato",
".",
"elasticsearch",
".",
"crawler",
".",
"fs",
".",
"beans",
".",
"Path",
"path",
")",
"throws",
"Exception",
"{",
"esIndex",
"(",
"fsSettings",
".",
"getElasticsearch",
... | Index a Path object (AKA a folder) in elasticsearch
@param id id of the path
@param path path object
@throws Exception in case of error | [
"Index",
"a",
"Path",
"object",
"(",
"AKA",
"a",
"folder",
")",
"in",
"elasticsearch"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/core/src/main/java/fr/pilato/elasticsearch/crawler/fs/FsParserAbstract.java#L526-L531 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java | DatabaseImpl.getAttachment | public Attachment getAttachment(final String id, final String rev, final String
attachmentName) {
"""
<p>Returns attachment <code>attachmentName</code> for the revision.</p>
<p>Used by replicator when pushing attachments</p>
@param id The revision ID with which the attachment is associated
@para... | java | public Attachment getAttachment(final String id, final String rev, final String
attachmentName) {
try {
return get(queue.submit(new SQLCallable<Attachment>() {
@Override
public Attachment call(SQLDatabase db) throws Exception {
long seq... | [
"public",
"Attachment",
"getAttachment",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"rev",
",",
"final",
"String",
"attachmentName",
")",
"{",
"try",
"{",
"return",
"get",
"(",
"queue",
".",
"submit",
"(",
"new",
"SQLCallable",
"<",
"Attachment",
... | <p>Returns attachment <code>attachmentName</code> for the revision.</p>
<p>Used by replicator when pushing attachments</p>
@param id The revision ID with which the attachment is associated
@param rev The document ID with which the attachment is associated
@param attachmentName Name of the attachment
@return <code>Att... | [
"<p",
">",
"Returns",
"attachment",
"<code",
">",
"attachmentName<",
"/",
"code",
">",
"for",
"the",
"revision",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java#L827-L843 |
aws/aws-sdk-java | aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/model/transform/AckEventUnmarshaller.java | AckEventUnmarshaller.getLongField | private Long getLongField(JsonNode json, String fieldName) {
"""
Get a Long field from the JSON.
@param json JSON document.
@param fieldName Field name to get.
@return Long value of field or null if not present.
"""
if (!json.has(fieldName)) {
return null;
}
return json... | java | private Long getLongField(JsonNode json, String fieldName) {
if (!json.has(fieldName)) {
return null;
}
return json.get(fieldName).longValue();
} | [
"private",
"Long",
"getLongField",
"(",
"JsonNode",
"json",
",",
"String",
"fieldName",
")",
"{",
"if",
"(",
"!",
"json",
".",
"has",
"(",
"fieldName",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"json",
".",
"get",
"(",
"fieldName",
")",
".... | Get a Long field from the JSON.
@param json JSON document.
@param fieldName Field name to get.
@return Long value of field or null if not present. | [
"Get",
"a",
"Long",
"field",
"from",
"the",
"JSON",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/model/transform/AckEventUnmarshaller.java#L71-L76 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java | AbstractTagLibrary.addValidator | protected final void addValidator(String name, String validatorId) {
"""
Add a ValidateHandler for the specified validatorId
@see javax.faces.view.facelets.ValidatorHandler
@see javax.faces.application.Application#createValidator(java.lang.String)
@param name
name to use, "foo" would be <my:foo />
@param... | java | protected final void addValidator(String name, String validatorId)
{
_factories.put(name, new ValidatorHandlerFactory(validatorId));
} | [
"protected",
"final",
"void",
"addValidator",
"(",
"String",
"name",
",",
"String",
"validatorId",
")",
"{",
"_factories",
".",
"put",
"(",
"name",
",",
"new",
"ValidatorHandlerFactory",
"(",
"validatorId",
")",
")",
";",
"}"
] | Add a ValidateHandler for the specified validatorId
@see javax.faces.view.facelets.ValidatorHandler
@see javax.faces.application.Application#createValidator(java.lang.String)
@param name
name to use, "foo" would be <my:foo />
@param validatorId
id to pass to Application instance | [
"Add",
"a",
"ValidateHandler",
"for",
"the",
"specified",
"validatorId"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java#L230-L233 |
vincentk/joptimizer | src/main/java/com/joptimizer/functions/SOCPLogarithmicBarrier.java | SOCPLogarithmicBarrier.calculatePhase1InitialFeasiblePoint | @Override
public double calculatePhase1InitialFeasiblePoint(double[] originalNotFeasiblePoint, double tolerance) {
"""
Calculates the initial value for the s parameter in Phase I.
Return s = max(||Ai.x+bi|| - (ci.x+di))
@see "S.Boyd and L.Vandenberghe, Convex Optimization, 11.6.2"
"""
double s = -Double... | java | @Override
public double calculatePhase1InitialFeasiblePoint(double[] originalNotFeasiblePoint, double tolerance){
double s = -Double.MAX_VALUE;
RealVector x = new ArrayRealVector(originalNotFeasiblePoint);
for(int i=0; i<socpConstraintParametersList.size(); i++){
SOCPConstraintParameters param = socpCo... | [
"@",
"Override",
"public",
"double",
"calculatePhase1InitialFeasiblePoint",
"(",
"double",
"[",
"]",
"originalNotFeasiblePoint",
",",
"double",
"tolerance",
")",
"{",
"double",
"s",
"=",
"-",
"Double",
".",
"MAX_VALUE",
";",
"RealVector",
"x",
"=",
"new",
"Array... | Calculates the initial value for the s parameter in Phase I.
Return s = max(||Ai.x+bi|| - (ci.x+di))
@see "S.Boyd and L.Vandenberghe, Convex Optimization, 11.6.2" | [
"Calculates",
"the",
"initial",
"value",
"for",
"the",
"s",
"parameter",
"in",
"Phase",
"I",
".",
"Return",
"s",
"=",
"max",
"(",
"||Ai",
".",
"x",
"+",
"bi||",
"-",
"(",
"ci",
".",
"x",
"+",
"di",
"))"
] | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/functions/SOCPLogarithmicBarrier.java#L158-L176 |
lazy-koala/java-toolkit | fast-toolkit3d/src/main/java/com/thankjava/toolkit3d/core/fastjson/FastJson.java | FastJson.appendObject | public static <T> T appendObject(String json, T t) {
"""
将会解析json字符串,并将json中解析的数据
append到对象t中,原对象t中的属性不会丢失
<p>Function: appendObject</p>
<p>Description: </p>
@param json
@param t
@return
@author acexy@thankjava.com
@date 2017年3月10日 下午3:01:58
@version 1.0
"""
@SuppressWarnings("unchecked")
... | java | public static <T> T appendObject(String json, T t) {
@SuppressWarnings("unchecked")
Class<T> clazz = (Class<T>) t.getClass();
T tNew = toObject(json, clazz);
BeanCopierUtil.append(tNew, t);
return tNew;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"appendObject",
"(",
"String",
"json",
",",
"T",
"t",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Class",
"<",
"T",
">",
"clazz",
"=",
"(",
"Class",
"<",
"T",
">",
")",
"t",
".",
"getClass"... | 将会解析json字符串,并将json中解析的数据
append到对象t中,原对象t中的属性不会丢失
<p>Function: appendObject</p>
<p>Description: </p>
@param json
@param t
@return
@author acexy@thankjava.com
@date 2017年3月10日 下午3:01:58
@version 1.0 | [
"将会解析json字符串,并将json中解析的数据",
"append到对象t中,原对象t中的属性不会丢失",
"<p",
">",
"Function",
":",
"appendObject<",
"/",
"p",
">",
"<p",
">",
"Description",
":",
"<",
"/",
"p",
">"
] | train | https://github.com/lazy-koala/java-toolkit/blob/f46055fae0cc73049597a3708e515f5c6582d27a/fast-toolkit3d/src/main/java/com/thankjava/toolkit3d/core/fastjson/FastJson.java#L76-L82 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/rpc/CmsRpcPrefetcher.java | CmsRpcPrefetcher.getSerializedObjectFromDictionary | public static Object getSerializedObjectFromDictionary(Object asyncService, String dictionaryName)
throws SerializationException {
"""
Deserializes the prefetched RPC data with the given dictionary name.<p>
@param asyncService the RPC service instance
@param dictionaryName the global variable name
@retu... | java | public static Object getSerializedObjectFromDictionary(Object asyncService, String dictionaryName)
throws SerializationException {
return getSerializedObjectFromString(asyncService, getString(dictionaryName));
} | [
"public",
"static",
"Object",
"getSerializedObjectFromDictionary",
"(",
"Object",
"asyncService",
",",
"String",
"dictionaryName",
")",
"throws",
"SerializationException",
"{",
"return",
"getSerializedObjectFromString",
"(",
"asyncService",
",",
"getString",
"(",
"dictionar... | Deserializes the prefetched RPC data with the given dictionary name.<p>
@param asyncService the RPC service instance
@param dictionaryName the global variable name
@return the prefetched RPC data
@throws SerializationException if the deserialization fails | [
"Deserializes",
"the",
"prefetched",
"RPC",
"data",
"with",
"the",
"given",
"dictionary",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/rpc/CmsRpcPrefetcher.java#L58-L62 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/NestedWriter.java | NestedWriter.setValue | public void setValue(Object toEntity, Object newValue) throws IllegalAccessException,
InvocationTargetException {
"""
Set the value on the source entity. If at any point the chaining results in a null value. The chaining
should end.
@param toEntity
the entity on which the getter should operate.
@... | java | public void setValue(Object toEntity, Object newValue) throws IllegalAccessException,
InvocationTargetException
{
Object propertyValue = getter.invoke(toEntity);
if (propertyValue != null)
nestedWriter.setValue(propertyValue, newValue);
} | [
"public",
"void",
"setValue",
"(",
"Object",
"toEntity",
",",
"Object",
"newValue",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Object",
"propertyValue",
"=",
"getter",
".",
"invoke",
"(",
"toEntity",
")",
";",
"if",
"(",
"pr... | Set the value on the source entity. If at any point the chaining results in a null value. The chaining
should end.
@param toEntity
the entity on which the getter should operate.
@param newValue
the value to set. | [
"Set",
"the",
"value",
"on",
"the",
"source",
"entity",
".",
"If",
"at",
"any",
"point",
"the",
"chaining",
"results",
"in",
"a",
"null",
"value",
".",
"The",
"chaining",
"should",
"end",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/NestedWriter.java#L77-L83 |
tango-controls/JTango | server/src/main/java/org/tango/server/device/DeviceManager.java | DeviceManager.startPolling | public void startPolling(final String polledObject, final int pollingPeriod) throws DevFailed {
"""
Configure polling of an attribute or a command and start it
@param polledObject The name of the polled object (attribute or command)
@param pollingPeriod The polling period
@throws DevFailed
"""
tr... | java | public void startPolling(final String polledObject, final int pollingPeriod) throws DevFailed {
try {
final AttributeImpl attr = AttributeGetterSetter.getAttribute(polledObject, device.getAttributeList());
attr.configurePolling(pollingPeriod);
device.startPolling(attr);
... | [
"public",
"void",
"startPolling",
"(",
"final",
"String",
"polledObject",
",",
"final",
"int",
"pollingPeriod",
")",
"throws",
"DevFailed",
"{",
"try",
"{",
"final",
"AttributeImpl",
"attr",
"=",
"AttributeGetterSetter",
".",
"getAttribute",
"(",
"polledObject",
"... | Configure polling of an attribute or a command and start it
@param polledObject The name of the polled object (attribute or command)
@param pollingPeriod The polling period
@throws DevFailed | [
"Configure",
"polling",
"of",
"an",
"attribute",
"or",
"a",
"command",
"and",
"start",
"it"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/device/DeviceManager.java#L164-L179 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.queryTransactionByID | public TransactionInfo queryTransactionByID(String txID, User userContext) throws ProposalException, InvalidArgumentException {
"""
Query this channel for a Fabric Transaction given its transactionID.
The request is sent to a random peer in the channel.
<STRONG>This method may not be thread safe if client co... | java | public TransactionInfo queryTransactionByID(String txID, User userContext) throws ProposalException, InvalidArgumentException {
return queryTransactionByID(getShuffledPeers(EnumSet.of(PeerRole.LEDGER_QUERY)), txID, userContext);
} | [
"public",
"TransactionInfo",
"queryTransactionByID",
"(",
"String",
"txID",
",",
"User",
"userContext",
")",
"throws",
"ProposalException",
",",
"InvalidArgumentException",
"{",
"return",
"queryTransactionByID",
"(",
"getShuffledPeers",
"(",
"EnumSet",
".",
"of",
"(",
... | Query this channel for a Fabric Transaction given its transactionID.
The request is sent to a random peer in the channel.
<STRONG>This method may not be thread safe if client context is changed!</STRONG>
@param txID the ID of the transaction
@param userContext the user context used.
@return a {@link Transacti... | [
"Query",
"this",
"channel",
"for",
"a",
"Fabric",
"Transaction",
"given",
"its",
"transactionID",
".",
"The",
"request",
"is",
"sent",
"to",
"a",
"random",
"peer",
"in",
"the",
"channel",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L3180-L3182 |
beanshell/beanshell | src/main/java/bsh/Invocable.java | Invocable.invoke | public synchronized Object invoke(Object base, Object... pars)
throws InvocationTargetException {
"""
Abstraction to cleanly apply the primitive result wrapping.
@param base represents the base object instance.
@param pars parameter arguments
@return invocation result
@throws InvocationTargetExcept... | java | public synchronized Object invoke(Object base, Object... pars)
throws InvocationTargetException {
if (null == pars)
pars = Reflect.ZERO_ARGS;
try {
return Primitive.wrap(
invokeTarget(base, pars), getReturnType());
}
catch (Throwabl... | [
"public",
"synchronized",
"Object",
"invoke",
"(",
"Object",
"base",
",",
"Object",
"...",
"pars",
")",
"throws",
"InvocationTargetException",
"{",
"if",
"(",
"null",
"==",
"pars",
")",
"pars",
"=",
"Reflect",
".",
"ZERO_ARGS",
";",
"try",
"{",
"return",
"... | Abstraction to cleanly apply the primitive result wrapping.
@param base represents the base object instance.
@param pars parameter arguments
@return invocation result
@throws InvocationTargetException wrapped target exceptions | [
"Abstraction",
"to",
"cleanly",
"apply",
"the",
"primitive",
"result",
"wrapping",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Invocable.java#L206-L217 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/miner/MinerAdapter.java | MinerAdapter.getUniprotNameForHuman | protected String getUniprotNameForHuman(Match m, String label) {
"""
Searches for the uniprot name of the given human EntityReference.
@param m current match
@param label label of the related EntityReference in the pattern
@return uniprot name
"""
ProteinReference er = (ProteinReference) m.get(label, getP... | java | protected String getUniprotNameForHuman(Match m, String label)
{
ProteinReference er = (ProteinReference) m.get(label, getPattern());
return getUniprotNameForHuman(er);
} | [
"protected",
"String",
"getUniprotNameForHuman",
"(",
"Match",
"m",
",",
"String",
"label",
")",
"{",
"ProteinReference",
"er",
"=",
"(",
"ProteinReference",
")",
"m",
".",
"get",
"(",
"label",
",",
"getPattern",
"(",
")",
")",
";",
"return",
"getUniprotName... | Searches for the uniprot name of the given human EntityReference.
@param m current match
@param label label of the related EntityReference in the pattern
@return uniprot name | [
"Searches",
"for",
"the",
"uniprot",
"name",
"of",
"the",
"given",
"human",
"EntityReference",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/miner/MinerAdapter.java#L220-L224 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/ParametricCcgParser.java | ParametricCcgParser.getParameterDescription | public String getParameterDescription(SufficientStatistics parameters, int numFeatures) {
"""
Gets a human-readable description of the {@code numFeatures}
highest-weighted (in absolute value) features of
{@code parameters}.
@param parameters
@param numFeatures
@return
"""
ListSufficientStatistics pa... | java | public String getParameterDescription(SufficientStatistics parameters, int numFeatures) {
ListSufficientStatistics parameterList = parameters.coerceToList();
StringBuilder sb = new StringBuilder();
sb.append("lexicon:\n");
List<SufficientStatistics> lexiconParameterList = parameterList
.getStat... | [
"public",
"String",
"getParameterDescription",
"(",
"SufficientStatistics",
"parameters",
",",
"int",
"numFeatures",
")",
"{",
"ListSufficientStatistics",
"parameterList",
"=",
"parameters",
".",
"coerceToList",
"(",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"Strin... | Gets a human-readable description of the {@code numFeatures}
highest-weighted (in absolute value) features of
{@code parameters}.
@param parameters
@param numFeatures
@return | [
"Gets",
"a",
"human",
"-",
"readable",
"description",
"of",
"the",
"{",
"@code",
"numFeatures",
"}",
"highest",
"-",
"weighted",
"(",
"in",
"absolute",
"value",
")",
"features",
"of",
"{",
"@code",
"parameters",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/ParametricCcgParser.java#L846-L899 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/xml/DomXmlMessageValidator.java | DomXmlMessageValidator.doNamespaceQualifiedAttributeValidation | private void doNamespaceQualifiedAttributeValidation(Node receivedElement, Node receivedAttribute, Node sourceElement, Node sourceAttribute) {
"""
Perform validation on namespace qualified attribute values if present. This includes the validation of namespace presence
and equality.
@param receivedElement
@param... | java | private void doNamespaceQualifiedAttributeValidation(Node receivedElement, Node receivedAttribute, Node sourceElement, Node sourceAttribute) {
String receivedValue = receivedAttribute.getNodeValue();
String sourceValue = sourceAttribute.getNodeValue();
if (receivedValue.contains(":") && sourceV... | [
"private",
"void",
"doNamespaceQualifiedAttributeValidation",
"(",
"Node",
"receivedElement",
",",
"Node",
"receivedAttribute",
",",
"Node",
"sourceElement",
",",
"Node",
"sourceAttribute",
")",
"{",
"String",
"receivedValue",
"=",
"receivedAttribute",
".",
"getNodeValue"... | Perform validation on namespace qualified attribute values if present. This includes the validation of namespace presence
and equality.
@param receivedElement
@param receivedAttribute
@param sourceElement
@param sourceAttribute | [
"Perform",
"validation",
"on",
"namespace",
"qualified",
"attribute",
"values",
"if",
"present",
".",
"This",
"includes",
"the",
"validation",
"of",
"namespace",
"presence",
"and",
"equality",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/xml/DomXmlMessageValidator.java#L634-L668 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.noNullValue | @Nullable
@CodingStyleguideUnaware
public static <T extends Map <?, ?>> T noNullValue (final T aValue, final String sName) {
"""
Check that the passed map is neither <code>null</code> nor empty and that
no <code>null</code> key or value is contained.
@param <T>
Type to be checked and returned
@param aVal... | java | @Nullable
@CodingStyleguideUnaware
public static <T extends Map <?, ?>> T noNullValue (final T aValue, final String sName)
{
if (isEnabled ())
return noNullValue (aValue, () -> sName);
return aValue;
} | [
"@",
"Nullable",
"@",
"CodingStyleguideUnaware",
"public",
"static",
"<",
"T",
"extends",
"Map",
"<",
"?",
",",
"?",
">",
">",
"T",
"noNullValue",
"(",
"final",
"T",
"aValue",
",",
"final",
"String",
"sName",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",... | Check that the passed map is neither <code>null</code> nor empty and that
no <code>null</code> key or value is contained.
@param <T>
Type to be checked and returned
@param aValue
The map to check. May be <code>null</code>.
@param sName
The name of the value (e.g. the parameter name)
@return The passed value. Maybe <co... | [
"Check",
"that",
"the",
"passed",
"map",
"is",
"neither",
"<code",
">",
"null<",
"/",
"code",
">",
"nor",
"empty",
"and",
"that",
"no",
"<code",
">",
"null<",
"/",
"code",
">",
"key",
"or",
"value",
"is",
"contained",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L987-L994 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.intSupplier | public static IntSupplier intSupplier(CheckedIntSupplier supplier, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedIntSupplier} in a {@link IntSupplier} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
ResultSet rs = statement.executeQuery();
Stream.generate(Unchecked.intSuppli... | java | public static IntSupplier intSupplier(CheckedIntSupplier supplier, Consumer<Throwable> handler) {
return () -> {
try {
return supplier.getAsInt();
}
catch (Throwable e) {
handler.accept(e);
throw new IllegalStateException("Exce... | [
"public",
"static",
"IntSupplier",
"intSupplier",
"(",
"CheckedIntSupplier",
"supplier",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"(",
")",
"->",
"{",
"try",
"{",
"return",
"supplier",
".",
"getAsInt",
"(",
")",
";",
"}",
"cat... | Wrap a {@link CheckedIntSupplier} in a {@link IntSupplier} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
ResultSet rs = statement.executeQuery();
Stream.generate(Unchecked.intSupplier(
() -> rs.getInt(1),
e -> {
throw new IllegalStateException(e);
}
));
</pre></code> | [
"Wrap",
"a",
"{",
"@link",
"CheckedIntSupplier",
"}",
"in",
"a",
"{",
"@link",
"IntSupplier",
"}",
"with",
"a",
"custom",
"handler",
"for",
"checked",
"exceptions",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"ResultSet",
"rs",
"=",
"state... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1733-L1744 |
seam/faces | api/src/main/java/org/jboss/seam/faces/component/UIInputContainer.java | UIInputContainer.getDefaultValidator | private Validator getDefaultValidator(final FacesContext context) throws FacesException {
"""
Get the default Bean Validation Validator to read the contraints for a property.
"""
if (!beanValidationPresent) {
return null;
}
ValidatorFactory validatorFactory;
Object ... | java | private Validator getDefaultValidator(final FacesContext context) throws FacesException {
if (!beanValidationPresent) {
return null;
}
ValidatorFactory validatorFactory;
Object cachedObject = context.getExternalContext().getApplicationMap().get(BeanValidator.VALIDATOR_FACTOR... | [
"private",
"Validator",
"getDefaultValidator",
"(",
"final",
"FacesContext",
"context",
")",
"throws",
"FacesException",
"{",
"if",
"(",
"!",
"beanValidationPresent",
")",
"{",
"return",
"null",
";",
"}",
"ValidatorFactory",
"validatorFactory",
";",
"Object",
"cache... | Get the default Bean Validation Validator to read the contraints for a property. | [
"Get",
"the",
"default",
"Bean",
"Validation",
"Validator",
"to",
"read",
"the",
"contraints",
"for",
"a",
"property",
"."
] | train | https://github.com/seam/faces/blob/2fdedbc7070318c2c58bfffb8a26f1ea1d0ee1e3/api/src/main/java/org/jboss/seam/faces/component/UIInputContainer.java#L316-L334 |
rhiot/rhiot | lib/utils/src/main/java/io/rhiot/utils/install/DefaultInstaller.java | DefaultInstaller.isCommandInstalled | public boolean isCommandInstalled(String command, String failureMessage) {
"""
True if the given command is installed in the shell, false otherwise.
@param command eg brew, aptitude, sudo etc
@param failureMessage the message expected upon failure.
@return <tt>true</tt> if the given command is installed in the ... | java | public boolean isCommandInstalled(String command, String failureMessage){
List<String> output = getProcessManager().executeAndJoinOutput(command);
return output.size() > 0 && !output.get(0).contains(failureMessage);
} | [
"public",
"boolean",
"isCommandInstalled",
"(",
"String",
"command",
",",
"String",
"failureMessage",
")",
"{",
"List",
"<",
"String",
">",
"output",
"=",
"getProcessManager",
"(",
")",
".",
"executeAndJoinOutput",
"(",
"command",
")",
";",
"return",
"output",
... | True if the given command is installed in the shell, false otherwise.
@param command eg brew, aptitude, sudo etc
@param failureMessage the message expected upon failure.
@return <tt>true</tt> if the given command is installed in the shell, false otherwise. | [
"True",
"if",
"the",
"given",
"command",
"is",
"installed",
"in",
"the",
"shell",
"false",
"otherwise",
"."
] | train | https://github.com/rhiot/rhiot/blob/82eac10e365f72bab9248b8c3bd0ec9a2fc0a721/lib/utils/src/main/java/io/rhiot/utils/install/DefaultInstaller.java#L82-L85 |
graphql-java/graphql-java | src/main/java/graphql/introspection/IntrospectionResultToSchema.java | IntrospectionResultToSchema.createSchemaDefinition | @SuppressWarnings("unchecked")
public Document createSchemaDefinition(Map<String, Object> introspectionResult) {
"""
Returns a IDL Document that reprSesents the schema as defined by the introspection result map
@param introspectionResult the result of an introspection query on a schema
@return a IDL Docu... | java | @SuppressWarnings("unchecked")
public Document createSchemaDefinition(Map<String, Object> introspectionResult) {
assertTrue(introspectionResult.get("__schema") != null, "__schema expected");
Map<String, Object> schema = (Map<String, Object>) introspectionResult.get("__schema");
Map<String,... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Document",
"createSchemaDefinition",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"introspectionResult",
")",
"{",
"assertTrue",
"(",
"introspectionResult",
".",
"get",
"(",
"\"__schema\"",
")",
"!="... | Returns a IDL Document that reprSesents the schema as defined by the introspection result map
@param introspectionResult the result of an introspection query on a schema
@return a IDL Document of the schema | [
"Returns",
"a",
"IDL",
"Document",
"that",
"reprSesents",
"the",
"schema",
"as",
"defined",
"by",
"the",
"introspection",
"result",
"map"
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/introspection/IntrospectionResultToSchema.java#L66-L109 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/query/parsing/impl/Neo4jAliasResolver.java | Neo4jAliasResolver.createAliasForEmbedded | public String createAliasForEmbedded(String entityAlias, List<String> propertyPathWithoutAlias, boolean optionalMatch) {
"""
Given the path to an embedded property, it will create an alias to use in the query for the embedded containing
the property.
<p>
The alias will be saved and can be returned using the met... | java | public String createAliasForEmbedded(String entityAlias, List<String> propertyPathWithoutAlias, boolean optionalMatch) {
return createAliasForRelationship( entityAlias, propertyPathWithoutAlias, NodeLabel.EMBEDDED.name(), optionalMatch );
} | [
"public",
"String",
"createAliasForEmbedded",
"(",
"String",
"entityAlias",
",",
"List",
"<",
"String",
">",
"propertyPathWithoutAlias",
",",
"boolean",
"optionalMatch",
")",
"{",
"return",
"createAliasForRelationship",
"(",
"entityAlias",
",",
"propertyPathWithoutAlias",... | Given the path to an embedded property, it will create an alias to use in the query for the embedded containing
the property.
<p>
The alias will be saved and can be returned using the method {@link #findAlias(String, List)}.
<p>
For example, using n as entity alias and [embedded, anotherEmbedded] as path to the embedde... | [
"Given",
"the",
"path",
"to",
"an",
"embedded",
"property",
"it",
"will",
"create",
"an",
"alias",
"to",
"use",
"in",
"the",
"query",
"for",
"the",
"embedded",
"containing",
"the",
"property",
".",
"<p",
">",
"The",
"alias",
"will",
"be",
"saved",
"and",... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/query/parsing/impl/Neo4jAliasResolver.java#L62-L64 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java | InsertAllRequest.of | public static InsertAllRequest of(TableInfo tableInfo, Iterable<RowToInsert> rows) {
"""
Returns a {@code InsertAllRequest} object given the destination table and the rows to insert.
"""
return newBuilder(tableInfo.getTableId(), rows).build();
} | java | public static InsertAllRequest of(TableInfo tableInfo, Iterable<RowToInsert> rows) {
return newBuilder(tableInfo.getTableId(), rows).build();
} | [
"public",
"static",
"InsertAllRequest",
"of",
"(",
"TableInfo",
"tableInfo",
",",
"Iterable",
"<",
"RowToInsert",
">",
"rows",
")",
"{",
"return",
"newBuilder",
"(",
"tableInfo",
".",
"getTableId",
"(",
")",
",",
"rows",
")",
".",
"build",
"(",
")",
";",
... | Returns a {@code InsertAllRequest} object given the destination table and the rows to insert. | [
"Returns",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java#L423-L425 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/JobBuilder.java | JobBuilder.usingJobData | public JobBuilder usingJobData (final String dataKey, final String value) {
"""
Add the given key-value pair to the JobDetail's {@link JobDataMap}.
@return the updated JobBuilder
@see IJobDetail#getJobDataMap()
"""
m_aJobDataMap.put (dataKey, value);
return this;
} | java | public JobBuilder usingJobData (final String dataKey, final String value)
{
m_aJobDataMap.put (dataKey, value);
return this;
} | [
"public",
"JobBuilder",
"usingJobData",
"(",
"final",
"String",
"dataKey",
",",
"final",
"String",
"value",
")",
"{",
"m_aJobDataMap",
".",
"put",
"(",
"dataKey",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add the given key-value pair to the JobDetail's {@link JobDataMap}.
@return the updated JobBuilder
@see IJobDetail#getJobDataMap() | [
"Add",
"the",
"given",
"key",
"-",
"value",
"pair",
"to",
"the",
"JobDetail",
"s",
"{",
"@link",
"JobDataMap",
"}",
"."
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/JobBuilder.java#L283-L287 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.beginResize | public void beginResize(String resourceGroupName, String clusterName, Integer targetInstanceCount) {
"""
Resizes the specified HDInsight cluster to the specified size.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param targetInstanceCount The target ins... | java | public void beginResize(String resourceGroupName, String clusterName, Integer targetInstanceCount) {
beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().single().body();
} | [
"public",
"void",
"beginResize",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"Integer",
"targetInstanceCount",
")",
"{",
"beginResizeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"targetInstanceCount",
")",
".",
... | Resizes the specified HDInsight cluster to the specified size.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param targetInstanceCount The target instance count for the operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws E... | [
"Resizes",
"the",
"specified",
"HDInsight",
"cluster",
"to",
"the",
"specified",
"size",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L1093-L1095 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/query/HiveAvroORCQueryGenerator.java | HiveAvroORCQueryGenerator.generateDropTableDDL | public static String generateDropTableDDL(String dbName, String tableName) {
"""
*
Generate DDL query to drop a Hive table.
@param dbName Hive database name.
@param tableName Hive table name.
@return Command to drop the table.
"""
return String.format("DROP TABLE IF EXISTS `%s`.`%s`", dbName, tableName... | java | public static String generateDropTableDDL(String dbName, String tableName) {
return String.format("DROP TABLE IF EXISTS `%s`.`%s`", dbName, tableName);
} | [
"public",
"static",
"String",
"generateDropTableDDL",
"(",
"String",
"dbName",
",",
"String",
"tableName",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"DROP TABLE IF EXISTS `%s`.`%s`\"",
",",
"dbName",
",",
"tableName",
")",
";",
"}"
] | *
Generate DDL query to drop a Hive table.
@param dbName Hive database name.
@param tableName Hive table name.
@return Command to drop the table. | [
"*",
"Generate",
"DDL",
"query",
"to",
"drop",
"a",
"Hive",
"table",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/query/HiveAvroORCQueryGenerator.java#L384-L386 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.plusMonths | public Period plusMonths(int months) {
"""
Returns a new period plus the specified number of months added.
<p>
This period instance is immutable and unaffected by this method call.
@param months the amount of months to add, may be negative
@return the new period plus the increased months
@throws Unsupporte... | java | public Period plusMonths(int months) {
if (months == 0) {
return this;
}
int[] values = getValues(); // cloned
getPeriodType().addIndexedField(this, PeriodType.MONTH_INDEX, values, months);
return new Period(values, getPeriodType());
} | [
"public",
"Period",
"plusMonths",
"(",
"int",
"months",
")",
"{",
"if",
"(",
"months",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"values",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"getPeriodType",
"(",
")",
".",
"addIndex... | Returns a new period plus the specified number of months added.
<p>
This period instance is immutable and unaffected by this method call.
@param months the amount of months to add, may be negative
@return the new period plus the increased months
@throws UnsupportedOperationException if the field is not supported | [
"Returns",
"a",
"new",
"period",
"plus",
"the",
"specified",
"number",
"of",
"months",
"added",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L1087-L1094 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AsCodeGen.java | AsCodeGen.writeResourceAdapter | private void writeResourceAdapter(Definition def, Writer out, int indent) throws IOException {
"""
Output ResourceAdapter method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeWithIndent(out, indent, "/**\n");
writeWithIndent(... | java | private void writeResourceAdapter(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Get the resource adapter\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * @return The handle\n");
... | [
"private",
"void",
"writeResourceAdapter",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
... | Output ResourceAdapter method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"ResourceAdapter",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AsCodeGen.java#L237-L270 |
owetterau/neo4j-websockets | client/src/main/java/de/oliverwetterau/neo4j/websockets/client/DatabaseService.java | DatabaseService.getData | public Result<JsonNode> getData(final String service, final String method, final JsonNode parameters) {
"""
Sends a read message to a Neo4j cluster and returns the data server's answer.
@param service the service of the data server to be used
@param method the method of the service to be used
@param parameters ... | java | public Result<JsonNode> getData(final String service, final String method, final JsonNode parameters) {
return getData(service, method, parameters, threadLocale.getLocale());
} | [
"public",
"Result",
"<",
"JsonNode",
">",
"getData",
"(",
"final",
"String",
"service",
",",
"final",
"String",
"method",
",",
"final",
"JsonNode",
"parameters",
")",
"{",
"return",
"getData",
"(",
"service",
",",
"method",
",",
"parameters",
",",
"threadLoc... | Sends a read message to a Neo4j cluster and returns the data server's answer.
@param service the service of the data server to be used
@param method the method of the service to be used
@param parameters a json node containing parameters for the method
@return data server's answer | [
"Sends",
"a",
"read",
"message",
"to",
"a",
"Neo4j",
"cluster",
"and",
"returns",
"the",
"data",
"server",
"s",
"answer",
"."
] | train | https://github.com/owetterau/neo4j-websockets/blob/ca3481066819d01169873aeb145ab3bf5c736afe/client/src/main/java/de/oliverwetterau/neo4j/websockets/client/DatabaseService.java#L68-L70 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/element/position/Positions.java | Positions.bottomAlignedTo | public static <T extends IPositioned & ISized> IntSupplier bottomAlignedTo(ISized owner, T other, int offset) {
"""
Bottom aligns the owner to the other.
@param <T> the generic type
@param other the other
@param offset the offset
@return the int supplier
"""
checkNotNull(other);
return () -> {
re... | java | public static <T extends IPositioned & ISized> IntSupplier bottomAlignedTo(ISized owner, T other, int offset)
{
checkNotNull(other);
return () -> {
return other.position().y() + other.size().height() - owner.size().height() + offset;
};
} | [
"public",
"static",
"<",
"T",
"extends",
"IPositioned",
"&",
"ISized",
">",
"IntSupplier",
"bottomAlignedTo",
"(",
"ISized",
"owner",
",",
"T",
"other",
",",
"int",
"offset",
")",
"{",
"checkNotNull",
"(",
"other",
")",
";",
"return",
"(",
")",
"->",
"{"... | Bottom aligns the owner to the other.
@param <T> the generic type
@param other the other
@param offset the offset
@return the int supplier | [
"Bottom",
"aligns",
"the",
"owner",
"to",
"the",
"other",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/element/position/Positions.java#L289-L297 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.matrixToPinhole | public static <C extends CameraPinhole>C matrixToPinhole(DMatrixRMaj K , int width , int height , C output ) {
"""
Converts a calibration matrix into intrinsic parameters
@param K Camera calibration matrix.
@param width Image width in pixels
@param height Image height in pixels
@param output (Output) Where t... | java | public static <C extends CameraPinhole>C matrixToPinhole(DMatrixRMaj K , int width , int height , C output )
{
return (C)ImplPerspectiveOps_F64.matrixToPinhole(K, width, height, output);
} | [
"public",
"static",
"<",
"C",
"extends",
"CameraPinhole",
">",
"C",
"matrixToPinhole",
"(",
"DMatrixRMaj",
"K",
",",
"int",
"width",
",",
"int",
"height",
",",
"C",
"output",
")",
"{",
"return",
"(",
"C",
")",
"ImplPerspectiveOps_F64",
".",
"matrixToPinhole"... | Converts a calibration matrix into intrinsic parameters
@param K Camera calibration matrix.
@param width Image width in pixels
@param height Image height in pixels
@param output (Output) Where the intrinsic parameter are written to. If null then a new instance is declared.
@return camera parameters | [
"Converts",
"a",
"calibration",
"matrix",
"into",
"intrinsic",
"parameters"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L297-L300 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.